CN115357740A - Large-scale data visualization method and device and electronic device - Google Patents

Large-scale data visualization method and device and electronic device Download PDF

Info

Publication number
CN115357740A
CN115357740A CN202210949931.0A CN202210949931A CN115357740A CN 115357740 A CN115357740 A CN 115357740A CN 202210949931 A CN202210949931 A CN 202210949931A CN 115357740 A CN115357740 A CN 115357740A
Authority
CN
China
Prior art keywords
data
current
time range
display
displayed
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.)
Pending
Application number
CN202210949931.0A
Other languages
Chinese (zh)
Inventor
庄有楷
邹才华
柏文波
何林飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202210949931.0A priority Critical patent/CN115357740A/en
Publication of CN115357740A publication Critical patent/CN115357740A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a method and a device for visualizing large-scale data and an electronic device, wherein the method for visualizing the large-scale data comprises the following steps: acquiring data to be displayed, and arranging the data to be displayed according to a time sequence; acquiring a current time range, and determining a current sampling step length according to the current time range; sampling the arranged data to be displayed within the current time range according to the current sampling step length so as to obtain current display data; and drawing a current curve graph in a display screen according to the current display data. According to the method and the device, the problem that the curve graph can not be smoothly displayed on the screen of the equipment based on large-scale data in the related technology is solved, and the rapid and smooth curve graph drawing effect is achieved.

Description

