CN112256218B - Method and device for drawing massive data graphs - Google Patents
Method and device for drawing massive data graphs Download PDFInfo
- Publication number
- CN112256218B CN112256218B CN202011065578.7A CN202011065578A CN112256218B CN 112256218 B CN112256218 B CN 112256218B CN 202011065578 A CN202011065578 A CN 202011065578A CN 112256218 B CN112256218 B CN 112256218B
- Authority
- CN
- China
- Prior art keywords
- data
- graph
- memory
- target
- fragment data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/1407—General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a method and a device for drawing a large number of data graphs, which preprocesses original data, and divides the original data into pieces according to the capacity of a viewport window to obtain a plurality of pieces of divided data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer more than or equal to 1; when the graph is drawn, corresponding fragment data is extracted according to the target to be displayed, and the graph is drawn on the extracted fragment data. According to the method and the device, the original data are divided into the plurality of fragment data according to the viewport window capacity, and when the graph is drawn, the fragment data corresponding to the target to be displayed are extracted and drawn without loading and drawing all the data, so that the graph drawing efficiency is greatly improved, and the smoothness of data switching between screens is effectively guaranteed.
Description
Technical Field
The invention relates to the field of graph drawing, in particular to a method and a device for drawing a large amount of data graphs.
Background
In the field of graphic drawing, a large amount of original data (namely, data which needs to be displayed by graphic drawing) are often processed, the requirement on display precision is high, and flow display is needed for data switching between screens. For example, when a vital sign application is programmed, a vital sign data graph needs to be drawn, the vital sign data includes data such as blood pressure, heart rate, pulse, respiration, blood oxygen, and the like, and the data volume is often large. At present, when a large amount of data is subjected to graph drawing, a large amount of original data is generally loaded and drawn, so that data switching between screens is not smooth enough, and the graph drawing efficiency is low.
Disclosure of Invention
In order to solve the problems, the invention provides a method and a device for drawing a large amount of data graphs, which improve the data switching smoothness and the drawing efficiency between screens.
The technical scheme of the invention is as follows: a method for drawing a large-volume data graph, comprising the steps of:
preprocessing original data, and fragmenting the original data according to the capacity of a viewport window to obtain a plurality of fragmented data, wherein the corresponding capacity of each fragment of data is not more than n times of the capacity of the viewport window, and n is an integer more than or equal to 1;
when drawing the graph, extracting the corresponding fragment data according to the target to be displayed, and drawing the graph of the extracted fragment data.
Further, the horizontal axis of the data graph drawn in the viewport window is time; a viewport window size refers to the number of data points that can be held within the length of time that a viewport window can display.
Further, the method further comprises:
creating memory mapping for the fragment data, and creating a one-to-one mapping relation between a pointer and physical addresses of the fragment data;
when drawing the graph, extracting corresponding fragment data of the target to be displayed based on memory mapping.
Further, when the graph drawing is carried out, the method also comprises the following steps:
and loading the extracted fragment data into a memory.
Further, when the graph drawing is carried out, the method also comprises the following steps:
judging whether the fragment data corresponding to the target to be displayed is loaded into the memory;
if the fragment data is loaded into the memory, performing graph drawing on the loaded fragment data in the memory;
and if the data is not loaded into the memory, extracting corresponding fragment data of the target to be displayed based on memory mapping, reloading the fragment data into the memory, and carrying out graphic drawing on the fragment data reloaded into the memory.
Further, when the fragment data is reloaded into the memory, the fragment data loaded previously in the memory is cleared.
The technical scheme of the invention also comprises a large-amount data graph drawing device, which comprises,
a data preprocessing module: preprocessing original data, and segmenting the original data according to the capacity of a viewport window to obtain a plurality of segmented data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer more than or equal to 1;
the data extraction and drawing module: when the graph is drawn, corresponding fragment data is extracted according to the target to be displayed, and the graph is drawn on the extracted fragment data.
Further, the horizontal axis of the data graph drawn in the viewport window is time; a viewport window size refers to the number of data points that can be held within the length of time that a viewport window can display.
Further, the device also comprises a control device,
a memory mapping module: and establishing memory mapping for the fragment data, and establishing a one-to-one mapping relation between the pointer and the physical address of the fragment data.
Further, the data extraction and rendering module comprises,
a target receiving unit to be displayed: receiving a target to be displayed;
a display target data judgment unit: judging whether the fragment data corresponding to the target to be displayed is loaded into the memory, if so, informing a graph drawing unit to draw a graph, otherwise, informing a data extraction and loading unit to extract and load data;
a data extraction loading unit: extracting corresponding fragment data of a target to be displayed based on memory mapping, and loading the extracted fragment data into a memory;
a graph drawing unit: and drawing the graph according to the fragment data loaded in the memory.
According to the method and the device for drawing the large-amount data graph, the original data are divided into the plurality of fragment data according to the viewport window capacity, the fragment data corresponding to the target to be displayed are extracted for drawing during graph drawing, all data do not need to be loaded and drawn, graph drawing efficiency is greatly improved, and smoothness of data switching between screens is effectively guaranteed.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a graphics rendering phase according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a second structure according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings by way of specific examples, which are illustrative of the present invention and are not limited to the following embodiments.
Example one
As shown in fig. 1, the present embodiment provides a method for drawing a large amount of data graphs, which includes the following steps:
s1, preprocessing original data, and segmenting the original data according to the capacity of a viewport window to obtain a plurality of segmented data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer more than or equal to 1;
and S2, when the graph is drawn, extracting corresponding fragment data according to the target to be displayed, and drawing the graph of the extracted fragment data.
According to the embodiment, the original data is fragmented, and graph drawing is performed on certain fragment data based on the target to be displayed, so that the graph drawing on all the original data is avoided, the drawing efficiency is greatly improved, and the smoothness of screen switching is ensured.
Preferably, after the target to be displayed is determined, the correspondingly extracted fragment data is loaded to the memory, so that the situation that all original data are loaded to the memory is avoided, the memory occupancy rate is greatly reduced, and the drawing efficiency is further improved.
In the embodiment, a graph horizontal axis of original data displayed in the viewport window is time, generally, ruler grids are used as labels, one grid represents 0.2 second, multiple grids can be drawn on one screen, and the length of one screen can be converted into time; taking vital signs as an example, fixed points can be collected within 1 second, and the points which can be contained within one screen time are the capacity of one screen of data, namely the capacity of a viewport window.
For example, the length of one screen is 2 seconds, and the number of collected points in 2 seconds is the capacity of one screen of data.
In this embodiment, the corresponding capacity of each piece of data is not greater than n times of the capacity of a viewport window, n is an integer greater than or equal to 1, for example, a viewport window capacity is defined as c, the corresponding capacity of each piece of data may be n × c, wherein a value of n is related to the memory occupancy rate, and since the sliced data is loaded into the memory when performing graphic rendering, the value of n should ensure that the memory occupancy rate is not too high, and may be based on the data volume that can be rendered by 2-3 screens.
It should be noted that, when the original data is sliced, the original data is sliced from front to back in sequence according to the time of acquiring the original data. Assuming that the length of one screen is 2 seconds, and the value of n is 2, the data of 0-4 seconds can be divided into a first fragment, the data of 4-8 seconds can be divided into a second fragment, and so on.
The horizontal axis of the graph in this embodiment is time, the target to be shown is also determined according to the time, and data in a certain time interval may be used as the target to be shown, or data at a certain time point may be used as the target to be shown. For example, data within 1-2 seconds is to be displayed, the data within 1-2 seconds corresponds to the first fragment data (one screen length is 2 seconds, and data of n =2,0-4 seconds is the first fragment), and the first fragment data is extracted and loaded into the memory to draw the graph. The first fragment data comprises data of 1-2 seconds and data of 0-4 seconds in total, actually drawn graphs comprise 2 screens in total, the first screen displays the data of 0-2 seconds, the second screen displays the data of 2-4 seconds, and the two screens can be switched.
The original data of the embodiment are respectively stored in a certain position of the hard disk, and when a certain target to be displayed needs to be displayed, the specific fragment data is extracted from the hard disk into the memory. Therefore, after the original data is sliced, the following steps are also performed in this embodiment:
and establishing memory mapping for the fragment data, and establishing a one-to-one mapping relation between the pointer and the physical address of the fragment data. For example, slice data 1- > pointer ptr1, slice data 2- > pointer ptr2 ….
Correspondingly, when the graph is drawn, corresponding fragment data are extracted from the target to be displayed based on memory mapping.
It should be noted that the memory map further includes information of a time interval corresponding to each piece of data, so that when a target to be displayed (i.e., a time interval to be displayed) is input, corresponding piece of data can be matched, and data is read from the hard disk based on a position pointed by a corresponding pointer.
In this embodiment, the memory map may be stored in the memory.
As shown in fig. 2, in the graph drawing stage, the present embodiment performs the following steps:
the SS1 receives a target to be displayed;
the target to be displayed is input by a worker, and the time interval to be displayed is set based on the time interval.
SS2, judging whether the fragment data corresponding to the target to be displayed is loaded into the memory;
when the display is carried out for the first time, no data is loaded in the memory, the step SS4 can be directly executed, and then when the target to be displayed is changed or refilled, whether the fragment data exists in the memory needs to be judged.
SS3, if the fragment data is loaded into the memory, performing graph drawing on the loaded fragment data in the memory;
for example, the data of 0-2 seconds is displayed for the first time, the first piece of sliced data (0-4 seconds) is loaded in the memory, and if the data of 2-3 seconds needs to be displayed for the second time and the first piece of sliced data is loaded in the memory, the first piece of sliced data loaded in the memory is directly subjected to graphic drawing and refreshing.
If the SS4 is not loaded in the memory, extracting corresponding fragment data of the target to be displayed based on memory mapping, reloading the fragment data into the memory, and carrying out graphic drawing on the fragment data reloaded into the memory;
similarly, data of 0-2 seconds is displayed for the first time, the first fragment data (0-4 seconds) is loaded in the memory, and if the data of 5-6 seconds needs to be displayed for the second time, the second fragment data (5-8 seconds) is extracted again and loaded in the memory, and the second fragment data is subjected to graph drawing.
In specific implementation, the value range of the target to be displayed at each time can be limited according to the time length of one screen, so that only one piece of fragment data is extracted at each time. When the target to be displayed needs to be changed and the fragment data needs to be reloaded into the memory, the fragment data loaded previously in the memory is cleared, so that the maximum memory space is vacated, and the drawing efficiency is improved.
Of course, the value range of the target to be displayed at each time may not be limited, and the target to be displayed at each time may correspond to multiple pieces of fragment data, and the corresponding multiple pieces of fragment data are loaded to the memory at the same time. If the target to be displayed is changed at a certain time, the changed target corresponds to two pieces of fragment data, and when only one piece of fragment data is loaded in the memory, the other piece of fragment data is reloaded, and the loaded fragment data does not need to be cleared and reloaded.
Example two
As shown in fig. 3, on the basis of the first embodiment, the present embodiment provides a massive data graph drawing apparatus, which includes the following functional modules.
The data preprocessing module 101: preprocessing original data, and segmenting the original data according to the capacity of a viewport window to obtain a plurality of segmented data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer more than or equal to 1;
the data extraction rendering module 102: when the graph is drawn, corresponding fragment data is extracted according to the target to be displayed, and the graph is drawn on the extracted fragment data.
In the embodiment, a graph horizontal axis of original data displayed in the viewport window is time, generally, ruler grids are used as labels, one grid represents 0.2 second, multiple grids can be drawn on one screen, and the length of one screen can be converted into time; taking vital signs as an example, fixed points can be collected within 1 second, and the points which can be contained within one screen time are the capacity of one screen of data, namely the capacity of a viewport window.
The original data is stored on the hard disk, the corresponding fragment data to be displayed according to the target to be displayed is extracted and loaded into the memory, and the device is further provided with a memory mapping module 103 for timely and efficient extraction of the corresponding data.
The memory mapping module 103 creates a memory map for the fragmented data, and establishes a one-to-one mapping relationship between the pointers and the physical addresses of the fragmented data.
The data extraction and rendering module 102 extracts the corresponding fragment data and loads the fragment data to the memory, and performs graph rendering on the extracted fragment data.
Accordingly, the data extraction rendering module 102 includes the following functional units.
A target receiving unit to be displayed: receiving a target to be displayed;
a display target data judgment unit: judging whether the fragment data corresponding to the target to be displayed is loaded into the memory, if so, informing a graph drawing unit to draw a graph, otherwise, informing a data extraction and loading unit to extract and load data;
a data extraction loading unit: extracting corresponding fragment data of a target to be displayed based on memory mapping, and loading the extracted fragment data into a memory;
a graph drawing unit: and drawing the graph according to the fragment data loaded in the memory.
The target to be displayed is input by a worker, and data in a certain time interval can be used as the target to be displayed or data at a certain time point can be used as the target to be displayed by taking a time interval as a reference. When the target to be displayed is changed, if the changed corresponding fragment data is stored in the memory, the corresponding fragment data is directly drawn and refreshed normally, and if the changed corresponding fragment data is not stored in the memory, the corresponding fragment data is extracted again for drawing the graph.
The above disclosure is only for the preferred embodiments of the present invention, but the present invention is not limited thereto, and any non-inventive changes that can be made by those skilled in the art and several modifications and amendments made without departing from the principle of the present invention shall fall within the protection scope of the present invention.
Claims (5)
1. A method for drawing a large-volume data graph is characterized by comprising the following steps:
preprocessing, namely segmenting original data according to the capacity of a viewport window to obtain a plurality of segmented data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer which is more than or equal to 1;
when the graph is drawn, extracting corresponding fragment data according to a target to be displayed, and drawing the graph of the extracted fragment data;
the method further comprises the following steps:
establishing memory mapping for the fragment data, and establishing a one-to-one mapping relation between pointers and physical addresses of the fragment data;
when drawing a graph, extracting corresponding fragment data of a target to be displayed based on memory mapping;
when the graph is drawn, the method further comprises the following steps:
loading the extracted fragment data into a memory;
when the graph is drawn, the method further comprises the following steps:
judging whether the fragment data corresponding to the target to be displayed is loaded into the memory;
if the fragment data is loaded into the memory, performing graph drawing on the loaded fragment data in the memory;
and if the data is not loaded into the memory, extracting corresponding fragment data of the target to be displayed based on memory mapping, reloading the fragment data into the memory, and carrying out graphic drawing on the fragment data reloaded into the memory.
2. The method of claim 1, wherein the horizontal axis of the data graph rendered in the viewport window is time; a viewport window size refers to the number of data points that can be held within the length of time that a viewport window can display.
3. The method of claim 1, wherein upon reloading the sliced data into memory, the sliced data previously loaded in memory is purged.
4. A large data pattern drawing apparatus, comprising,
a data preprocessing module: preprocessing, namely segmenting original data according to the capacity of a viewport window to obtain a plurality of segmented data, wherein the corresponding capacity of each piece of data is not more than n times of the capacity of the viewport window, and n is an integer which is more than or equal to 1;
the data extraction and drawing module: when the graph is drawn, extracting corresponding fragment data according to a target to be displayed, and drawing the graph of the extracted fragment data;
the device also comprises a control device which is used for controlling the operation of the device,
a memory mapping module: establishing memory mapping for the fragment data, and establishing a one-to-one mapping relation between pointers and physical addresses of the fragment data;
the data extraction and drawing module comprises a data extraction and drawing module,
a target receiving unit to be displayed: receiving a target to be displayed;
a display target data judgment unit: judging whether the fragment data corresponding to the target to be displayed is loaded into the memory, if so, informing a graph drawing unit to draw a graph, otherwise, informing a data extraction and loading unit to extract and load data;
a data extraction loading unit: extracting corresponding fragment data of a target to be displayed based on memory mapping, and loading the extracted fragment data into a memory;
a graph drawing unit: and drawing the graph according to the fragment data loaded in the memory.
5. The mass data graph rendering apparatus of claim 4, wherein a horizontal axis of the rendered data graph in the viewport window is time; a viewport window size refers to the number of data points that can be held within the length of time that a viewport window can display.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011065578.7A CN112256218B (en) | 2020-09-30 | 2020-09-30 | Method and device for drawing massive data graphs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011065578.7A CN112256218B (en) | 2020-09-30 | 2020-09-30 | Method and device for drawing massive data graphs |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112256218A CN112256218A (en) | 2021-01-22 |
CN112256218B true CN112256218B (en) | 2023-03-10 |
Family
ID=74234789
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011065578.7A Active CN112256218B (en) | 2020-09-30 | 2020-09-30 | Method and device for drawing massive data graphs |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112256218B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113129407B (en) * | 2021-03-15 | 2023-08-18 | 武汉联影智融医疗科技有限公司 | Physiological waveform drawing method, device, computer equipment and readable storage medium |
CN112860729A (en) * | 2021-03-29 | 2021-05-28 | 中信银行股份有限公司 | Operation method, operation device, electronic equipment and readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107784195A (en) * | 2017-11-30 | 2018-03-09 | 新华三大数据技术有限公司 | Data processing method and device |
CN111652955A (en) * | 2020-04-09 | 2020-09-11 | 北京奇艺世纪科技有限公司 | Data display method and device, computer equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
NL2018853B1 (en) * | 2017-05-05 | 2018-11-14 | Illumina Inc | Systems and methods for improved focus tracking using a hybrid mode light source |
-
2020
- 2020-09-30 CN CN202011065578.7A patent/CN112256218B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107784195A (en) * | 2017-11-30 | 2018-03-09 | 新华三大数据技术有限公司 | Data processing method and device |
CN111652955A (en) * | 2020-04-09 | 2020-09-11 | 北京奇艺世纪科技有限公司 | Data display method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112256218A (en) | 2021-01-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112256218B (en) | Method and device for drawing massive data graphs | |
US4642790A (en) | Presentation space management and viewporting on a multifunction virtual terminal | |
EP0179193B1 (en) | Data display systems having a display source merge capability and using a storage-type display device | |
EP0026266B1 (en) | Digital data display system | |
US7724260B2 (en) | Method and system for image monitoring | |
US11170555B2 (en) | Graphics processing systems | |
US20050156937A1 (en) | Screen display processing apparatus, screen display processing method and computer program | |
DE102013014846A1 (en) | Systems and methods for partial frame buffer update | |
US11644810B2 (en) | Hybrid rendering HMI terminal device | |
EP2449456B1 (en) | Vector-based magnified pointer | |
US8487952B2 (en) | Methods and systems for marking pixels for image monitoring | |
CN108733441A (en) | A kind of rendering method for visualizing and system suitable for large scale electric network symbolic device | |
US20180089873A1 (en) | Page image display control system, page image display control method, and program therefor | |
US6295059B1 (en) | Method of vertically compressing a large list of data to fit on a screen | |
CN111506679A (en) | Map element data generation method, map element data display method, map element data generation device, map element data display device, medium, and equipment | |
US8824806B1 (en) | Sequential digital image panning | |
CA2023832C (en) | Method and apparatus for filing contours in digital typefaces | |
CN111261088B (en) | Image drawing method and device and display device | |
US6344856B1 (en) | Text optimization | |
US20080055286A1 (en) | Method And Apparatus For Displaying Bitmap Images | |
US11222161B1 (en) | Grid magnifier | |
JPH06110989A (en) | Method and system for apparent direct editing for fixed element displayed in main window, which is provided by application | |
US5452409A (en) | System and method for creating and modifying graphs in a computer system using a multiple segment graph format | |
US6262727B1 (en) | Method of compressing and expanding large lists of data | |
US7394466B2 (en) | Method for memory allocation for images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 250000 East Hall, five floor, R & D and production building, 2 Shenhua science and Technology Park, 699 Shun Hua West Road, Ji'nan High-tech Zone, Shandong Applicant after: Shensi (Shandong) Medical Information Technology Co.,Ltd. Address before: 250000 East Hall, five floor, R & D and production building, 2 Shenhua science and Technology Park, 699 Shun Hua West Road, Ji'nan High-tech Zone, Shandong Applicant before: SYNTHESIS SUNRISE MEDICAL INFORMATION TECHNOLOGY CO.,LTD. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |