Data visualization method and device, electronic device, and computer medium

By acquiring and using visual parameter groups, including visual identifiers and intervals, and configuring multiple bars on the same coordinate axis, the problem of single bar configuration in the prior art is solved, and more flexible and expressive data visualization is achieved.

CN119759335APending Publication Date: 2025-04-04SHANSHU TECH (BEIJING) CO LTD +5
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411835789.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, it is difficult to configure multiple bars on the same coordinate axis, especially when using open source visualization solutions, only one bar can be configured for one coordinate axis.

Method used

By obtaining visual parameter groups, including visual identification and visual intervals, and drawing visual bars in the preset coordinate system based on these parameters. The same visual identifier can form different visual parameter groups with different visual intervals, thereby configuring multiple bars on the same coordinate axis.

Benefits of technology

The function of configuring multiple bars on the same coordinate axis is realized, which solves the problem of single bar configuration in the prior art, and enhances the expressiveness and flexibility of data visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759335A_ABST
    Figure CN119759335A_ABST
Patent Text Reader

Abstract

The present application provides a data visualization method and device, an electronic device, and a computer medium. The method includes: obtaining at least one visualization parameter group, wherein the visualization parameter group includes a visualization identifier and a visualization interval; drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval. The present application provides a method for drawing a visualization bar corresponding to a visualization parameter group in a coordinate system. Since the same visualization identifier can form different visualization parameter groups with different visualization intervals, when the data visualization method provided by the present application is used to draw different visualization parameter groups corresponding to the same visualization identifier, it is possible to configure multiple bars on the same coordinate axis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, in particular to the field of data visualization, and specifically to a data visualization method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] Visualization is the theory, method and technology that uses computer graphics and image processing technology to convert data into graphics or images and display them on the screen, and then perform interactive processing.

[0003] With the development of computer graphics and image processing technology, some open source visualization solutions have emerged.

[0004] When implementing some visualization solutions on the web page, you can use open source visualization solutions to complete common graphic displays, such as AntV or ECharts. You can complete common graphic representations, such as interval bar charts. However, an interval bar chart drawn using an open source visualization solution can only be configured with one bar on one coordinate axis (such as the X-axis of a rectangular coordinate system). Summary of the invention

[0005] In view of the above problems, the present application aims to provide a data visualization method and device, an electronic device, and a computer-readable storage medium to solve the problem in the prior art that it is difficult to configure multiple bars on the same coordinate axis.

[0006] In a first aspect, the present application provides a data visualization method, the method comprising:

[0007] Acquire at least one visualization parameter group, where the visualization parameter group includes a visualization identifier and a visualization interval;

[0008] A visualization bar corresponding to the visualization parameter group is drawn in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval.

[0009] In a possible implementation, the coordinate system is a rectangular coordinate system; and drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes:

[0010] Determine the starting Y-axis coordinate and the ending Y-axis coordinate of the visualization bar in the rectangular coordinate system according to the visualization mark;

[0011] Determine the starting X-axis coordinate of the visualization bar in the rectangular coordinate system according to the upper boundary of the visualization interval, and determine the ending X-axis coordinate of the visualization bar in the rectangular coordinate system according to the lower boundary of the visualization interval;

[0012] Determine vertex coordinates of a plurality of vertices of the visualization bar according to the starting Y-axis coordinate, the ending Y-axis coordinate, the starting X-axis coordinate, and the ending Y-axis coordinate;

[0013] The visualization bar is drawn in the rectangular coordinate system according to the vertex coordinates, and the visualization bar is horizontally placed in the rectangular coordinate system.

[0014] In a possible implementation manner, the visualization parameter further includes a visualization mode;

[0015] Drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes:

[0016] The visualization bar is rendered using a visualization element corresponding to the visualization method; the visualization element includes at least one of a color and a shape.

[0017] In a possible implementation, drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes:

[0018] An open source visualization solution is used to draw visualization bars corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group.

[0019] In a possible implementation, the using an open source visualization solution to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter includes:

[0020] In the case where there are multiple visualization parameter groups, setting a switch value;

[0021] When the switch value meets the preset loop start condition, a loop is entered in which an open source visualization solution is used to draw visualization bars corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameters.

[0022] In a possible implementation manner, the object to be recorded is a vehicle; the state of the object to be recorded is any one of an upward state, a downward state or other states;

[0023] The recording of the state of the object to be recorded within a preset time period includes:

[0024] Convert the time of a day into a total number of minutes, and record the number of minutes corresponding to the time points when the state of the vehicle changes during the day;

[0025] The determining, according to the state of the object to be recorded, at least one time interval during which the state of the object to be recorded does not change comprises:

[0026] The number of minutes corresponding to the time points at which adjacent states change is used as the upper and lower bounds of a time interval;

[0027] The determining the visualization identifier according to the object to be recorded, and determining the visualization interval according to the time interval, includes:

[0028] The identification of the vehicle is determined as the visualization identification, the time interval is determined as the visualization interval, and at least one visualization parameter group is generated according to the visualization identification and at least one visualization interval.

[0029] In a second aspect, the present application provides a data visualization device, comprising:

[0030] A data module, used to obtain at least one visualization parameter group, wherein the visualization parameter group includes a visualization identifier and a visualization interval;

[0031] A visualization module is used to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval.

[0032] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0033] The memory stores computer-executable instructions;

[0034] The processor executes the computer-executable instructions stored in the memory to implement the method in any possible implementation of the first aspect above.

[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the method in any possible implementation of the above-mentioned first aspect.

[0036] The present application provides a data visualization method and device, an electronic device, and a computer-readable storage medium, wherein the method obtains at least one visualization parameter group, wherein the visualization parameter group includes a visualization identifier and a visualization interval; a visualization bar corresponding to the visualization parameter group is drawn in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval. The present application provides a method for drawing a visualization bar corresponding to a visualization parameter group in a coordinate system, and since the same visualization identifier can form different visualization parameter groups with different visualization intervals, when the data visualization method provided by the present application is used to draw different visualization parameter groups corresponding to the same visualization identifier, it is possible to configure multiple bars on the same coordinate axis. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] Figure 1 An interval bar chart implemented as an open source visualization solution in related technologies;

[0039] Figure 2 A flowchart of a data visualization method provided in an embodiment of the present application;

[0040] Figure 3 A flowchart of some steps of another data visualization method provided in an embodiment of the present application;

[0041] Figure 4 A flowchart of some steps of another data visualization method provided in an embodiment of the present application;

[0042] Figure 5 A diagram drawn using a data visualization method in a specific embodiment of another data visualization method provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the structure of a data visualization device provided in an embodiment of the present application;

[0044] Figure 7 A hardware structure diagram of an electronic device provided in an embodiment of the present application.

[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments.

[0046] Description of reference numerals:

[0047] 601-data module; 602-visualization module;

[0048] 701 - processor; 702 - memory; 703 - communication interface; 704 - communication bus. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0050] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0051] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more.

[0052] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.

[0053] In the embodiments of the present application, the following terms may appear, and their corresponding explanations are as follows:

[0054] Interval bar chart: A bar chart that displays interval ranges, usually used to show the distribution of values ​​or the range of categorical data.

[0055] Coordinate system: used to define how data is positioned in a chart. Common ones include rectangular coordinate system and polar coordinate system.

[0056] Chart configuration items: parameters used to define the visual properties and interactive behaviors of a chart.

[0057] Hover: An interactive event in the browser. When the mouse pointer hovers over a specified element, this event can trigger a change in the style of the mouse pointer or a change in the style of the specified element.

[0058] AntV: An open source data visualization solution.

[0059] ECharts: An open source data visualization solution.

[0060] In some related technologies, some open source visualization solutions, such as AntV or ECharts, can complete commonly used graphical representations, such as interval bar charts.

[0061] Figure 1 An open source visualization solution is shown to implement an interval bar chart. Figure 1 As shown, the interval bar chart is implemented based on a plane rectangular coordinate system, wherein the plane rectangular coordinate system consists of an X-axis and a Y-axis that are perpendicular to each other and have a common origin, the X-axis is located in a horizontal position, and each unit length of the X-axis represents a different mouth (month), and the Y-axis is located in a vertical position, and each unit length represents a different number.

