Method and apparatus for data visualization

By setting view identifiers, label names, and target scripts during the data visualization process, and unifying the data format and storing it in the target database, the problem of front-end and back-end interface integration errors was solved, thus achieving accuracy and reliability in data visualization.

CN115599855BActive Publication Date: 2026-06-05ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2022-10-17
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, front-end and back-end interfaces are prone to errors during data visualization, leading to inaccurate interface connections.

Method used

By setting view identifiers, tag names, and target scripts, target data is obtained from external data sources, and the data is stored in the target database under a unified data model and a unified data format. The backend sends the data in the unified format to the frontend through an interface.

Benefits of technology

It ensures accuracy in front-end and back-end interface integration, reduces interface errors, and improves the reliability of data visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599855B_ABST
    Figure CN115599855B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of data visualization method and device, apply in big data technical field, including: for any view, the view identification of view, the label name of view and the target script of view are set;View is used to carry out data visualization display;Based on target script, target data is obtained from external data source, and label name and the field value of each field of target data under uniform data model are set for target data;Label name is used to establish the corresponding relationship between target data and view;Target data, label name and the field value of each field of target data under uniform data model are stored in target database;Wherein, uniform data model has each general field and each unique field determined according to each visualization type.Back end sends the data format of uniform target data to front end through an interface, and front end obtains the data format of uniform target data through an interface, so that the interface of front end and back end is not easy to make mistake when docking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology, and in particular to a method and apparatus for data visualization. Background Technology

[0002] With the continuous development of big data technology, digital technology is gradually being applied in various fields. As the scale of data continues to expand, data from external data sources is presented in a visual form to make it easier to intuitively display various information about the data.

[0003] Currently, the method for data visualization involves the backend generating data in various specific formats and then sending it to the frontend through multiple interfaces. The frontend then generates the corresponding visualization based on the specific data format. However, the large number of backend interfaces can easily lead to errors when connecting the frontend and backend interfaces.

[0004] In summary, how to ensure that the front-end and back-end interfaces are less prone to errors during integration is a pressing technical problem that needs to be solved. Summary of the Invention

[0005] This invention provides a data visualization method and apparatus to solve the problem of errors that easily occur when connecting front-end and back-end interfaces in the prior art.

[0006] In a first aspect, embodiments of the present invention provide a data visualization method, comprising: for any view, setting a view identifier, a label name, and a target script for the view; the view being used for data visualization display; based on the target script, obtaining target data from an external data source, and setting the label name and field values ​​of each field of the target data under a unified data model for the target data; the label name being used to establish a correspondence between the target data and the view; storing the target data, the label name, and the field values ​​of each field of the target data under the unified data model in a target database; wherein the unified data model has general fields and unique fields determined according to each visualization type.

[0007] In this embodiment of the invention, target data is obtained from an external data source through a target script, and the field values ​​of each field of the target data under a unified data model are determined, thereby unifying the data format of the target data. In this way, the backend sends the unified target data format to the frontend through an interface, and the frontend only needs to obtain the unified target data format through an interface, thus making it less prone to errors when the frontend and backend interfaces are connected.

[0008] Optionally, the visualization type of the view is set; determining the field values ​​of each field of the target data under the unified data model includes: for the target data that has a corresponding relationship with the view, determining the first value of each general field of the target data under the unified data model and the second value of the specific field corresponding to the visualization type, based on the visualization type of the view.

[0009] In this embodiment of the invention, by determining the first value of each general field of the target data under the unified data model and the second value of the specific field corresponding to the visualization type according to the visualization type, the value of each field of the target data under the unified data model is determined, and then the data visualization can be displayed according to the value of each field.

[0010] Optionally, the visualization type of the view is switched; for the target data that corresponds to the view, a third value of the unique field corresponding to the switched visualization type is added according to the switched visualization type.

[0011] In this embodiment of the invention, after the view is generated, multiple views can be obtained by switching the visualization type of the view, thereby achieving diverse display of the view.

[0012] Optionally, the target script for the view is set, including: configuring the first connection information of the external data source, the second connection information of the target database, and the transformation information for the target data; the transformation information is used to set the label name of the target data and the field values ​​of each field of the target data under each visualization type.

[0013] In this embodiment of the invention, by setting a target template for the view, target data is obtained from an external data source, and the field values ​​of each field of the target data under each visualization type and the label name of the target data are stored in the target database. This facilitates the subsequent retrieval of the field values ​​of each field of the target data from the target database based on the label name of the target data, thereby generating a view for data visualization display.

[0014] Optionally, the general fields include data name, data content, and data unit; the specific fields include at least one of the following: the proportion of data; the total amount of data; and the coordinate axis information of the data.

[0015] In this embodiment of the invention, by dividing the field values ​​of each field into general fields and specific fields, each field can be templated, which facilitates the subsequent retrieval of the field values ​​of each field of the target data from the target database based on the tag name of the target data, thereby generating a view for data visualization display.

[0016] Secondly, embodiments of the present invention provide a data visualization method, comprising: receiving a visualization request for a view sent by a user through a visualization interface; obtaining a tag name corresponding to the view according to the view identifier in the visualization request; obtaining the field values ​​of each field of target data with the tag name under a unified data model from a target database; wherein the unified data model has each general field and each unique field determined according to each visualization type; encapsulating the field values ​​of each field according to the format requirements of the visualization interface and sending them through the visualization interface for visualization display.

[0017] In this embodiment of the invention, after receiving a visualization request for a view from a user, the field values ​​of each field of the target data under a unified data model can be quickly found from the target database based on the view identifier in the visualization request, thereby generating a view for data visualization display.

[0018] Optionally, each view identifier corresponds to a view visualization type; the field values ​​of the target data with the label name under the unified data model are the first value of the target data under each general field and the second value of each specific field corresponding to the visualization type.

[0019] In this embodiment of the invention, by determining the second value of each unique field in the visualization type of the view, it is possible to combine the first value of each general field and the second value of each unique field to obtain the field value of each field of the target data under a unified data model, and then generate a view based on the field value of each field for data visualization display.

[0020] Optionally, the visualization type of the view can be switched; the field values ​​of each field of the target data with the label name under the unified data model are the first value of the target data under each general field and the third value of each specific field corresponding to the switched visualization type.

[0021] In this embodiment of the invention, by switching the visualization type of the view, the third value of each unique field corresponding to the switched visualization type can be determined, thereby combining the first value of each general field and the third value of each unique field to obtain the field value of each field of the target data under the unified data model, and then generating a view based on the field value of each field for data visualization display.

[0022] Optionally, the visualization request includes a view identifier and a visualization type; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the second values ​​of each specific field corresponding to each visualization type; obtaining the field values ​​of each field of the target data with the label name under the unified data model from the target database includes: obtaining the first values ​​of the target data with the label name under each general field and the second values ​​of each specific field corresponding to the visualization type from the target database according to the label name and the visualization type.

[0023] In this embodiment of the invention, the field values ​​of each field of the target data under a unified data model can be determined according to the visualization request, thereby realizing the generation of a view based on the field values ​​of each field of the target data under the unified data model for data visualization display.

[0024] Optionally, the visualization request includes a view identifier and filtering parameters; obtaining the field values ​​of each field of the target data with the label name under the unified data model from the target database includes: obtaining the field values ​​of each field of the target data with the label name and conforming to the filtering parameters under the unified data model from the target database.

[0025] In this embodiment of the invention, by using the filtering parameters in the visualization request, the field values ​​of each field of the target data that meets the filtering parameters can be obtained from the target database under a unified data model, thereby realizing the generation of a view based on the field values ​​of each field of the target data for data visualization display.

[0026] Thirdly, embodiments of the present invention provide a data visualization apparatus, comprising: a determining unit, configured to, for any view, set a view identifier and a corresponding label name for the view; the view is used for data visualization display; the label name is used to establish a correspondence between target data and the view; determine the label name of the target data according to the label name corresponding to the view; and set a target script corresponding to the label name of the target data; and a processing unit, configured to, for any external data source, obtain target data from the external data source based on the target script corresponding to the label name of the target data and determine the field values ​​of each field of the target data under a unified data model, and store the target data and the field values ​​of each field of the target data under the unified data model in a target database; wherein the unified data model has general fields and unique fields determined according to each visualization type.

[0027] Optionally, the visualization type of the view is set; the processing unit is specifically used to: for target data that has a corresponding relationship with the view, determine the first value of each general field of the target data under the unified data model, and the second value of the specific field corresponding to the visualization type, according to the visualization type of the view.

[0028] Optionally, the visualization type of the view is switched; the processing unit is further configured to: for target data that has a corresponding relationship with the view, add a third value for the unique field corresponding to the switched visualization type according to the switched visualization type.

[0029] Optionally, the processing unit is specifically used to: configure the first connection information of the external data source, the second connection information of the target database, and the transformation information for the target data; the transformation information is used to set the label name of the target data and the field values ​​of each field of the target data under each visualization type.

[0030] Optionally, the processing unit is specifically used for: the general fields including data name, data content, and data unit; the specific fields including at least one of the following: the proportion of data; the total amount of data; and the coordinate axis information of the data.

[0031] Fourthly, embodiments of the present invention also provide a data visualization apparatus, comprising: a determining unit, configured to receive a visualization request for a view sent by a user through a visualization interface;

[0032] Based on the view identifier in the visualization request, obtain the tag name corresponding to the view; the processing unit is used to obtain the field values ​​of each field of the target data with the tag name under the unified data model from the target database; wherein, the unified data model has each general field and each unique field determined according to each visualization type; the field values ​​of each field are encapsulated according to the format requirements of the visualization interface and sent through the visualization interface for visualization display.

[0033] Optionally, the processing unit is specifically used for: each view identifier corresponds to a visualization type of the view; the field values ​​of each field of the target data with the label name under the unified data model are the first value of the target data under each general field and the second value of each specific field corresponding to the visualization type.

[0034] Optionally, the processing unit is further configured to: switch the visualization type of the view; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the third values ​​of each specific field corresponding to the switched visualization type.

[0035] Optionally, the visualization request includes a view identifier and a visualization type; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the second values ​​of each specific field corresponding to each visualization type; the processing unit is specifically used to: obtain the first values ​​of the target data with the label name under each general field and the second values ​​of each specific field corresponding to the visualization type from the target database according to the label name and the visualization type.

