An Incremental Rendering and Redrawing Optimization Algorithm for Real-Time Data Charts
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-08-14
AI Technical Summary
[0002]现有实时数据图表渲染过程中,通常采用全量刷新或粗粒度局部刷新方式对图层进行更新处理,在高频数据变化场景下容易产生重复渲染开销大、资源占用高以及渲染延迟增加的问题
一、本发明通过构建图层关联图谱、建立图层敏感因子评价机制以及设计基于可视状态的增量重绘策略,实现了实时数据图表在高频数据更新场景下的高效渲染与精准重绘。相比于传统对整张图表进行全量刷新或简单区域刷新方式,本方案首先依据业务关注度、实时性要求和数据精度要求生成图层重绘优先级序列,使关键业务图层能够优先获得计算与渲染资源;同时利用图层关联图谱识别数据变化所影响的关联图层,仅针对目标图层及其关联图层执行增量重绘,从源头减少无关图层的重复计算与渲染开销。进一步地,通过可视区域检测、可视区域裁剪以及变化数据区段提取机制,仅对实际参与显示的数据区域构建增量绘制区域,显著降低GPU与CPU资源消耗,提高图表响应速度和刷新效率,从而保证实时数据图表在大规模数据持续更新情况下仍具备良好的交互流畅性和显示实时性。
Smart Images

