A data visualization method and apparatus
This data visualization method, which generates and configures visualization chart components, solves the problem in existing technologies where chart changes require modification of business code, enabling flexible chart management and rapid deployment, and reducing labor costs.
Patent Information
- Application Number
- CN202111489819.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-12-08
AI Technical Summary
In existing technologies, changes to the content of visualization chart components require modifications to the business code, resulting in frequent development and deployment work, impacting service availability, and leading to long development cycles.
This provides a data visualization method that retrieves target data objects from a data warehouse by receiving data query instructions, generates visualization chart components of a specified type based on preset rendering rules, and adds the charts to the dashboard by receiving dashboard configuration instructions. It supports the configuration and interactive settings of visualization chart components.
The process of changing charts has been simplified, reducing labor costs and improving operational flexibility. Charts can be dragged and dropped in the dashboard, reducing service downtime.
Smart Images

Figure CN114595416B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a data visualization method and device. BACKGROUND
[0002] The homepage or other business overview pages of a system mostly use various charts for statistical analysis from various dimensions, that is, front-end and back-end developers need to develop specific charts for business analysis.
[0003] However, if the charts in the page need to be changed, or if charts need to be added or deleted on the homepage or overview page, or if a new requirement is proposed by a customer, the corresponding front-end and back-end codes need to be modified, the business codes need to be frequently modified, and the service needs to be restarted. During the service deployment stage, the function is unavailable for a period of time, and heavy work such as manpower development, deployment, and re-online needs to be done. The period from the generation of a requirement to the use of the requirement is long. SUMMARY
[0004] The present application provides a data visualization method and device to solve the problem that the content of a visualization chart component needs to be modified in the prior art.
[0005] In a first aspect, the present application provides a data visualization method, which comprises:
[0006] receiving a data query instruction, and obtaining a target data object from a data warehouse based on the query instruction, wherein the data query instruction comprises a data query condition;
[0007] performing rendering and encapsulation processing on the target data object based on a preset data visualization rendering rule to obtain a visualization chart component of a specified type;
[0008] receiving a dashboard configuration instruction, and adding one or more target visualization chart components to a dashboard based on the dashboard configuration instruction.
[0009] Optionally, after performing rendering and encapsulation processing on the target data object based on the preset data visualization rendering rule to obtain a visualization chart component of a specified type, the method further comprises:
[0010] receiving a visualization chart component configuration instruction, and configuring display attributes of the visualization chart component based on the visualization chart component configuration instruction.
[0011] Optionally, the visualization chart component type comprises a line chart, a column chart, a pie chart, and a table.
[0012] The display attributes of the visualization chart component comprise data sources of an X-axis and a Y-axis, margin attributes, and text size attributes.
[0013] Optionally, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain the specified type of visualization chart component, the method further includes:
[0014] An interaction setting instruction of the visualization chart component is received, and a hyperlink for linking other visualization charts / dashboards is set on the visualization chart component based on the interaction setting instruction.
[0015] Optionally, the method further includes:
[0016] A query condition modification instruction corresponding to the target dashboard is received, wherein the query condition modification instruction includes a modified data query condition;
[0017] The corresponding data object is obtained from the data warehouse based on the query condition modification instruction;
[0018] Based on the data object, the target dashboard is updated to include each visualization icon component.
[0019] In a second aspect, the present application provides a data visualization device, the device includes:
[0020] An obtaining unit is configured to receive a data query instruction and obtain a target data object from a data warehouse based on the query instruction, wherein the data query instruction includes a data query condition;
[0021] A processing unit is configured to render and encapsulate the target data object based on a preset data visualization rendering rule to obtain a specified type of visualization chart component;
[0022] An adding unit is configured to receive a dashboard configuration instruction and add one or more target visualization charts to a dashboard based on the dashboard configuration instruction.
[0023] Optionally, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain the specified type of visualization chart component, the device further includes:
[0024] A configuration unit is configured to receive a visualization chart component configuration instruction and configure display attributes of the visualization chart component based on the visualization chart component configuration instruction.
[0025] Optionally, the visualization chart component type includes a line chart, a column chart, a pie chart, and a table;
[0026] The display attributes of the visualization chart component include data sources of X-axis and Y-axis, margin attributes, and text size attributes.
[0027] Optionally, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain a specified type of visualization chart component, the apparatus further includes:
[0028] a setting unit configured to receive an interactive setting instruction of the visualization chart component, and set a hyperlink for linking other visualization charts / dashboards on the visualization chart component based on the interactive setting instruction.
[0029] Optionally, the apparatus further includes:
[0030] a receiving unit configured to receive a query condition modification instruction corresponding to the target dashboard, wherein the query condition modification instruction includes a modified data query condition;
[0031] The obtaining unit is further configured to obtain corresponding data objects from the data warehouse based on the query condition modification instruction.
[0032] an updating unit configured to update each visualization chart component included in the target dashboard based on the data objects.
[0033] In a third aspect, an embodiment of the present application provides a data visualization apparatus, which includes:
[0034] a memory configured to store program instructions;
[0035] a processor configured to invoke the program instructions stored in the memory, and perform the steps of the method according to any one of the first aspect above according to the obtained program instructions.
[0036] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are used to make the computer perform the steps of the method according to any one of the first aspect above.
[0037] In summary, the data visualization method provided by the embodiments of the present application receives a data query instruction, and obtains target data objects from a data warehouse based on the query instruction, wherein the data query instruction includes a data query condition; renders and encapsulates the target data objects based on a preset data visualization rendering rule to obtain a specified type of visualization chart component; receives a dashboard configuration instruction, and adds one or more target visualization charts to a dashboard based on the dashboard configuration instruction.
[0038] The data visualization method provided in this application generates visual charts based on query and analysis statements. The generated charts can be added to the dashboard, and then dragged and dropped to the appropriate position using the mouse. This simple and flexible operation reduces development pressure and significantly lowers labor costs. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.
[0040] Figure 1 A detailed flowchart illustrating a data visualization method provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of the structure of a data visualization device provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of another data visualization device provided in an embodiment of this application. Detailed Implementation
[0043] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0044] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0045] For example, see Figure 1 The diagram shown is a detailed flowchart of a data visualization method provided in an embodiment of this application. The method includes the following steps:
[0046] Step 100: receiving a data query instruction, and obtaining a target data object from a data warehouse based on the query instruction, wherein the data query instruction comprises a data query condition.
[0047] In the embodiment of the application, data is collected and processed, and finally stored in a data warehouse. The data warehouse (distributed database) stores data collected from various data sources (such as device logs of devices in a network). When managing data in the data warehouse, preferably, data with the same data structure is referred to as a data set. The data warehouse can be simply understood as a collection of various data sets, and the type of data warehouse is not limited, which can be an ElasticSearch or ClickHouse distributed database, or a Mysql or SQLServer traditional relational database.
[0048] In practical applications, a user can query a database table through an SQL query analysis statement to obtain a target data object (a group of data objects with analysis business).
[0049] Step 110: performing rendering and encapsulation processing on the target data object based on a preset data visualization rendering rule to obtain a specified type of visualization chart component.
[0050] The visualization chart component type includes a line chart, a column chart, a pie chart, and a table.
[0051] In practical applications, Antv is a data visualization project that provides encapsulation libraries of various types of charts. The result of query analysis is a group of data objects, and the data can be rendered into different types of visualization chart components, such as line charts, column charts, pie charts, etc. In the embodiment of the application, different types of visualization chart components can use the same data content, and the chart is decoupled from the data, which is very convenient for rendering graphics and does not need to maintain data conversion.
[0052] Further, in the embodiment of the application, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain a specified type of visualization chart component, the above data visualization method can further comprise the following steps:
[0053] Receiving a visualization chart component configuration instruction, and configuring display attributes of the visualization chart component based on the visualization chart component configuration instruction.
[0054] In the embodiment of the application, the display attributes of the visualization chart component include data sources of X-axis and Y-axis, margin attributes, and text size attributes.
[0055] That is, after obtaining a visualization chart component, display properties of the visualization chart component can be configured. For example, data sources of X and Y axes in the visualization chart component are configured, margin size is configured, and font size in the visualization chart component is set. Display properties of different visualization chart components can be the same or different.
[0056] Step 120: receiving a dashboard configuration instruction, and adding one or more target visualizations to a dashboard based on the dashboard configuration instruction.
[0057] In the embodiments of the present application, after obtaining a plurality of visualizations, the plurality of visualizations can be added to a dashboard, that is, a dashboard includes one or more visualizations.
[0058] Specifically, a plurality of visualizations based on query and analysis results can be added to a dashboard to provide an overview page of real-time data analysis.
[0059] Further, in the embodiments of the present application, after obtaining a visualization chart component of a specified type based on the preset data visualization rendering rule for rendering and encapsulating the target data object, the above data visualization method can further include the following steps:
[0060] Receiving an interactive setting instruction of the visualization chart component, and setting a hyperlink for linking other visualizations / dashboards on the visualization chart component based on the interactive setting instruction.
[0061] Specifically, a drill-down action of the chart is set, and after setting, clicking a value in the chart in the dashboard can execute a specified drill-down action. It is suitable for triggering a drill-down chart / dashboard in a drill-down scenario.
[0062] Further, the above data visualization method can further include the following steps:
[0063] Receiving a query condition modification instruction corresponding to a target dashboard, wherein the query condition modification instruction includes a modified data query condition; obtaining a corresponding data object from the data warehouse based on the query condition modification instruction; and updating each visualization icon component included in the target dashboard based on the data object.
[0064] That is, if a dashboard includes a plurality of visualizations, each visualization displays historical data collected within 10 minutes, then after receiving a new data query condition input by a user (for example, historical data collected within 20 minutes), historical data collected within 20 minutes is obtained based on the new query, and each visualization in the dashboard is updated based on the historical data collected within 20 minutes.
[0065] In the embodiment of the present application, a filter is arranged, which is used to batch modify query conditions for all visual chart components in the dashboard. Each visual chart component is actually a query and analysis statement ([search query]|[sql query]), and the filter is essentially an operation on the query and analysis statement.
[0066] The table structure of the visual chart, the dashboard and the filter provided by the embodiment of the present application will be described in detail below in combination with a specific application scenario. For example, refer to Table 1 for a table format of a visual chart provided by the embodiment of the present application. Table 2 is a table format of a dashboard provided by the embodiment of the present application.
[0067] Table 3 is a table format of a filter provided by the embodiment of the present application.
[0068] Column Type Length Required Comment id varchar 36 Yes Primary key name varchar 256 Yes Visualization name descr varchar 512 No Visualization description data_source_type varchar 8 Yes Data source type sql_config text 0 Yes SQL configuration items api_config text 0 Yes API configuration items chart_type varchar 256 Yes Chart type attribute_config text 0 No Attribute configuration interaction_config text 0 No Drill-down configuration
[0069] Table 1
[0070]
[0071] Table 2
[0072] Column Type Length Required Comment id varchar 36 Yes Primary key dashboard_id varchar 36 Yes Foreign key, dashboard id name varchar 256 Yes Filter name key_variable varchar 256 Yes Key value key_alias varchar 256 Yes Key alias static_list text 0 No Static list items use_dynamic_list varchar 8 No Whether to use dynamic list items data_source_type varchar 64 No Data source type sql_config text 0 No SQL configuration items api_config text 0 No API configuration items
[0073] Table 3
[0074] In the embodiment of the present application, after a visual chart component is configured, the configuration parameters of the visual chart component can be saved to the database. After a dashboard is configured, the configuration parameters of the dashboard can also be saved to the database. After the query conditions of a filter are modified, the configuration parameters of the filter can also be saved to the database.
[0075] For example, refer to Figure 2 Fig. 1 for a structural schematic diagram of a data visualization device provided by the embodiment of the present application. The device comprises:
[0076] An acquisition unit 20 is configured to receive a data query instruction and acquire a target data object from a data warehouse based on the query instruction, wherein the data query instruction comprises a data query condition.
[0077] A processing unit 21 is configured to perform rendering and encapsulation processing on the target data object based on a preset data visualization rendering rule, to obtain a visual chart component of a specified type.
[0078] An adding unit 22 is configured to receive a dashboard configuration instruction and add one or more target visual charts to a dashboard based on the dashboard configuration instruction.
[0079] Optionally, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain the specified type of visualization chart component, the apparatus further includes:
[0080] The configuration unit is configured to receive a visualization chart component configuration instruction and configure display attributes of the visualization chart component based on the visualization chart component configuration instruction.
[0081] Optionally, the visualization chart component type includes a line chart, a column chart, a pie chart, and a table.
[0082] The display attributes of the visualization chart component include data sources of an X-axis and a Y-axis, margin attributes, and text size attributes.
[0083] Optionally, after the target data object is rendered and encapsulated based on the preset data visualization rendering rule to obtain the specified type of visualization chart component, the apparatus further includes:
[0084] The setting unit is configured to receive an interactive setting instruction of the visualization chart component and set a hyperlink for linking other visualization charts / dashboards on the visualization chart component based on the interactive setting instruction.
[0085] Optionally, the apparatus further includes:
[0086] The receiving unit is configured to receive a query condition modification instruction corresponding to a target dashboard, wherein the query condition modification instruction includes a modified data query condition.
[0087] The obtaining unit 20 is further configured to obtain corresponding data objects from the data warehouse based on the query condition modification instruction.
[0088] The updating unit is configured to update each visualization chart component included in the target dashboard based on the data objects.
[0089] The above units can be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For example, when a certain unit above is implemented in the form of a processing element scheduling program code, the processing element can be a general purpose processor, such as a central processing unit (CPU) or other processor that can invoke program code. For another example, the units can be integrated together to implement a system-on-a-chip (SOC).
[0090] In summary, the data visualization method provided by the embodiments of the present application receives a data query instruction, and obtains a target data object from a data warehouse based on the query instruction, wherein the data query instruction includes a data query condition; performs rendering and encapsulation processing on the target data object based on a preset data visualization rendering rule to obtain a specified type of visualization chart component; receives a dashboard configuration instruction, and adds one or more target visualization charts to a dashboard based on the dashboard configuration instruction.
[0091] Using the data visualization method provided by the embodiments of the present application, a visualization chart is generated based on a query and analysis statement. The generated visualization chart is added to a dashboard, and the chart can be placed in a suitable position using a mouse, which is simple and flexible, releases development pressure, and greatly reduces the investment of human cost.
[0092] Further, the data visualization device provided by the embodiments of the present application is from the hardware level, and the hardware architecture diagram of the data visualization device can be seen from Figure 3 As shown in the figure, the data visualization device can include a memory 30 and a processor 31,
[0093] The memory 30 is used to store program instructions; the processor 31 invokes the program instructions stored in the memory 30, and executes the above method embodiments according to the obtained program instructions. The specific implementation and technical effects are similar, and will not be repeated here.
[0094] Optionally, the present application also provides a data visualization device, which includes at least one processing element (or chip) for executing the above method embodiments.
[0095] Optionally, the present application also provides a program product, for example, a computer readable storage medium, which stores computer executable instructions for causing the computer to execute the above method embodiments.
[0096] Here, the machine readable storage medium can be any electronic, magnetic, optical, or other physical storage device that contains or stores information, such as executable instructions, data, etc. For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard drive), a solid state drive, any type of storage disk (such as a floppy disk, a DVD, etc.), or similar storage medium, or a combination thereof.
[0097] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an e-mail device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0098] For the convenience of description, the above apparatuses are described in various units by functions respectively when described. Of course, the functions of the units can be implemented in one or more software and / or hardware in the implementation of the present application.
[0099] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, a disk storage, a CD-ROM, an optical storage, etc.) containing computer-usable program code.
[0100] 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 flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams 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 apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce the functions described in the flowcharts and / or block diagrams for implementing the flows and / or blocks in the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 an apparatus with a function specified in one or more processes and / or blocks.
[0101] Also, these computer program instructions can be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the Figure 1 one or more processes and / or blocks Figure 1 an apparatus with a function specified in one or more processes and / or blocks.
[0102] The computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 one or more processes and / or blocks Figure 1 an apparatus with a function specified in one or more processes and / or blocks.
[0103] The above description is embodied in the context of only a few of its preferred embodiments and is not intended to be limiting of the present application. Any modifications, equivalents and / or improvements, made within the spirit and principles of the present application, shall fall within the scope of the present application.
Claims
1. A data visualization method, characterized in that, The method includes: Receive a data query instruction and retrieve a target data object from the data warehouse based on the query instruction, wherein the data query instruction includes data query conditions; The target data object is rendered and encapsulated based on preset data visualization rendering rules to obtain a visualization chart component of a specified type. Receive dashboard configuration instructions and add one or more target visualization charts to the dashboard based on the dashboard configuration instructions; The filter batch modifies the query conditions for all visualization chart components in the dashboard. Each visualization chart component corresponds to a query and analysis statement, and the filter is used to manipulate the query and analysis statement. The filter updates all associated visualization chart components in the dashboard uniformly by modifying the variable values in the query and analysis statement.
2. The method as described in claim 1, characterized in that, After rendering and encapsulating the target data object based on preset data visualization rendering rules to obtain a visualization chart component of a specified type, the method further includes: Receive a configuration instruction for the visualization chart component, and configure the display properties of the visualization chart component based on the configuration instruction.
3. The method as described in claim 2, characterized in that, Visual chart component types include line charts, bar charts, pie charts, and tables; The display properties of the visualization chart component include the data source for the X and Y axes, margin properties, and text size properties.
4. The method as described in claim 3, characterized in that, After rendering and encapsulating the target data object based on preset data visualization rendering rules to obtain a visualization chart component of a specified type, the method further includes: Receive interactive setting instructions from the visualization chart component, and set hyperlinks on the visualization chart component to link to other visualization charts / dashboards based on the interactive setting instructions.
5. The method as described in claim 4, characterized in that, The method further includes: Receive a query condition modification instruction corresponding to the target dashboard, wherein the query condition modification instruction includes the modified data query conditions; Based on the query conditions, the corresponding data object is retrieved from the data warehouse. Based on the data object, update each visual icon component included in the target dashboard.
6. A data visualization device, characterized in that, The device includes: An acquisition unit is configured to receive a data query instruction and acquire a target data object from a data warehouse based on the query instruction, wherein the data query instruction includes data query conditions; The processing unit is used to render and encapsulate the target data object based on preset data visualization rendering rules to obtain a visualization chart component of a specified type. An adding unit is used to receive dashboard configuration instructions and add one or more target visualization charts to the dashboard based on the dashboard configuration instructions; The update unit is used to batch modify the query conditions for all visualization chart components in the dashboard through filters. Each visualization chart component corresponds to a query and analysis statement, and the filter is used to operate the query and analysis statement. The filter updates all associated visualization chart components in the dashboard in a unified manner by modifying the variable values in the query and analysis statement.
7. The apparatus as claimed in claim 6, characterized in that, After rendering and encapsulating the target data object based on preset data visualization rendering rules to obtain a visualization chart component of a specified type, the device further includes: The configuration unit is used to receive configuration instructions for the visualization chart component and configure the display attributes of the visualization chart component based on the configuration instructions.
8. The apparatus as claimed in claim 7, characterized in that, Visual chart component types include line charts, bar charts, pie charts, and tables. The display properties of the visualization chart component include the data source for the X and Y axes, margin properties, and text size properties.
9. The apparatus as claimed in claim 8, characterized in that, After rendering and encapsulating the target data object based on preset data visualization rendering rules to obtain a visualization chart component of a specified type, the device further includes: The setting unit is used to receive interactive setting instructions from the visualization chart component, and set hyperlinks on the visualization chart component to link to other visualization charts / dashboards based on the interactive setting instructions.
10. The apparatus as claimed in claim 9, characterized in that, The device further includes: The receiving unit is used to receive a query condition modification instruction corresponding to the target dashboard, wherein the query condition modification instruction includes the modified data query conditions; The acquisition unit is further configured to acquire the corresponding data object from the data warehouse based on the query condition modification instruction; An update unit is used to update each visual icon component included in the target dashboard based on the data object.
Citation Information
Patent Citations
Big data visualization method and system
CN112732795A