[0036] Optionally, the visualization request includes a view identifier and filtering parameters; the processing unit is specifically used to: obtain the field values ​​of each field of the target data with the label name and conforming to the filtering parameters under the unified data model from the target database.

[0037] Fifthly, embodiments of the present invention also provide an electronic device, including at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform any of the data visualization-based methods described in the first aspect.

[0038] In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing a program that, when run on a computer, causes the computer to execute any of the data visualization methods described in the first aspect above. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram illustrating a possible application scenario provided by an embodiment of the present invention;

[0041] Figure 2 A flowchart illustrating a data visualization method provided in an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a first interface provided in an embodiment of the present invention;

[0043] Figure 4 A flowchart illustrating a data visualization method provided in an embodiment of the present invention;

[0044] Figure 5 This is a schematic diagram of the structure of the second interface provided in an embodiment of the present invention;

[0045] Figure 6 This is a schematic diagram of another second interface provided in an embodiment of the present invention;

[0046] Figure 7 This is a schematic diagram of another second interface provided in an embodiment of the present invention;

[0047] Figure 8 This is a schematic diagram of another second interface provided in an embodiment of the present invention;

[0048] Figure 9 An interface diagram for data management provided in an embodiment of the present invention;

[0049] Figure 10 A schematic diagram of the structure of a data visualization device provided in an embodiment of the present invention;

[0050] Figure 11 A schematic diagram of the structure of a data visualization device provided in an embodiment of the present invention;

[0051] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0053] like Figure 1 The diagram illustrates a possible application scenario provided by an embodiment of the present invention. Taking platform 101 as an example, this application scenario uses platform 101 to display data visualizations. Using a pie chart as an example, in general, for platform 101 to successfully display data visualizations, the backend needs to generate a unique data format from the data, and then send this specific data format to the frontend. The frontend then parses the specific data format to generate the corresponding data visualization.

[0054] In one possible scenario, the backend generates data in four formats: A, B, C, and D. Since different data formats correspond to different interfaces, to send these formats to the frontend, the backend needs to interface with the frontend via interface A to send data in format A, interface B to send data in format B, interface C to send data in format C, and interface D to send data in format D. If the frontend requires data in format A, and the backend interfaces with it via interface B, it will be unable to send data in format A. Therefore, because the sources and types of data are diverse, the number of data formats and corresponding frontend / backend interfaces increases, making it easy to make mistakes when connecting these interfaces.

[0055] In view of this, embodiments of the present invention provide a data visualization method that can solve the problem of easy interface errors between the front-end and back-end by unifying the data format.

[0056] like Figure 2 The diagram shown is a flowchart illustrating a data visualization method provided in an embodiment of the present invention. The method includes the following steps:

[0057] Step 201: For any view, set the view identifier, view label name, and view target script.

[0058] In this embodiment of the invention, views are used for data visualization. To enable the front-end to display any view, the back-end needs to set an identifier for each view, with each view corresponding to a view identifier. For example, if view A is a pie chart of the total number of cases, the view identifier for view A is set to 1, and view A can be displayed based on view identifier 1. As another example, if view B is a line chart of the total number of cases, the view identifier for view B is set to 2, and view B can be displayed based on view identifier 2.

[0059] The front-end needs to obtain the field values ​​of each field of the target data required for view generation under a unified data model from the back-end to generate the view. Therefore, for any view, the back-end not only needs to set the view identifier, but also the view's tag name and the view's target script. Since the view's tag name is related to the target data's tag name, by setting the view's tag name on the back-end, the back-end can find the corresponding target data and determine the field values ​​of each field of the target data under the unified data model based on the association between the view's tag name and the target data's tag name.

[0060] Since the target data is obtained by the backend from an external data source, the backend sets the target script for the view and then retrieves the corresponding target data from the external data source based on the target script. There is a relationship between the view identifier, the view's tag name, and the view's target script.

[0061] Step 202: Based on the target script, obtain the target data from the external data source, set the label name for the target data, and determine the field values ​​of each field of the target data under the unified data model.

[0062] In this embodiment of the invention, the backend, based on the target script, can obtain target data from an external data source and determine the field values ​​of each field in the target data under a unified data model. By determining the field values ​​of each field in the target data under the unified data model, the field values ​​of the data format that constitutes the target data can be determined, thereby unifying the data format of the target data. The field values ​​of each field in the target data under the unified model include general fields and specific fields. General fields include data name, data content, and data unit. Specific fields include at least one of the following: data proportion; total data volume; and data axis information. Based on the target script, label names can also be set for the target data, thereby associating the label names of the target data with the label names corresponding to the views, facilitating the subsequent retrieval of the field values ​​of each field in the target data under the unified data model from the target database based on the label names of the target data.

[0063] Step 203: Store the target data, tag name, and field values ​​of each field of the target data under the unified data model in the target database.

[0064] In this embodiment of the invention, by storing the target data, tag name, and field values ​​of each field of the target data under a unified data model in the target database, since the tag name of the view can be associated with the tag name of the target data, the target data corresponding to the tag name of the target data and the field values ​​of each field of the target data under the unified data model can be retrieved from the target database through the tag name of the view.