[0062] like Figure 1 As shown in the figure, the bar chart is displayed vertically on the X-axis, and the bottom edge of the bar may not be aligned with the X-axis. By configuring the hover function for the bar, the floating prompt function is realized, that is, the mouse pointer hovers over the bar to trigger the information prompt corresponding to the bar. You can also configure the legend of the interval bar chart, such as Figure 1 The "Interval Bar Chart" in the figure is the configuration legend.

[0063] However, the interval bar chart of the open source visualization solution can only be configured with one bar on one X-axis, such as Figure 1 As shown, the elements Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, and Total on the X-axis correspond to only one bar, and if you want to configure colors for different bars, the open source visualization solution can only configure a single bar, but cannot configure different colors for different bars on the same axis.

[0064] In order to solve the above technical problems, the embodiments of the present application provide a data visualization method and device, an electronic device, and a computer-readable storage medium. The same visualization identifier can form different visualization parameter groups with different visualization intervals. When drawing different visualization parameter groups corresponding to the same visualization identifier, it is possible to configure multiple bars on the same coordinate axis.

[0065] The data visualization method provided by the exemplary embodiment of the present application is described below with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.

[0066] Figure 2 A schematic diagram of a data visualization method provided in an embodiment of the present application, the specific implementation process of the method may include the following steps:

[0067] S210: Acquire at least one visualization parameter group;

[0068] The visualization parameter group may include a visualization identifier and a visualization interval; the visualization interval may be a data interval, which includes an interval upper bound and an interval lower bound.

[0069] The visualization parameter group may be generated according to the visualization data. The visualization data may be the recorded data of the object to be recorded. The visualization identifier in the visualization parameter group may be the identifier of the object to be recorded, and the visualization interval may be the data interval corresponding to the recorded data.

[0070] Multiple visualization parameter groups can be obtained according to the visualization data.

[0071] S220: drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval;

[0072] The preset coordinate system may be a rectangular coordinate system.

[0073] Determining the position of the visualization bar in the coordinate system according to the visualization identifier may be determining the coordinates of an axis corresponding to the visualization bar according to the visualization.

[0074] Determining the length of the visualization bar according to the visualization interval may be determining the coordinates of another axis of the visualization bar according to the upper bound and the lower bound of the visualization interval.

[0075] Draw visualization bars in a rectangular coordinate system according to the determined coordinates.

[0076] The data visualization method provided by the exemplary embodiment of the present application is described in detail below.

[0077] As described above, the visualization parameter set may be generated based on the visualization data.

[0078] Figure 3 A schematic diagram of a process for obtaining visualization data and generating visualization parameters according to the visualization data is shown. Figure 3As shown, obtaining visualization data and generating visualization parameters according to the visualization data may include the following steps:

[0079] S310: Recording the state of the object to be recorded within a preset time period;

[0080] The object to be recorded may be a means of transport, including a car, a ship, a train, etc. The preset time period may be a day or a daytime period.

[0081] Recording the state of the object to be recorded may include recording the state of the object to be recorded at the start time of a preset time period, and when the state of the object to be recorded changes, recording the changed state of the object to be recorded, and recording the state of the object to be recorded at the end time of the preset time period.

[0082] S320: Determine, according to the state of the object to be recorded, at least one time interval during which the state of the object to be recorded does not change;

[0083] Determining at least one time interval during which the state of the object to be recorded does not change according to the state of the object to be recorded may be determining a time interval during which the state of the object to be recorded does not change according to a start time point of a preset time period and a time point when the state of the object to be recorded changes for the first time.

[0084] A time interval in which the state of an object to be recorded does not change may be determined according to a time point at which the state of an adjacent object to be recorded changes.

[0085] A time interval in which the state of the object to be recorded does not change can be determined according to the time point when the state of the object to be recorded last changed and the end time point of the set time period.

[0086] S330: Determine a visualization identifier according to the object to be recorded, and determine a visualization interval according to the time interval;

[0087] Determining the visualization identifier according to the object to be recorded and determining the visualization interval according to the time interval may be taking the identifier of the object to be recorded as the visualization identifier and determining the time interval as the visualization interval.

