Visual chart query method, device and equipment and computer storage medium
By obtaining the unique identifier and target parameters of third-party applications, updating and linking the chart display, the problem of low chart query efficiency is solved, and flexible linkage and efficient query between charts are realized.
Patent Information
- Application Number
- CN201910975679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-14
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2039-10-14
AI Technical Summary
In the fintech field, chart queries are inefficient, especially when the number of charts increases. It is difficult to maintain the relationship between multiple chart parameters, resulting in low query efficiency and complexity. Furthermore, existing technologies lack flexible parameter passing methods and effective linkage between charts.
By obtaining the unique identifier sent by the third-party application, the target parameters are determined, and the corresponding dashboards and charts are retrieved from the system database. The parameters are then updated, and related charts are identified and linked to achieve interactive display between charts.
It improves the efficiency of chart queries, enables flexible linkage between charts and timely parameter updates, reduces manual user intervention, and enhances the system's query efficiency and flexibility.
Smart Images

Figure CN110737674B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Fintech, and in particular to a visual chart query method and device, equipment and a computer storage medium. BACKGROUND
[0002] With the development of computer technology, more and more technologies (big data, distributed, Blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to Fintech, but due to the security and real-time requirements of the financial industry, higher requirements are also put forward for the technology. For example, in BI (Business Intelligence) applications, charts are often not only used for viewing within the system, but also shared through various forms, or even embedded in third-party applications as part of an integrated display solution. When accessing third-party applications, many user-defined operations are difficult to implement due to the need to separate from the original BI application, and often in different scenarios, the same chart needs to be queried through different parameters. Therefore, a unified and flexible external parameter passing method is needed to pass parameters from the third-party application to the chart in the BI application and sequentially perform differentiated queries and calculations. However, when the number of charts increases, the association between multiple chart parameters becomes difficult to maintain, and controlling all chart parameters is inefficient and complex, resulting in low efficiency of chart queries. SUMMARY
[0003] The main purpose of the present application is to provide a visual chart query method, device, equipment and computer storage medium, which aims to improve the efficiency of chart queries in the system.
[0004] To achieve the above purpose, the present application provides a visual chart query method, which comprises the following steps:
[0005] The system obtains the unique identifier sent by the third-party application, and obtains the target parameter corresponding to the unique identifier in the database of the system;
[0006] According to the target parameter, determine the dashboard in the system and the plurality of to-be-updated charts in the dashboard, and perform parameter updating on each of the to-be-updated charts according to the target parameter to obtain a plurality of updated charts;
[0007] Obtain the primary chart in the dashboard that has not been updated, and determine the associated chart associated with each of the updated charts in each of the primary charts, and perform parameter updating on each of the associated charts according to a preset linkage mode;
[0008] The updated charts and the associated charts of the completed parameter update are placed on a chart display page in the system for display.
[0009] Optionally, the parameter updating of each of the to-be-updated charts according to the target parameter includes:
[0010] The query statements in each of the to-be-updated charts are obtained, each of the query statements is updated by a keyword value of the target parameter value, and when each of the query statements is updated, it is determined that each of the to-be-updated charts has completed the parameter update.
[0011] Optionally, the step of determining the associated charts associated with each of the updated charts in each of the primary charts includes:
[0012] The view corresponding to each of the primary charts is obtained, and a target view corresponding to the updated chart is determined in each of the views;
[0013] The query statements in the target view are parsed to determine the correspondence between a plurality of view fields in the target view, a plurality of primary fields in the primary chart, and a plurality of update fields in the updated chart;
[0014] Based on the correspondence, it is determined whether the primary chart and the updated chart are associated, and if associated, the primary chart is taken as an associated chart.
[0015] Optionally, the step of determining whether the primary chart and the updated chart are associated based on the correspondence, and if associated, taking the primary chart as an associated chart includes:
[0016] Based on the correspondence, it is determined whether there is a target primary field in each of the primary fields that is the same as a target update field in each of the update fields;
[0017] If there is, it is determined that the primary chart and the updated chart are associated, and the primary chart is taken as an associated chart.
[0018] Optionally, the step of determining whether the primary chart and the updated chart are associated based on the correspondence, and if associated, taking the primary chart as an associated chart includes:
[0019] The primary dimension corresponding to each of the primary fields and the update dimension corresponding to each of the update fields are obtained;
[0020] Based on the correspondence, it is determined whether there is a target primary dimension in each of the primary dimensions that is the same as a target update dimension in each of the update dimensions;
[0021] If the primary chart and the update chart are associated, the primary chart is determined as an associated chart.
[0022] Optionally, the step of determining whether the primary chart and the update chart are associated based on the correspondence, and if associated, determining the primary chart as an associated chart, comprises:
[0023] Based on the correspondence, a first field name before a logical operator in the primary field and a second field name before a logical operator in the update chart are obtained, and it is determined whether the first field name and the second field name are the same.
[0024] If the first field name and the second field name are the same, it is determined that the primary chart and the update chart are associated, and the primary chart is determined as an associated chart.
[0025] Optionally, the system obtains a unique identifier sent by a third-party application, and before the step of obtaining a target parameter corresponding to the unique identifier in a database of the system, the system comprises:
[0026] The system obtains a preset format parameter sent by a third-party application, parses the preset format parameter to obtain a target parameter, assigns a unique identifier to the target parameter, stores the unique identifier and the target parameter to a database of the system, and sends the unique identifier to the third-party application.
[0027] In addition, to achieve the above object, the application further provides a visual chart query device, which comprises:
[0028] An obtaining module is configured to obtain, by a system, a unique identifier sent by a third-party application, and obtain a target parameter corresponding to the unique identifier in a database of the system.
[0029] A determining module is configured to determine a dashboard in the system and a plurality of to-be-updated charts in the dashboard according to the target parameter, and perform parameter updating on each of the to-be-updated charts according to the target parameter to obtain a plurality of update charts.
[0030] An updating module is configured to obtain primary charts in the dashboard that have not been subjected to parameter updating, determine, in each of the primary charts, an associated chart associated with each of the update charts, and perform parameter updating on each of the associated charts according to a preset linkage mode.
[0031] A display module is configured to place each of the update charts and each of the associated charts that have completed parameter updating on a chart display page in the system for display.
[0032] In addition, to achieve the above object, the application further provides a visual chart query device, comprising a memory, a processor and a visual chart query program stored in the memory and executable on the processor, and the visual chart query program implements the steps of the visual chart query method when executed by the processor.
[0033] In addition, to achieve the above object, the application further provides a computer storage medium, wherein the computer storage medium stores a visual chart query program, and the visual chart query program implements the steps of the visual chart query method when executed by a processor.
[0034] The application obtains the unique identifier sent by the third-party application through the system, and obtains the target parameter corresponding to the unique identifier in the database of the system; determines the dashboard in the system and the plurality of to-be-updated charts in the dashboard according to the target parameter, and performs parameter updating on each of the to-be-updated charts according to the target parameter to obtain a plurality of updated charts; obtains the primary charts in the dashboard which have not been subjected to parameter updating, and determines the associated charts associated with each of the updated charts in each of the primary charts, and performs parameter updating on each of the associated charts according to a preset linkage mode; and places each of the updated charts and each of the associated charts which have completed parameter updating on a chart display page in the system for display. By obtaining the unique identifier sent by the third-party system, and updating each of the to-be-updated charts in the dashboard according to the target parameter corresponding to the unique identifier to obtain updated charts, and determining the associated charts in the dashboard according to the updated charts, and updating the associated charts, and then sending the updated charts and the updated associated charts to the chart display page for display, the user can query the associated charts associated with the chart when querying the chart, and the efficiency of chart query in the system is improved. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is the device structure schematic diagram of the hardware running environment involved in the embodiment scheme of the application;
[0036] Figure 2 is the flowchart of the first embodiment of the visual chart query method of the application;
[0037] Figure 3 is the device module schematic diagram of the visual chart query device of the application;
[0038] Figure 4 is the flowchart of chart query in the visual chart query method of the application.
[0039] The implementation, functional features and advantages of the application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are merely exemplary and do not limit the application.
[0041] As shown in Figure 1 , the device structure of the hardware running environment involved in the embodiment of the application is shown in the figure. Figure 1
[0042] The visual chart query device in the embodiment of the application can be a PC or a server device, and a Java virtual machine runs on the device.
[0043] As shown in Figure 1 , the visual chart query device can include a processor 1001 such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard). The optional user interface 1003 can also include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory) such as a disk memory. The memory 1005 can also be an independent storage device from the aforementioned processor 1001.
[0044] Those skilled in the art can understand that Figure 1 the device structure shown in the figure does not constitute a limitation on the device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0045] As shown in Figure 1 , the memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a visual chart query program.
[0046] In the device shown in Figure 1 , the network interface 1004 is mainly used to connect a background server and communicate data with the background server; the user interface 1003 is mainly used to connect a client (user end) and communicate data with the client; and the processor 1001 can be used to call the visual chart query program stored in the memory 1005 and perform the operations in the following visual chart query method.
[0047] Based on the above hardware structure, the embodiment of the visual chart query method of the application is proposed.
[0048] Reference Figure 2 , Figure 2 The figure is a flowchart of the first embodiment of the visualization chart query method of the present application. The method comprises the following steps:
[0049] In step S10, the system acquires the unique identifier sent by the third-party application and acquires the target parameter corresponding to the unique identifier in the database of the system.
[0050] The parameter can be information copied from the outside for a certain variable, containing the variable name and the value of the variable. The chart can be a form of data display according to the index and dimension, such as a column chart, a pie chart, a line chart, etc. The variable can be a probability that can store and reference a certain value. In this embodiment, it is a certain variable part in the query statement. In this embodiment, the system can be a BI system in the current visualization chart query scheme, mainly including the following levels: data source docking layer: this layer mainly adapts to various data calculation / storage bottom components, so that the query statement can be executed and the result can be returned after being submitted to the corresponding component. Query job layer: this layer packs the structured query statement such as SQL (Structured Query Language) and the corresponding data source information into a job form, submits it to the corresponding execution engine for execution, and manages the progress, state, error and result set information in the life cycle of the job. Model management layer: this layer takes the metadata of a certain data set as the center, maintains the information such as indexes, dimensions and filtering conditions derived from fields, and constitutes a complete model together with the data source. Operation display layer: this layer supports user operations on elements in the model and actual query submission. After waiting for the returned result set, the chart is rendered and displayed. It is often in the form of a web page. That is, after the user defines the SQL in the model management layer and declares the variable and the default value, the variable is referenced in the SQL in the format of ${variable name}. Then in the operation display layer, the value of the specific parameter is declared again in the specific chart configuration. In the query process after opening the report, the query job layer acquires the parameter configuration information in the chart (if not, the default value is used), assigns the variable in the SQL in the model, and submits it to the query engine of each data source for query.
[0051] But the existing technology is difficult to form an effective linkage between charts (according to the current business scenario, after a chart is queried, its display result further affects the display result of related other charts), mainly in the following aspects: the charts do not form a logical structure. After a chart changes, which charts should be affected, how to organize these charts, there is a lack of a reasonable way. Even if the charts are logically associated, it is difficult to associate their queries, the fields between the charts are associated, and there is a lack of an effective definition method. Moreover, different underlying data sources, different query languages, different computing engines, etc. deepen the complexity of these associations. There is a lack of flexible parameter passing method. Chart linkage is effective when external scenarios change, and parameter changes involved in external scenario changes need an efficient way to notify the BI system from the third-party application, but the existing technology often requires users to assign values to parameters on the BI system side, which causes the coupling of third-party applications and BI systems, and the interaction loses flexibility and customization. Moreover, in the existing technology, all parameters need to be declared in advance, and the values of the variables are configured on the operation interface in the name of the user in advance. In the case of no change in configuration, all subsequent user queries will be based on the current configured parameters. When there are a large number of chart query methods similar to each other, only some parameters are different, the existing query method needs to manually update the value of the parameter under manual intervention, which seriously affects the query efficiency. Among them, the parameter passing method is freely customized by the third-party application, as long as the parameters are submitted in a fixed format.
[0052] In the present embodiment, however, the linkage relationship between charts can be defined, and a flexible parameter passing method can be provided to the third party. Among them, the definition of the linkage relationship between charts can be manual definition: above the hierarchy of charts, a Dashboard (instrument panel) hierarchy is added, so that users can put business-related charts into the same instrument panel for unified storage, display and operation. It can also be automatic association: between the data source and the chart, a view layer is added to manage the metadata uniformly, so as to identify the association points between the charts through the metadata information. And the third party can store the parameters in the BI system through the interface and obtain the unique identifier of the parameter group, so that the parameter setting has flexibility, timeliness and reusability, and does not worry that the subsequent parameter setting will cover the previous parameter setting.
[0053] And in this embodiment, the third-party application defines parameters to the BI system in the format of json, that is, the BI system receives the definition of external parameters through an HTTP interface. When receiving the following format of json, parameter analysis will be performed: paramDetails as an array, each element of which can correspond to a chart in a dashboard (dashboardId is associated with a dashboard, and widgetId is associated with a chart); each element contains a variables (variable) array, and an element in the array is a definition of a parameter, in which name is parsed as the name of the parameter, and value is parsed as the specific value of the parameter. For example, take the array of an element as an example, that is, take the json code example:
[0054]
[0055] Parameter description:
[0056] Name Description Parameter Specific Value paramDetails Array \ dashboardId Dashboard ID 166 viewId View ID 774 widgetId Chart ID 609 variables Variable \ name Name Arg key1 value Specific Value argvalue1
[0057] That is, in the parsed parameters, the dashboard ID, view ID, chart ID, name, and specific value, and other parameter information need to be included. After completing the analysis, a UUID (unique identifier) will be randomly generated as the unique identifier of the parameter definition, and the id and json will be stored in the database for subsequent query use, and the UUID will also be returned to the requester in the Response (response, reply). The requester retains the UUID and provides it in the subsequent query request. When the third-party application requests a chart display page from the BI system in the iframe (tag) embedded in its own page, the unique identifier is sent to the BI system (that is, the UUID is passed from the third-party application to the BI system in the form of a URL parameter), and the target parameters corresponding to the unique identifier are obtained from the database of the system according to the unique identifier.
[0058] Step S20, determining the dashboard in the system and a plurality of to-be-updated charts in the dashboard according to the target parameters, and performing parameter updating on each of the to-be-updated charts according to the target parameters to obtain a plurality of updated charts;
[0059] When the target parameter is obtained, the page (i.e. the dashboard) in the system will call the data query interface for each chart. In the query interface, the UUID received by the page URL is submitted as a parameter to the query interface. The backend query interface obtains the corresponding parameter json from the database according to the UUID, performs matching, finds the key-value value of the parameter according to the id of the current dashboard and display, and replaces it in the query statement. (For example, the SQL statement is select*from students where class='${argkey1}', then after the replacement is completed, the actual statement will become select*from students where class='argvalue1'). The backend will submit the SQL to the corresponding query engine for query according to the data source type of the chart, and return the result set to the front end for rendering. That is, each to-be-updated chart will update its own query statement according to the target parameter, and after the update is completed, these to-be-updated charts that have been updated by parameters are taken as updated charts. And in this embodiment, each page corresponds to a dashboard.
[0060] In step S30, the primary charts in the dashboard that have not been updated by parameters are obtained, and the associated charts associated with each of the updated charts are determined in each of the primary charts. The parameters of each of the associated charts are updated according to a preset linkage mode.
[0061] After obtaining the updated charts, the primary charts in the dashboard that have not been updated in parameters need to be queried to determine whether there are charts in these primary charts that are associated with a certain one of the updated charts, and if so, they are taken as associated charts. To identify the association between charts, a transitional view layer can be set between the data source and the chart, a view contains a query statement and the metadata information (table name, field name, field type) of the execution result of the statement, each chart has a corresponding view, and multiple charts can correspond to the same view. Among them, the indicators, dimensions and conditions of the chart all refer to one or more fields as the object, then multiple charts can be associated by analyzing the source of the data by parsing the sql, and the association point can be confirmed by the field referred by the condition. After obtaining the view of each chart and the corresponding relationship of the view, the parameter update of each associated chart can be performed according to the preset linkage mode. The preset linkage mode includes indicator linkage, dimension linkage and parameter linkage. Indicator linkage is to find charts with the same indicator field in the charts of the same view according to the field associated with the indicator, and the association point between each two charts is the part that is repeated. When the query result of the indicator of a certain chart comes out, the range of the value of the result will be used to generate a having (all) statement, which is then put into the query sql statement of the associated chart as an additional limiting condition. Dimension linkage is to find charts with the same dimension field in the charts of the same view according to the field associated with the indicator, and the association point between each two charts is the part that is repeated. When the query result of the indicator of a certain chart comes out, the range of the value of the result will be used to generate a where statement, which is then put into the query sql statement of the associated chart as an additional limiting condition. Since external parameters generally act on the conditions after the logical operators (such as >, <, =, in, etc.) of the where statement. Therefore, parameter linkage is to parse the field name before the logical operator when querying the result of the associated chart, find the corresponding relationship according to the field name, and then apply the same parameter to the query of the associated chart. If the field does not originally exist in the where statement of the associated chart, a similar condition is added and connected with and; if the field originally exists in the where statement of the associated chart, the original condition is replaced with the condition acted on by the current parameter.
[0062] In step S40, each of the updated charts and each of the associated charts that have completed parameter update are placed on a chart display page in the system for display.
[0063] After obtaining each of the updated charts and each of the associated charts that have completed parameter update, they are sent to the chart display page as a result set for display.
[0064] In addition, to help understand the process of parameter application linkage from third-party applications to queries, the following example is provided.
[0065] For example, such as Figure 4 As shown, the system includes a third-party application, a parameter manager, a sharing page, a chart manager, and a query service. The third-party application requests the chart's logical structure from the chart manager. After obtaining the chart's logical structure, it registers parameters with the parameter manager to obtain a unique identifier sent by the parameter manager. It then provides this unique identifier to the sharing page so that the sharing page can retrieve detailed chart information (model, data source, style, etc.) from the chart manager based on the unique identifier. The sharing page then retrieves the parameter details corresponding to the unique identifier from the parameter manager, and finally uses the query service to perform a query based on the parameters and assigned variable values to obtain the result set. The returned result set is then rendered and displayed on the sharing page, and the rendered chart is sent to the third-party application. In other words, when the scenario (i.e., business logic) of a third-party application changes, the application generates parameters based on the scenario and submits them to the BI system's interface via JSON format. The BI system persists these parameters and generates a corresponding UUID, which is then returned to the third-party application. When the third-party application refreshes the chart display page, it passes this UUID to the page. The BI system queries and parses the parameters using the UUID, then replaces the parameters in the query statements for charts within the parameter's scope, performing the initial query. After the initial query, for charts outside the parameter's scope but within the same dashboard, it performs a correlation analysis. For charts with correlation, it modifies the query statements according to the corresponding linkage methods and performs a second query. After both queries, the returned result set is rendered and displayed on the page.
[0066] In the embodiment, a unique identifier sent by a third-party application is acquired by a system, and a target parameter corresponding to the unique identifier is acquired in a database of the system; a dashboard in the system and a plurality of to-be-updated charts in the dashboard are determined according to the target parameter, and each of the to-be-updated charts is updated according to the target parameter to acquire a plurality of updated charts; a primary chart in the dashboard that has not been updated is acquired, and an associated chart associated with each of the updated charts is determined in each of the primary charts, and each of the associated charts is updated according to a preset linkage mode; each of the updated charts and each of the associated charts that have completed the parameter update are placed in a chart display page in the system for display. By acquiring a unique identifier sent by a third-party system, and updating each of to-be-updated charts in a dashboard according to a target parameter corresponding to the unique identifier to acquire updated charts, and determining associated charts in the dashboard according to the updated charts, and updating the associated charts, and sending the updated charts and the updated associated charts to a chart display page for display, a user can query associated charts associated with a certain chart when querying the certain chart, and the efficiency of chart querying in the system is improved.
[0067] Further, based on the first embodiment of the visualization chart querying method, a second embodiment of the visualization chart querying method is provided. The embodiment is a refinement of the step S20 of the first embodiment of the present application, and the step of updating each of the to-be-updated charts according to the target parameter comprises:
[0068] In step a, a query statement in each of the to-be-updated charts is acquired, each of the query statements is updated according to a keyword value of the target parameter value, and when each of the query statements is updated, it is determined that each of the to-be-updated charts has completed the parameter update.
[0069] After the target parameter is obtained, the query statement in the to-be-updated chart needs to be determined, and the query statement is updated through the key value of the target parameter value. That is, the back-end query interface obtains the corresponding parameter json from the database according to the UUID, performs matching, finds the key-value value of the parameter according to the id of the current dashboard and display, and replaces the key-value value in the query statement. (For example, the SQL statement is select * from students where class = '${argkey1}', and after the replacement is completed, the actual statement becomes select * from students where class = 'argvalue1'). Each to-be-updated chart is updated in the same way to update the query statement, and after the query statement of each to-be-updated chart is updated, it can be determined that each to-be-updated chart has completed parameter updating.
[0070] In the embodiment, the query statement in the to-be-updated chart is updated according to the key value of the target parameter value, and when each query statement is updated, it is determined that each to-be-updated chart has completed parameter updating, thereby ensuring the efficiency of parameter updating of the target parameter on each to-be-updated chart.
[0071] Further, the step of determining the associated chart associated with each of the update charts in each of the primary charts comprises:
[0072] Step b: obtaining the view corresponding to each of the primary charts, and determining the target view corresponding to the update chart in each of the views;
[0073] In the embodiment, there is a transition view layer between the data source and the chart. A view contains a query statement and metadata information (table name, field name, and field type) of the execution result of the statement. Each chart has a corresponding view, and multiple charts can correspond to the same view. The indicators, dimensions, and conditions of the chart all refer to each field as an object. Therefore, multiple charts can be associated by analyzing the source of the data by parsing the SQL, and the association point can be confirmed by the field referenced by the condition. Therefore, after obtaining the view corresponding to each of the primary charts, the target view corresponding to the update chart can be determined in each of the views, that is, the target view corresponds to the primary chart and also corresponds to the update chart.
[0074] Step c: parsing the query statement in the target view to determine the correspondence between the multiple view fields in the target view, the multiple primary fields in the primary chart, and the multiple update fields in the update chart;
[0075] The query statement in the target view is parsed to obtain the corresponding relationship of the view field to the source table field, that is, the corresponding relationship between the plurality of view fields in the target view, the plurality of primary fields in the primary graph, and the plurality of update fields in the update graph. And for the SQL without subquery (no nesting, join, union, etc. Operation), the view field is the direct correspondence of the source table field, and the corresponding relationship of both ends is directly returned. For example, select a as A, b, c from xxx (query a, b, and c fields from table xxx, where a is aliased as A); then the corresponding relationship is {A: xxx.a, b: xxx.b; c: xxx.c} (where the view field of the as statement is the alias after as). For the SQL with nested query, through the bracket and the level of the select statement, the multi-layer SQL is identified from the inside to the outside as the 0th layer to the nth layer. First, the corresponding relationship of the 0th layer is parsed, and then the corresponding view field is expanded and replaced layer by layer outward until the outermost view field. For example, select a as A, b, c from (select d as a, e as b, f as c from xxx) (query def fields from table xxx, where d is aliased as a, e is aliased as b, and f is aliased as c, and then query abc fields from the result, where a field is aliased as A); the 0th layer is parsed as {a: xxx.d, b: xxx.e, c: xxx.f}, and then the 1st layer is derived, a is replaced by A, and bc remains unchanged, and the final result is {A: xxx.d, b: xxx.e, c: xxx.f}. For the join operation, it is similar to i, except that the table name of the source table field is the actual table. For example, select a.x, b.y from aaa a left outer join bbb b on a.x = b.y (query x field of a and y field of b from the connection of tables aaa and bbb, where a is aliased as a, b is aliased as b, and when the connection condition is that the value of x field of a is equal to the value of y field of b, x field of a and y field of b are queried); then the mapping relationship is {a.x: aaa.x, b.y: bbb.y}. For the union (union) operation, it is similar to i, except that the first subquery is parsed according to the union statement, and the subsequent statements are ignored.
[0076] Step d, determining whether the primary graph and the update graph are associated based on the corresponding relationship, if associated, the primary graph is taken as an associated graph.
[0077] When the corresponding relationship of the target view is acquired, whether the primary graph and the update graph are associated can be determined according to the corresponding relationship, and if associated, the primary graph can be taken as the associated graph. When there are multiple primary graphs corresponding to the target view and multiple update graphs corresponding to the target view, if there is an association between one of the primary graphs and each of the update graphs, the primary graph can be taken as the associated graph.
[0078] In the embodiment, the accuracy of determining the associated graph is ensured by acquiring the corresponding relationship of the target view and determining the associated graph according to the corresponding relationship.
[0079] Specifically, the step of determining, based on the corresponding relationship, whether the primary graph and the update graph are associated, and if associated, taking the primary graph as the associated graph, comprises:
[0080] In step d1, whether there is a target primary field same as a target update field in each of the update fields is determined based on the corresponding relationship.
[0081] When the corresponding relationship of the target view is acquired, whether there is a target primary field same as a target update field in each of the update fields can be determined according to the corresponding relationship, and if not, the next linkage mode is determined. The target update field is an update field same as a certain primary field in each of the update fields. The target primary field is same as the target update field.
[0082] In step d2, if there is a target primary field, it is determined that the primary graph and the update graph are associated, and the primary graph is taken as the associated graph.
[0083] When it is found that there is a target primary field, it is determined that the primary graph and the update graph are associated, and the primary graph is taken as the associated graph, that is, in the graphs of the same view, according to the fields associated with the indexes, the graphs with the same index fields are found, and the association points between each two graphs are the parts that are repeated. When the query result of the index of a certain graph is obtained, the range of the value of the result will be used to generate a having statement, and then put into the query sql statement of the associated graph as an additional limiting condition.
[0084] In the embodiment, the accuracy of determining the associated graph is ensured by determining that the primary graph is the associated graph when it is determined that there is a target primary field same as a target update field in each of the update fields.
[0085] Specifically, the step of determining, based on the corresponding relationship, whether the primary graph and the update graph are associated, and if associated, taking the primary graph as the associated graph, comprises:
[0086] Step d3, obtaining a primary dimension corresponding to each of the primary fields and an update dimension corresponding to each of the update fields;
[0087] After obtaining the corresponding relationship of the target view, the associated chart can also be determined through dimension linkage, that is, the primary dimensions corresponding to each of the primary fields and the update dimensions corresponding to each of the update fields are obtained first, and then whether there is an associated chart is determined according to the primary dimensions and the update dimensions.
[0088] Step d4, determining whether there is a target primary dimension same as a target update dimension in each of the update dimensions based on the corresponding relationship in each of the primary dimensions;
[0089] After obtaining each of the primary dimensions and the update dimensions, whether there is a target primary dimension same as a target update dimension in each of the update dimensions is determined in each of the primary dimensions based on the corresponding relationship, and if not, the next linkage mode is determined.
[0090] Step d5, if there is, determining that the primary chart and the update chart are associated, and taking the primary chart as the associated chart.
[0091] If there is a target primary dimension, it can be determined that the primary chart and the update chart are associated, and the primary chart can be taken as the associated chart. That is, in the charts of the same view, according to the fields associated with the indicators, the charts with the same dimension fields are found, and the association points between each two charts are the part that is repeated. When the query result of an indicator of a chart is obtained, the range of the value of the result will be used to generate a where statement, which is then put into the query sql statement of the associated chart as an additional limiting condition.
[0092] In this embodiment, by determining that the primary chart is the associated chart when the target primary dimension of the primary field and the target update dimension of the update field are determined to be the same, the accuracy of determining the associated chart is guaranteed.
[0093] Specifically, the step of determining whether the primary chart and the update chart are associated based on the corresponding relationship, and if associated, taking the primary chart as the associated chart, includes:
[0094] Step d6, obtaining a first field name before a logical operator in the primary field and a second field name before the logical operator in the update chart based on the corresponding relationship, and determining whether the first field name and the second field name are the same;
[0095] After the correspondence of the target view is acquired, the associated chart can also be determined through parameter linkage. Since the external parameter generally acts on the condition after the logical operator (such as >, <, =, in, etc.) of the where statement. Therefore, the first field name before the logical operator in the primary field and the second field name before the logical operator in the update chart can be acquired, and then it is judged whether the first field name and the second field name are the same. If they are not the same, the next linkage mode judgment can be performed. And it needs to be explained that when all linkage mode judgments are not qualified, it can be considered that the primary chart and the update chart are not associated.
[0096] Step d7, if they are the same, it is determined that the primary chart and the update chart are associated, and the primary chart is taken as the associated chart.
[0097] When it is found through judgment that the first field name and the second field name are the same, it can be determined that the primary chart and the update chart are associated, and the primary chart can be taken as the associated chart. That is, when the result of querying the associated chart is queried, the field name before the logical operator is parsed, and then the corresponding relationship is found according to the field name, and the same parameter is applied to the query of the associated chart. If the field does not originally exist in the where statement of the associated chart, a similar condition is added and connected with and; if the field originally exists in the where statement of the associated chart, the original condition is replaced with the condition acted by the current parameter.
[0098] In the embodiment, by determining that the first field name and the second field name are the same, the primary chart is determined as the associated chart, which guarantees the accuracy of determining the associated chart.
[0099] Further, the system acquires the unique identifier sent by the third-party application, and before the step of acquiring the target parameter corresponding to the unique identifier in the database of the system, the step includes:
[0100] Step x, the system acquires the preset format parameter sent by the third-party application, parses the preset format parameter to acquire the target parameter, assigns a unique identifier to the target parameter, stores the unique identifier and the target parameter to the database of the system, and sends the unique identifier to the third-party application.
[0101] When the scene of the third-party application changes, the third-party application generates parameters according to the scene, and sends the parameters to the system through a preset format (such as json format). The system parses the parameters to acquire the target parameters, assigns a unique identifier to the target parameters, stores the unique identifier and the target parameters to the database of the system, and sends the unique identifier to the third-party application.
[0102] In the embodiment, a preset format parameter sent by a third-party application is acquired and parsed to obtain a target parameter and a unique identifier, the target parameter and the unique identifier are stored into a database, and the unique identifier is sent to the third-party application, so that a basis is provided for subsequent query of charts by the third-party application.
[0103] The application further provides a visual chart query device, referring to Figure 3 , the visual chart query device comprises:
[0104] An acquisition module is configured to acquire, by a system, a unique identifier sent by a third-party application, and acquire, by the system, a target parameter corresponding to the unique identifier in a database of the system.
[0105] A determination module is configured to determine a dashboard in the system and a plurality of to-be-updated charts in the dashboard according to the target parameter, and perform parameter updating on each of the to-be-updated charts according to the target parameter to obtain a plurality of updated charts.
[0106] An updating module is configured to acquire a primary chart in the dashboard that has not been subjected to parameter updating, determine an associated chart associated with each of the updated charts in each of the primary charts, and perform parameter updating on each of the associated charts according to a preset linkage mode.
[0107] A display module is configured to place each of the updated charts and each of the associated charts that have completed parameter updating on a chart display page in the system for display.
[0108] Optionally, the determination module is further configured to:
[0109] acquire a query statement in each of the to-be-updated charts, update each of the query statements by using a keyword value of the target parameter value, and determine that each of the to-be-updated charts has completed parameter updating when each of the query statements has completed updating.
[0110] Optionally, the updating module is further configured to:
[0111] acquire a view corresponding to each of the primary charts, and determine a target view corresponding to the updated chart in each of the views.
[0112] parse a query statement in the target view to determine a corresponding relationship between a plurality of view fields in the target view, a plurality of primary fields in the primary chart, and a plurality of updated fields in the updated chart.
[0113] determine, based on the corresponding relationship, whether the primary chart and the updated chart are associated, and if so, take the primary chart as an associated chart.
[0114] Optionally, the updating module is further configured to:
[0115] determine, based on the correspondence, whether a target primary field exists in the primary fields and is identical to a target update field in the update fields;
[0116] if the target primary field exists, determine that the primary chart and the update chart are associated, and take the primary chart as an associated chart.
[0117] Optionally, the updating module is further configured to:
[0118] obtain a primary dimension corresponding to each of the primary fields and an update dimension corresponding to each of the update fields;
[0119] determine, based on the correspondence, whether a target primary dimension exists in the primary dimensions and is identical to a target update dimension in the update dimensions;
[0120] if the target primary dimension exists, determine that the primary chart and the update chart are associated, and take the primary chart as an associated chart.
[0121] Optionally, the updating module is further configured to:
[0122] obtain, based on the correspondence, a first field name before a logical operator in the primary fields and a second field name before the logical operator in the update chart, and determine whether the first field name and the second field name are identical;
[0123] if the first field name and the second field name are identical, determine that the primary chart and the update chart are associated, and take the primary chart as an associated chart.
[0124] Optionally, the obtaining module is further configured to:
[0125] the system obtains a preset format parameter sent by a third-party application, parses the preset format parameter to obtain a target parameter, assigns a unique identifier to the target parameter, stores the unique identifier and the target parameter to a database of the system, and sends the unique identifier to the third-party application.
[0126] The method performed by each program module can refer to each embodiment of the visualization chart query method, and will not be described here.
[0127] The application further provides a computer storage medium.
[0128] The computer storage medium of the application stores a visualization chart query program, and the visualization chart query program, when executed by a processor, implements the steps of the visualization chart query method.
[0129] The method realized when the visual chart query program running on the processor is executed can refer to the embodiments of the visual chart query method of the present application, and will not be described here.
[0130] It should be noted that in this document, the terms "comprise", "comprising", or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or system that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed, or inherent to such process, method, article, or system. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article, or system that includes the element.
[0131] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0132] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, an optical disk) as described above, and includes a number of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.
[0133] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for visual chart querying, characterized in that, The visualization chart query method includes the following steps: The system obtains preset format parameters sent by a third-party application, parses the preset format parameters to obtain target parameters, assigns a unique identifier to the target parameters, stores the unique identifier and the target parameters in the system's database, and sends the unique identifier to the third-party application. The system obtains a unique identifier sent by a third-party application and retrieves the target parameter corresponding to the unique identifier from the system's database. The system dashboard and multiple charts to be updated are determined based on the target parameters. The query statements in each chart to be updated are obtained. The keyword values are determined based on the dashboard and the displayed ID. The query statements are updated using the keyword values. When the query statements are updated, it is determined that the parameters of each chart to be updated have been updated, so as to obtain multiple updated charts. The dashboard uniformly stores related charts. Obtain the primary charts in the dashboard that have not been updated with parameters, and determine the associated charts in each primary chart that are associated with each updated chart. Update the parameters of each associated chart according to a preset linkage method. The updated charts and the associated charts with completed parameter updates are displayed on the chart display page of the system. The parameters include dashboard ID, view ID, chart ID, name, and specific value.
2. The visualization chart query method as described in claim 1, characterized in that, The step of determining the associated chart in each of the primary charts that is associated with each of the updated charts includes: Obtain the view corresponding to each of the primary charts, and determine the target view that corresponds to the updated chart in each of the views; The query statement in the target view is parsed to determine the correspondence between multiple view fields in the target view, multiple primary fields in the primary chart, and multiple update fields in the update chart; Based on the correspondence, it is determined whether the primary chart and the updated chart are related. If they are related, the primary chart is used as the related chart.
3. The visualization chart query method as described in claim 2, characterized in that, The step of determining whether the primary chart and the updated chart are associated based on the correspondence, and if associated, then treating the primary chart as the associated chart, includes: Based on the correspondence, determine whether there exists a target primary field in each of the primary fields that is the same as the target update field in each of the update fields; If they exist, the primary chart and the updated chart are determined to be associated, and the primary chart is designated as the associated chart.
4. The visualization chart query method as described in claim 2, characterized in that, The step of determining whether the primary chart and the updated chart are associated based on the correspondence, and if associated, then treating the primary chart as the associated chart, includes: Obtain the primary dimension corresponding to each primary field and the update dimension corresponding to each update field; Based on the correspondence, determine whether there exists a target primary dimension in each primary dimension that is the same as the target update dimension in each update dimension; If they exist, the primary chart and the updated chart are determined to be associated, and the primary chart is designated as the associated chart.
5. The visualization chart query method as described in claim 2, characterized in that, The step of determining whether the primary chart and the updated chart are associated based on the correspondence, and if associated, then treating the primary chart as the associated chart, includes: Based on the correspondence, obtain the name of the first field before the logical operator in the primary field and the name of the second field before the logical operator in the updated chart, and determine whether the first field name and the second field name are the same; If they are the same, then the primary chart and the updated chart are determined to be associated, and the primary chart is designated as the associated chart.
6. A visual chart query device, characterized in that, The visualization chart query device includes: The acquisition module is used to acquire preset format parameters sent by a third-party application, parse the preset format parameters to obtain target parameters, assign a unique identifier to the target parameters, store the unique identifier and the target parameters in the system's database, and send the unique identifier to the third-party application. Obtain the unique identifier sent by the third-party application, and retrieve the target parameter corresponding to the unique identifier from the database of the system; The determination module is used to determine the dashboard and multiple charts to be updated in the dashboard according to the target parameters, obtain the query statements in each chart to be updated, determine the keyword value according to the dashboard and the displayed ID, update each query statement through the keyword value, and determine that each chart to be updated has completed the parameter update when each query statement is updated, so as to obtain multiple updated charts. The dashboard uniformly stores related charts. The update module is used to obtain the primary charts in the dashboard that have not been updated with parameters, determine the associated charts in each primary chart that are associated with each updated chart, and update the parameters of each associated chart according to a preset linkage method. The display module is used to place each of the updated charts and each of the associated charts with completed parameter updates on the chart display page of the system for display. The parameters include dashboard ID, view ID, chart ID, name, and specific value.
7. A visual chart query device, characterized in that, The visualization chart query device includes: a memory, a processor, and a visualization chart query program stored in the memory and executable on the processor. When the visualization chart query program is executed by the processor, it implements the steps of the visualization chart query method as described in any one of claims 1 to 5.
8. A computer storage medium, characterized in that, The computer storage medium stores a visualization chart query program, which, when executed by a processor, implements the steps of the visualization chart query method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Commercial intelligent data query method and system
CN109492056A
Linkage display method and device between components in a chart
CN109582403A