[0065] like Figure 3The diagram illustrates a first interface provided in an embodiment of the present invention. For example, if view A is a pie chart of the total number of cases, the view identifier corresponding to view A is set to 1, the label name of view A is set to zfsx_zwfw_bjzI, and the target script corresponding to view A is set to XXXAAA. Thus, by inputting view identifier 1 into the first interface of the front end, the label name of view A and the target script of view A will be associated. First, the target data and the field values ​​of each field under the unified data model are determined from the external data source through the target script of view A. The target data and the determined field values ​​of each field under the unified data model are stored in the target database. Then, through the association between the label name of view A and the label name of the target data, the field values ​​of each field under the unified data model of the corresponding target data are obtained from the target database. The back end then encapsulates the field values ​​of each field under the unified data model of the target data according to the format requirements of the visualization interface and sends them to the front end through the visualization interface. The field values ​​of each field under the unified data model of the target data, encapsulated by the front end according to the format requirements of the visualization interface, can then be visualized and displayed on the first interface.

[0066] As can be seen from steps 201 to 203, the target script obtains target data from an external data source and determines the field values ​​of each field of the target data under a unified data model, thereby unifying the data format of the target data. In this way, the backend sends the unified target data format to the frontend through an interface, and the frontend only needs to obtain the unified target data format through an interface, thus making it less prone to errors when the frontend and backend interfaces are connected.

[0067] like Figure 4 The diagram shown is a flowchart illustrating a data visualization method provided in an embodiment of the present invention. The method includes the following steps:

[0068] Step 401: Receive the visualization request for the view sent by the user through the visualization interface.

[0069] like Figure 5 The diagram shows the structure of the second interface provided in an embodiment of the present invention. For example, if a user needs to display view A on the second interface, the user will enter the view identifier of view A on the second interface. After the user clicks save, the front end generates a visualization request for view A based on the view identifier of view A and sends the visualization request for view A to the back end through the visualization interface. Then the back end receives the visualization request for view A sent by the front end through the visualization interface.

[0070] Step 402: Obtain the tag name corresponding to the view based on the view identifier in the visualization request.

[0071] In this embodiment of the invention, since there is a correspondence between the view identifier and the view's tag name, and a correspondence between the view's tag name and the target data's tag name, the backend can obtain the tag name corresponding to the view based on the view identifier in the visualization request, which facilitates the subsequent determination of the target data's tag name based on the view's tag name.

[0072] Step 403: Obtain the field values ​​of each field of the target data with the tag name under the unified data model from the target database.

[0073] In this embodiment of the invention, since the target data, the label name of the target data, and the field values ​​of each field of the target data under the unified data model are all stored in the target database, the label name of the target data can be determined based on the label name of the view, and then the target data can be retrieved from the target database based on the label name of the target data. For example, if a pie chart of the total number of cases needs to be generated, the view is a pie chart of the total number of cases, and the target data is the data of the total number of cases, then the view identifier is set to 1, and the label name of the view corresponding to view identifier 1 is set to zfsx_zwfw_bjzI. Based on the label name zfsx_zwfw_bjzI of the view, the label name zfsx_zwfw_bjzI of the total number of cases can be determined, thereby retrieving the general fields and specific fields of the total number of cases under the unified data model from the target database. The general fields include the data name of the total number of cases, the unit of the total number of cases, and the data content of the total number of cases. Since a pie chart needs to be generated, the specific fields include the proportion of the total number of cases and the total data volume of the total number of cases.

[0074] Step 404: Encapsulate the field values ​​of each field according to the format requirements of the visualization interface and send them through the visualization interface for visualization display.

[0075] In this embodiment of the invention, by encapsulating the field values ​​of each field according to the format requirements of the visualization interface, a unified data format is achieved. Since one data format corresponds to one interface, unifying the data format also unifies the visualization interface, thereby reducing the likelihood of errors during the interface integration between the front-end and back-end. After the back-end encapsulates the field values ​​of each field according to the format requirements of the visualization interface and sends them to the front-end through the visualization interface, the front-end achieves visualization display based on the field values ​​encapsulated according to the format requirements of the visualization interface.

[0076] As can be seen from steps 401 to 404, by encapsulating the field values ​​of each field according to the format requirements of the visualization interface, the data format is unified. Since one data format corresponds to one interface, unifying the data format also means unifying the visualization interface, thereby making it less likely for errors to occur when the front-end and back-end interfaces are connected.

[0077] The following five scenarios illustrate how to minimize errors during front-end and back-end integration.

[0078] First scenario