[0088] The visualization identifier and a visualization interval are combined into a visualization parameter group. When multiple visualization intervals are obtained, the visualization identifier and the multiple visualization intervals are combined into multiple visualization parameter groups. The multiple visualization parameter groups are all drawn using the visualization method of the embodiment of the present application.

[0089] Since a visualization interval is a time interval in which the state of the object to be recorded does not change, the visualization bar corresponding to the visualization parameter group composed of the visualization interval is a visualization of a state of the object to be recorded, and different visualization bars are visualizations of different states of the object to be recorded.

[0090] That is to say, using the visualization method of the embodiment of the present application, the state change of the object to be recorded can be represented in the form of a bar.

[0091] As described above, the preset coordinate system may be a rectangular coordinate system, and the position of the visualization bar in the coordinate system may be determined according to the visualization mark, and the length of the visualization bar may be determined according to the visualization interval to draw the visualization bar.

[0092] Figure 4 A schematic diagram of a process for drawing a visualization bar in a rectangular coordinate system is shown, Figure 4 As shown, drawing a visualization bar in a rectangular coordinate system may include the following steps:

[0093] S410: Determine the starting Y-axis coordinate and the ending Y-axis coordinate of the visualization bar in the rectangular coordinate system according to the visualization identifier;

[0094] The Y-axis of the rectangular coordinate system is configured with a visual identifier, that is, different visual identifiers correspond to different Y-axis coordinates.

[0095] Since the Y-axis is configured with a visualization symbol, different visualization symbols can be used at different positions on the Y-axis. The visualization bar has width and length. Points cannot be used to represent visualization expressions, but line segments are needed to represent visualization symbols. Therefore, each segment of the Y-axis with a length of N can represent a visualization symbol.

[0096] Determining the starting Y-axis coordinate and the ending Y-axis coordinate of the visualization bar in the rectangular coordinate system according to the visualization identifier can be performed by obtaining the corresponding equal division on the Y-axis according to the visualization identifier, using the starting position of the equal division as the starting Y-axis coordinate and the ending position of the equal division as the ending Y-axis coordinate.

[0097] S420: determining a starting X-axis coordinate of the visualization bar in the rectangular coordinate system according to an upper boundary of the visualization interval, and determining a terminating X-axis coordinate of the visualization bar in the rectangular coordinate system according to a lower boundary of the visualization interval;

[0098] Determining the starting X-axis coordinate of the visualization bar in the rectangular coordinate system according to the upper limit of the visualization interval, and determining the ending X-axis coordinate of the visualization bar in the rectangular coordinate system according to the lower limit of the visualization interval can be determining the corresponding coordinate on the X-axis according to the value of the upper limit of the visualization interval, that is, the starting X-axis coordinate, and determining the corresponding coordinate on the X-axis according to the value of the lower limit of the visualization interval, that is, the ending X-axis coordinate.

[0099] S430: Determine vertex coordinates of multiple vertices of the visualization bar according to the starting Y-axis coordinate, the ending Y-axis coordinate, the starting X-axis coordinate, and the ending Y-axis coordinate;

[0100] The vertex coordinates of the multiple vertices of the visualized bar are (starting X-axis coordinate, starting Y-axis coordinate), (starting X-axis coordinate, ending Y-axis coordinate), (ending X-axis coordinate, starting Y-axis coordinate), and (ending X-axis coordinate, ending Y-axis coordinate).

[0101] S440: Draw a visualization bar in a rectangular coordinate system according to the vertex coordinates, and place the visualization bar horizontally in the rectangular coordinate system;

[0102] Since the Y-axis is configured with a visualization mark, each segment of the Y-axis with a length of N represents a visualization mark. Therefore, the width of all visualization bars is consistent, and the length is determined according to the visualization interval. The lengths of different visualization bars are inconsistent. Therefore, the visualization bars are placed horizontally in the rectangular coordinate system.

[0103] The vertex coordinates determined in S430 are used as vertices of the visualization bar to draw a rectangle, that is, the visualization bar.

[0104] You can also use the rectangular coordinate system's X-axis to configure the visualization mark and the Y-axis to configure the visualization interval. Figure 4 In the corresponding embodiment, the X-axis and the Y-axis are swapped, and a similar method can be used to draw a visualization bar, which will not be repeated here.

