Real-time dynamic curve drawing method, system and equipment based on data driving and medium
By using a data-driven real-time dynamic curve plotting method, the problems of convenient data processing and historical data preservation in nuclear reactor systems have been solved. This enables real-time monitoring of reactor status and multi-parameter trend analysis, thereby improving the safety and controllability of reactor operation.
Patent Information
- Application Number
- CN202511125204.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-11-14
AI Technical Summary
In the existing technology, nuclear reactor systems lack convenient data post-processing mechanisms during design and operation, making it impossible to intuitively analyze real-time parameter changes and lacking historical data storage functions, which affects engineering design and operators' understanding of the reactor status.
A data-driven real-time dynamic curve drawing method is adopted. Through rectangular area nested layout management and incremental drawing mechanism, real-time curve drawing of physical parameters and historical data storage are realized, and multi-curve comparison and confidence interval drawing are supported.
It enables real-time monitoring and historical trend analysis of nuclear reactor system status, facilitates data processing and multi-parameter comparison, provides customized display of confidence intervals, and improves the safety and controllability of reactor operation.
Smart Images

Figure CN120953430A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nuclear reactor engineering software technology, specifically to a data-driven real-time dynamic curve plotting method, system, device, and medium. Background Technology
[0002] In reactor system design, simulation calculations using computational programs often involve the real-time output of various physical parameters, such as power variations over time, core temperature variations over time, radioactivity variations over time, and pressure variations over temperature. However, these programs typically only output these parameter values in simple numerical form, lacking convenient post-processing mechanisms for intuitive parameter analysis. Furthermore, they lack the ability to save historical data, hindering engineers' ability to analyze and understand the reactor simulation's operational status during the system design process.
[0003] On the other hand, during actual operation of a nuclear reactor, operators need to intuitively analyze changes in various parameters (such as core temperature / pressure, control rod position, hydrogen concentration, and radioactivity concentration) to monitor the reactor's operation in real time and ensure that the reactor always operates within a safe range. These parameter values are often collected by various sensors and output in real time after signal conversion, similar to the data output of a calculation program, and do not have data post-processing or historical storage functions.
[0004] In conclusion, a convenient and effective tool is needed during reactor design and operation to provide a clear understanding of the real-time status of the nuclear reactor system during the design or operation phases, enabling timely identification of potential problems or risks and the development of corresponding improvement or countermeasures. Summary of the Invention
[0005] The purpose of this invention is to provide a data-driven real-time dynamic curve drawing method, system, device, and medium to solve the technical problems existing in the prior art.
[0006] This invention is achieved through the following technical solution: In a first aspect, the first embodiment of the present invention provides a data-driven real-time dynamic curve drawing method, comprising the following steps: In the main interface of the curve, each drawing element is assigned a rectangular area to limit the drawing position and size. The rectangular area consists of the starting coordinates, width and height. Each rectangular area supports nested sub-areas. The main interface of the curve is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the sub-area is relative to the origin of the parent area. The sub-area records the information of the parent area. Get the new parameter value from the data source, construct the parameter coordinates from the new parameter value, convert the parameter coordinates into the corresponding pixel coordinates and draw the curve; Obtain the pixel coordinates of the last data point of the original curve; Draw a line segment between the two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
[0007] Furthermore, the rectangular area includes a Y-axis area, an X-axis area, and a curve area. The starting coordinate of the Y-axis area is (0,0), the height is the height of the curve main interface, and the width is the sum of the width of the title area, the width of the scale text, and the width of the scale line. The starting coordinates of the X-axis region are (0, curve main interface height - X-axis height). The X-axis height is the sum of the title area position height, the scale position height, and the scale line position height. The width is equal to the width of the curve main interface. The starting coordinates of the curve region are (Y-axis width, 0), the width is the difference between the width of the main curve interface and the Y-axis width, and the height is the difference between the height of the main curve interface and the X-axis height.
[0008] Furthermore, the nested sub-region includes a nested title sub-region within the Y-axis region. The starting coordinate of the nested title sub-region within the Y-axis region is (0,0), its height is equal to the height of the Y-axis region, and its width is the width of the title text.
[0009] Furthermore, after the step of drawing a line segment between the two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point, the method also includes recording historical data, specifically including: Define a data list; The parameter value information at a certain moment is represented by physical coordinate points; All collected physical coordinate points are stored in a data list in order.
[0010] Furthermore, after the step of recording historical data, the method further includes: locating and querying data according to the request to view historical data and completing the drawing of historical data curves, specifically including: determining the coordinate axis range when dragging and scrolling the mouse, querying data from historical data that meets the current representation range, and completing the drawing of historical data curves based on the queried data.
[0011] Furthermore, the specific method for determining the coordinate axis range during mouse dragging includes: Get the current coordinate axis parameter range span and coordinate axis pixel length, and calculate the ratio of the coordinate axis pixel length to the parameter range span before dragging; Get the translation length in pixels along the coordinate axis when the mouse position is dragged, and calculate the span of the parameter value corresponding to the translation length in pixels; Add or subtract the range of the parameter value from the upper and lower limits of the coordinates respectively.
[0012] Furthermore, the specific method for determining the coordinate axis range during mouse scrolling includes: Get the current coordinate axis parameter range span and coordinate axis pixel length, and calculate the ratio of coordinate axis pixel length to parameter range span before scrolling; The parameters are adjusted proportionally based on the number of scroll levels and the scrolling direction of the mouse wheel within a given range. The range of the coordinate axes is calculated by adjusting the range of parameters after addition or subtraction and by using the mouse position.
[0013] Furthermore, the specific method for querying data that satisfies the current representation range from historical data includes: Use the binary search algorithm to find the index of the data point that is closest to the maximum and minimum values of the coordinate axes in the sorted historical data; When the data values at both ends of the found range are within the range represented by the coordinate axis, the sequence range is expanded by 1 unit to both ends to form the historical data range that needs to be read and drawn within the current coordinate range; Data points are obtained from the historical data range.
[0014] Furthermore, after the step of drawing a line segment between the two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point, the method further includes: overlaying a confidence interval region that completely overlaps with the curve region onto the curve region. The confidence interval drawing method includes: Obtain the upper and lower limits of the confidence interval; The upper and lower limits are constructed in the form of parametric coordinates, and the parametric coordinates are mapped to pixel coordinates. Confidence intervals are drawn based on pixel coordinates. In a second aspect, another embodiment of the present invention provides a data-driven real-time dynamic curve drawing system for implementing the data-driven real-time dynamic curve drawing method described in the first embodiment, comprising: a layout manager, a first acquisition module, a second acquisition module, and a drawing module; The layout manager is configured to allocate a rectangular area to each drawing element in the main curve interface to limit the drawing position and size. The rectangular area consists of starting coordinates, width and height. Each rectangular area supports nested child areas. The main curve interface is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the child area is relative to the origin of the parent area. The child area records the information of the parent area. The first acquisition module is configured to acquire new parameter values from the data source, construct parameter coordinates from the new parameter values, convert the parameter coordinates into corresponding pixel coordinates, and draw a curve. The second acquisition module is configured to acquire the pixel coordinates of the last data point of the original curve; The drawing module is configured to draw a line segment between two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
[0015] Furthermore, the rectangular area includes a Y-axis area, an X-axis area, and a curve area. The starting coordinate of the Y-axis area is (0,0), the height is the height of the curve main interface, and the width is the sum of the width of the title area, the width of the scale text, and the width of the scale line. The starting coordinates of the X-axis region are (0, curve main interface height - X-axis height). The X-axis height is the sum of the title area position height, the scale position height, and the scale line position height. The width is equal to the width of the curve main interface. The starting coordinates of the curve region are (Y-axis width, 0), the width is the difference between the width of the main curve interface and the Y-axis width, and the height is the difference between the height of the main curve interface and the X-axis height.
[0016] Furthermore, the system also includes a recording module, which is configured to define a data list, use physical value coordinate points to represent parameter value information at a certain moment, and store all collected physical value coordinate points in the data list in order.
[0017] Furthermore, the system also includes a query module, which is configured to locate and query data based on a request to view historical data and to complete the drawing of historical data curves. Specifically, this includes: determining the coordinate axis range when the mouse is dragged and scrolled, querying data from historical data that meets the current representation range, and completing the drawing of historical data curves based on the queried data.
[0018] Furthermore, the system also includes a confidence interval drawing module, which is configured to obtain the upper and lower limits of the confidence interval, construct the upper and lower limits into parameter coordinates, map the parameter coordinates to pixel coordinates, and complete the confidence interval drawing based on the pixel coordinates.
[0019] Thirdly, an electronic device provided by an embodiment of the present invention includes a processor, an input device, an output device, and a memory. The processor is connected to the input device, the output device, and the memory, respectively. The memory is used to store a computer program, the computer program including program instructions, and the processor is configured to call the program instructions to execute the method described in the above embodiments.
[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the method described in the above embodiments.
[0021] The present invention provides a data-driven real-time dynamic curve drawing method, system, device, and medium, the beneficial effects of which are: 1. Enables efficient and flexible layout of various rectangular regions and sub-regions. The laid-out region independently completes the drawing of elements within the region, achieving separation of layout and drawing logic. An incremental drawing mechanism is used for drawing curves with new data, avoiding unnecessary redrawing and ensuring that real-time data can be promptly converted into curve output.
[0022] 2. It provides methods for saving and querying historical data of physical parameters, enabling convenient analysis of historical trends in physical parameter changes.
[0023] 3. A multi-curve plotting method has been implemented, which facilitates the comparative analysis of multiple physical parameters.
[0024] 4. A method for drawing confidence intervals has been implemented, and a customized implementation method for the drawing effect of confidence intervals has been provided. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a data-driven real-time dynamic curve drawing method provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of nested layout management based on rectangular regions in the first embodiment of the present invention; Figure 3 This is a flowchart of the binary search method in the first embodiment of the present invention; Figure 4 The present invention provides a structural block diagram of a data-driven real-time dynamic curve drawing system according to another embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0027] like Figure 1 As shown, the first embodiment of the present invention provides a data-driven real-time dynamic curve drawing method, applicable to a data-driven real-time dynamic curve drawing system provided in the embodiments of the present invention, comprising the following steps: In the main interface of the curve, each drawing element is assigned a rectangular area to limit the drawing position and size. The rectangular area consists of the starting coordinates, width and height. Each rectangular area supports nested sub-areas. The main interface of the curve is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the sub-area is relative to the origin of the parent area. The sub-area records the information of the parent area. Get the new parameter value from the data source, construct the parameter coordinates from the new parameter value, convert the parameter coordinates into the corresponding pixel coordinates and draw the curve; Obtain the pixel coordinates of the last data point of the original curve; Draw a line segment between the two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
[0028] Computers typically use a screen coordinate system for image drawing and display. It uses the top-left corner of the computer screen as the origin, with the horizontal and vertical directions as the positive X and Y axes, respectively, and uses pixels as coordinate values. Common monitors typically have pixel resolutions of 800*600, 1280*720, 1920*1080, etc. For a given monitor, the pixel count is usually fixed, and the displayed image must be within the monitor's pixel range; that is, the range that the screen coordinate system can represent is usually a fixed value no larger than the screen's pixel count. However, in a reactor system, the parameters represent specific physical values, and different parameters have different ranges. On the other hand, engineering development often uses a Cartesian coordinate system with the bottom-left corner of the screen or interface window as the origin and the horizontal and vertical directions as the positive X and Y axes. Therefore, a crucial aspect of curve drawing is converting various parameter values into specific pixel coordinates in the screen coordinate system and drawing the curve using a specified Cartesian coordinate method. In addition to displaying the curve, the Cartesian coordinate system also needs to display the coordinate axes and the parameter information and physical value ranges they represent. To achieve this effect, this embodiment of the invention employs a nested layout management method based on rectangular regions. Specifically, a layout management method is used on the drawing interface where each drawing element is assigned a rectangular region to define its drawing position and size. Drawing elements assigned rectangular regions can only be drawn within the defined regions, and can also undergo further layout management within these regions in smaller units, thereby achieving nested layout management. Figure 2This demonstrates a typical layout for a curve-based main interface. The main interface consists of different rectangular areas, primarily including the X-axis, Y-axis, and curve areas. Titles and scales within the coordinate axis rectangular areas serve as their next-level rectangular layout areas. For example, the Y-axis area may contain nested title sub-areas. This layout method performs layout calculations when the interface size changes or internal drawing elements change, requiring a re-layout. When a drawing element area is re-layouted, it is automatically redrawn. When using a graphics program for actual drawing, the coordinates of each drawing element within the defined area are converted to pixel coordinates, and the corresponding interface of the drawing framework is called to complete the curve drawing. The layout management method in this embodiment can also flexibly adjust the position of each area, such as displaying the Y-axis on the right side of the curve interface, displaying the X-axis at the top of the curve interface, or hiding the corresponding coordinate axes. This example only demonstrates… Figure 2 The curve interface layout effect shown describes the specific implementation method of layout management in this embodiment of the invention.
[0029] In this embodiment of the invention, the layout management object is each sub-region within a region (parent region). The position of each sub-region is relative to the origin (0, 0) of the parent region, not relative to the origin of the main curve interface. If a sub-region within this region also has its own layout requirements, the sub-region will autonomously execute the next level of layout using the same layout management method. After layout calculation, the position and size of each region are recorded in its respective layout data. Figure 2 The calculation methods for the size and location of each region are as follows: (1) Y-axis, starting position coordinates are (0, 0). The height is equal to the height of the curve's main interface. The width is determined by the position width of the title area, tick value text, and tick lines within the coordinate axis area. The position width of the text can generally be calculated using the interface provided by the drawing framework. Therefore, the total width of the Y-axis is equal to: title area position width + tick text position width + tick line position width. Alternatively, drawing spacing and margins can be added to each element, and the corresponding total width can be obtained by adding each drawing spacing and margin. In summary, the height of the Y-axis area is specified externally, while the width is determined by its own position width requirements.
[0030] (2) The X-axis starts at coordinates (0, curve main interface height - X-axis height) and has a width equal to the width of the curve main interface. Its height is determined by the position height of the title area, tick values, and tick lines within the axis region. The text position height is generally calculated using the interface provided by the drawing framework. Therefore, the total height of the X-axis is equal to: title area position height + tick position height + tick line position height. Alternatively, drawing spacing and margins can be added to each element, and the corresponding total height can be calculated by adding the drawing spacing and margins. In summary, the width of the X-axis region is specified externally, while its height is determined by its own position height requirements. (3) Curved area: This area is compressed by the X-axis height and Y-axis width, so its width and height are specified externally. The layout manager first lays out the X-axis and Y-axis areas, and then uses the remaining area as the curved area. The starting position coordinates of the curved area are (Y-axis width, 0), the width is equal to the width of the main curved interface - the Y-axis width, and the height is equal to the height of the main curved interface - the X-axis height.
[0031] (4) A sub-region nested within a region, in order to Figure 2 Taking the title sub-region in the Y-axis region as an example, its height is equal to the height of the Y-axis region. Its width is determined by the width of the title text. Therefore, the width of this region is equal to the width of the title text. Drawing margins can also be added; the corresponding width plus the margins at both ends will suffice. Regarding the starting coordinates of nested regions, since the positions of all regions in this invention are relative to their parent regions, in this example, we only need to focus on the position of the title sub-region relative to the origin of the Y-axis region. Since the starting point of the title region coincides with the starting point of the Y-axis region, the starting coordinates of the title region are (0, 0).
[0032] After the above layout algorithm, each region has a defined position and size. Since its position is a relative coordinate, while drawing frames generally use absolute pixel positions for drawing and positioning, for some drawing frames that support coordinate system translation, it is only necessary to determine the absolute pixel position of the current drawing region on the main curve interface, then translate the coordinate system to that position, and then use the relative positions of each drawing element in that region to complete the drawing. However, for drawing frames that do not provide coordinate system translation functionality, it is necessary to manually convert the relative positions of each drawing element into absolute positions on the main curve interface before drawing. To support the conversion of relative positions to absolute positions, this embodiment of the invention stipulates that: each rectangular region needs to record its parent region information, the main curve interface is the top-level region of all other rectangular regions, and all rectangular regions form a tree structure with parent-child relationships. Then, the absolute positions of each region or each drawing element in a region on the main curve interface can be obtained through simple recursion or loop accumulation.
[0033] Real-time data-driven dynamic curve plotting: During reactor system design or actual operation, the data sources for various physical parameters are typically the real-time output of calculation programs or real-time acquisition by sensors in the engineering process. When a parameter value is updated in the data source, the system receives the new parameter value, constructs parameter coordinates from the new parameter value, and uses a coordinate transformation algorithm to convert the parameter coordinates into pixel coordinates. The specific transformation steps are as follows: (1) Calculate the ratio of pixels to parameter values on the X-axis and Y-axis respectively; (2) Use this ratio to calculate the pixel coordinates corresponding to the parameter coordinates.
[0034] To avoid unnecessary redrawing, the curve drawing based on new data is designed as an incremental drawing mechanism. New parameter values are retrieved from the data source, constructed into parameter coordinates, and promptly converted into pixel coordinates. The pixel coordinates of the last data point of the original curve are also retrieved, and their processing is consistent with the pixel coordinate conversion process for the new data. After obtaining the pixel coordinates, a line segment is drawn between the two points using the drawing framework, thus completing the dynamic drawing of the real-time data. By drawing a line segment from the end of the original curve to the specified pixel coordinates, dynamic curve drawing driven by real-time data is achieved.
[0035] Recording and querying historical data: Data sources typically only push the latest parameter values and lack historical data recording capabilities. Engineering applications often require combining historical parameter changes for scientific analysis and decision-making. To meet this need, another embodiment of this invention provides a data-driven real-time dynamic curve plotting method that enables the storage of historical parameter data. First, a data list is defined, using a physical coordinate point (e.g., (time, temperature)) to represent the parameter value information at a certain moment. Then, all collected physical coordinate points are sorted in a certain order and stored in the data list or computer memory.
[0036] Users can view historical data after it has been recorded. For example... Figure 3 As shown, when historical data needs to be viewed, a binary search algorithm is used to find the parameter point index within a specified range that is closest to the specified value from the sorted historical data. After determining the start and end indexes of the historical data range using this algorithm, the historical data can be read. The specific method of the binary search algorithm includes: Find the index of the closest value to x in an array of size count; Let: low equal 0, high equal count - 1; Determine if low is less than or equal to high; If low is less than or equal to high, then calculate the midpoint between low and high, which is equal to: ; Get the value midX at the mid position in the array, and determine whether midX is equal to x; If it is equal, then the index is found, and its value is mid. The search is completed, and the index value is returned. If they are not equal, check if midX is less than x; If so, recalculate low, with a value of mid+1, and return to determine if low is less than or equal to high; If it is greater than or equal to, then recalculate high, which has a value of mid-1, and return to determine whether low is less than or equal to high; If low is greater than high, then check if high is less than 0; If the value is less than 0, then the index is found, its value is 0, the search is completed, and the index value is returned. If it is greater than or equal to 0, then check if low is greater than count-1; If so, find the index, whose value is count-1. After the search is complete, return the index value. If not, calculate the difference between the corresponding values of low and high indices and the x value: distanceLow and distanceHigh respectively; When distanceLow is less than distanceHigh, the index is low; otherwise, it is high. After the search is completed, the index value is returned.
[0037] Viewing historical data: Upon receiving a request to view historical data, another embodiment of the present invention provides a data-driven real-time dynamic curve drawing method that further includes: locating and querying data according to the request to view historical data and completing the drawing of historical data curves. Specifically, this includes: determining the coordinate axis range when the mouse is dragged and scrolled, querying data from historical data that meets the current representation range, and completing the drawing of historical data curves based on the queried data.
[0038] This invention supports two methods for viewing historical data: dragging and zooming. When dragging the mouse within the curve area, the curve shifts accordingly. When scrolling the mouse within the curve area, the curve is zoomed in two ways: 1) zooming outwards from the mouse position; 2) fixing one end of the coordinate axis and zooming outwards. Dragging and scrolling allow viewing the global trend and details of changes in historical data. In this invention, both dragging and zooming ultimately translate into updating the coordinate axis representation range, and the curve drawing refreshes accordingly. Specifically, the method for determining the coordinate axis range during mouse dragging and scrolling is as follows: The calculation process for the coordinate axis range when dragging the mouse is as follows: (1) Obtain the parameter range span and coordinate axis pixel length of the current coordinate axis, and calculate the ratio of the coordinate axis pixel length to the parameter range span before dragging; (2) Obtain the translation pixel length of the mouse position in the coordinate axis direction when the mouse is dragged, and calculate the span of the parameter value corresponding to this length.
[0039] (3) Add (or subtract, depending on the drag direction) the span of the parameter value to the upper and lower limits of the coordinates respectively.
[0040] The calculation process for the coordinate axis range when the mouse scrolls is as follows: (1) Obtain the parameter range span and coordinate axis pixel length of the current coordinate axis, and calculate the ratio of coordinate axis pixel length to parameter range span before scrolling; (2) Obtain the number of mouse wheel scroll levels and scrolling direction and increase or decrease the parameter range proportionally; (3) Calculate the range of the coordinate axes based on the range ratio of the parameters after the increase or decrease and the mouse position.
[0041] Historical data query and plotting: Viewing historical data often occurs when scaling or dragging curves, at which point the range of the X-axis changes, necessitating a query from historical data that matches the current range. The processing steps are as follows: (1) Use the binary search algorithm described above to obtain the data sequence numbers that are closest to the minimum and maximum values of the coordinate axes respectively; (2) Expand the range of serial numbers by 1 unit at both ends.
[0042] (3) Find the data points within this range from historical data.
[0043] (4) Convert the data points into pixel coordinates in sequence and use the corresponding interface provided by the drawing framework to complete the drawing of historical data curves.
[0044] By finding the historical data points closest to the maximum and minimum values of the coordinate axes, which may fall within the coordinate axis range, blank areas near the minimum and maximum values of the coordinate axes can appear when plotting the curve. This situation can be prevented by taking the indexes of the two data points immediately outside the range of the maximum and minimum values as the range of historical data to be read and plotted within the current coordinate range.
[0045] Plotting multiple curves simultaneously: In some reactor engineering applications, the changing trends of multiple parameters are monitored simultaneously to achieve a holistic analysis of the reactor's state. Another embodiment of this invention provides a data-driven real-time dynamic curve drawing method that also includes simultaneous drawing of multiple curves. Specifically, this includes: overlapping curve regions on the main curve interface, with each curve's rectangular region having the same position and size; multiple curves can share a common coordinate system. Each curve is set to a different drawing style. The drawing process for each curve is the same as the drawing logic for real-time and historical data curves. Curves are drawn independently within overlapping rectangular regions, and the curves support style settings such as color, thickness, and line type for easy differentiation and viewing.
[0046] Confidence interval plotting: When analyzing reactor parameters, it is often necessary to compare parameter values with sample data or design target ranges in a timely manner to determine the rationality of the design or the reactor's operating status. Another embodiment of this invention provides a data-driven real-time dynamic curve plotting method that also implements a confidence interval function. Confidence intervals are divided into absolute confidence intervals (e.g., intervals higher than the reference value by 10% and lower than the reference value by 20%) and relative confidence intervals (e.g., intervals higher than the reference value by 10% and lower than the reference value by 20%). The size and position of the confidence interval rectangle are designed to completely overlap with the curve area, considering that the display format of the confidence interval may differ between different curve interfaces and even between different curves on the same curve interface. The confidence interval plotting method includes: (1) Obtain the upper and lower limits of the confidence interval, which may remain unchanged throughout the coordinate system (e.g., Figure 2 As shown in the figure, its upper and lower limits may also be different at different times.
[0047] (2) Construct the upper and lower limits in the form of parametric coordinates, and map the parametric coordinates to pixel coordinates; when the confidence interval is composed of multiple different parametric coordinates, obtain the pixel coordinates corresponding to each parametric coordinate. (3) Combine the pixel coordinates corresponding to the coordinates of each parameter in the confidence interval to complete the custom style drawing of the confidence interval.
[0048] The present invention provides a data-driven real-time dynamic curve plotting method, which can be widely applied to the design and implementation of trend curves in engineering design and operation. Its beneficial effects are: 1. This method enables efficient and flexible layout of regions and sub-regions, including X-axis, Y-axis, and curves. Each layout region independently draws its elements, separating layout and drawing logic. An incremental drawing mechanism is used for drawing curves with new data, avoiding unnecessary redrawing and ensuring that real-time data is promptly converted into curve output.
[0049] 2. It provides methods for saving and querying historical data of physical parameters, enabling convenient analysis of historical trends in physical parameter changes.
[0050] 3. A multi-curve plotting method has been implemented, which facilitates the comparative analysis of multiple physical parameters.
[0051] 4. A method for drawing confidence intervals has been implemented, and a customized implementation method for the drawing effect of confidence intervals has been provided.
[0052] like Figure 4As shown, another embodiment of the present invention provides a data-driven real-time dynamic curve drawing system for implementing the data-driven real-time dynamic curve drawing method described in the above embodiments. The system includes: a layout manager, a first acquisition module, a second acquisition module, and a drawing module. The layout manager is configured to allocate a rectangular area to each drawing element in the main curve interface to limit the drawing position and size. The rectangular area consists of starting coordinates, width and height. Each rectangular area supports nested child areas. The main curve interface is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the child area is relative to the origin of the parent area. The child area records the information of the parent area. The first acquisition module is configured to acquire new parameter values from the data source, construct parameter coordinates from the new parameter values, convert the parameter coordinates into corresponding pixel coordinates, and draw a curve. The second acquisition module is configured to acquire the pixel coordinates of the last data point of the original curve; The drawing module is configured to draw a line segment between two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
[0053] Specifically, the rectangular area includes a Y-axis area, an X-axis area, and a curve area. The starting coordinate of the Y-axis area is (0,0), the height is the height of the curve main interface, and the width is the sum of the width of the title area, the width of the scale text, and the width of the scale line. The starting coordinates of the X-axis region are (0, curve main interface height - X-axis height). The X-axis height is the sum of the title area position height, the scale position height, and the scale line position height. The width is equal to the width of the curve main interface. The starting coordinates of the curve region are (Y-axis width, 0), the width is the difference between the width of the main curve interface and the Y-axis width, and the height is the difference between the height of the main curve interface and the X-axis height.
[0054] Specifically, the system also includes a recording module, which is configured to define a data list, use physical value coordinate points to represent parameter value information at a certain moment, and store all collected physical value coordinate points in the data list in order.
[0055] Specifically, the system also includes a query module, which is configured to locate and query data based on a request to view historical data and to complete the drawing of historical data curves. Specifically, this includes: determining the coordinate axis range when the mouse is dragged and scrolled, querying data from historical data that meets the current representation range, and completing the drawing of historical data curves based on the queried data.
[0056] Specifically, the system also includes a confidence interval drawing module, which is configured to obtain the upper and lower limits of the confidence interval, construct the upper and lower limits into parameter coordinates, map the parameter coordinates to pixel coordinates, and complete the confidence interval drawing based on the pixel coordinates.
[0057] The execution process of each module can be carried out according to the steps of the data-driven real-time dynamic curve drawing method described in the above embodiment, and will not be repeated in this embodiment.
[0058] Another embodiment of the present invention provides an electronic device, which includes a processor, an input device, an output device, and a memory. The processor is connected to the input device, the output device, and the memory. The memory is used to store a computer program, which includes program instructions. The processor is configured to call the program instructions to execute the method described in the first embodiment above.
[0059] It should be understood that, in the embodiments of the present invention, the processor may be a Central Processing Unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0060] Input devices may include temperature sensors, pressure sensors, neutron detectors (used to detect neutron flux and as an important basis for judging or controlling nuclear reactor power), radiation detection sensors, etc., while output devices may include displays (LCDs, etc.), speakers, etc.
[0061] The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store information about the device type.
[0062] In specific implementations, the processor, input device, and output device described in the embodiments of the present invention can execute the implementation methods described in the method embodiments of the present invention, or they can execute the implementation methods described in the system embodiments of the present invention, which will not be repeated here.
[0063] In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the method described in the first embodiment above.
[0064] The computer-readable storage medium can be an internal storage unit of the terminal described in the foregoing embodiments, such as the terminal's hard drive or memory. The computer-readable storage medium can also be an external storage device of the terminal, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the terminal. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0065] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0066] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the terminals and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0067] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.
[0068] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A data-driven real-time dynamic curve plotting method, characterized in that, Includes the following steps: In the main interface of the curve, each drawing element is assigned a rectangular area to limit the drawing position and size. The rectangular area consists of the starting coordinates, width and height. Each rectangular area supports nested sub-areas. The main interface of the curve is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the sub-area is relative to the origin of the parent area. The sub-area records the information of the parent area. Get the new parameter value from the data source, construct the parameter coordinates from the new parameter value, convert the parameter coordinates into the corresponding pixel coordinates and draw the curve; Obtain the pixel coordinates of the last data point of the original curve; Draw a line segment between the two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
2. The method according to claim 1, characterized in that, The rectangular area includes a Y-axis area, an X-axis area, and a curve area. The starting coordinate of the Y-axis area is (0,0), the height is the height of the curve main interface, and the width is the sum of the width of the title area, the width of the scale text, and the width of the scale line. The starting coordinates of the X-axis region are (0, curve main interface height - X-axis height). The X-axis height is the sum of the title area position height, the scale position height, and the scale line position height. The width is equal to the width of the curve main interface. The starting coordinates of the curve region are (Y-axis width, 0), the width is the difference between the width of the main curve interface and the Y-axis width, and the height is the difference between the height of the main curve interface and the X-axis height.
3. The method according to claim 2, characterized in that, The nested sub-region includes a title sub-region nested within the Y-axis region. The starting coordinate of the title sub-region nested within the Y-axis region is (0,0), its height is equal to the height of the Y-axis region, and its width is the width of the title text.
4. The method according to claim 1, characterized in that, After the step of drawing a line segment between two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point, the method also includes recording historical data, specifically including: Define a data list; The parameter value information at a certain moment is represented by physical coordinate points; All collected physical coordinate points are stored in a data list in order.
5. The method according to claim 4, characterized in that, Following the step of recording historical data, the process further includes: locating and querying data based on the request to view historical data and completing the plotting of historical data curves. Specifically, this includes: determining the coordinate axis range when dragging and scrolling the mouse, querying data from historical data that meets the current representation range, and completing the plotting of historical data curves based on the queried data.
6. The method according to claim 5, characterized in that, The specific methods for determining the coordinate axis range during mouse dragging include: Get the current coordinate axis parameter range span and coordinate axis pixel length, and calculate the ratio of the coordinate axis pixel length to the parameter range span before dragging; Get the translation length in pixels along the coordinate axis when the mouse position is dragged, and calculate the span of the parameter value corresponding to the translation length in pixels; Add or subtract the range of the parameter value from the upper and lower limits of the coordinates respectively.
7. The method according to claim 6, characterized in that, The specific methods for determining the coordinate axis range during mouse scrolling include: Get the current coordinate axis parameter range span and coordinate axis pixel length, and calculate the ratio of coordinate axis pixel length to parameter range span before scrolling; The parameters are adjusted proportionally based on the number of scroll levels and the scrolling direction of the mouse wheel within a given range. The range of the coordinate axes is calculated by adjusting the range of parameters after addition or subtraction and by using the mouse position.
8. The method according to claim 7, characterized in that, The specific methods for querying data that satisfy the current representation range from historical data include: Use the binary search algorithm to find the index of the data point that is closest to the maximum and minimum values of the coordinate axes in the sorted historical data; When the data values at both ends of the found range are within the range represented by the coordinate axis, the sequence range is expanded by 1 unit to both ends to form the historical data range that needs to be read and drawn within the current coordinate range; Data points are obtained from the historical data range.
9. The method according to claim 1, characterized in that, After the step of drawing a line segment between two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point, the method further includes: overlaying a confidence interval region that completely overlaps with the curve region on the curve region. The confidence interval drawing method includes: Obtain the upper and lower limits of the confidence interval; The upper and lower limits are constructed in the form of parametric coordinates, and the parametric coordinates are mapped to pixel coordinates. Confidence intervals are drawn based on pixel coordinates.
10. A data-driven real-time dynamic curve plotting system, characterized in that, The method for implementing the data-driven real-time dynamic curve drawing method described in any one of 1-9 includes: a layout manager, a first acquisition module, a second acquisition module, and a drawing module; The layout manager is configured to allocate a rectangular area to each drawing element in the main curve interface to limit the drawing position and size. The rectangular area consists of starting coordinates, width and height. Each rectangular area supports nested sub-areas. The main curve interface is the top-level area of all rectangular areas. All rectangular areas form a tree structure with parent-child relationship. The position of the sub-area is relative to the origin of the parent area. The sub-area records the information of the parent area. The first acquisition module is configured to acquire new parameter values from the data source, construct parameter coordinates from the new parameter values, convert the parameter coordinates into corresponding pixel coordinates, and draw a curve. The second acquisition module is configured to acquire the pixel coordinates of the last data point of the original curve; The drawing module is configured to draw a line segment between two points based on the corresponding pixel coordinates and the pixel coordinates of the last data point.
11. The system according to claim 10, characterized in that, The rectangular area includes a Y-axis area, an X-axis area, and a curve area. The starting coordinate of the Y-axis area is (0,0), the height is the height of the curve main interface, and the width is the sum of the width of the title area, the width of the scale text, and the width of the scale line. The starting coordinates of the X-axis region are (0, curve main interface height - X-axis height). The X-axis height is the sum of the title area position height, the scale position height, and the scale line position height. The width is equal to the width of the curve main interface. The starting coordinates of the curve region are (Y-axis width, 0), the width is the difference between the width of the main curve interface and the Y-axis width, and the height is the difference between the height of the main curve interface and the X-axis height.
12. The system according to claim 10, characterized in that, The system also includes a recording module, which is configured to define a data list, use physical value coordinate points to represent parameter value information at a certain moment, and store all collected physical value coordinate points in the data list in order.
13. The system according to claim 12, characterized in that, The system also includes a query module, which is configured to locate and query data based on a request to view historical data and to complete the drawing of historical data curves. Specifically, this includes: determining the coordinate axis range when the mouse is dragged and scrolled, querying data from historical data that meets the current representation range, and completing the drawing of historical data curves based on the queried data.
14. The system according to claim 10, characterized in that, The system also includes a confidence interval drawing module, which is configured to obtain the upper and lower limits of the confidence interval, construct the upper and lower limits into parameter coordinates, map the parameter coordinates to pixel coordinates, and complete the drawing of the confidence interval based on the pixel coordinates.
15. An electronic device comprising a processor, an input device, an output device, and a memory, wherein the processor is connected to the input device, the output device, and the memory, and the memory is used to store a computer program, the computer program comprising program instructions, characterized in that... The processor is configured to invoke the program instructions to perform the method as described in any one of claims 1-9.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-9.