[0079] like Figure 6The diagram shows another structural schematic of the second interface provided in an embodiment of the present invention. If the view identifier only associates with the view's label name and the view's target script, and does not associate with the visualization type, then the field values ​​of the target data satisfying any visualization type will be obtained according to the view's target script, and the field values ​​of the target data of any visualization type will be stored in the target database. The view's label name is used to retrieve the field values ​​of the target data of any visualization type from the target database. For example, if the view that the front end needs to display is a pie chart of the cumulative birth and death population for this year, the back end needs to set the view identifier to 104, the view's label name to zfsx_zwfw_bjxj, and the view's target script. The target script of the view is used to retrieve the cumulative birth and death population data for the current year, along with the values ​​of each field for the cumulative birth and death population data, from an external data source. It also sets the label name for the cumulative birth and death population data. Then, it stores the cumulative birth and death population data, its field values, and the label name in the target database. The field values ​​include general fields and specific fields. General fields include the data name, data content, and unit of measurement for the cumulative birth and death population data. Specific fields include the proportion of the cumulative birth and death population data, the total number of the cumulative birth and death population data, and the coordinate axis information for the cumulative birth and death population data. Since the required view is a pie chart of the cumulative births and deaths this year, the user will select view identifier 104 and visualization type as pie chart on the second interface. The front end will send a visualization request for the view to the back end through the visualization interface. The visualization request includes view identifier 104 and visualization type as pie chart. The back end will associate the view label name zfsx_zwfw_bjxj with view identifier 104, and associate the target data label name zfsx_zwfw_bjxj with the target data label name zfsx_zwfw_bjxj. Then, it will retrieve the field values ​​of the corresponding pie chart's cumulative births and deaths this year from the target database using the target data label name zfsx_zwfw_bjxj and visualization type as pie chart. Since the fields for generating the pie chart are divided into the first value of the general fields and the second value of the specific fields, the first value of the general fields includes the data name of the cumulative births and deaths this year, the data content of the cumulative births and deaths this year, and the data unit of the cumulative births and deaths this year. Since generating a pie chart does not require the coordinate axis information of the cumulative birth and death population data for the current year, the second value of the specific field includes the proportion of the cumulative birth and death population data for the current year and the total number of cumulative birth and death population data for the current year. Then, the backend encapsulates the field values ​​of each field according to the format requirements of the visualization interface and sends them to the frontend through the visualization interface. The frontend then performs visualization display based on the field values ​​encapsulated according to the visualization interface format.Since both the front-end and back-end are connected via a visual interface, it is less prone to errors during the connection process.

[0080] For another example, if a user finds the pie chart of cumulative births and deaths for the year insufficiently intuitive and wants to view a line chart of the same number, they need to switch visualization types. This is because the view's label name is used to retrieve the field values ​​of the target data for any visualization type from the target database. Each field value consists of a first value for each general field and a second value for each specific field. Since both pie charts and line charts require general fields, the first value of the general fields for the pie chart is the same as that for the line chart. Because the elements used to generate a pie chart include proportions, the second value of the specific fields for the pie chart includes the proportion of cumulative births and deaths for the year and the total number of cumulative births and deaths for the year. However, the elements used to generate a line chart do not require proportions but rather axis information; therefore, the third value of the specific fields for the line chart includes the coordinate axis information for the cumulative births and deaths for the year. Since the target database stores the field values ​​corresponding to any visualization type, the backend associates the target data's label name with the target view's label name. Based on the switched visualization type (line chart) and the target data's label name, it retrieves the field values ​​of the target data corresponding to the line chart from the target database. Then, it encapsulates these field values ​​according to the visualization interface's format requirements and sends them to the frontend via the visualization interface. The frontend then uses these encapsulated field values ​​to perform the visualization display. Because both the frontend and backend interface are connected via the visualization interface, errors are less likely to occur during the integration process.

[0081] The second scenario

[0082] To implement the view required for front-end display, the back-end first needs to set the view identifier, view tag name, view target script, and view visualization type.

[0083] like Figure 7The diagram shows another structural schematic of a second interface provided in an embodiment of the present invention. Since various visualization types can be generated based on the target data, there is a one-to-one correspondence between the view identifier, visualization type, view label name, and view target script. Specifically, the view target script obtains the field values ​​of the target data for the corresponding visualization type from an external data source. The view label name is associated with the label name of the target data; based on the label name of the target data, the field values ​​of the target data for the corresponding visualization type can be obtained from the target database. For example, if the view to be generated is a pie chart of the cumulative birth and death population for the current year, the target data is the cumulative birth and death population data for the current year, the backend-set view identifier is 104, the label name of view 104 is zfsx_zwfw_bjxj, the visualization type is a pie chart, and the target script for view 104... Based on the target script, the system retrieves the cumulative birth and death population data for the current year, as well as the data visualized as a pie chart, from external data sources. Under a unified data model, it assigns values ​​to each field, sets labels for the target data, and stores it in the target database. The fields are divided into a first value for general fields and a second value for specific fields. The first value of the general fields includes the data name, content, and unit of measurement for the cumulative birth and death population data. Since the visualization type is a pie chart, the second value of the specific fields is determined based on the elements used to generate the pie chart. Therefore, the second value of the specific fields includes the proportion and total amount of the cumulative birth and death population data for the current year. Therefore, the user will select view identifier 104 on the second interface. The front-end will send a visualization request for the view to the back-end through the visualization interface. The visualization request includes view identifier 104. The back-end will associate the view's label name zfsx_zwfw_bjxj with view identifier 104, and associate the target data's label name zfsx_zwfw_bjxj with the visualization type pie chart. Then, using the target data's label name zfsx_zwfw_bjxj, it will retrieve the field values ​​of the cumulative birth and death population data for the current year from the target database. Since the fields for generating the pie chart are divided into general fields and specific fields, the first value of the general fields includes the data name, data content, and data unit of the cumulative birth and death population data for the current year. Since generating the pie chart does not require the coordinate axis information of the cumulative birth and death population data for the current year, the second value of the specific fields includes the proportion and total amount of the cumulative birth and death population data for the current year. Then the backend encapsulates the field values ​​of each field according to the format requirements of the visualization interface and sends them to the frontend through the visualization interface. The frontend then displays the visualization based on the field values ​​encapsulated according to the format of the visualization interface.Since both the front-end and back-end are connected via a visual interface, it is less prone to errors during the connection process.