[0105] In some possible implementations, the visualization parameter group further includes a visualization mode. The visualization mode is a mode of drawing a visualization bar in a preset coordinate system. Different visualization modes correspond to different visualization elements. When drawing a visualization bar, the visualization element corresponding to the visualization mode is used for drawing.

[0106] Visual elements can include colors and can also include bar shapes, such as rounded rectangles and normal rectangles.

[0107] That is to say, if the visualization element corresponding to the visualization mode of the visualization parameter group is yellow and rounded rectangle, when drawing the visualization bar in step S440, the vertex coordinates are used as the vertices of the visualization bar to draw the rounded rectangle and fill the rounded rectangle with yellow.

[0108] The visualization method can be determined according to the state of the object to be recorded within the time interval. Different states of the object to be recorded correspond to different visualization elements, so that the state of the object to be recorded can be determined by the color and shape of the visualization bar.

[0109] In some possible implementations, the drawing process may be implemented based on an open source visualization solution, such as AntV or ECharts. Specifically, the above process may be implemented based on a public function of the open source visualization solution.

[0110] If you want to draw visualization bars corresponding to multiple visualization parameter groups, since the logic of drawing the visualization bars corresponding to each visualization parameter group is consistent, you can draw the visualization bars corresponding to multiple visualization parameter groups through a loop.

[0111] That is, after drawing the visualization bar corresponding to one visualization parameter group, continue to draw the visualization bar corresponding to the next visualization parameter group, until the visualization bars corresponding to all visualization parameter groups are drawn, and then exit the loop.

[0112] In some possible implementations, in order to prevent multiple entries into the loop and thus waste computing resources, a switch value may be set and initialized to a value that meets a preset loop start condition. When the switch value meets the preset loop start condition, a loop is entered that uses an open source visualization solution to draw visualization bars corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameters. When exiting the loop, the switch value is modified so that it does not meet the preset loop start condition to avoid entering the loop a second time.

[0113] The following specific example specifically introduces the data visualization method provided in the embodiment of the present application.

[0114] Specifically, the embodiments of the present application can be used in scenarios such as automobile charging, scheduling, mileage recording, etc., and can also be applied to other transportation industries such as ships, airplanes, trains, etc. that involve visualization of interval-type data.

[0115] Taking the bus status record as an example, convert the time of a day into a total of minutes, and record the minutes corresponding to the time points when the bus status changes during the day (conversion into minutes is to avoid the influence of different time expressions such as 12-hour system or 24-hour system on the time axis, that is, the form of the X-axis).

[0116] Among them, the states of the public bus include up, down, and other states (such as charging). The minutes corresponding to the time points when adjacent states change are used as the upper and lower bounds of a time interval. The bus logo is determined as a visualization logo, the time interval is determined as a visualization interval, and the state of the bus in the time interval is determined as a visualization method, generating multiple visualization parameter groups.

[0117] Specifically, the generated visualization parameter group can be in the form of an object array, and its content can include type, values, and way, where type is a visualization identifier, and its value can be the number of the bus. Value is interval data, which is the visualization interval obtained above, and way is a visualization method. Its value can be E, which means that the bus status is up, and the corresponding visualization element is green and a rounded rectangle with rounded corners at the upper left and lower left corners. Its value can also be S, which means that the bus status is down, and the corresponding visualization element is blue and a rounded rectangle with rounded corners at the upper right and lower right corners. Its value can also be M, which means that the bus status is charging, and the corresponding visualization element is red and a standard rectangle. For example, a visualization parameter group can be {type:18,values:[280,432],way:E}, which means that the bus with the identifier 18 is in the up state during the time period from 280 minutes to 432 minutes.

[0118] Use the Bar method in @antv / g2plot to draw a rectangular coordinate system. The X-axis of the rectangular coordinate system is the time axis. The time axis uses a 24-hour system and is drawn in minutes.