Large-scale data visualization method and device and electronic device
Technical Field
The present application relates to the field of data processing, and in particular, to a method and an apparatus for visualizing large-scale data, and an electronic apparatus.
Background
In today's information age, a large amount of data, such as thermometers, stocks, etc., is produced in many fields. A large amount of data needs to be presented to the user in the form of a chart so that the user can quickly obtain useful information, such as a thermometer chart, to quickly know the temperature trend within the cycle and which periods are high and which periods are low. These data structures contain at least two fields: a value and a timestamp. The value is a value concerned by the user in a certain field, for example, the value concerned by the thermometer is a temperature value, and the stock is a price; the time stamp is the time when this corresponding value was generated. Rendering such data into a graph presents a coordinate axis, the X-axis being represented by a time stamp and the Y-axis being represented by a numerical value.
Because the magnitude of the information data is very large, it is not easy to show millions of data on the screen of a mobile phone/computer in a graph form. If a graph of millions of data is directly drawn on a screen, the equipment is directly locked, and the graphics processor cannot process the large data volume. In order to avoid the above-mentioned problem of equipment jamming, one of the prior art approaches divides the big data into units of time, and then displays the divided big data in the form of a histogram, where each column represents a unit of time, and the data of the column is an average value in the unit of time. Although the method can reduce the data processing amount of the image processor, thereby avoiding the problem of equipment jamming, the method has the defect that the data display is not accurate and intuitive enough because the graph display mode is abandoned.
Aiming at the problem that the curve graph can not be smoothly displayed on the screen of the equipment based on large-scale data in the related technology, no effective solution is provided at present.
Disclosure of Invention
The embodiment provides a method, a device, a system, an electronic device and a storage medium for visualizing large-scale data, so as to solve the problem that a curve graph cannot be smoothly displayed on an equipment screen based on the large-scale data in the related art.
In a first aspect, there is provided in this embodiment a method of visualizing large-scale data, the method comprising:
acquiring data to be displayed, and arranging the data to be displayed according to a time sequence;
acquiring a current time range, and determining a current sampling step length according to the current time range;
sampling the arranged data to be displayed within the current time range according to the current sampling step length so as to obtain current display data;
and drawing a current curve graph in a display screen according to the current display data.
In some of these embodiments, the method further comprises:
receiving a graphic operation instruction input by a user, wherein the graphic operation instruction comprises enlarging the current curve graph and reducing the current curve graph;
updating the current time range according to the graphic operation instruction, and updating the current sampling step length according to the updated current time range;
sampling the arranged data to be displayed according to the updated current time range and the current sampling step length, so as to update the current display data;
and updating and drawing the current curve graph according to the updated current display data.
In some of these embodiments, the data to be presented includes historical data and incremental data;
the acquiring the data to be displayed and arranging the data to be displayed according to the time sequence comprises the following steps:
and acquiring the historical data from a server, acquiring the incremental data from the Internet of things equipment, and arranging the data to be displayed according to a generation time sequence according to a data timestamp.
In some embodiments, after the acquiring the data to be displayed and arranging the data to be displayed in a time sequence, the method further includes:
and arranging the data to be displayed according to a preset processing means at a first time interval.
In some embodiments, the predetermined processing means includes data deduplication, dummy data padding, and null data padding;
the arranging the data to be displayed according to a first time interval according to a preset processing means comprises:
when a plurality of pieces of data exist in the same first time interval, reserving the first piece of data in the first time interval;
filling dummy data between two adjacent data when the time interval of the two adjacent data is greater than the first time interval and less than a second time interval;
and filling null data between the two adjacent data when the time interval of the two adjacent data is greater than the second time interval.
In some of these embodiments, said determining a current sampling step size from said current time range comprises:
and determining the current sampling step length according to the current time range and the resolution of the display screen.
In some of these embodiments, said determining a current sample step size based on said current time range and a resolution of said display screen comprises:
determining a unit time range represented by each pixel according to the current time range and the display state of the display screen;
and determining the current sampling step length according to the unit time range.
In some of these embodiments, the display state includes a landscape display and a portrait display, and the unit time range includes a first time range and a second time range;
when the display state is vertical screen display, determining the first pixel number of the display screen along a horizontal axis, determining the first time range represented by each pixel on the horizontal axis according to the first pixel number and the current time range, and determining the current sampling step length according to the first time range;
when the display state is the horizontal screen display, determining the second pixel number of the display screen along the vertical axis, determining the second time range represented by each pixel on the vertical axis according to the second pixel number and the current time range, and determining the current sampling step length according to the second time range.
In a second aspect, there is provided in this embodiment an apparatus for visualization of large-scale data, the apparatus comprising:
the data acquisition module is used for acquiring data to be displayed and arranging the data to be displayed according to a time sequence;
the step length determining module is used for acquiring a current time range and determining a current sampling step length according to the current time range;
the data sampling module is used for sampling the arranged data to be displayed within the current time range according to the current sampling step length so as to obtain current display data;
and the graph drawing module is used for drawing the current curve graph in a display screen according to the current display data.
In a third aspect, in the present embodiment, there is provided an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the method for visualizing the large-scale data according to the first aspect.
In a fourth aspect, in the present embodiment, there is provided a storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the method for visualizing large scale data according to the first aspect.
Compared with the related art, the large-scale data visualization method, the large-scale data visualization device and the large-scale data visualization electronic device provided by the embodiment of the invention have the advantages that when the data to be displayed are displayed in the form of the graph, not all data in the current time range are rendered and drawn, but the data in the current time range are sampled, and the current graph is drawn according to the current display data obtained by sampling, so that the data processing load of the graph processor is greatly reduced. Also, the current sampling step size is determined according to the current time range. Through the dynamic change, the finally sampled data volume is relatively stable and can be kept within the normal load of the graphics processor, and therefore the data in any time range can be smoothly displayed by the terminal equipment. The problem that the curve graph can not be smoothly displayed on the screen of the equipment based on large-scale data in the related technology is solved, and the quick and smooth curve graph drawing effect is achieved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a terminal of the large-scale data visualization method according to the present embodiment.
Fig. 2 is a flowchart of a method of visualizing large-scale data of the present embodiment.
Fig. 3 is a preferred flowchart of the method for visualizing large-scale data in the present embodiment.
Fig. 4 is a block diagram of the structure of the large-scale data visualization device according to the present embodiment.
Detailed Description
For a clearer understanding of the objects, technical solutions and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, "a and/or B" may indicate: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the method is executed on a terminal, and fig. 1 is a block diagram of a hardware structure of the terminal of the large-scale data visualization method according to the embodiment. As shown in fig. 1, the terminal may include one or more processors 102 (only one shown in fig. 1) and a memory 104 for storing data, wherein the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the method for visualizing the large-scale data in the embodiment, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices via a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In the present embodiment, a method for visualizing large-scale data is provided, and fig. 2 is a flowchart of the method for visualizing large-scale data of the present embodiment, as shown in fig. 2, the method for visualizing large-scale data includes the following steps:
step S210, acquiring data to be displayed, and arranging the data to be displayed according to a time sequence.
Specifically, the terminal device first obtains data to be displayed, and arranges the obtained data according to a time sequence. The terminal device comprises a processor and a display screen, wherein the processor is used for processing data, and the display screen is used for displaying data, for example, the terminal device can be a computer, a mobile phone and the like. The data to be presented may exemplarily be temperature data, humidity data, stock data, etc. Wherein in an application scene, terminal equipment is used for showing the data that the intelligence hygrothermograph based on the thing networking was gathered, and the temperature and hygrometer of intelligence can continuous record ambient temperature, humidity and correspond the timestamp, and terminal equipment can acquire the data that the temperature and hygrometer of intelligence gathered to show data in follow-up step, thereby be convenient for the user to know temperature, humidity change directly perceivedly.
Step S220, obtaining the current time range, and determining the current sampling step length according to the current time range.
Specifically, after acquiring data to be displayed, the terminal device needs to sample the data, and in the subsequent steps, only the sampled data is displayed, instead of displaying all the acquired data. Therefore, when a large amount of data to be displayed are faced, the amount of rendered data can be reduced through data sampling, the load of the graphics processor is greatly reduced, and the terminal equipment can display the data more smoothly. Specifically, sampling is performed according to a preset sampling step length in the sampling process, and the preset sampling step length is not fixed. Further, the current time range refers to a data time range required to be displayed by the screen of the terminal device at the current moment. For example, when the temperature data is displayed, if the current date is 6 months and 5 days, and the user selects to display the temperature change of the latest month, the temperature data of the latest month needs to be displayed according to the time sequence, so that the current time range is 5 months and 6 days to 6 months and 5 days. As can be seen from the above example, the current time range varies according to the display requirement of the user, and may be a month, a day, or even an hour. The current sampling step size is determined based on the current time range. When the current time range is larger, the current sampling step length is also larger; when the current time range is smaller, the current sampling step length is smaller. Through the dynamic change, the finally sampled data volume is relatively stable and can be kept within the normal load of the graphics processor, and therefore the data in any time range can be smoothly displayed by the terminal equipment.
Step S230, sampling the arranged data to be displayed within the current time range according to the current sampling step length, thereby obtaining the current display data.
Specifically, after the terminal device determines the current sampling step length according to the current time range, the data which are arranged according to the time sequence and are in the current time range are sampled through the sampling step length, the current display data are obtained after sampling, and the current display data are the data which can be displayed in the device screen.
And step S240, drawing the current curve graph in the display screen according to the current display data.
Specifically, after the terminal device obtains the current display data through sampling, the current data is rendered and drawn in a screen to be displayed in a curve graph mode, and then the current curve graph displays the data change in the current time range. In a specific example, temperature changes, humidity changes, etc. within the current range may then be demonstrated.
Through the steps, when the terminal equipment displays the data to be displayed in the form of the curve graph, the terminal equipment does not render and draw all the data in the current time range, but performs sampling processing on the data in the current time range, and draws the current curve graph according to the current display data obtained by sampling, so that the data processing load of the graph processor is greatly reduced. Also, the current sampling step size is determined according to the current time range. When the current time range is larger, the current sampling step length is also larger; when the current time range is smaller, the current sampling step length is also smaller. Through the dynamic change, the finally sampled data volume is relatively stable and can be kept in the normal load of the graphic processor, and therefore the terminal equipment can be guaranteed to smoothly display the data in any time range. The problem that the curve graph can not be smoothly displayed on the screen of the equipment based on large-scale data in the related technology is solved, and the quick and smooth curve graph drawing effect is achieved.
In some of these embodiments, the visualization method of large-scale data may also enable real-time updating of the current curve image. Fig. 3 is a preferred flowchart of the method for visualizing large-scale data in the present embodiment. As shown in fig. 3, the method for visualizing large-scale data further includes the following steps:
step S310, receiving a graphic operation instruction input by a user, wherein the graphic operation instruction comprises enlarging the current curve graph and reducing the current curve graph.
Specifically, the terminal device may further receive a graphic operation instruction input by a user in a process of displaying the current curve graphic, where the graphic operation instruction includes enlarging the current curve graphic and reducing the current curve graphic. That is, the user may zoom in or zoom out the current curve pattern while using the terminal device. It should be further noted that, because the screen size of the terminal device is fixed, when the current curve graph is enlarged, the corresponding current time range is reduced, that is, the time range that the screen can display is reduced; when the current curve graph is reduced, the corresponding current time range is increased, namely the time range which can be displayed by the screen is increased.
Step S320, updating the current time range according to the graphics operation instruction, and updating the current sampling step length according to the updated current time range.
Specifically, after the current curve graph is processed or reduced, the corresponding current time range is changed accordingly. Therefore, the terminal device updates the current time range simultaneously in the process of enlarging or reducing the current curve graph according to the operation instruction input by the user. Further, the current sampling step size is related to the current time range, and thus the current sampling step size is updated at the same time.
And step S330, sampling the arranged data to be displayed according to the updated current time range and the current sampling step length, thereby updating the current display data.
Specifically, after the user operation is finished, the terminal device may determine the updated current time range and the current sampling step length, and sample the data to be displayed again according to the updated current time range and the current sampling step length, to obtain updated current display data, and then update the current display data.
And step S340, updating and drawing the current curve graph according to the updated current display data.
Specifically, after the terminal device obtains new current display data, the current curve graph is redrawn according to the new current display data. Thereby showing the data changes on the screen within the time range that the user needs to know.
Through the steps, the current curve graph is updated and drawn; when the user needs to know the data change in a larger range, the current curve graph can be reduced. And the terminal equipment updates the current time range and the current sampling step length in real time according to the corresponding operation of the user, samples the data to be displayed again according to the updated current time range and the current sampling step length, and updates and draws the changed curve graph in real time.
In some of these embodiments, the data to be presented includes historical data and incremental data;
step S210, acquiring data to be displayed, and arranging the data to be displayed according to a time sequence specifically includes:
step S211, obtaining historical data from the server, obtaining incremental data from the Internet of things equipment, and arranging the data to be displayed according to the data time stamp in a generation time sequence.
In some specific application scenarios, the terminal device may be a data display based on an internet of things device. Namely, the terminal equipment acquires the data acquired by the Internet of things equipment and displays the corresponding data. For example, an intelligent thermo-hygrometer may keep track of the ambient temperature, humidity, and corresponding time stamp. Because the hygrothermograph is a bluetooth device, the recorded data is transmitted to the server through the bluetooth connection mobile phone App. Therefore, the server may store more history data; the thermo-hygrometer itself will store less of the most recently generated incremental data. Therefore, in a specific example, the terminal device obtains the historical data from the server, obtains the incremental data from the internet of things device, and arranges the incremental data according to the time stamp of the data and the generation time of the data.
In some embodiments, the method for visualizing large-scale data further includes, after acquiring data to be displayed and arranging the data to be displayed in a time sequence in step S210:
step S290, arranging the data to be displayed according to a first time interval according to a preset processing means.
Specifically, after the terminal device obtains the data to be displayed and arranges the data according to the time sequence, the data generation time is random and partial data is lost, so that the data interval after arrangement is irregular. For example, the data distribution is dense in some time periods, i.e. the time interval is small; the data distribution is sparse in some time periods, namely, the time interval is large. In order to avoid the influence of the irregularity of the data distribution on the subsequent data sampling, the step processes the data to be displayed according to a preset processing means, so that the processed data are regularly distributed, namely, the same or similar time intervals are kept between any two adjacent data. Specifically, part of the data may be discarded in a range where the data distribution is dense, and part of the data may be filled in a range where the data distribution is sparse. The first time interval may be set according to actual conditions, for example, one second or one minute.
Based on this, in a specific embodiment, the preset processing means includes data deduplication, dummy data padding, and null data padding;
step S290, arranging the data to be displayed according to the preset processing means at the first time interval specifically includes:
step S291, when there are multiple pieces of data in the same first time interval, retaining the first piece of data in the first time interval;
step S292, when the time interval between two adjacent pieces of data is greater than the first time interval and less than the second time interval, filling dummy data between the two adjacent pieces of data;
in step S293, when the time interval between two adjacent pieces of data is greater than the second time interval, null data is padded between the two adjacent pieces of data.
Specifically, the preset processing means includes three types of data deduplication, dummy data padding and null data padding, which correspond to step S291, step S292 and step S293, respectively. When there are multiple pieces of data in the same first time interval, that is, the data distribution in the time interval is dense, only the first piece of data in the first time interval is retained, and the other pieces of data are discarded. When the time interval between two adjacent data is greater than the first time interval and less than the second time interval, that is, the data distribution in the time period is sparse, and therefore the data needs to be adjusted and compensated at corresponding positions, so that the data are regularly distributed according to the first time interval. For example, setting the first time interval to be one minute, and filling a dummy data between two data when the time interval between the two data is two minutes; when the time interval between two data is three minutes, two dummy data are padded between the two data. The specific value of the false data can be determined based on the data on both sides, for example, the average value of the data on both sides can be used. And when the time interval between two adjacent data is greater than the second time interval, namely the data distribution in the time period is quite sparse, filling null data between the two adjacent data. The adjustment and compensation rule of the null data is the same as that of the dummy data, namely, a first time interval is kept between two adjacent data. But differs in that the null data only serves as a placeholder and is not rendered to draw in the screen.
In some embodiments, in step S220, determining the current sampling step size according to the current time range specifically includes:
step S221, determining a current sampling step size according to the current time range and the resolution of the display screen.
Specifically, the current sampling step size is determined according to the current time range and the resolution of the display screen. The resolution of the display screen determines the number of pixels of the display screen. Generally, if the amount of rendered data is greater than the number of pixels, a large load pressure is applied to the image processor, thereby causing a device jam. Therefore, in this embodiment, the current sampling step length is determined according to the number of the pixel points of the display screen and the current data range, so as to control the number of the current display data obtained by sampling.
Further, in some specific embodiments, the step S221 of determining the current sampling step size according to the current time range and the resolution of the display screen specifically includes:
determining a unit time range represented by each pixel according to the current time range and the display state of the display screen;
and determining the current sampling step length according to the unit time range.
Specifically, first, a unit time range that each pixel in the display screen can represent is determined according to the current time range and the display state of the display screen. The unit time range is equal to the current time range divided by the number of the pixel points; the current sampling step size is then determined by the unit time range. Preferably, the unit time range is directly used as the current sampling step length, and the number of the current display data obtained by sampling through the current sampling step length is less than or equal to the number of the pixel points, so that each pixel point is guaranteed to display at most one piece of data. Therefore, the current curve graph can be displayed clearly, and the data processing amount of the graph processor can be greatly reduced. Accordingly, the current sampling step size may be set to twice the unit time range, so that the graphics data throughput is lower, but the corresponding graphics resolution is also reduced.
Based on this, in one specific embodiment, the display state comprises a landscape display and a portrait display, and the unit time range comprises a first time range and a second time range;
when the display state is vertical screen display, determining the first pixel number of the display screen along the horizontal axis, determining a first time range represented by each pixel on the horizontal axis according to the first pixel number and the current time range, and determining the current sampling step length according to the first time range;
and when the display state is horizontal screen display, determining the second pixel number of the display screen along the vertical axis, determining a second time range represented by each pixel on the vertical axis according to the second pixel number and the current time range, and determining the current sampling step length according to the second time range.
Specifically, when the display screen of the terminal device is used by a vertical screen, the time axis of the current curve graph is parallel to the horizontal axis of the display screen, so that the first pixel number of the display screen along the horizontal axis needs to be determined, then the current time range is divided by the first pixel number to obtain a first time range, and finally the current sampling step length is determined according to the first time range.
When the display screen of the terminal equipment is used by a transverse screen, the time axis of the current curve graph is parallel to the vertical axis of the display screen, the second pixel number of the display screen along the vertical axis needs to be determined, then the current time range is divided by the second pixel number to obtain a second time range, and finally the current sampling step length is determined according to the second time range.
The technical solutions in the present application are described and illustrated below by means of specific preferred embodiments.
The preferred embodiment is described by taking an example that a large-scale data visualization method is applied to an intelligent humiture meter based on the internet of things. The method in the preferred embodiment comprises the steps of:
1. before rendering the graph is started, data to be displayed needs to be acquired. There are two aspects to obtaining the data to be presented: 1) Acquiring historical data from a server; 2) Incremental data was obtained from a hygrothermograph. After both data are acquired, the data are arranged according to the ascending order of time.
2. The data is preprocessed to ensure that the data is regularly distributed (for example, one data per minute, that is, the first time interval is one minute), and a data source is generated. The pretreatment step specifically comprises the following steps:
a) Data deduplication, data for time within the same minute only retained the first bar; for example, there are A, B, C three data with time stamps all in the same minute, so this step would remove B, C data.
b) Two adjacent data have a time difference of more than 1 minute (first time interval) and less than 5 minutes (second time interval), fill in false data, and compensate one piece of data every minute; for example, there are two data D, E, the two have time stamps of 13.
c) The time difference between two adjacent data is greater than 5 minutes (second time interval), null data (only used as occupation) is filled, and the time of the null data does not draw a graph; for example, there are H, I two data with time stamps of 18.
d) Thus, the data preprocessing is completed.
3. Data for a time range TimeRange1 is shown. Specifically, the method comprises the following steps:
e) Each time, the upper limit of the display data is based on the device pixels, for example, if the number of the device pixels is PixelCount, the time range UnitTimeRange = TimeRange1/PixelCount represented by each pixel;
f) Acquiring data from a data source by taking the UnitTimeRange as a step length to obtain a sampled data fragment DataSlice corresponding to the time range TimeRange 1; for example, in the time range 1100 minutes shown in the graph, since one piece of data is retained every minute, there are 1100 pieces of data, and assuming that the number of pixels of the device is 500, 500 pieces of data are required to be extracted from 1000 pieces of data for rendering the graph, and the calculation step size 1100/500 is rounded to 2, so that one piece of data is extracted for every two pieces of data until 500 pieces of data are extracted. It should be further noted that there are cases where end data is discarded because the sample step size must be an integer multiple of the data interval. In practical applications, such errors can be reduced by adjusting the data interval. A common way to do this is to reduce the data interval, for example, one piece of data can be retained per second during preprocessing, in which case the calculation step size 66000/500 is equal to 132 seconds, i.e., one piece of data is taken for every 132 pieces of data, all the data can be sampled without discarding the end data.
g) At the moment, the size of the data fragment DataSlice is at most PixelCount, and the DataSlice is rendered into a curve;
h) So far, the data calculation in the current time range is completed.
4. The user zooms in and out on the chart, which changes the time range from TimeRange1 to TimeRange2.
5. The TimeRange2 is brought into step 3 and execution continues.
Through the preferred embodiment, the technical scheme in the application has the following advantages:
large-scale data are rendered into a chart, so that the blockage of equipment cannot be caused;
the chart supports continuous amplification, and data within one hour can be checked; the data can be continuously reduced and checked within one year;
in the chart scaling process, data are calculated in real time and a chart is rendered, and no pause exists in the process.
In this embodiment, a large-scale data visualization apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, which have already been described and are not described again. The terms "module," "unit," "subunit," and the like as used below may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram showing the structure of a large-scale data visualization apparatus according to the present embodiment, and as shown in fig. 4, the apparatus includes:
a data obtaining module 410, configured to obtain data to be displayed, and arrange the data to be displayed according to a time sequence;
a step length determining module 420, configured to obtain a current time range, and determine a current sampling step length according to the current time range;
the data sampling module 430 is configured to sample the arranged data to be displayed within the current time range according to the current sampling step length, so as to obtain current display data;
and the graph drawing module 440 is configured to draw the current curve graph in the display screen according to the current display data.
Specifically, through the cooperation among the modules, when the data to be displayed is displayed in the form of a curve graph, the large-scale data visualization device does not render and draw all data in the current time range, but performs sampling processing on the data in the current time range, and draws the current curve graph according to the current display data obtained by sampling, so that the data processing load of the graph processor is greatly reduced. Furthermore, the current sampling step size is determined according to the current time range. When the current time range is larger, the current sampling step length is also larger; when the current time range is smaller, the current sampling step length is smaller. Through the dynamic change, the finally sampled data volume is relatively stable and can be kept in the normal load of the graphic processor, and therefore the terminal equipment can be guaranteed to smoothly display the data in any time range.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules may be located in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring data to be displayed, and arranging the data to be displayed according to a time sequence.
And S2, acquiring a current time range, and determining a current sampling step length according to the current time range.
And S3, sampling the arranged data to be displayed within the current time range according to the current sampling step length, thereby obtaining the current display data.
And S4, drawing the current curve graph in the display screen according to the current display data.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiment and optional implementation manners, and details are not described in this embodiment again.
In addition, in combination with the method for visualizing large-scale data provided in the above embodiments, a storage medium may also be provided in this embodiment. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements a method for visualizing large scale data as in any of the above embodiments.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that such a development effort might be complex and lengthy, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure, and is not intended to limit the present disclosure to the particular forms disclosed herein.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for visualizing large scale data, the method comprising:
acquiring data to be displayed, and arranging the data to be displayed according to a time sequence;
acquiring a current time range, and determining a current sampling step length according to the current time range;
sampling the arranged data to be displayed within the current time range according to the current sampling step length so as to obtain current display data;
and drawing a current curve graph in a display screen according to the current display data.
2. A method for visualization of large scale data as recited in claim 1, the method further comprising:
receiving a graphic operation instruction input by a user, wherein the graphic operation instruction comprises enlarging the current curve graph and reducing the current curve graph;
updating the current time range according to the graphic operation instruction, and updating the current sampling step length according to the updated current time range;
sampling the arranged data to be displayed according to the updated current time range and the current sampling step length, thereby updating the current display data;
and updating and drawing the current curve graph according to the updated current display data.
3. The method for visualizing large-scale data of claim 1, wherein the data to be presented comprises historical data and incremental data;
the acquiring the data to be displayed and arranging the data to be displayed according to the time sequence comprises the following steps:
and acquiring the historical data from a server, acquiring the incremental data from the Internet of things equipment, and arranging the data to be displayed according to a generation time sequence according to a data timestamp.
4. The method for visualizing large-scale data according to any one of claims 1 to 3, further comprising, after said acquiring the data to be presented and arranging the data to be presented in chronological order:
and arranging the data to be displayed according to a preset processing means at a first time interval.
5. The method for visualizing the large-scale data of claim 4, wherein the preset processing means comprises data deduplication, dummy data padding and null data padding;
the arranging the data to be displayed according to a first time interval according to a preset processing means comprises:
when a plurality of pieces of data exist in the same first time interval, reserving the first piece of data in the first time interval;
filling false data between two adjacent data when the time interval between the two adjacent data is greater than the first time interval and less than a second time interval;
and filling null data between two adjacent data when the time interval of the two adjacent data is greater than the second time interval.
6. A method for visualization of large scale data according to any of claims 1 to 3, wherein the determining a current sampling step size according to the current time range comprises:
and determining the current sampling step length according to the current time range and the resolution of the display screen.
7. A visualization method of large scale data as recited in claim 6, wherein the determining a current sampling step size as a function of the current time range and the resolution of the display screen comprises:
determining a unit time range represented by each pixel according to the current time range and the display state of the display screen;
and determining the current sampling step length according to the unit time range.
8. The method for visualizing large-scale data of claim 7, wherein the display status includes a landscape display and a portrait display, and the unit time range includes a first time range and a second time range;
when the display state is vertical screen display, determining a first pixel number of the display screen along a horizontal axis, determining the first time range represented by each pixel on the horizontal axis according to the first pixel number and the current time range, and determining the current sampling step length according to the first time range;
when the display state is the horizontal screen display, determining the second pixel number of the display screen along the vertical axis, determining the second time range represented by each pixel on the vertical axis according to the second pixel number and the current time range, and determining the current sampling step length according to the second time range.
9. An apparatus for visualization of large-scale data, the apparatus comprising:
the data acquisition module is used for acquiring data to be displayed and arranging the data to be displayed according to a time sequence;
the step length determining module is used for acquiring a current time range and determining a current sampling step length according to the current time range;
the data sampling module is used for sampling the arranged data to be displayed within the current time range according to the current sampling step length so as to obtain current display data;
and the graph drawing module is used for drawing the current curve graph in a display screen according to the current display data.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the method for visualizing large scale data of any of claims 1 to 7.
CN202210949931.0A 2022-08-09 2022-08-09 Large-scale data visualization method and device and electronic device Pending CN115357740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210949931.0A CN115357740A (en) 2022-08-09 2022-08-09 Large-scale data visualization method and device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210949931.0A CN115357740A (en) 2022-08-09 2022-08-09 Large-scale data visualization method and device and electronic device