[0084] For another example, if a user finds the pie chart of the cumulative births and deaths this year not intuitive enough and wants to view a line chart of the cumulative births and deaths this year, the target data is still the cumulative births and deaths this year. Since one view identifier corresponds to one visualization type, when the visualization type is converted from a pie chart to a line chart, the target database stores the first value of the common field and the second value of the specific field corresponding to the pie chart of the cumulative births and deaths this year. Since the first value of the common field is the same for all visualization types, when the visualization type is converted from a pie chart to a line chart, if the target database previously stored the third value of the specific field corresponding to the line chart of the cumulative birth and death population data for the year, then based on the visualization type and the label name of the target data, the third value of the specific field corresponding to the line chart of the cumulative birth and death population data for the year and the first value of the common field corresponding to the line chart of the cumulative birth and death population data for the year are directly retrieved from the target database. Then, the backend encapsulates the field values ​​of each field according to the format requirements of the visualization interface and sends them to the frontend through the visualization interface. The frontend performs visualization display based on the field values ​​encapsulated according to the format of the visualization interface, thereby displaying the line chart of the cumulative birth and death population for the year.

[0085] If the target database does not store the third value of the specific field corresponding to the line chart of the cumulative birth and death population data for the current year, then a target script is set according to the visualization type. Based on the target script, the field values ​​of each field of the cumulative birth and death population data for the current year under the unified data model are obtained from the external data source. These field values ​​include the first value of the general field corresponding to the line chart of the cumulative birth and death population data for the current year and the third value of the specific field corresponding to the line chart of the cumulative birth and death population data for the current year, and are stored in the target database. Then, based on the visualization type and the label name of the target data, the third value of the specific field corresponding to the line chart of the cumulative birth and death population data for the current year and the first value of the general field corresponding to the line chart of the cumulative birth and death population data for the current year are retrieved from the target database. The backend then encapsulates the field values ​​of each field according to the format requirements of the visualization interface and sends them to the frontend through the visualization interface. The frontend performs visualization display based on the field values ​​encapsulated according to the visualization interface format, thus displaying the line chart of the cumulative birth and death population for the current year.

[0086] The third scenario

[0087] like Figure 8The diagram shown illustrates another embodiment of the second interface provided by this invention. The target data's field values ​​under a unified data model are obtained based on the view identifier and filtering parameters, thereby achieving visual display. The filtering parameters are used to filter out the required field values ​​of the target data under the unified data model. For example, if the view to be displayed on the front end is a pie chart of the cumulative birth and death population for the current year, the user needs to select view identifier 104 and filtering parameters on the second interface. The filtering parameters can be the proportion of the cumulative birth and death population for the current year, the total number of births and deaths for the current year, the data name of the cumulative birth and death population for the current year, the data content of the cumulative birth and death population for the current year, and the data unit of the cumulative birth and death population for the current year. The front-end sends a visualization request for the view to the back-end through a visualization interface. The visualization request includes the view identifier 104 and filter parameters. The back-end associates the view's tag name zfsx_zwfw_bjxj with the view identifier 104, and then associates the target data's tag name zfsx_zwfw_bjxj with the view's tag name zfsx_zwfw_bjxj. Finally, using the target data's tag name zfsx_zwfw_bjxj and filter parameters, it retrieves the field values ​​of the cumulative birth and death population data for the current year from the target database. The field values ​​are: the proportion of the cumulative birth and death population for the current year, the total number of the cumulative birth and death population for the current year, the data name of the cumulative birth and death population for the current year, the data content of the cumulative birth and death population for the current year, and the data unit of the cumulative birth and death population for the current year. The field values ​​are divided into general field values ​​and specific field values. The general fields include the data name of the cumulative birth and death population for the current year, the data content of the cumulative birth and death population for the current year, and the data unit of the cumulative birth and death population for the current year. Specific fields include the percentage of births and deaths this year and the total number of births and deaths this year. The backend then encapsulates the field values ​​according to the visualization interface's format requirements and sends them to the frontend via the visualization interface. The frontend then displays the visualization based on the encapsulated field values. Because both the frontend and backend interface are connected via the visualization interface, errors are less likely to occur during the integration process.

[0088] Fourth case

[0089] like Figure 9The diagram shows a data management interface provided in an embodiment of the present invention. The data management interface displays the field values ​​of target data stored in the target database and the corresponding tag names of the target data. The data management interface includes a function to add target data. If the field values ​​of target data A are not stored in the target database, by filling in the field values ​​of the new target data into the corresponding fields and then pressing the "Add" button, the field values ​​of target data A can be stored in the target database and displayed on the data management interface.

[0090] If the field values ​​of the pie chart corresponding to target data B are stored in the target database, but the field values ​​of the line chart corresponding to target data B are not stored in the target database, and if the field values ​​of the line chart corresponding to target data B are known, and it is not necessary to obtain them from an external data source through a target script, then the field values ​​of the line chart corresponding to target data B can be stored in the target database through the data management interface. Specifically, since the common fields of the field values ​​of the pie chart and the line chart corresponding to target data B are the same, but the specific fields are different, it is necessary to store the field values ​​of the line chart corresponding to target data B in the target database. This can be achieved by storing the specific field values ​​of the line chart corresponding to target data B in the target database. Therefore, in the operation box corresponding to the field values ​​of the pie chart corresponding to target data B, select "Edit," then enter the field values ​​of the specific fields of the line chart corresponding to target data B into the corresponding fields, and then select the "Save" button to store the field values ​​of the line chart corresponding to target data B in the target database.