[0119] According to the visualization mark, the corresponding equal division on the Y axis is obtained, and the starting position of the equal division is used as the starting Y axis coordinate, and the ending position of the equal division is used as the ending Y axis coordinate. According to the value of the upper limit of the visualization interval, the corresponding coordinate on the X axis is determined, that is, the starting X axis coordinate, and according to the value of the lower limit of the visualization interval, the corresponding coordinate on the X axis is determined, that is, the ending X axis coordinate. The vertex coordinates of the multiple vertices of the visualization bar are respectively (starting X axis coordinate, starting Y axis coordinate), (starting X axis coordinate, ending Y axis coordinate), (ending X axis coordinate, starting Y axis coordinate), (ending X axis coordinate, ending Y axis coordinate), and a rectangle is drawn in the rectangular coordinate system with the vertices corresponding to the vertex coordinates placed horizontally in the rectangular coordinate system.

[0120] For example, the bar corresponding to {type:18,values:[280,432],way:E} is a rounded rectangle with 18 on the Y axis, 4:40-7:12 on the X axis, and blue color, and the upper right and lower right corners are rounded.

[0121] When using the Bar method in @antv / g2plot for drawing, some configurations need to be modified. The half-angle and rounded corners are configured through the barStyle configuration. This configuration receives an object, in which the radius is the configuration of the half-angle or rounded corner. A bar has four corners in total. The returned radius is an array that can receive four values, such as [10,10,0,0], which means the rounded corners on the left (upper left and lower left). The way in the above data can be used to determine the direction of the vehicle's movement, whether it is up, down, or charging. Charging does not require rounded corners. This configuration is a loop. Because each piece of data needs to be processed, a switch count is required to determine whether to enter the loop, otherwise the loop will enter twice, which will affect performance. The method for configuring half-angle rounded corners is as follows:

[0122] barStyle:(()=>{

[0123] var count = 0

[0124] var arr = []

[0125] return(arg)=>{

[0126] const{type=""}=arg

[0127] if(type===”){

[0128] count=count+1

[0129] }

[0130] / / Solve the problem of loop entering twice

[0131] if(count!==1)return

[0132] arr.push(type)

[0133] const currentArr=data.filter((item)=>item.type===type)

[0134] const filterArr=arr.filter((item)=>item===type)

[0135] / / Get the current round trip type

[0136] const wayType=currentArr[filterArr.length-1]? .way

[0137] if (wayType === 'E') {

[0138] return{radius:[10,10,0,0]}

[0139] }else if(wayType===='M'){

[0140] return{radius:[0,0,0,0]}

[0141] }

[0142] return{radius:[0,0,10,10]}

[0143] }

[0144] })(),

[0145] The configuration for color is similar to the rounded corner configuration above, except that we can directly return the color value string here. We can also use the way field to distinguish colors. This method of returning the callback function will also process the loop twice, which can be solved by switching count. The color configuration code is as follows:

[0146] color:(()=>{

[0147] var count = 0

[0148] var arr = []

[0149] return(arg)=>{

[0150] const{type=""}=arg

[0151] if(type===”){

[0152] count=count+1

[0153] }

[0154] / / Solve the problem of loop entering twice

[0155] if(count!==1)return

[0156] arr.push(type)

[0157] const currentArr=data.filter((item)=>item.type===type)

[0158] const filterArr=arr.filter((item)=>item===type)

[0159] / / Get the current round trip type

[0160] const wayType=currentArr[filterArr.length-1]? .way

[0161] if (wayType === 'E') {

[0162] return '#436FF6'

[0163] }else if(wayType===='M'){

[0164] return '#F76560'

[0165] }

[0166] return '#00B589'

[0167] }

[0168] })()

[0169] The final drawn bar can be Figure 5 As shown, Figure 5 The Y-axis of the rectangular coordinate system is the bus number (such as 1, 2, 3, etc.), the X-axis is time (from 4:30 to 24:00), and multiple bars are placed horizontally in the coordinate system. Each row of the Y-axis can be configured with multiple horizontal bars, and the rounded corners or color of the columns can be configured. Each bar in the same row represents the status of the same bus at different times. Therefore, the bars can be used to achieve visual displays such as vehicle scheduling or vehicle charging information.

[0170] At the same time, a hover event can be set for each bar. When the mouse hovers over a bar, the corresponding information of the bar is displayed, such as the vehicle number, itinerary (i.e., bus status), and operating time (i.e., the corresponding time interval). Figure 5 As shown, the corresponding information of the corresponding bar is that the bus with vehicle number 22 is in the up state from 08:46 to 11:24.