Figure CN122570741A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chart rendering technology, and in particular to an incremental rendering and redrawing optimization algorithm for real-time data charts. Background Technology
[0002] In current real-time data chart rendering processes, full refresh or coarse-grained partial refresh methods are typically used to update layers. In scenarios with high-frequency data changes, this can easily lead to high overhead from repeated rendering, high resource consumption, and increased rendering latency. Furthermore, when the chart contains a multi-layered structure, the lack of an effective data correlation mechanism between layers results in unclear propagation of data changes, easily triggering redundant redrawing of unrelated layers, further reducing the overall system rendering efficiency. In addition, while layers are not visible, data continues to be updated, but the lack of an effective caching and delay mechanism for such changes can cause data gaps or incomplete redrawing when layers re-enter visibility, affecting the continuity and consistency of the chart display.
[0003] The existing technology has two main problems: First, it lacks a fine-grained incremental rendering mechanism based on relationships in multi-layer scenes, resulting in an excessively large redraw range; second, it lacks an effective delay caching and compensation mechanism for data changes in unviewable layers, affecting the continuity of data display and the accuracy of rendering. Summary of the Invention
[0004] Therefore, it is necessary to provide an incremental rendering and redrawing optimization algorithm for real-time data charts to solve at least one of the aforementioned technical problems.
[0005] To achieve the above objectives, an incremental rendering and redrawing optimization algorithm for real-time data charts is provided, the method comprising the following steps: Step S1: Obtain the layer objects and corresponding data update events in the real-time data chart, establish the data relationship between layers, and construct the layer relationship map; Step S2: Based on the business focus, real-time requirements and data accuracy requirements of each layer, calculate the sensitivity factors of the corresponding layers, and generate a layer redrawing priority sequence based on the sensitivity factors; Step S3: When a data change is detected in the target layer, determine the set of associated layers related to the target layer based on the layer association map; Step S4: Perform visible area detection on the target layer and its associated layer set, and generate the corresponding incremental redraw task; Step S5: Sort the incremental redraw tasks according to the layer redraw priority sequence, and encapsulate the incremental redraw tasks with related relationships into a linked task group; Step S6: Perform synchronous incremental redrawing on the linked task group to complete the rendering update of the real-time data chart.
[0006] The present invention has the following beneficial effects: I. This invention achieves efficient rendering and accurate redrawing of real-time data charts in high-frequency data update scenarios by constructing a layer association graph, establishing a layer sensitivity factor evaluation mechanism, and designing an incremental redrawing strategy based on visual status. Compared to traditional methods of full refresh of the entire chart or simple area refresh, this solution first generates a layer redrawing priority sequence based on business focus, real-time requirements, and data accuracy requirements, ensuring that key business layers receive priority computing and rendering resources. Simultaneously, it uses the layer association graph to identify related layers affected by data changes, performing incremental redrawing only on the target layer and its related layers, reducing redundant calculation and rendering overhead for irrelevant layers from the source. Furthermore, through visual area detection, visual area clipping, and changed data segment extraction mechanisms, incremental drawing areas are constructed only for the data areas actually displayed, significantly reducing GPU and CPU resource consumption, improving chart response speed and refresh efficiency, thereby ensuring that real-time data charts maintain good interactive smoothness and real-time display even under large-scale continuous data updates.
[0007] Second, this invention addresses the issue of continuous data changes occurring even when layers are invisible. It introduces a delayed redraw identifier, a delayed redraw caching task, and a visual regression fusion mechanism. When the layer re-enters the visible state, it uses the data change information from the caching period to seamlessly connect and compensate for missing information with real-time data changes, avoiding data gaps, display jumps, or loss of historical changes caused by direct redrawing in traditional solutions. Simultaneously, through a dynamic redraw boundary region generation mechanism and an overlap weight correction strategy based on boundary crossing risk values, it can not only accurately identify the effective redraw areas that truly need updating but also anticipate the expansion trend of data change boundaries, achieving dynamic optimization control of the redraw range. Furthermore, by combining the redraw backlog potential value and the delayed redraw level value to assess the redraw pressure during the invisible period, the system can intelligently adjust subsequent redraw strategies based on data activity, the intensity of changes, and backlog time. This effectively reduces the number of invalid redraws, improves rendering resource utilization, and enhances the stability, accuracy, and overall display performance of complex real-time charts in high-concurrency, multi-layer, and continuously dynamically updated scenarios. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the steps of an incremental rendering and redrawing optimization algorithm for real-time data charts. Figure 2 for Figure 1 A detailed flowchart illustrating the implementation steps of step S4. Figure 3 This is a schematic diagram of the rendering and updating process of a data chart according to one embodiment; The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0009] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0010] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0011] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0012] To achieve the above objectives, please refer to Figures 1 to 3 An incremental rendering and redrawing optimization algorithm for real-time data charts, the method comprising the following steps: Step S1: Obtain the layer objects and corresponding data update events in the real-time data chart, establish the data relationship between layers, and construct the layer relationship map; Step S2: Based on the business focus, real-time requirements and data accuracy requirements of each layer, calculate the sensitivity factors of the corresponding layers, and generate a layer redrawing priority sequence based on the sensitivity factors; Step S3: When a data change is detected in the target layer, determine the set of associated layers related to the target layer based on the layer association map; Step S4: Perform visible area detection on the target layer and its associated layer set, and generate the corresponding incremental redraw task; Step S5: Sort the incremental redraw tasks according to the layer redraw priority sequence, and encapsulate the incremental redraw tasks with related relationships into a linked task group; Step S6: Perform synchronous incremental redrawing on the linked task group to complete the rendering update of the real-time data chart.
[0013] In one embodiment, reference may be made to Figure 3 In a real-time market visualization system for a certain securities market, the front-end real-time data charts are used to display the "price trend layer," "volume layer," "fund flow layer," and "technical indicator layer" of stocks. The system adopts a frame-level rendering mechanism based on Request Animation Frame (RAF) to uniformly schedule the updates of multi-layer data, so as to achieve incremental redrawing and linkage synchronization under high-concurrency market data.
[0014] When a stock experiences rapid price fluctuations within a short period of time, the following processing procedure should be followed.
[0015] During real-time data acquisition, each layer object and its corresponding data update events are obtained. For example, if the price layer detects a rapid increase in the latest transaction price from 52.10 to 53.80, the volume layer, fund flow layer, and technical indicator layer will all generate corresponding data update events. Layer relationships are established based on the business dependencies between layers. Price changes drive the interpretation of volume, volume changes assist in fund flow judgment, and both price and volume jointly affect the calculation of technical indicators, thus constructing a layer relationship graph: Price Layer → Volume Layer → Fund Flow Layer → Technical Indicator Layer.
[0016] The sensitivity factor of each layer is calculated based on its business focus, real-time requirements, and data accuracy requirements. For example, the price layer has the highest sensitivity factor because it directly affects trading decisions; the technical indicator layer has high accuracy requirements but a low update frequency; the fund flow layer and the volume layer are in between. Based on this, a layer redrawing priority sequence is generated: Price Layer > Technical Indicator Layer > Volume Layer > Fund Flow Layer.
[0017] When a data change is detected in the target layer (price layer), an impact propagation analysis is performed based on the layer correlation graph to identify the set of layers that have a direct or indirect dependency relationship with the target layer, including the volume layer, the fund flow layer, and the technical indicator layer, thereby generating a set of related layers: Set of related layers = {volume layer, fund flow layer, technical indicator layer}.
[0018] The system detects the visible area of the target layer and its associated layers within the current viewport, for example, if the user is currently only viewing a portion of the stock's candlestick chart. For layer areas within the visible range that have changed, corresponding incremental redraw tasks are generated, including tasks for updating price curves, volume bars, fund flow arrows, and technical indicator curves, thus avoiding invalid rendering of invisible areas.
[0019] Within the current Request Animation Frame callback period (approximately 16.67ms), all incremental redraw tasks are sorted according to the layer redraw priority sequence generated in step S2, ensuring that price layer-related tasks are executed first. Simultaneously, based on the layer association graph, tasks related to price changes driving volume changes, volume influencing fund flows, and multiple layers jointly affecting technical indicators are encapsulated into linked task groups. These linked task groups are marked as intra-frame atomic execution units, and are prohibited from being inserted into the execution of other non-urgent tasks within the same frame to ensure rendering consistency across multiple layers.
[0020] Within a single RAF callback cycle, synchronous incremental redrawing is performed on the linked task group. First, the basic drawing update of the price layer is completed, and it is used as the coordinate and time axis reference. Then, the volume layer and fund flow layer are updated synchronously to keep them in time alignment with price changes. Finally, the recalculation and rendering update of the technical indicator layer is completed. Through this intra-frame synchronization mechanism, all related layers are refreshed consistently within the same rendering cycle, effectively avoiding the visual misalignment problem of price updating first while volume or technical indicators lag behind, and realizing the synchronous presentation of real-time data from multiple layers.
[0021] Preferably, based on the business focus, real-time requirements, and data accuracy requirements of each layer, the sensitivity factor for the corresponding layer is calculated as follows: Obtain the business type information, data update frequency information, and data precision configuration parameters corresponding to each layer, and establish a layer attribute mapping table; Read the business attention parameters corresponding to each layer according to the layer attribute mapping table, and use the business attention parameters as the business attention score of the layer; Extract the latency threshold corresponding to each layer and obtain the preset baseline latency threshold; The real-time factor of the layer is calculated based on the latency threshold and the baseline latency threshold, and a real-time score is generated. Obtain the data precision configuration level corresponding to each layer, and convert the data precision configuration level into the corresponding precision factor according to the preset precision level mapping rule to generate a precision score; By using preset weighting rules, the business attention score, real-time score, and accuracy score are weighted and fused to obtain the sensitivity factors corresponding to each layer.
[0022] In one embodiment, in a real-time securities market visualization system, front-end real-time data charts are used to display multi-dimensional information during stock trading, including a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses a Request Animation Frame (RAF) frame-level rendering mechanism to uniformly schedule updates to multi-layer data, enabling synchronous incremental redrawing and linked updates of high-frequency market data. When the system detects rapid price fluctuations in a stock (e.g., "Technology Stock A") within a short period, the following processing flow is executed.
[0023] This process acquires the layer objects and corresponding data update events from real-time data charts, including price change events for the price layer, trading volume change events for the volume layer, fund flow change events for the fund flow layer, and indicator recalculation events for the technical indicator layer. It then establishes data dependencies between layers and constructs a layer relationship graph. Price changes, as a fundamental driving factor, influence changes in trading volume and fund flow, while price and trading volume jointly participate in the calculation of technical indicators, thus forming a hierarchical relationship structure from the price layer to other layers.
[0024] Based on the constructed layer association graph, the sensitivity factors of each layer are calculated according to the business focus, real-time requirements, and data precision requirements of each layer. Specifically, the business type information, data update frequency information, and data precision configuration parameters of each layer are first obtained, and a layer attribute mapping table is established. Among them, the business type is used to identify the importance of the layer in transaction decisions, the update frequency is used to characterize the real-time requirements of the layer, and the precision configuration is used to characterize the calculation and display refinement of the layer.
[0025] Based on this, the business attention parameters of each layer are extracted from the layer attribute mapping table and used as the business attention score. For example, the price layer has the highest business attention score because it directly affects trading decisions; the trading volume layer and the capital flow layer are at a medium level; the technical indicator layer, as an auxiliary analysis layer, has a relatively low but stable business attention score.
[0026] Subsequently, the latency thresholds corresponding to each layer are extracted and compared with preset baseline latency thresholds to characterize the sensitivity of each layer to real-time response. The lower the latency threshold, the higher the real-time requirement. For example, the price layer requires priority to complete updates within a single RAF period, so its real-time score is the highest; while the technical indicator layer allows calculations across periods, so its real-time score is relatively lower.
[0027] Furthermore, the data precision configuration level of each layer is obtained, and it is converted into a unified precision factor according to the preset precision level mapping rules. For example, the price layer uses a high-precision candlestick chart, the volume layer uses a standard bar chart, the capital flow layer uses a vector arrow chart, and the technical indicator layer uses a smooth curve chart, thereby generating a precision score for each layer.
[0028] Finally, by using preset weighting rules, the business attention score, real-time score, and accuracy score are weighted and fused to obtain the sensitivity factors corresponding to each layer, thereby quantifying the priority weight of each layer in the current real-time rendering process.
[0029] As an example of the present invention, reference is made to... Figure 2 As shown, step S4 in this example includes: Step S41: Obtain the current display area information corresponding to the target layer and the set of associated layers, and determine the visibility status of each layer in the display area, wherein the visibility status includes visible layers and invisible layers. Step S42: Perform visible area boundary resolution on the visible layers to determine the actual visible area range of each layer and generate corresponding visible area clipping data; Step S43: Extract the corresponding change data segments of each layer based on the visible area clipping data, construct the incremental drawing area based on the change data segments, and generate the corresponding first incremental redraw task; Step S44: Establish a delayed redraw identifier for layers that are not visible, cache the corresponding changed data segments, and generate a delayed redraw cache task; Step S45: Generate the corresponding incremental redraw task through the delayed redraw cache task and the first incremental redraw task.
[0030] In one embodiment, in a real-time securities market visualization system, the front-end real-time data charts are used to display the "price layer," "volume layer," "fund flow layer," and "technical indicator layer" of stocks. The system uses the RequestAnimation Frame (RAF) frame-level rendering mechanism to incrementally redraw and schedule updates to multi-layer data. It also employs a dual-layer rendering strategy of "visibility priority + delayed caching" combined with the current user's viewport to improve rendering efficiency in high-frequency market scenarios. When a user is currently only viewing a partial area of a stock's candlestick chart (e.g., only displaying the price range of the most recent 30 minutes), the system executes the following processing flow.
[0031] First, obtain the display area information of the target layer and its associated layer set in the current interface, including the chart window range, zoom level, and current scroll offset, and determine the visibility status of each layer in the current viewport based on this information.
[0032] For example: Price layer: visible (K-line range in the center of the screen), Volume layer: visible (displayed synchronously with price), Fund flow layer: partially visible (only partial arrows are visible), Technical indicator layer: invisible (currently collapsed and hidden). Based on this, layers are divided into two categories: visible layers and invisible layers.
[0033] For layers that are visible, further analysis is performed on their actual drawing range within the current display area. For example, only the local area corresponding to the most recent 30-minute candlestick chart is displayed. Based on the relationship between layer boundaries and viewport clipping, the effective visible area range of each layer is calculated, and corresponding visible area clipping data is generated. For example: Price layer: clipped to candlestick data for time interval T1 to T2; Volume layer: clipped to bar chart data for the corresponding time interval; Fund Flow layer: clipped to partially visible arrow data.
[0034] Based on the cropped data of the visible area, the data segments that have changed within the visible area of each layer are further extracted, such as the latest price change points, the intervals of sudden increases in trading volume, and the nodes of changes in capital inflow. On this basis, only local incremental drawing areas are constructed for the changed areas, instead of redrawing the entire map, thereby generating the corresponding first incremental redrawing tasks, such as: T1: Local K-line incremental update task for the price layer; T2: Local bar refresh task for trading volume; T3: Local arrow update task for capital flow.
[0035] For layers that are currently invisible (such as technical indicator layers), rendering is not performed immediately. Instead, a delayed redraw flag is created, and the corresponding changed data segments are cached. For example, although the MACD data of a technical indicator layer has been updated, it is currently not visible. Its calculation results are temporarily stored as a delayed redraw cache task, and its latest change status is recorded for use when the view is restored later.
[0036] The first incremental redraw task and the deferred redraw cache task are managed and scheduled in a unified manner to generate the final incremental redraw task set. Among them: visible layer tasks are executed immediately in the current RAF frame; invisible layer tasks are executed in subsequent restoration of the visible state or in the next scheduling cycle. Through this mechanism, a unified incremental redraw strategy of "preferential rendering of visible areas + delayed update of non-visible areas" is realized.
[0037] Preferably, generating the corresponding incremental redraw task through the delayed redraw cache task and the first incremental redraw task further includes: In response to the target layer switching from an invisible state to a visible state, the corresponding deferred redraw cache task is read, and the data change information recorded during the cache period is extracted; Extract real-time data change information within the current visible area of the target layer; Time series alignment is performed between data change information during the caching period and real-time data change information to generate a corresponding data change sequence; Based on the data change sequence, identify the missing data segments that were not rendered during the caching period and generate the corresponding missing data compensation dataset; The missing compensation dataset is fused with the real-time data change information corresponding to the current visible area to generate a visual regression fusion dataset. The data change boundaries of the corresponding layers are redefined by visual regression fusion dataset, and the corresponding dynamically redrawn boundary regions are generated. The first incremental redrawing task is compensated and expanded based on the dynamically redrawn boundary region to obtain the second incremental redrawing task, and the first incremental redrawing task is integrated into the corresponding incremental redrawing task.
[0038] In one embodiment, in a real-time securities market visualization system, the front-end real-time data charts include a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses a Request AnimationFrame (RAF) frame-level rendering mechanism to schedule incremental redrawing of multiple layers. In a certain operational scenario, the user switches the technical indicator layer from a hidden state to a visible state, while the price and volume continue to be updated frequently. The system generates the final incremental redrawing task through a "delayed redrawing cache task and first incremental redrawing task fusion mechanism," the specific process of which is as follows.
[0039] When a target layer (such as a technical indicator layer) switches from an invisible state to a visible state, the system first reads the deferred redraw cache tasks generated during the invisible period of that layer and extracts the data change information recorded during the caching period. For example, while the user hides technical indicators, indicator data such as MACD and KDJ continue to be calculated and updated, but no drawing is performed, and these changes are fully cached.
[0040] Based on the current interface display, determine the latest visible area of the target layer (e.g., the current candlestick chart shows the most recent 30-minute interval), and extract real-time data change information within this visible area. For example: the current price fluctuation has been updated to the latest candlestick chart, the trading volume has been refreshed synchronously, and technical indicators need to be realigned at the latest current time point.
[0041] The data change information during the caching period is aligned with the current real-time data change information through time series alignment. The changes during the invisible period are mapped to the current visible changes on a unified time axis to generate a data change sequence. For example: During the caching period: MACD gradually evolves from the "pre-golden cross trend"; Current state: It has entered the "golden cross formation stage"; The two data segments are spliced together in chronological order to form a continuous change sequence.
[0042] Based on the data change sequence, identify the unrendered change segments during the invisible period, such as key inflection points, trend reversals, or local peaks that are not displayed in the interface. For these unrendered segments, generate a missing data compensation dataset to fill in the data gaps between the invisible and visible states of the layer.
[0043] The missing data compensation dataset is fused with real-time data change information of the current visible area to generate a visual regression fusion dataset, enabling the layer state to achieve "non-jump recovery" visually. Subsequently, the layer data change boundary is recalculated based on the fused data. For example, the starting point and the latest point of the technical indicator curve are realigned, the missing fluctuations in the MACD trend line are filled in, and the range of indicator changes is re-expanded, thereby generating a dynamically redrawn boundary area.
[0044] Based on the dynamic redraw boundary region, the original first incremental redraw task is compensated and expanded. For example, the original task only covers the latest changes in the current visible area. After expansion, the unrendered sections during the caching period are supplemented, generating a second incremental redraw task, which is then integrated with the first incremental redraw task to finally form a complete set of incremental redraw tasks.
[0045] Preferably, the process of redefining the data change boundaries corresponding to the layers by visual regression fusion datasets and generating corresponding dynamically redrawn boundary regions includes: Based on the spatiotemporal characteristics of the visual regression fusion dataset, determine the distribution characteristics of data changes in the time and spatial dimensions; Calculate the range of data change boundaries based on distribution characteristics, and identify the initial redrawing boundaries; Perform overlap analysis on the visible area of the initial redraw boundary and the target layer to determine the effective redraw boundary interval; The corresponding dynamically redrawn boundary region is generated by effectively redrawing the boundary interval.
[0046] In one embodiment, in a real-time securities market visualization system, after a user resumes viewing the "technical indicator layer," the front-end real-time data chart needs to fuse the data changes during the caching period with the current real-time data to ensure a continuous and seamless rendering effect when the layer is re-visualized. The system uses a Request Animation Frame (RAF) frame-level rendering mechanism to dynamically determine the redrawing boundary area of the layer based on the visual regression fusion dataset. When the technical indicator layer is restored from an invisible state to a visible state, the system executes the following processing flow.
[0047] First, the visual regression fusion dataset undergoes spatiotemporal feature analysis, modeling data changes from both temporal and spatial dimensions. In the temporal dimension, the continuous changes in indicator data during the caching period and the current real-time stage are analyzed; for example, the MACD indicator gradually transitions from a convergence state to a golden cross formation stage. In the spatial dimension, the distribution range of the indicator curve within the chart coordinate system is analyzed, such as the amplitude range, fluctuation density, and distribution of local inflection points of the indicator line. Through these analyses, the joint distribution characteristics of data changes in time and space are obtained, which are used for subsequent boundary localization.
[0048] Based on the aforementioned distribution characteristics, the overall coverage of data changes is calculated, and the extreme value intervals of data changes on the time and spatial coordinate axes are identified, thus forming the initial redraw boundary. For example, in the process of technical indicator recovery: the time range covers "from the start of the cache to the latest time"; the spatial range covers "the range of changes from the minimum to the maximum value of the indicator". This initial boundary is used to describe the complete envelope of data changes, but the current window limitations have not yet been considered.
[0049] The initial redraw boundary is analyzed to determine its overlap with the visible area of the current layer. For example, if the current visible area only displays the indicator area corresponding to the K-line of the most recent 30 minutes, the initial redraw boundary may cover historical cached data from an earlier time period. By eliminating invisible areas through overlap analysis, only the boundary intervals that intersect with the current view are retained, thereby determining the effective redraw boundary intervals.
[0050] After obtaining the effective redraw boundary range, this range is used as the final redraw control area to generate a dynamic redraw boundary region. This dynamic boundary not only includes the latest data changes within the currently visible area but also incorporates key change segments compensated during caching, thus ensuring that the layer can fully cover the key data evolution path when redisplayed. For example, the MACD curve is only partially filled within the currently visible range, historical cached changes only participate in redrawing within the effective intersection range, and data changes exceeding the viewport range are automatically clipped.
[0051] Preferably, an overlap analysis is performed on the visible area of the initial redraw boundary and the target layer to determine the effective redraw boundary interval, specifically as follows: Construct a boundary mapping set based on the mapping region of the initial redrawn boundary in the target layer coordinate system; The visible area of the target layer is divided into multiple visible sub-region units; Calculate the spatial overlap between the initial redraw boundary and each visible sub-region unit, and generate the corresponding overlap weight value; The effectiveness of each visible sub-region unit is filtered based on the overlap weight value, and the set of sub-regions that meet the preset weight threshold is retained; The retained sub-region sets are continuously merged to generate continuous and valid redraw intervals.
[0052] In one embodiment, in a real-time securities market visualization system, after the technical indicator layer is restored to a visible state from an invisible state, the system has calculated the initial redraw boundary based on the visual regression fusion dataset. However, this initial boundary may cover data areas beyond the current viewport range, therefore, further overlap analysis with the visible area of the target layer is required to determine the effective redraw boundary interval truly used for rendering. In this scenario, the user currently only views the "technical indicator area corresponding to the most recent 30-minute candlestick chart," and the system executes the following processing flow.
[0053] First, the initial redraw boundary is mapped to the target layer coordinate system for unified representation. Since the technical indicator layer uses a time-numerical two-dimensional coordinate system, the range of data changes recovered during the caching period is converted into corresponding coordinate intervals, and a boundary mapping set is constructed. For example, this set may include: time interval T0~T1 (cached history), time interval T1~T2 (current real-time), and corresponding indicator value fluctuation intervals Vmin~Vmax. Through this mapping process, the initial redraw boundary can be made consistent with the semantics of the current layer space.
[0054] The current visible area of the target layer is discretized and partitioned, dividing the continuous display area into multiple visible sub-region units. For example, the current 30-minute candlestick chart display area is divided into: sub-region U1: 0-10 minute interval; sub-region U2: 10-20 minute interval; sub-region U3: 20-30 minute interval. Each sub-region unit corresponds to an independent rendering range for subsequent overlap analysis.
[0055] Calculate the spatial overlap between the initial redraw boundary and each visible sub-region unit. For example: U1 has a low overlap with the initial boundary (involving only a small amount of cached compensation data), U2 has a high overlap with the initial boundary (including key trend changes), and U3 has the highest overlap with the initial boundary (including the latest real-time fluctuations). Based on the overlap range ratio and data density, generate corresponding overlap weight values to quantify the importance of each sub-region.
[0056] Based on a preset overlap weight threshold, each visible sub-region unit is filtered. For example: U1: weight below the threshold → removed; U2: weight close to the threshold → retained; U3: weight above the threshold → retained, thus forming a set of valid sub-regions that meet the conditions. This process ensures that only regions highly correlated with data changes are redrawn, avoiding invalid rendering.
[0057] The selected set of valid sub-regions undergoes continuity analysis, merging spatially adjacent or temporally continuous sub-regions. For example, U2 and U3 are temporally continuous and have a high overlap weight, so they are merged into a unified continuous redraw interval, ultimately generating a continuous valid redraw interval for precise control of subsequent dynamic redraw boundary regions.
[0058] Preferably, the calculation of the spatial overlap between the initial redraw boundary and each visible sub-region unit is specifically as follows: Determine the corresponding boundary projection parameters based on the boundary projection area of the initial redrawn boundary in the target layer coordinate system; Extract the region coordinate range corresponding to each visible sub-region unit in sequence, and establish a set of visible sub-region indexes; Calculate the spatial overlap area between the boundary projection area and each visible sub-region unit, and calculate the basic overlap degree by the ratio of the spatial overlap area to the total area of the corresponding visible sub-region unit; Calculate the offset distance between the center point of the boundary projection area and the center point of the corresponding visible sub-area unit, and use the offset distance to correct the position of the basic overlap, generating the corresponding overlap weight value.
[0059] In one embodiment, in a real-time securities market visualization system, after the technical indicator layer is restored from an invisible state to a visible state, the system generates an initial redraw boundary based on the visual regression fusion dataset and maps it to the target layer coordinate system. To further accurately determine the effective redraw area, the system needs to quantify the spatial overlap between the initial redraw boundary and each visible sub-region unit, thereby generating an overlap weight value. In this embodiment, the current visible area is divided into multiple time-continuous sub-region units, such as U1, U2, and U3, each sub-region corresponding to a K-line display range over a certain time span.
[0060] First, the initial redrawn boundary is projected onto the target layer coordinate system to obtain the boundary projection area. For example, after mapping the range of technical indicator changes during the caching period from the data space to the chart coordinate space, we obtain: time dimension range: T0~T2, numerical dimension range: Vmin~Vmax. At the same time, the geometric representation parameters of this boundary in the coordinate system are extracted, including the boundary start point, end point, envelope range, and shape of the covered area, thus forming the boundary projection parameters for subsequent spatial calculations.
[0061] The coordinate ranges of each visible sub-region unit are extracted sequentially, and a set of visible sub-region indexes is constructed. For example: sub-region U1: time T0~T1; sub-region U2: time T1~T2; sub-region U3: time T2~T3. Each sub-region contains corresponding spatial boundary coordinate information (time axis range and index value range) and participates in subsequent calculations as an independent index unit.
[0062] Calculate the spatial overlap between the boundary projection region and each visible sub-region unit, and obtain the overlap area. For example, the overlap area between the boundary projection region and U1 is small, the overlap area with U2 is medium, and the overlap area with U3 is large. Then, the overlap area is proportionally calculated to the total area of the corresponding sub-region unit to obtain the basic overlap degree, which is used to characterize the coverage of the sub-region in the overall redraw boundary.
[0063] After obtaining the basic overlap, the impact of spatial offset is further calculated. Specifically, the coordinates of the center point of the boundary projection area and the center point coordinates of each visible sub-region unit are calculated, and the spatial offset distance between them is calculated to reflect the degree of spatial alignment between the boundary and the sub-regions. When the offset distance is large, even if there is a certain overlap area, it may indicate that the actual correlation of the area is weak. Therefore, the basic overlap is corrected by the offset distance, so that the sub-regions closer to the center area receive higher weights.
[0064] The final overlap weight value is generated by combining the basic overlap degree and the position correction results. For example: U1: small overlap area and large offset → low weight; U2: medium overlap area and small offset → high weight; U3: large overlap area and close center → highest weight. This overlap weight is used for subsequent effective sub-region selection and continuous effective redrawing interval generation.
[0065] Preferably, the positional correction of the basic overlap using the offset distance further includes: The boundary expansion direction of the boundary projection area is determined based on the offset distance between the center point of the boundary projection area and the center point of the corresponding visible sub-region unit. Construct the boundary extension trajectory based on the boundary extension direction, and analyze the trajectory crossing relationship between the boundary extension trajectory and the corresponding visible sub-region unit; When the boundary extension trajectory points to the corresponding visible sub-region unit, the corresponding visible sub-region unit is determined to be in a pre-entry state; when the boundary extension trajectory moves away from the corresponding visible sub-region unit, the corresponding visible sub-region unit is determined to be in a pre-exit state. The corresponding boundary crossing risk value is generated by using the offset distance, pre-entry state, and pre-exit state. The basic overlap degree is dynamically corrected using the boundary crossing risk value to generate the corresponding overlap weight value.
[0066] In one embodiment, in a real-time securities market visualization system, after the technical indicator layer is restored to visibility, the system has completed the basic overlap calculation between the initial redraw boundary and the visible sub-region units. To further improve the accuracy of the redraw boundary selection, the system introduces a dynamic correction mechanism of "boundary expansion direction - trajectory crossing - state determination" to correct the position of the basic overlap, thereby generating an overlap weight value that better meets the actual rendering requirements. In this embodiment, the current visible area is divided into multiple time-continuous sub-region units (such as U1, U2, U3), and the initial redraw boundary has been mapped to the same coordinate system.
[0067] First, the expansion direction of the boundary projection area is determined based on the offset distance between the initial redrawn boundary center point and the center point of each visible sub-region unit. For example, if the boundary center is offset to the right relative to U2, the expansion direction is the positive extension of the time axis; if the boundary center is offset to the left relative to U1, the expansion direction is the negative contraction of the time axis. In this way, the "static overlap relationship" can be transformed into a "dynamic evolution direction" for subsequent trajectory analysis.
[0068] After determining the expansion direction, a boundary extension trajectory is constructed based on this direction to simulate the potential expansion path of the initial redrawn boundary in the time or spatial dimensions. Subsequently, the spatial crossing relationship between this extension trajectory and each visible sub-region unit is analyzed. For example, whether the extension trajectory enters the U2 region, crosses the boundary of the U3 region, or only makes boundary contact with U1 without entering its interior. Through this process, the dynamic relationship between the boundary change trend and each sub-region can be determined.
[0069] Based on trajectory crossing relationships, the state of each visible sub-region unit is identified: when the boundary extension trajectory points to a sub-region unit and shows an entering trend, the sub-region is determined to be in a pre-entry state; when the boundary extension trajectory moves away from a sub-region unit and gradually leaves the coverage area, the sub-region is determined to be in a pre-exit state. For example: U2: extension trajectory continuously enters → pre-entry state; U1: extension trajectory gradually moves away → pre-exit state; U3: no obvious crossing → neutral state. The boundary crossing risk value is constructed by combining the following three types of information: offset distance (degree of spatial misalignment), pre-entry state (potential coverage enhancement), and pre-exit state (coverage decay trend). Among them, the smaller the offset distance, the stronger the potential correlation. The pre-entry state will increase the risk value (indicating that it is about to enter an effective redrawing area), and the pre-exit state will decrease the risk value (indicating a gradually failing area). Through the above comprehensive analysis, the boundary crossing risk value of each sub-region is obtained.
[0070] Preferably, step S44, which involves establishing a delayed redraw flag for layers that are in an invisible state, includes: Record the data version information and timestamp information corresponding to the target layer when it enters an invisible state, and generate a state freeze record; Monitor the data changes corresponding to the target layer, and count the number of data changes and the magnitude of data changes during the period when the data is not visible; The corresponding delayed redraw level value is generated by the number of data changes, the magnitude of data changes, and the duration of invisibility. The state freeze record is associated with the delayed redraw level value and encapsulated to generate the corresponding delayed redraw identifier.
[0071] In one embodiment, in a real-time securities market visualization system, the front-end charts include a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses a Request Animation Frame (RAF) frame-level rendering mechanism to incrementally redraw multiple layers. In a certain interactive scenario, the user collapses and hides the "technical indicator layer," leaving only the price and volume layers visible. For this hidden layer, the system does not immediately perform a redraw; instead, it constructs a delayed redraw flag to structurally record and hierarchically manage the data evolution during the period it is not visible.
[0072] When a technical indicator layer switches from a visible state to an invisible state, the key state information of the layer at the time of entering the invisible state is immediately recorded, including: the current data version identifier (e.g., indicator calculation version V12) and the timestamp of entering the invisible state (e.g., time T0). This information is then encapsulated to generate a state freeze record, used to identify the baseline state of the layer at the moment it is hidden. For example: Technical indicator layer version: MACD_V12, freeze time: 10:15:30.120.
[0073] While the layer is invisible, changes to its underlying data are continuously monitored, but no graphical rendering is performed; only the change behavior is recorded. This includes: the number of data changes (e.g., the number of times indicators are recalculated due to price fluctuations) and the magnitude of data changes (e.g., the size of the range of indicator value fluctuations). For example, during the invisible period, there were 15 indicator updates; the maximum fluctuation range was significantly higher than the historical average.
[0074] By combining the duration of invisibility, the number of data changes, and the magnitude of data changes, the activity level of the invisible layer is comprehensively evaluated, and a delayed redraw level value is generated. Specifically: a longer duration of invisibility indicates more potential accumulated changes; a higher number of data changes indicates a stronger frequency of change; and a larger magnitude of data changes indicates a more drastic change intensity. For example: Short duration + low change rate → low-level delayed redraw; long duration + high-frequency change + large fluctuation rate → high-level delayed redraw, thus achieving a differentiated redraw strategy for different unviewable layers.
[0075] The state freeze record is associated with and encapsulated with the deferred redraw level value to generate a complete deferred redraw identifier. This identifier not only records the layer's "state baseline when it enters invisibility" but also the "intensity level of changes during invisibility," which is used as the basis for redraw decisions when restoring visibility. For example: layer frozen state + high-level deferred redraw identifier → indicates that the layer underwent a large number of critical changes during its hiding period and needs to be compensated for rendering first.
[0076] Preferably, the corresponding delayed redraw level value is generated based on the number of data changes, the magnitude of data changes, and the duration of invisibility, including: Perform statistical analysis on the number of data changes to generate corresponding data activity indicators; Extract the fluctuation characteristics of the data change magnitude to obtain the corresponding data fluctuation intensity index; The duration of invisibility is cumulatively analyzed to generate a corresponding state dwell time index. The redrawing backlog potential value is constructed based on the data activity index, the data fluctuation intensity index, and the state dwell time index. The data activity index is used to characterize the frequency of change, the data fluctuation intensity index is used to characterize the severity of change, and the state dwell time index is used to characterize the redrawing backlog time. The accumulated potential energy value is redrawn to classify the levels, and corresponding delayed redraw level values are generated.
[0077] In one embodiment, in a real-time securities market visualization system, the front-end real-time data charts include a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses a requestAnimationFrame (RAF) frame-level rendering mechanism to incrementally redraw these layers. In a certain interactive scenario, after the user switches the "technical indicator layer" to an invisible state, this layer continues to update data in the background. To avoid excessive redrawing pressure or data jumps when restoring visibility, the system quantitatively evaluates the data changes during the invisible period and generates a delayed redrawing level value for subsequent redrawing resource scheduling.
[0078] First, statistical analysis is performed on the number of data changes during the period when the data is not visible. For example, the technical indicator layer may experience multiple updates to MACD and KDJ parameters during the hidden period. In this process: a higher number of data changes indicates that the layer is still in a high-frequency calculation state during the period when it is not visible. The number of changes per unit time is normalized to generate a data activity index. For example: few updates in a short period → low activity; frequent updates over a long period → high activity, used to characterize the frequency of data changes.
[0079] Further extract the fluctuation characteristics of data changes, such as the maximum offset range of indicator values during periods when they are not visible, the difference in local extreme values, and the intensity of fluctuations. For example, a rapid rise of MACD from a negative value to the zero axis indicates high fluctuation intensity; KDJ oscillations at a high level indicates moderate fluctuation intensity. Based on this, a data fluctuation intensity index is generated to characterize the severity of changes.
[0080] The duration of invisibility is cumulatively analyzed, for example, a technical indicator layer being hidden for 5 seconds, 10 seconds, or longer. In this process: the longer the invisibility duration, the greater the data backlog, and prolonged periods without redrawing can lead to an accumulation of potential display biases. Based on this, a state dwell time metric is generated to characterize the redraw backlog time.
[0081] By comprehensively modeling data activity indicators, data volatility intensity indicators, and state dwell time indicators, a redrawing backlog potential energy value is constructed. Specifically: the data activity indicator represents the frequency of change; the data volatility intensity indicator represents the severity of change; and the state dwell time indicator represents the duration of backlog. These three indicators work together to identify different redrawing pressure patterns: "short-term high-frequency fluctuations" and "long-term sustained backlogs." For example: high frequency + large fluctuations + long-term hiding → high potential energy backlog; low frequency + small fluctuations + short-term hiding → low potential energy backlog.
[0082] Based on the redraw overlay potential energy value, a delayed redraw level value is generated. For example: Level 1: light overlay (low potential energy), Level 2: medium overlay (medium potential energy), Level 3: high overlay (high potential energy). The higher the level, the higher the priority of compensation redraw when the layer is restored to visibility, in order to avoid data gaps or visual jumps.
[0083] Of particular importance is the construction of boundary extension trajectories based on the boundary expansion direction, and the analysis of the trajectory crossing relationships between the boundary extension trajectories and the corresponding visible sub-region units, including: The extension path of the boundary projection area is determined based on the boundary extension direction, and the corresponding boundary extension trajectory is generated. Visual sub-region units that are spatially adjacent to the boundary extension trajectory are extracted sequentially, and corresponding region contact sequences are established. Analyze the intersection positions and intersection order of each visible sub-region unit in the boundary extension trajectory and the region contact sequence to generate the corresponding boundary intrusion sequence; The intrusion sequence of the boundary extension trajectory to each visible sub-region unit is determined by the boundary intrusion sequence, and the corresponding boundary intrusion chain is constructed. The corresponding trajectory crossing relationship is generated based on the positional order of each visible sub-region unit in the boundary intrusion chain.
[0084] In one embodiment, in a real-time securities market visualization system, the front-end chart includes a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses a Request Animation Frame (RAF) frame-level rendering mechanism to incrementally redraw and dynamically clip multiple layers. In a certain interactive scenario, after the technical indicator layer is restored from an invisible state to a visible state, the system has generated an initial redraw boundary based on the visual regression fusion dataset and further determined its boundary expansion direction. To achieve fine-grained control over the layer redraw range, the system constructs a boundary extension trajectory and analyzes its trajectory crossing relationship with visible sub-region units.
[0085] First, determine the extension path of the initial redrawn boundary in the spatial coordinate system based on the direction of boundary expansion, such as extending forward or backward along the time axis. Then, represent the initial redrawn boundary as a path, forming a continuous boundary extension trajectory to simulate the dynamic expansion process of the boundary in the time or spatial dimensions. For example: extending to the right indicates that the data time axis advances towards the latest candlestick; extending to the left indicates retracing the historical cached data range.
[0086] The visible sub-regions that are spatially adjacent to the boundary extension trajectory are scanned sequentially, and a region contact sequence is established. For example, the current visible region is divided into: U1: 0-10 minutes; U2: 10-20 minutes; U3: 20-30 minutes. As the boundary extension trajectory extends in the positive direction of the time axis, the contact order with U1, U2, and U3 is identified in sequence, thus forming a region contact sequence.
[0087] Based on the regional contact sequence, the intersection positions and sequence of the boundary extension trajectory with each sub-region unit are further analyzed. For example, the trajectory first contacts the boundary of U2, then enters the interior region of U2, and finally extends to the boundary region of U3. Based on this, a boundary intrusion sequence is generated to characterize the entry path and sequence of the boundary to different sub-regions.
[0088] Based on the boundary intrusion sequence, the intrusion order of each sub-region unit is further determined and structured into a boundary intrusion chain. For example: U2→U3→U4 (assuming there are more subdivided regions). This chain structure can fully express the hierarchical influence path of each visible sub-region during the boundary expansion process.
[0089] Finally, based on the positional order of each visible sub-region unit in the boundary intrusion chain, a trajectory crossing relationship is generated. This relationship not only describes whether the boundary enters a certain sub-region, but also clarifies its entry order and spatial advancement logic, thus forming a structured expression of the boundary expansion behavior. For example: U2: crossed first, U3: crossed later, U1: did not cross.
[0090] Most importantly, the specific path for determining the extension of the boundary projection area based on the boundary extension direction is as follows: Obtain the spatial geometry corresponding to the initial redrawn boundary and extract its boundary point set; Calculate the gradient direction of each boundary point based on the set of boundary points, and generate the corresponding local expansion vector; Perform directional consistency analysis on each local expansion vector, and generate the global expansion main direction based on the consistency results; The global extension main direction is corrected based on the center offset information of the boundary projection area, and a corrected extension direction vector is generated. The path extrapolation calculation is performed on the boundary projection area based on the corrected extension direction vector to generate the corresponding boundary extension path.
[0091] In one embodiment, in a real-time securities market visualization system, the front-end real-time data charts include a "price layer," a "volume layer," a "fund flow layer," and a "technical indicator layer." The system uses the Request AnimationFrame (RAF) frame-level rendering mechanism to implement incremental redrawing and dynamic boundary control of multiple layers. After the technical indicator layer is restored from an invisible state to a visible state, the system has generated an initial redrawing boundary and needs to further determine the extension path of the boundary projection area for subsequent dynamic redrawing range prediction and visible area clipping control.
[0092] First, obtain the spatial geometry of the initial redraw boundary in the layer coordinate system. For example, the boundary may be represented as an irregular envelope region on the time axis, and extract the set of discrete points that constitute the boundary. For example: upper boundary point: corresponds to the maximum fluctuation range of the indicator; lower boundary point: corresponds to the minimum fluctuation range of the indicator; left and right boundary points: correspond to the start and end positions of time. Through the above processing, the continuous boundary structure is transformed into a computable set of boundary points.
[0093] Based on the set of boundary points, the gradient direction of change in the local space is calculated point by point, such as the upward or downward trend of the indicator curve corresponding to a certain point. For each boundary point: the direction of change between its neighboring points is calculated, the local expansion trend of that point is extracted, and the corresponding local expansion vector is generated. For example: upward trend point → upward expansion vector; sideways trend point → horizontal expansion vector; downward trend point → downward expansion vector.
[0094] Perform directional consistency analysis on all local expansion vectors, such as determining whether the majority of vectors are concentrated in a dominant direction. When multiple local expansion vectors show a consistent trend: if most vectors point to the positive direction of the time axis → the main expansion direction is to the right; if they show up-down oscillations → the main direction is the vertical equilibrium direction. This process generates a global expansion main direction to express the expansion trend of the overall boundary.
[0095] Considering that the boundary projection area may have an overall offset (such as center offset caused by chart scaling or translation), center offset information is introduced to correct the global expansion direction. For example, if the boundary center is offset to the right relative to the viewport, the rightward expansion intensity is appropriately weakened; if the boundary center is offset downward, the upward expansion weight is enhanced. This correction process generates a corrected expansion direction vector, making the expansion path closer to the actual layer distribution.
[0096] Based on the corrected extension direction vector, the path extrapolation calculation is performed on the initial redraw boundary, that is, to simulate the potential extension trajectory of the boundary in this direction. This process transforms the original static boundary into a dynamic and predictable path for subsequent purposes: visual area prediction, redraw range expansion, and layer clipping boundary adjustment, ultimately generating the boundary extension path.
[0097] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0098] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. An incremental rendering and redrawing optimization algorithm for real-time data charts, characterized in that, Includes the following steps: Step S1: Obtain the layer objects and corresponding data update events in the real-time data chart, establish the data relationship between layers, and construct the layer relationship map; Step S2: Based on the business focus, real-time requirements and data accuracy requirements of each layer, calculate the sensitivity factors of the corresponding layers, and generate a layer redrawing priority sequence based on the sensitivity factors; Step S3: When a data change is detected in the target layer, determine the set of associated layers related to the target layer based on the layer association map; Step S4: Perform visible area detection on the target layer and its associated layer set, and generate the corresponding incremental redraw task; Step S5: Sort the incremental redraw tasks according to the layer redraw priority sequence, and encapsulate the incremental redraw tasks with related relationships into a linked task group; Step S6: Perform synchronous incremental redrawing on the linked task group to complete the rendering update of the real-time data chart.
2. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 1, characterized in that, Based on the business focus, real-time requirements, and data accuracy requirements of each layer, the sensitivity factors for the corresponding layers are calculated as follows: Obtain the business type information, data update frequency information, and data precision configuration parameters corresponding to each layer, and establish a layer attribute mapping table; Read the business attention parameters corresponding to each layer according to the layer attribute mapping table, and use the business attention parameters as the business attention score of the layer; Extract the latency threshold corresponding to each layer and obtain the preset baseline latency threshold; The real-time factor of the layer is calculated based on the latency threshold and the baseline latency threshold, and a real-time score is generated. Obtain the data precision configuration level corresponding to each layer, and convert the data precision configuration level into the corresponding precision factor according to the preset precision level mapping rule to generate a precision score; By using preset weighting rules, the business attention score, real-time score, and accuracy score are weighted and fused to obtain the sensitivity factors corresponding to each layer.
3. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 1, characterized in that, Step S4 includes the following steps: Step S41: Obtain the current display area information corresponding to the target layer and the set of associated layers, and determine the visibility status of each layer in the display area, wherein the visibility status includes visible layers and invisible layers. Step S42: Perform visible area boundary resolution on the visible layers to determine the actual visible area range of each layer and generate corresponding visible area clipping data; Step S43: Extract the corresponding change data segments of each layer based on the visible area clipping data, construct the incremental drawing area based on the change data segments, and generate the corresponding first incremental redraw task; Step S44: Establish a delayed redraw identifier for layers that are not visible, cache the corresponding changed data segments, and generate a delayed redraw cache task; Step S45: Generate the corresponding incremental redraw task through the delayed redraw cache task and the first incremental redraw task.
4. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 3, characterized in that, The generation of the corresponding incremental redraw task through the delayed redraw cache task and the first incremental redraw task also includes: In response to the target layer switching from an invisible state to a visible state, the corresponding deferred redraw cache task is read, and the data change information recorded during the cache period is extracted; Extract real-time data change information within the current visible area of the target layer; Time series alignment is performed between data change information during the caching period and real-time data change information to generate a corresponding data change sequence; Based on the data change sequence, identify the missing data segments that were not rendered during the caching period and generate the corresponding missing data compensation dataset; The missing compensation dataset is fused with the real-time data change information corresponding to the current visible area to generate a visual regression fusion dataset. The data change boundaries of the corresponding layers are redefined by visual regression fusion dataset, and the corresponding dynamically redrawn boundary regions are generated. The first incremental redrawing task is compensated and expanded based on the dynamically redrawn boundary region to obtain the second incremental redrawing task, and the first incremental redrawing task is integrated into the corresponding incremental redrawing task.
5. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 4, characterized in that, By visually regressing and fusing datasets, the data change boundaries corresponding to the layers are redefined, and the corresponding dynamically redrawn boundary regions are generated, including: Based on the spatiotemporal characteristics of the visual regression fusion dataset, determine the distribution characteristics of data changes in the time and spatial dimensions; Calculate the range of data change boundaries based on distribution characteristics, and identify the initial redrawing boundaries; Perform overlap analysis on the visible area of the initial redraw boundary and the target layer to determine the effective redraw boundary interval; The corresponding dynamically redrawn boundary region is generated by effectively redrawing the boundary interval.
6. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 5, characterized in that, An overlap analysis is performed on the visible area of the initial redraw boundary and the target layer to determine the effective redraw boundary interval. Construct a boundary mapping set based on the mapping region of the initial redrawn boundary in the target layer coordinate system; The visible area of the target layer is divided into multiple visible sub-region units; Calculate the spatial overlap between the initial redraw boundary and each visible sub-region unit, and generate the corresponding overlap weight value; The effectiveness of each visible sub-region unit is filtered based on the overlap weight value, and the set of sub-regions that meet the preset weight threshold is retained; The retained sub-region sets are continuously merged to generate continuous and valid redraw intervals.
7. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 6, characterized in that, The calculation of the spatial overlap between the initial redraw boundary and each visible sub-region unit is as follows: Determine the corresponding boundary projection parameters based on the boundary projection area of the initial redrawn boundary in the target layer coordinate system; Extract the region coordinate range corresponding to each visible sub-region unit in sequence, and establish a set of visible sub-region indexes; Calculate the spatial overlap area between the boundary projection area and each visible sub-region unit, and calculate the basic overlap degree by the ratio of the spatial overlap area to the total area of the corresponding visible sub-region unit; Calculate the offset distance between the center point of the boundary projection area and the center point of the corresponding visible sub-area unit, and use the offset distance to correct the position of the basic overlap, generating the corresponding overlap weight value.
8. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 7, characterized in that, Positional correction of the basic overlap using offset distance also includes: The boundary expansion direction of the boundary projection area is determined based on the offset distance between the center point of the boundary projection area and the center point of the corresponding visible sub-region unit. Construct the boundary extension trajectory based on the boundary extension direction, and analyze the trajectory crossing relationship between the boundary extension trajectory and the corresponding visible sub-region unit; When the boundary extension trajectory points to the corresponding visible sub-region unit, the corresponding visible sub-region unit is determined to be in a pre-entry state; when the boundary extension trajectory moves away from the corresponding visible sub-region unit, the corresponding visible sub-region unit is determined to be in a pre-exit state. The corresponding boundary crossing risk value is generated by using the offset distance, pre-entry state, and pre-exit state. The basic overlap degree is dynamically corrected using the boundary crossing risk value to generate the corresponding overlap weight value.
9. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 3, characterized in that, Step S44, which involves establishing a delayed redraw flag for layers that are not visible, includes: Record the data version information and timestamp information corresponding to the target layer when it enters an invisible state, and generate a state freeze record; Monitor the data changes corresponding to the target layer, and count the number of data changes and the magnitude of data changes during the period when the data is not visible; The corresponding delayed redraw level value is generated by the number of data changes, the magnitude of data changes, and the duration of invisibility. The state freeze record is associated with the delayed redraw level value and encapsulated to generate the corresponding delayed redraw identifier.
10. The incremental rendering and redrawing optimization algorithm for real-time data charts according to claim 9, characterized in that, The delayed redraw level value is generated based on the number of data changes, the magnitude of data changes, and the duration of invisibility, including: Perform statistical analysis on the number of data changes to generate corresponding data activity indicators; Extract the fluctuation characteristics of the data change magnitude to obtain the corresponding data fluctuation intensity index; The duration of invisibility is cumulatively analyzed to generate a corresponding state dwell time index. The redrawing backlog potential value is constructed based on the data activity index, the data fluctuation intensity index, and the state dwell time index. The data activity index is used to characterize the frequency of change, the data fluctuation intensity index is used to characterize the severity of change, and the state dwell time index is used to characterize the redrawing backlog time. The accumulated potential energy value is redrawn to classify the levels, and corresponding delayed redraw level values are generated.