[0091] If you need to delete the values ​​of each field of the target data in the target database, locate the values ​​of each field of the target data that need to be deleted, and then select "Delete" in the corresponding operation box to delete the values ​​of each field of the target data in the target database.

[0092] Fifth case

[0093] To ensure the real-time nature of the view, the values ​​of each field in the target data in the target database need to be updated promptly. Optionally, at regular intervals, the target script will retrieve the new field values ​​of each target data field from an external data source, replace the original field values, and then store them in the target database. Alternatively, a scheduled update time can be set to update the field values ​​of the target data in the target database. For example, if the scheduled update time is set to 8:00 AM, then every day at 8:00 AM, the target script will retrieve the new field values ​​of each target data field from an external data source, replace the original field values, and then store them in the target database.

[0094] Based on the same technical concept described above, embodiments of the present invention also provide a data visualization device, such as... Figure 10 The diagram shows a structural schematic of a data visualization device provided in an embodiment of the present invention. The device 1000 includes: a determining unit 1001, configured to, for any view, set a view identifier and a corresponding tag name for the view; the view is used for data visualization display; the tag name is used to establish a correspondence between target data and the view; determine the tag name of the target data based on the tag name corresponding to the view; and set a target script corresponding to the tag name of the target data; and a processing unit 1002, configured to, for any external data source, obtain target data from the external data source based on the target script corresponding to the tag name of the target data and determine the field values ​​of each field of the target data under a unified data model, and store the target data and the field values ​​of each field of the target data under the unified data model in a target database; wherein the unified data model has general fields and unique fields determined according to each visualization type.

[0095] Optionally, the visualization type of the view is set; the processing unit 1002 is specifically used to: for target data that has a corresponding relationship with the view, determine the first value of each general field of the target data under the unified data model and the second value of the special field corresponding to the visualization type, according to the visualization type of the view.

[0096] Optionally, the visualization type of the view is switched; the processing unit 1002 is further configured to: for target data that has a corresponding relationship with the view, add a third value of the unique field corresponding to the switched visualization type according to the switched visualization type.

[0097] Optionally, the processing unit 1002 is specifically used to: configure the first connection information of the external data source, the second connection information of the target database, and the transformation information for the target data; the transformation information is used to set the label name of the target data and the field values ​​of each field of the target data under each visualization type.

[0098] Optionally, the processing unit 1002 is specifically used for: the general fields include data name, data content, and data unit; the specific fields include at least one of the following: the proportion of data; the total amount of data; and the coordinate axis information of the data.

[0099] Based on the same technical concept described above, embodiments of the present invention also provide a data visualization device, such as... Figure 11 The diagram shown is a structural schematic of a data visualization device provided in an embodiment of the present invention. The device 1100 includes: a determining unit 1101, configured to receive a visualization request for a view sent by a user through a visualization interface;

[0100] Based on the view identifier in the visualization request, obtain the tag name corresponding to the view; the processing unit 1102 is used to obtain the field values ​​of each field of the target data with the tag name under the unified data model from the target database; wherein, the unified data model has each general field and each unique field determined according to each visualization type; the field values ​​of each field are encapsulated according to the format requirements of the visualization interface and sent through the visualization interface for visualization display.

[0101] Optionally, the processing unit 1102 is specifically used for: each view identifier corresponds to a visualization type of the view; the field values ​​of each field of the target data with the label name under the unified data model are the first value of the target data under each general field and the second value of each specific field corresponding to the visualization type.

[0102] Optionally, the processing unit 1102 is further configured to: switch the visualization type of the view; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the third values ​​of each specific field corresponding to the switched visualization type.

[0103] Optionally, the visualization request includes a view identifier and a visualization type; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the second values ​​of each specific field corresponding to each visualization type; the processing unit 1102 is specifically used to: obtain the first values ​​of the target data with the label name under each general field and the second values ​​of each specific field corresponding to the visualization type from the target database according to the label name and the visualization type.

[0104] Optionally, the visualization request includes a view identifier and filtering parameters; the processing unit 1102 is specifically used to: obtain the field values ​​of each field of the target data with the label name and conforming to the filtering parameters under the unified data model from the target database.

[0105] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 12 As shown, the electronic device 1200 includes at least one processor 1201 and a memory 1202 connected to the at least one processor. In this embodiment, the specific connection medium between the processor 1201 and the memory 1202 is not limited. Figure 12 Taking the connection between processor 1201 and memory 1202 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.

[0106] In this embodiment of the application, the memory 1202 stores instructions that can be executed by at least one processor 1201. By executing the instructions stored in the memory 1202, at least one processor 1201 can perform the steps included in the aforementioned data visualization-based method.

[0107] The processor 1201 serves as the control center of the computing device, connecting to various parts of the device via various interfaces and lines. It performs data processing by running or executing instructions stored in the memory 1202 and accessing data stored in the memory 1202. In one or more embodiments, the processor 1201 may include one or more processing units. The processor 1201 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles issuing instructions. It is understood that the modem processor may not be integrated into the processor 1201. In some embodiments, the processor 1201 and the memory 1202 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.