[0171] The data visualization method provided in the above-mentioned embodiment provides a method for drawing visualization bars corresponding to visualization parameter groups in a coordinate system. Since the same visualization identifier can form different visualization parameter groups with different visualization intervals, when the data visualization method provided in the embodiment of the present application is used to draw different visualization parameter groups corresponding to the same visualization identifier, it is possible to configure multiple bars on the same coordinate axis.

[0172] Figure 6 This is a schematic diagram of the structure of a data visualization device provided in an embodiment of the present application. The device may be in the form of software and / or hardware. Figure 6 As shown, a data visualization device includes: a data module 601 and a visualization module 602.

[0173] The data module 601 is used to obtain at least one visualization parameter group, where the visualization parameter group includes a visualization identifier and a visualization interval;

[0174] The visualization module 602 is used to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval.

[0175] In some embodiments, the coordinate system is a rectangular coordinate system; the visualization module 602 is specifically configured to: determine the starting Y-axis coordinate and the ending Y-axis coordinate of the visualization bar in the rectangular coordinate system according to the visualization identifier; determine the starting X-axis coordinate of the visualization bar in the rectangular coordinate system according to the upper limit of the visualization interval, and determine the ending X-axis coordinate of the visualization bar in the rectangular coordinate system according to the lower limit of the visualization interval; determine the vertex coordinates of multiple vertices of the visualization bar according to the starting Y-axis coordinate, the ending Y-axis coordinate, the starting X-axis coordinate, and the ending Y-axis coordinate; draw the visualization bar in the rectangular coordinate system according to the vertex coordinates, and place the visualization bar horizontally in the rectangular coordinate system.

[0176] In some embodiments, the visualization parameters also include a visualization method; the visualization module 602 is specifically configured to: render the visualization bar using a visualization element corresponding to the visualization method; the visualization element includes at least one of a color and a shape.

[0177] In some embodiments, the visualization module 602 is specifically configured to: use an open source visualization solution to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group.

[0178] In some embodiments, the visualization module 602 is specifically configured to: when there are multiple visualization parameter groups, set the switch value; when the switch value meets the preset loop start condition, enter a loop of using an open source visualization solution to draw visualization bars corresponding to the visualization parameter groups in a preset coordinate system according to the visualization parameters.

[0179] In some embodiments, the data module 601 is specifically configured to: record the state of the object to be recorded within a preset time period; determine at least one time interval in which the state of the object to be recorded has not changed based on the state of the object to be recorded; determine a visualization identifier based on the object to be recorded, and determine a visualization interval based on the time interval.

[0180] In some embodiments, the object to be recorded is a vehicle; the state of the object to be recorded is any one of up, down or other states; the data module 601 is specifically configured to: convert the time of a day into a total of minutes, and record the minutes corresponding to the time points when the state of the vehicle changes within a day; use the minutes corresponding to the time points when adjacent states change as the upper and lower bounds of a time interval; determine the identification of the vehicle as a visualization identification, determine the time interval as a visualization interval, and generate at least one visualization parameter group based on the visualization identification and at least one visualization interval.

[0181] The data visualization device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned data visualization method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned data visualization method embodiment.

[0182] Figure 7 A hardware structure diagram of an electronic device provided in an embodiment of the present application. This embodiment provides an electronic device, comprising: at least one processor 701, and a memory 702 in communication with the at least one processor 701; the memory 702 stores computer-executable instructions; the processor 701 executes the computer-executable instructions stored in the memory 702 to implement the data visualization method described in any of the above embodiments.

[0183] Figure 7 The electronic device shown also includes a communication interface 703 and a communication bus 704, wherein the processor 701, the memory 702 and the communication interface 703 are connected to each other via the communication bus 704. The communication bus 704 can be divided into an address bus, a data bus, a control bus, etc. Figure 7 In the figure, only one thick line is used to represent the communication bus 704, but it does not mean that there is only one communication bus 704 or one type of communication bus 704. The processor 701 may also be called a controller, and there is no limitation on the name.

[0184] In the embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701. The at least one processor 701 can execute the data visualization method discussed above by executing the instructions stored in the memory 702. The processor 701 can implement Figure 7 The functions of each module in the device shown.