Publications (1)

Publication Number Publication Date
CN115357740A true CN115357740A (en) 2022-11-18

Family

ID=84001599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210949931.0A Pending CN115357740A (en) 2022-08-09 2022-08-09 Large-scale data visualization method and device and electronic device

Country Status (1)

Country Link
CN (1) CN115357740A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069833A (en) * 2022-12-30 2023-05-05 北京航天测控技术有限公司 Mass data processing and visualizing method based on dynamic multi-level resolution self-adaptive analysis
CN116383452A (en) * 2023-06-06 2023-07-04 天翼云科技有限公司 Self-adaptive display method, device and equipment for monitoring data and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116069833A (en) * 2022-12-30 2023-05-05 北京航天测控技术有限公司 Mass data processing and visualizing method based on dynamic multi-level resolution self-adaptive analysis
CN116069833B (en) * 2022-12-30 2024-04-19 北京航天测控技术有限公司 Mass data processing and visualizing method based on dynamic multi-level resolution self-adaptive analysis
CN116383452A (en) * 2023-06-06 2023-07-04 天翼云科技有限公司 Self-adaptive display method, device and equipment for monitoring data and storage medium

Similar Documents

Publication Publication Date Title
CN115357740A (en) Large-scale data visualization method and device and electronic device
KR101253283B1 (en) Method and system for reconstructing zoom-in image having high resolution
US10796466B2 (en) Graph drawing method, graph drawing system, server apparatus, graph drawing apparatus, and recording medium
CN110825286B (en) Image processing method and device and electronic equipment
US20240112299A1 (en) Video cropping method and apparatus, storage medium and electronic device
CN111857719A (en) Data processing method, device, electronic equipment and medium
US20070098082A1 (en) Transmitting apparatus, image processing system, image processing method, program, and storage medium
CN108256072B (en) Album display method, apparatus, storage medium and electronic device
CN110134905B (en) Page update display method, device, equipment and storage medium
CN108228030B (en) Album display method, apparatus, storage medium and electronic device
CN111258582A (en) Window rendering method and device, computer equipment and storage medium
CN103793849A (en) Device and method for financial commodity real-time trend chart frequency conversion type data updating
CN110569007A (en) Method and device for displaying data, electronic equipment and computer readable storage medium
CN115778590A (en) Dental model section line generation method, device, equipment and medium
CN113808134A (en) Oil tank layout information generation method, oil tank layout information generation device, electronic apparatus, and medium
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN111565325B (en) Information pushing method and device, server and storage medium
CN116266206A (en) Page display method and device and electronic equipment
CN112685271A (en) Pressure measurement data processing method and device, electronic equipment and readable storage medium
CN114398571A (en) Image annotation method, image annotation system, electronic device and storage medium
CN113407045A (en) Cursor control method and device, electronic equipment and storage medium
CN113506356A (en) Drawing method and device of area map, readable medium and electronic equipment
CN113204557A (en) Electronic form importing method, device, equipment and medium
CN111770385A (en) Card display method and device, electronic equipment and medium
CN111552705A (en) Data processing method and device based on chart, electronic equipment and medium

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