[0108] Processor 1201 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the data visualization method embodiments can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0109] Memory 1202, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1202 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1202 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 1202 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0110] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing a computer program executable by a computing device, which, when run on the computing device, causes the computing device to perform the steps of the above-described data visualization method.

[0111] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0112] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0113] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0114] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0115] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0116] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data visualization method, characterized in that, include: For any given view, set the view identifier, the view's tag name, and the view's target script; The view is used for data visualization; Based on the target script, target data is obtained from an external data source, and the tag name and field values ​​of each field of the target data under the unified data model are set for the target data; the tag name is used to establish the correspondence between the target data and the view; The target data, the tag name, and the field values ​​of each field of the target data under the unified data model are stored in the target database; wherein, the unified data model has general fields and unique fields determined according to each visualization type; Set the visualization type of the view; Determining the field values ​​of each field in the target data under a unified data model includes: For target data that has a corresponding relationship with the view, based on the visualization type of the view, determine the first value of each general field of the target data under the unified data model, and the second value of the specific field corresponding to the visualization type; Switch the visualization type of the view; For target data that corresponds to the view, a third value is added to the unique field corresponding to the switched visualization type, based on the switched visualization type.

2. The method as described in claim 1, characterized in that, The target script for the view is set, including: Configure the first connection information of the external data source, the second connection information of the target database, and the transformation information for the target data; the transformation information is used to set the label name of the target data and the field values ​​of each field of the target data under each visualization type.

3. The method as described in claim 1, characterized in that, The general fields include data name, data content, and data unit; The specific fields include at least one of the following: The proportion of data; Total amount of data; The coordinate axis information of the data.

4. A data visualization method, characterized in that, include: Receive visualization requests for views sent by users through the visualization interface; Based on the view identifier in the visualization request, obtain the tag name corresponding to the view; Retrieve the field values ​​of each field of the target data with the stated tag name from the target database under a unified data model; wherein, the unified data model has general fields and unique fields determined according to each visualization type; The field values ​​of each field are encapsulated according to the format requirements of the visualization interface and sent through the visualization interface for visualization display; Each view identifier corresponds to the view's visualization type; The field values ​​of the target data with the label name under the unified data model are the first value of the target data under each general field and the second value of each specific field corresponding to the visualization type; Switch the visualization type of the view; The field values ​​of the target data with the stated label name under the unified data model are the first value of the target data under each general field and the third value of each specific field corresponding to the changed visualization type.

5. The method as described in claim 4, characterized in that, The visualization request includes a view identifier and a visualization type; Under the unified data model, the field values ​​of the target data with the aforementioned label name are the first values ​​of the target data under each general field and the second values ​​of each specific field corresponding to each visualization type. Retrieve the field values ​​of each field in the target data with the stated tag name under the unified data model from the target database, including: Based on the label name and the visualization type, obtain the first value of the target data with the label name under each general field and the second value of each specific field corresponding to the visualization type from the target database.

6. The method as described in claim 4, characterized in that, The visualization request includes a view identifier and filtering parameters; Retrieve the field values ​​of each field in the target data with the stated tag name under the unified data model from the target database, including: Retrieve the field values ​​of each field in the unified data model of the target data that has the stated label name and meets the stated filtering parameters from the target database.

7. A data visualization device, characterized in that, include: The determining unit is used to set the view identifier, the label name, and the target script of any view. The view is used for data visualization; The processing unit is used to obtain target data from an external data source based on the target script, and set the tag name and field values ​​of each field of the target data under the unified data model for the target data; the tag name is used to establish the correspondence between the target data and the view; A storage unit is used to store the target data, the tag name, and the field values ​​of each field of the target data under a unified data model in a target database; wherein, the unified data model has general fields and unique fields determined according to each visualization type; The processing unit is specifically used to: for target data that has a corresponding relationship with the view, determine the first value of each general field of the target data under the unified data model and the second value of the specific field corresponding to the visualization type, according to the visualization type of the view; The processing unit is further configured to: for target data that corresponds to the view, add a third value to the unique field corresponding to the switched visualization type according to the switched visualization type.

8. A data visualization device, characterized in that, include: The determination unit is used to receive visualization requests for views sent by users through the visualization interface; Based on the view identifier in the visualization request, obtain the tag name corresponding to the view; The processing unit is used to obtain the field values ​​of each field of the target data with the label name under the unified data model from the target database; wherein the unified data model has each general field and each unique field determined according to each visualization type; the field values ​​of each field are encapsulated according to the format requirements of the visualization interface and sent through the visualization interface for visualization display; The processing unit is specifically used for: each view identifier corresponds to the visualization type of the view; The field values ​​of the target data with the label name under the unified data model are the first value of the target data under each general field and the second value of each specific field corresponding to the visualization type; The processing unit is further configured to: switch the visualization type of the view; the field values ​​of each field of the target data with the label name under the unified data model are the first values ​​of the target data under each general field and the third values ​​of each specific field corresponding to the switched visualization type.

9. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1 to 6 according to the obtained program.

10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for processing multiple services bills data

    CN101158977A

  • Data auditing monitoring system

    CN114584600A