[0185] Among them, the processor 701 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 702 and calling data stored in the memory 702, the various functions of the device and process data, the device can be monitored as a whole.

[0186] In one possible design, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip or on separate chips.

[0187] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the data visualization method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0188] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0189] By programming the processor 701, the code corresponding to the data visualization method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The steps of the data visualization method of the embodiment shown are as follows: How to design and program the processor 701 is a technique known to those skilled in the art and will not be described in detail here.

[0190] The embodiment of the present application also provides a computer-readable storage medium, in which a computer-executable instruction is stored. When the computer-executable instruction is executed by a processor, it is used to implement the data visualization method described in any of the above embodiments. Therefore, it will not be described in detail here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in the present invention, please refer to the description of the method embodiment of the present invention.

[0191] In some possible implementations, various aspects of the data visualization method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the data visualization method according to various exemplary implementations of the present application described above in this specification.

[0192] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0193] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0194] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0196] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data visualization method, characterized in that: The method comprises: Acquire at least one visualization parameter group, where the visualization parameter group includes a visualization identifier and a visualization interval; A visualization bar corresponding to the visualization parameter group is drawn in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval.

2. The method according to claim 1, characterized in that The coordinate system is a rectangular coordinate system; and drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes: Determine the starting Y-axis coordinate and the ending Y-axis coordinate of the visualization bar in the rectangular coordinate system according to the visualization mark; Determine the starting X-axis coordinate of the visualization bar in the rectangular coordinate system according to the upper limit of the visualization interval, and determine the ending X-axis coordinate of the visualization bar in the rectangular coordinate system according to the lower limit of the visualization interval; Determine vertex coordinates of a plurality of vertices of the visualization bar according to the starting Y-axis coordinate, the ending Y-axis coordinate, the starting X-axis coordinate, and the ending Y-axis coordinate; The visualization bar is drawn in the rectangular coordinate system according to the vertex coordinates, and the visualization bar is horizontally placed in the rectangular coordinate system.

3. The method according to claim 1, characterized in that The visualization parameters also include visualization mode; Drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes: The visualization bar is rendered using a visualization element corresponding to the visualization method; the visualization element includes at least one of a color and a shape.

4. The method according to claim 1, characterized in that: Drawing a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group includes: An open source visualization solution is used to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group.

5. The method according to claim 4, characterized in that The method of using an open source visualization solution to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter includes: In the case where there are multiple visualization parameter groups, setting a switch value; When the switch value meets the preset loop start condition, a loop is entered in which an open source visualization solution is used to draw visualization bars corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameters.

6. The method according to claim 1, characterized in that The obtaining of at least one visualization parameter group includes: Record the status of the object to be recorded within a preset time period; Determine at least one time interval in which the state of the object to be recorded does not change according to the state of the object to be recorded; The visualization identifier is determined according to the object to be recorded, and the visualization interval is determined according to the time interval.

7. The method according to claim 6, characterized in that The object to be recorded is a vehicle; the state of the object to be recorded is any one of upward, downward or other states; The recording of the state of the object to be recorded within a preset time period includes: Convert the time of a day into a total number of minutes, and record the number of minutes corresponding to the time points when the state of the vehicle changes during the day; The determining, according to the state of the object to be recorded, at least one time interval during which the state of the object to be recorded does not change comprises: The number of minutes corresponding to the time points at which adjacent states change is used as the upper and lower bounds of a time interval; The determining the visualization identifier according to the object to be recorded, and determining the visualization interval according to the time interval, includes: The identification of the vehicle is determined as the visualization identification, the time interval is determined as the visualization interval, and at least one visualization parameter group is generated according to the visualization identification and at least one visualization interval.

8. A data visualization device, characterized in that: The device comprises: A data module, used to obtain at least one visualization parameter group, wherein the visualization parameter group includes a visualization identifier and a visualization interval; A visualization module is used to draw a visualization bar corresponding to the visualization parameter group in a preset coordinate system according to the visualization parameter group; the position of the visualization bar in the coordinate system is determined according to the visualization identifier, and the length of the visualization bar is determined according to the visualization interval.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to implement the method according to any one of claims 1 to 7 when executed by a processor.