Visual query method and device, electronic device, and storage medium
Patent Information
- Application Number
- CN202611223508.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-30
AI Technical Summary
同时,用户手动配置的分组、聚合、筛选、排序规则往往是数据层约束,而图表展示存在图形层表达规范,二者由用户独立配置、缺乏统一联动机制,极易出现数据计算规则与图形表达规则相互冲突的问题
本申请实施例首先基于通道绑定关系自动完成字段角色归类与属性判定,构建包含列字段、行字段、值字段、几何图形层和坐标系的统一编码模型,从而实现前端可视化配置信息的标准化、结构化存储,解决了传统可视化配置字段角色混乱、图层结构不统一、多坐标系适配复杂的问题,为后续数据计算与图形渲染提供了统一底层模型支撑。
Smart Images

Figure CN123012244A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data analysis technology, and more specifically, relates to a visualization query method and device, electronic device, and storage medium. Background Technology
[0002] Current mainstream visualization query and rendering solutions are all driven by fixed chart types and rely on users manually configuring data calculation rules. When creating visualization charts, users need to manually configure query control rules such as dimension grouping, indicator aggregation, data filtering, and field sorting separately for different chart types, which requires users to have high data modeling capabilities and chart adaptation experience. At the same time, the grouping, aggregation, filtering, and sorting rules manually configured by users are often data-level constraints, while chart display has graphical expression specifications. The two are configured independently by users and lack a unified linkage mechanism, which easily leads to problems such as conflict between data calculation rules and graphical expression rules. For example, the aggregation granularity configured by the user may not match the axis display precision, the filtering conditions may cause the graphical data to break, the sorting rules may destroy the visual hierarchy of layers, and parameters may interfere with each other in multi-layer scenarios. This can lead to problems such as chart rendering errors, missing graphics, and inconsistent display effects. Summary of the Invention
[0003] The purpose of this application is to provide a visualization query method, device, electronic device, and storage medium to improve the intelligence level and chart display effect of visualization queries.
[0004] A first aspect of this application provides a visual query method, including: Based on the user's triggered operation, obtain query configuration information for the data source; the query configuration information includes the target field, the type of the target chart, query control parameters, and the channel binding relationship between the target chart and the target field; Based on the channel binding relationship, each target field is classified and mapped as a column field, row field, or value field. Based on the type of the target chart, the chart rendering rules are determined, and at least one geometric shape layer and a coordinate system bound to each geometric shape layer are generated based on the chart rendering rules. A layer binding relationship is established between each geometric layer and the query control parameter based on the layer matching identifier carried by the query control parameter; For each geometric layer, based on the channel binding relationship and the layer binding relationship, the column field, row field, value field, and query control parameter bound to that geometric layer are determined and used as the target column field, target row field, target value field, and target query control parameter, respectively. The target column field and target row field are used as dimension columns, and the target value field is used as a value column. A calculated column is generated based on the target column field, target row field, target value field, and target query control parameter. The target query control parameter is filtered and pruned to select effective configuration parameters that can be applied to the calculated column, which are then used as effective query control parameters. A calculation unit is constructed based on the dimension column, the value column, the calculated column, and the effective query control parameter. A preset query semantic description template is filled based on at least one of the computing units to obtain a query semantic description. A query against the data source is executed based on the query semantic description to obtain query result data. The query result data is rendered based on the chart rendering rules to obtain query results in chart form.
[0005] A second aspect of this application provides a visual query device, comprising: The configuration information acquisition module acquires query configuration information for the data source based on the user's triggered operation; the query configuration information includes the target field, the type of the target chart, query control parameters, and the channel binding relationship between the target chart and the target field; A unified encoding module is used to classify and map each target field into a column field, row field, or value field based on the channel binding relationship, determine the chart rendering rules based on the type of the target chart, and generate at least one geometric layer and a coordinate system bound to each geometric layer based on the chart rendering rules. The layer binding module is used to establish a layer binding relationship between each geometric layer and the query control parameter based on the layer matching identifier carried by the query control parameter; The calculation unit construction module is used to determine, for each geometric layer, the column field, row field, value field, and query control parameter bound to that geometric layer based on the channel binding relationship and the layer binding relationship, and to use them as the target column field, target row field, target value field, and target query control parameter, respectively; to use the target column field and target row field as dimension columns, and the target value field as value columns; to generate a calculation column based on the target column field, target row field, target value field, and target query control parameter; to filter and prune the target query control parameter to select effective configuration parameters that can be applied to the calculation column, and to use them as effective query control parameters; and to construct a calculation unit based on the dimension column, value column, calculation column, and effective query control parameter. The data query module is used to fill a preset query semantic description template based on at least one of the computing units to obtain a query semantic description, and to execute a query against the data source based on the query semantic description to obtain query result data. The chart rendering module is used to render the query result data based on the chart rendering rules to obtain the query results in chart form.
[0006] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above-described visualization query method.
[0007] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described visualization query method.
[0008] A fifth aspect of this application provides a computer program product, including a computer program or computer executable instructions, wherein when the computer program or computer executable instructions are executed by a processor, the steps of the above-described visualization query method are implemented.
[0009] The beneficial effects of the visualization query method and apparatus, electronic device, and storage medium provided in this application embodiment are as follows: This application embodiment first automatically completes field role classification and attribute determination based on channel binding relationship, and constructs a unified coding model including column field, row field, value field, geometric shape layer and coordinate system, thereby realizing the standardized and structured storage of front-end visual configuration information, solving the problems of chaotic field roles, inconsistent layer structure and complex multi-coordinate system adaptation in traditional visual configuration, and providing a unified underlying model support for subsequent data calculation and graphics rendering.
[0010] Based on this, this embodiment constructs an independent calculation unit for each geometric layer, encapsulates the dimension column, value column, derived calculation column, and filtered valid query parameters, and automatically completes grouping, aggregation, derived calculation, and parameter pruning without requiring users to manually configure calculation rules, thereby reducing the threshold for visualization analysis.
[0011] Furthermore, this embodiment generates compliant query semantics and executes data source queries based on the calculation unit filling a preset query semantic description template. This enables the generalization and template-based nature of data query logic, avoiding the defects of inconsistent query logic, error-proneness, and the need for adaptation development in different chart types, coordinate systems, and geometric layers. This significantly improves the universality and stability of data queries.
[0012] Finally, the query results are rendered using chart rendering rules to obtain the query results in chart form.
[0013] In summary, the embodiments of this application construct a standardized hierarchical transformation link of "unified coding model → calculation unit → query specification → rendering specification". Users can achieve efficient and accurate chart generation by simply dragging and dropping fields and selecting chart types, thereby improving the intelligence level and display effect of visualization query. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating a visualization query method provided in an embodiment of this application; Figure 2 A flowchart illustrating a visualization query method provided in another embodiment of this application; Figure 3 This is a structural block diagram of a visualization query device provided in an embodiment of this application; Figure 4 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0016] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0017] Existing visualization systems are built around various chart types, with each chart requiring separate development of data query, aggregation, and rendering logic, resulting in significant redundancy in the underlying code. Furthermore, as the types of charts, such as bar charts, heatmaps, and maps, increase, the development workload rises linearly, making overall architecture expansion difficult. In addition, existing technologies require writing a separate set of data-to-location mapping code for each coordinate system; adding new coordinate systems necessitates repeated development, leading to high maintenance costs.
[0018] To address the aforementioned technical problems, this application provides a visual query method that achieves the following technical effects: (1) This embodiment provides an interactive mechanism that automatically infers and generates query semantics by dragging and dropping field roles, so that users can correctly generate graphs without manually writing queries, thereby reducing the threshold and error rate.
[0019] (2) In this embodiment, the calculation units are first split according to the geometric layer, and then the duplicates are merged and deduplicated by dimension column. This can merge the repeated requests of multiple charts into a single backend query, thereby avoiding repeated aggregation operations, effectively reducing the number of queries and shortening the response time.
[0020] (3) In this embodiment, the multi-coordinate system mapping method enables the rectangular coordinate system and the polar coordinate system to share the same primitives and coordinate axis specifications, and to be distinguished only by coordinate system parameters. The coordinate transformation is also carried out, so that a set of data can be reused in multiple coordinate systems. The richness of chart types is achieved by expanding primitives.
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.
[0022] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a visualization query method provided in an embodiment of this application. The method can be executed by an electronic device and includes: S101: Based on the user's triggered operation, obtain the query configuration information for the data source; the query configuration information includes the target field, the type of the target chart, the query control parameters, and the channel binding relationship between the target chart and the target field.
[0023] In this embodiment, users can perform a series of operations in the visual configuration interface, such as dragging and dropping fields, selecting chart types, setting filter sorting, adjusting coordinate axes and styles. After the configuration is completed, users can click a trigger button (e.g., the "Generate Chart" button). When the electronic device receives the click event of the trigger button, it determines that it is a user's trigger operation, and at this time, the user's above configuration information is saved as query configuration information.
[0024] The target fields are the dimension fields and / or indicator fields selected by the user from the data source, which are the original foundational fields for subsequent data analysis and calculations. The target chart type is the type of visualization chart selected by the user, including bar charts, line charts, maps, or detail tables. The query control parameters include various data control parameters and visual control parameters configured by the user, such as filter conditions, sorting rules, conditional formatting, layer binding identifiers, or reference line styles. The channel binding relationship is the mapping relationship formed by the user dragging and binding the selected target fields to various visual channels of the target chart, such as dragging the sales field to the vertical axis channel, dragging the time field to the horizontal axis channel, and binding the region field to the color channel.
[0025] S102: Based on the channel binding relationship, classify and map each target field as a column field, row field or value field, determine the chart rendering rules based on the type of the target chart, and generate at least one geometric layer and a coordinate system bound to each geometric layer based on the chart rendering rules.
[0026] In this embodiment, based on the aforementioned channel binding relationships, fields bound to the horizontal axis channel can be uniformly categorized as column fields, fields bound to the vertical axis channel can be uniformly categorized as row fields, and metric fields bound to visual channels such as color, size, and tooltip channels can be uniformly categorized as value fields. Simultaneously, during field categorization, the discrete / continuous attributes of a field can be determined based on its data type and aggregation method. For example, detail fields are categorized according to their original data type; aggregated fields are categorized as continuous attributes by default. However, if the aggregation method involves special cases such as taking the first or last item of text, taking the earliest or latest date, the field is classified as a discrete attribute. This determination of discrete / continuous attributes provides a basis for subsequent coordinate axis scale calculations and data mapping rendering.
[0027] Meanwhile, different chart types have different chart rendering rules. The corresponding chart rendering rules can be determined based on the type of the target chart, and one or more independent geometric layers can be generated based on the chart rendering rules to draw various graphic elements such as lines, bars or reference lines. The chart rendering rules also predefine the coordinate system system that is compatible with the target chart. Based on this, a rectangular coordinate system, a polar coordinate system or a geographic coordinate system can be constructed, and each coordinate system can be bound to the corresponding geometric layer one by one to complete the value axis configuration simultaneously.
[0028] Furthermore, the column fields, row fields, value fields, geometric layers, and coordinate systems bound to each geometric layer obtained in the above steps can be integrated into a unified coding model instance for subsequent data queries.
[0029] S103: Establish the layer binding relationship between each geometric layer and the query control parameters based on the layer matching identifier carried by the query control parameters.
[0030] In this embodiment, when the user sets control parameters such as filtering conditions, sorting rules, reference line styles, and conditional formatting for different charts in the visual configuration interface, the electronic device will automatically generate a unique layer matching identifier (which can be in the form of a string, number, etc.) for each set of independently configured query control parameters, and embed the layer matching identifier into the query control parameters of this set.
[0031] Based on this, encoding comparison can be performed according to layer matching identifiers to bind each set of query control parameters to the corresponding geometric layer, achieving isolation between personalized data rules across multiple layers. For example, when a large screen contains multiple geometric layers such as line charts, bar charts, and tables, each geometric layer can be configured with completely different filtering and sorting rules. Query control parameters are assigned to the corresponding geometric layer according to the binding relationship, avoiding parameter confusion and rule overlap conflicts. Therefore, this embodiment, by establishing layer binding relationships, can solve the pain point of difficulty in distinguishing and managing multiple sets of data rules in mixed chart scenarios.
[0032] S104: For each geometric layer, determine the column field, row field, value field, and query control parameter bound to that geometric layer based on the channel binding relationship and layer binding relationship, and use them as the target column field, target row field, target value field, and target query control parameter, respectively; use the target column field and target row field as dimension columns, and the target value field as value column; generate calculated columns based on the target column field, target row field, target value field, and target query control parameter; filter and prune the target query control parameter to select the effective configuration parameters that can be applied to the calculated column, and use them as effective query control parameters; construct a calculation unit based on the dimension column, value column, calculated column, and effective query control parameter.
[0033] In this embodiment, for each geometric layer, the column fields, row fields, value fields, and query control parameters bound to that geometric layer can be filtered according to the aforementioned channel binding relationships and layer binding relationships, and respectively used as target column fields, target row fields, target value fields, and target query control parameters. Based on this, the field roles can be further categorized. Specifically, the target column fields and target row fields are merged and collectively referred to as dimension columns (dimensional data used for grouping, categorization, and axis display), and the target value fields are defined as value columns (metric data used for aggregation operations such as summation, counting, and averaging), facilitating subsequent unified aggregation, querying, and calculation optimization.
[0034] Furthermore, the target query control parameters encapsulate user-configured aggregation methods, conditional judgments, time comparisons, and field arithmetic operations, among other calculation logic. Data is grouped based on target column and row fields. Within each group, the aforementioned calculation logic is invoked to perform operations such as summation, averaging, threshold segmentation, and year-on-year / month-on-month calculations on the target value field. The results generate entirely new fields, which are then used as the calculated columns. This process automatically completes field partitioning and derived calculations based on channel and layer binding relationships, eliminating the need for users to manually fill in aggregation and grouping rules, thus lowering the barrier to entry.
[0035] Furthermore, considering that the target query control parameters include data operation parameters and purely visual style parameters, where data operation parameters are mainly used for data filtering, sorting, aggregation granularity, and conditional calculation rules, and can be applied to fields and calculated columns, participating in data queries and numerical calculations; and purely visual style parameters including axis color schemes, line thickness, font size, legend layout, and reference line appearance, these parameters only control the front-end display and do not participate in back-end data calculations, we can filter and prune the target query control parameters to eliminate invalid parameters that only control visual styles and select effective configuration parameters that can be applied to calculated columns, i.e., effective query control parameters.
[0036] Finally, the dimension columns, value columns, calculated columns, and the pruned valid query control parameters are encapsulated as an independently schedulable calculation unit. Each geometric layer corresponds to a dedicated calculation unit, which encapsulates all the fields, calculation rules, and data filtering constraints required by that geometric layer. It can serve as the minimum scheduling carrier for visual data analysis.
[0037] S105: Fill the preset query semantic description template based on at least one computing unit to obtain the query semantic description, execute the query against the data source based on the query semantic description, and obtain the query result data.
[0038] In this embodiment, the preset query semantic description template has multiple reserved fill positions for modules such as grouping fields, aggregation metrics, derived calculation fields, filtering conditions, sorting rules, and data row limits. Based on this, the contents of the calculation unit are embedded into the corresponding empty positions in the query semantic description template. This eliminates the need for users to manually write query statements or configure grouping and aggregation conditions, allowing for the generation of a complete and compliant query semantic description. For example, the dimension column in the calculation unit is used to fill the grouping area, the value column and calculation column are used to fill the aggregation operation area, and the valid query control parameters (filtering and sorting rules) are used to fill the query condition area.
[0039] Subsequently, based on the obtained query semantic description, a data retrieval or aggregation calculation request is initiated to the underlying data source, and the query result data returned by the data source can be obtained.
[0040] S106: Render the query result data based on the chart rendering rules to obtain the query results in chart form.
[0041] In this embodiment, the query result data is a two-dimensional structured dataset that is output in a regularized manner according to dimension columns, value columns, and calculated columns. By matching the query result data with the row and column fields pre-bound to each geometric shape layer, that is, the dimension columns correspond to the coordinate axis classification scale, and the value columns and calculated column values correspond to visual measurements such as graphic height, length, and color block size, the binding relationship configured by the user through field dragging can be completely restored. At the same time, based on the discrete / continuous attributes of the fields and in conjunction with the coordinate system rules, the maximum and minimum values of the coordinate axes, segmented scales, etc. can be automatically calculated to adapt to the data range of the query result data.
[0042] As can be seen from the above, this embodiment first automatically completes the classification of field roles and attribute determination based on the channel binding relationship, and constructs a unified coding model that includes column fields, row fields, value fields, geometric layers and coordinate systems, thereby realizing the standardized and structured storage of front-end visual configuration information. This solves the problems of chaotic field roles, inconsistent layer structures and complex multi-coordinate system adaptation in traditional visual configuration, and provides a unified underlying model support for subsequent data calculation and graphics rendering.
[0043] Based on this, this embodiment constructs an independent calculation unit for each geometric layer, encapsulates the dimension column, value column, derived calculation column, and filtered valid query parameters, and automatically completes grouping, aggregation, derived calculation, and parameter pruning without requiring users to manually configure calculation rules, thereby reducing the threshold for visualization analysis.
[0044] Furthermore, this embodiment generates compliant query semantics and executes data source queries based on the calculation unit filling a preset query semantic description template. This enables the generalization and template-based nature of data query logic, avoiding the defects of inconsistent query logic, error-proneness, and the need for adaptation development in different chart types, coordinate systems, and geometric layers. This significantly improves the universality and stability of data queries.
[0045] Finally, the query results are rendered using chart rendering rules to obtain the query results in chart form.
[0046] Therefore, this embodiment constructs a standardized hierarchical transformation link of "unified coding model → calculation unit → query specification → rendering specification". Users can achieve efficient and accurate chart generation by simply dragging and dropping fields and selecting chart types, thereby improving the intelligence and display effect of visualization query.
[0047] In one embodiment of this application, for each geometric layer, a calculated column for that geometric layer is generated based on the target column field, target row field, target value field, and target query control parameters, including: Determine the base fields and user-defined calculated fields from the target column field, target row field, and target value field. The base fields are the fields in the target column field, target row field, and target value field other than the calculated fields. For each calculated field, parse the calculated field into a column of calculation formulas; For each basic field, the basic field is encapsulated into a standard calculated column with metadata; the basic fields are the target column field, target row field, and target value field, excluding the calculated fields. Based on the target query control parameters, the reference line configuration information and conditional formatting configuration information of the geometric layer are determined. The reference line configuration information is parsed into a reference formula column, and the conditional formatting configuration information is parsed into a conditional formatting column. The calculation formula column, standard calculation column, reference formula column, and conditional formatting column are used as the calculation columns for this geometry layer.
[0048] In this embodiment, the target column field, target row field, and target value field typically include native basic fields (ordinary fields) from the data source and user-defined fields. For each basic field, it can be converted into a standard calculated column based on its metadata. The standard calculated column carries necessary data information {physical column name, type, grouping method, aggregation method, and secondary calculation method}. For each calculated field, its internal calculation logic, the dependencies between participating fields, and the calculation priority can be parsed and converted into a calculation formula column. The calculation formula column fully stores configuration information such as the calculation expression, the identifiers of the participating fields, the data type of the calculation result, and the scope of the calculation.
[0049] Simultaneously, reference line configuration rules and conditional formatting configuration information can be extracted from the target query control parameters. Based on this, aggregate functions, applicable fields, and numerical thresholds are parsed according to the reference line configuration rules and converted into a reference formula column. The reference formula column stores information such as aggregate operation functions, bound fields, reference line value logic, and layer scope. Similarly, the conditional formatting judgment conditions, interval thresholds, and style mapping rules in the conditional formatting configuration information can be read and parsed into a conditional formatting column. The conditional formatting column records configuration content such as numerical interval judgment rules, matching styles, effective fields, and rendering priorities.
[0050] The above-mentioned standard calculation column, calculation formula column, reference formula column, and conditional formatting column together constitute all the calculation columns required for the current geometry layer.
[0051] In one embodiment of this application, filling a preset query semantic description template based on at least one computing unit includes: If there are multiple computation units, the merging operation is performed multiple times until all computation units are traversed to obtain the first set of computation units; If there is only one computing unit, then that single computing unit is taken as the first set of computing units; Discard the valid query control parameters of each computing unit in the first computing unit set, extract the global query control parameters from the query control parameters, and write the global query control parameters into each computing unit of the first computing unit set to obtain the second computing unit set; The preset query semantic description template is filled based on the second set of computing units; The steps involved in the merging operation include: Select one computing unit from those computing units that have never participated in the merging operation as the current computing unit; If there exists a computation unit in the first computation unit set whose dimension column is exactly the same as the current computation unit, then the computation unit in the first computation unit set is taken as the matching computation unit, the union of the value column of the current computation unit and the value column of the matching computation unit is calculated, the value column of the matching computation unit is updated to the union, and the identifier of the current computation unit is merged into the identifier set of the matching computation unit. If there is no computation unit in the first set of computation units that has the same dimension column as the current computation unit, then the current computation unit is added to the first set of computation units.
[0052] In this embodiment, when filling a preset query semantic description template based on at least one computing unit, if there are multiple computing units, they can be merged and deduplicated first. Filling the preset query semantic description template with the merged and deduplicated computing units allows for the merging of multiple data query requests, reducing the number of accesses to the underlying data source and improving overall data query efficiency. If there is only one computing unit, there is no need to merge and deduplicatize the computing units.
[0053] Specifically, when constructing each computational unit, an identifier for each computational unit is generated synchronously. When merging and deduplicating multiple computational units, all computational units can be traversed, and the merging operation can be executed multiple times to achieve the merging and deduplication of multiple computational units. During each merging operation, one computational unit can be randomly selected from those that did not participate in the merging operation as the current computational unit. The current computational unit is compared with existing computational units in the first computational unit set. If a computational unit with the same dimension column as the current computational unit exists in the first computational unit set (i.e., a matching computational unit), the identifier of the current computational unit is merged into the identifier set of the matching computational unit. Simultaneously, the union of the value columns of the current computational unit and the matching computational unit is calculated and updated in the matching computational unit, achieving merged storage and merged querying of multiple indicators under the same dimension. If no computational unit with the same dimension column as the current computational unit exists in the first computational unit set, the current computational unit is directly added to the first computational unit set. Through the above multiple merging operations, all computational units with consistent dimension structures can be merged into one, thereby significantly reducing the total number of computational units in the first computational unit set.
[0054] Among them, the merging and deduplication operation of the above-mentioned multiple computing units can be merged uniformly after all computing units are generated, or it can be merged incrementally during the construction of computing units. That is, when a new computing unit is generated, it is immediately checked and compared with all the historical computing units that are currently cached and retained. If the condition of the same dimension column is met, then the merge is performed.
[0055] Furthermore, to eliminate the differences in filtering conditions among multiple computing units in the first computing unit set and ensure that the same set of constraints is used to query the underlying data source subsequently, this embodiment discards all valid query control parameters (layer personalized filtering, sorting conditions) corresponding to all computing units, extracts global query control parameters (common filtering conditions shared by the entire large screen) from the original query control parameters, and uniformly writes the global query control parameters into each computing unit of the first computing unit set to obtain the second computing unit set. The dimension columns, value columns, calculated columns, and global query control parameters in the second computing unit set are then filled into a preset query semantic description template, concatenated to generate a query semantic description, and a unified query is initiated to the data source based on this query semantic description.
[0056] In one embodiment of this application, when generating a calculated column based on the target column field, target row field, target value field, and target query control parameters, a field mapping relationship between the virtual field identifier carried in the global query control parameters and the real field ID of the corresponding calculated column is constructed simultaneously. The process of filling a preset query semantic description template based on the second set of computing units includes: For each calculation unit in the second set of calculation units, assign corresponding type labels to the calculation formula column, standard calculation column, reference formula column, and conditional formatting column of that calculation unit; Extract the sorting rule control parameters, filtering condition control parameters, and conditional formatting configuration parameters from the global query control parameters and use them as the original query control parameters; Based on the field mapping relationship, the virtual field identifiers in the original query control parameters are replaced with the real field IDs of the corresponding calculated columns to obtain standardized query control parameters; The calculation type of each calculation unit is determined based on its dimension and value columns; calculation types include crosstabs, detail tables, and grouped tables. The preset query semantic description template is filled based on the type labels, standardized query control parameters, calculation types, dimension columns, and calculation columns corresponding to each calculation unit.
[0057] In this embodiment, when filling the preset query semantic description template based on the second set of calculation units, corresponding type labels are assigned to the calculation formula column, standard calculation column, reference formula column and condition format column of each calculation unit. This can distinguish the field purpose and operation logic. The type labels are filled into the preset query semantic description template. In subsequent queries, the assembly position and operation priority of different fields can be identified according to the type labels, avoiding confusion in the arrangement of fields with different functions and causing query semantic errors.
[0058] Meanwhile, sorting rule control parameters, filtering condition control parameters, and condition format configuration parameters are extracted from the global query control parameters and used as the original query control parameters. The field identifiers in the original query control parameters are all virtual field identifiers configured on the front end, which cannot be recognized by the database. Therefore, the pre-built field mapping relationship can be retrieved to replace all the virtual field identifiers in the original query control parameters with the real field IDs corresponding to the calculated columns, thereby generating standardized query control parameters that can be recognized and parsed by the database.
[0059] Furthermore, considering that different calculation types such as grouping tables (adapting to chart types such as bar charts, line charts, area charts, pie charts, donut charts, radar charts, funnel charts, etc.), cross tables (adapting to chart types such as stacked bar charts, heatmaps, matrix tables, dual-axis combination charts, multi-dimensional comparison line charts, etc.) and detail tables (adapting to chart types such as data detail tables, original list lists, map point distribution maps, etc.) correspond to different query statement (e.g., SQL statement) assembly logic and grouping aggregation rules, this embodiment automatically classifies the corresponding calculation type based on the combination structure of the dimension columns and value columns of each calculation unit.
[0060] Finally, the computed column type label, standardized query control parameters, compute type, dimension column, and all computed column information of each compute unit are uniformly filled into the preset query semantic description template. The template retrieves the corresponding assembly branch according to the compute type, arranges the field order and nested operation logic in combination with the field type label, and finally generates a standardized query semantic with a standardized structure that can be executed directly.
[0061] In one embodiment of this application, the valid query control parameters to be discarded are pre-stored before discarding the valid query control parameters of each computing unit in the first computing unit set. The rendering of query results data based on chart rendering rules includes: The query result data is split based on the identifier of each computing unit to obtain the query result data corresponding to each computing unit; For each computing unit, the query result data corresponding to the computing unit is subjected to secondary filtering and sorting based on the pre-stored valid query control parameters of the computing unit to obtain the secondary processed query result data; The query result data after secondary processing corresponding to each calculation unit is rendered based on the chart rendering rules.
[0062] In this embodiment, after obtaining the query result data, the query result data can be split based on the identifier of each computing unit to divide the query result data exclusive to each computing unit. Furthermore, for each computing unit, the previously stored valid query control parameters exclusive to that computing unit can be read, and secondary filtering and reordering operations can be performed on the query result data in the front-end memory to restore the personalized sorting and local filtering rules that the user initially set for each chart individually.
[0063] The secondary processed datasets are bound to the corresponding geometric layers, and the visualization rendering is completed sequentially according to the unified chart rendering rules. All charts can display data according to user-defined rules, thereby ensuring that the personalized display effect of multiple charts on the front end is not affected by the merge query while improving query efficiency through merge queries.
[0064] In related technologies, the rendering and calculation modules are not clearly and effectively separated during the construction of visual charts. During chart configuration adjustments, whenever a user modifies any visualization configuration such as filter conditions, sorting methods, or style parameters, a data query request is repeatedly sent to the database. Each request involves repeated grouping and aggregation calculations, resulting in wasted computing power and high response latency. This embodiment performs data queries and aggregation calculations uniformly at the underlying level. The front end only performs secondary processing (filtering and sorting) on the unified data query results, avoiding repeated queries and aggregation calculations and reducing chart loading response latency.
[0065] In one embodiment of this application, for each computing unit, the secondary processed query result data corresponding to that computing unit is rendered based on chart rendering rules, including: The secondary processed query result data is formatted to obtain the formatted query result data. Based on the channel binding relationship and the formatted query result data, generate the primitive specification of the geometric graphics layer corresponding to the computing unit; The coordinate system specification generation logic is determined based on the coordinate system corresponding to the computing unit; the coordinate system corresponding to the computing unit is the coordinate system bound to the geometric layer corresponding to the computing unit. The coordinate system specification generation logic is invoked, and the corresponding default coordinate system configuration is loaded based on the chart rendering rules to generate the coordinate system specification. Based on the channel binding relationship, determine the field information bound to the horizontal axis channel and the vertical axis channel respectively, and generate the coordinate axis configurations corresponding to the horizontal axis and the vertical axis respectively; The formatted query result data corresponding to this calculation unit is rendered based on the primitive specification, coordinate system specification, and coordinate axis configuration.
[0066] In this embodiment, the query results after secondary processing are first uniformly formatted to ensure a consistent data format. Then, for each geometric layer, the formatted data is integrated according to preset channel binding relationships to generate a unified primitive specification for that geometric layer, uniformly controlling all visual styles such as color, size, labels, and tooltips. Simultaneously, the pre-bound coordinate system type for that geometric layer is retrieved for split processing. Specifically, the Cartesian and polar coordinate systems reuse the same coordinate system generation logic, while the geographic coordinate system uses independent adaptation logic. The default basic coordinate system configuration is loaded and combined with user-defined parameters to generate a complete coordinate system specification. Then, based on the horizontal and vertical axis channel binding fields, coordinate axis scales and label configurations are constructed respectively. Finally, the three sets of specification rendering data—primitives, coordinate systems, and coordinate axes—are integrated.
[0067] This embodiment completes layer drawing based on a unified standard system. One process can be adapted to all charts, avoiding the drawbacks of repeated development according to chart type in the existing technology. The architecture has stronger scalability and is also convenient for unified optimization of the underlying data calculation logic.
[0068] In one embodiment of this application, rendering the formatted query result data corresponding to the calculation unit is performed based on primitive specifications, coordinate system specifications, and coordinate axis configuration, including: The formatted query result data is padded with null values to obtain the padded query result data. Obtain browser environment information, and based on the browser environment information, complete the primitive specifications, coordinate system specifications, and coordinate axis configurations respectively; Based on the completed primitive specifications, the completed coordinate system specifications, and the completed coordinate axis configuration, the completed query result data corresponding to the calculation unit is rendered.
[0069] In this embodiment, since the formatted query results data does not include virtual dimension fields such as indicator names and contains various null values, data integrity compensation is required before chart rendering. This involves actively supplementing empty virtual dimension data columns and uniformly formatting null values and abnormal special values to obtain the completed query results data, ensuring the integrity of the plotted data structure and the uniformity of the numerical format. Simultaneously, relevant parameters of the current browser environment are read, and adaptation parameters in the primitive specifications, coordinate system specifications, and coordinate axis configurations are improved and supplemented based on environmental characteristics to eliminate rendering differences caused by different browsers, forming a complete set of rendering standards adapted to the current operating environment. Finally, based on the completed query results data and the complete set of adapted rendering standards, chart visualization is executed, outputting a visual chart with a unified display effect and stronger compatibility.
[0070] The following two specific examples illustrate the processing flow of the visualization query method in this embodiment.
[0071] Example 1: Dual-axis "column + line" combination diagram - splitting and merging calculation units; Suppose a user drags in the dimension field "Region", the measure fields "Sales Revenue" (bars) and "Profit Margin" (line), and selects a dual-axis chart. The processing procedure is as follows: (1) “Region” is the dimension by default (grouping = by value), “sales” and “profit margin” are the measures by default (aggregation = sum / average); the two measures belong to the primary axis and the secondary axis respectively, and are written into different value axis buckets; two geometric layers (interval column, line) are generated according to the number of measures.
[0072] (2) Divide the data into two calculation units based on two geometric layers: Unit A {dimension column: region; value column: sales revenue}, and Unit B {dimension column: region; value column: profit margin}.
[0073] (3) Both unit dimension sets are {region}, and the bidirectional set difference is empty, so it is determined that they can be merged; keep the dimensions unchanged, take the union of the measures to get {sales amount, profit margin}, merge them into one calculation unit, and the original two group queries are reduced to one query.
[0074] (4) Convert to query specification and execute to obtain a result dataset with “region” as the grouping key and containing two columns: sales amount and profit margin.
[0075] (5) The coordinate system is rectangular coordinate, generating two primitive specifications: column and line; sales revenue and profit margin belong to different value axis buckets, each generating a value axis (primary axis / secondary axis, placed on the left and right sides), realizing dual axes.
[0076] (6) After supplementing the remaining undefined configurations (the bars are blue by default and the lines are green by default), the underlying rendering kernel is used to draw the graph to obtain the dual-axis combined graph.
[0077] Example 2: Switching between rectangular and polar coordinates for the same dataset—multi-coordinate system mapping; Following the "Region / Sales" section of use case 1, the user switches the chart type from a bar chart to a pie chart: (1) The reverse flattening of the encapsulated chart layer sets "region" as the angle channel and "sales" as the radius channel, and switches the coordinate system from rectangular to polar coordinates. The geometry type remains interval, and the unified coding model and calculation unit do not need to be changed.
[0078] (2) The specifications for marks and axes remain unchanged, only the specifications for the coordinate system are changed from "type only" to inject {start angle = 0, end angle = 360, inner radius, outer radius, angle shape}.
[0079] (3) The underlying rendering kernel maps "region" to an angle and "sales amount" to a radius in the same (region, sales amount) data and performs a triangulation. The stacked bars that were originally laid out along right angles are now laid out along angles to fill 360° to become a pie chart. The nice rounding of the value axis is disabled for polar coordinates to ensure that the sector fills the entire circle. No new position mapping code is written in the whole process.
[0080] In summary, the visualization query method proposed in this embodiment builds a complete visualization workflow based on graphical grammar. Its core design principle is: Chart = Visual Channel + Geometric Markers + Coordinate System, such as... Figure 2As shown, this design principle runs through all steps from user interaction to final chart generation. Users only need to complete the initial operation (step ①), and the rest of the steps (②~④) are all executed automatically.
[0081] At the user interface, users complete the configuration by dragging and dropping target fields and selecting chart types. The system automatically encapsulates chart admission rules, default styles, and performs reverse flattening preprocessing. The encoding model, as the carrier of the overall visualization design, is used to establish the mapping and binding between target fields and visual channels. At the same time, it infers the role of fields based on field attributes and determines the data calculation rules for subsequent grouping and aggregation. On this basis, by splitting the calculation tasks, each geometric layer corresponds to an independent calculation unit. For calculation units with completely identical dimension columns, merging and deduplication are performed to achieve multi-chart merged queries, avoid repeated aggregation operations, and reduce computing power consumption. Furthermore, the calculation tasks are uniformly transformed into executable data query instructions, sent to the database for execution, and the query result data is received and returned. Then, based on the rendering specification, the adaptation mapping of Cartesian coordinate system, polar coordinate system, and geographic coordinate system is completed, generating a complete set of drawing standards for primitives, coordinate systems, and coordinate axes. The front end performs data completion, browser compatibility adaptation, and other compensation processing to fill rendering gaps. Finally, the underlying rendering kernel completes the drawing according to the complete set of rendering specifications and outputs the final visualization chart.
[0082] Corresponding to the visualization query method in the above embodiments, Figure 3 This is a structural block diagram of a visualization query device provided according to an embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. References Figure 3 The visualization query device 20 includes: a configuration information acquisition module 21, a unified encoding module 22, a layer binding module 23, a calculation unit construction module 24, a data query module 25, and a chart rendering module 26.
[0083] Among them, the configuration information acquisition module 21 acquires the query configuration information for the data source based on the user's trigger operation; the query configuration information includes the target field, the type of the target chart, the query control parameters, and the channel binding relationship between the target chart and the target field; The unified encoding module 22 is used to classify and map each target field into a column field, row field or value field based on the channel binding relationship, determine the chart rendering rules based on the type of the target chart, and generate at least one geometric layer and a coordinate system bound to each geometric layer based on the chart rendering rules. Layer binding module 23 is used to establish a layer binding relationship between each geometric layer and the query control parameters based on the layer matching identifier carried by the query control parameters; The calculation unit construction module 24 is used to determine, for each geometric layer, the column fields, row fields, value fields, and query control parameters bound to that geometric layer based on channel binding relationships and layer binding relationships, and to use them as target column fields, target row fields, target value fields, and target query control parameters, respectively; to use the target column fields and target row fields as dimension columns, and the target value field as value columns; to generate calculated columns based on the target column fields, target row fields, target value fields, and target query control parameters; to filter and prune the target query control parameters to select valid configuration parameters that can be applied to the calculated columns, and to use them as valid query control parameters; and to construct calculation units based on the dimension columns, value columns, calculated columns, and valid query control parameters. The data query module 25 is used to fill a preset query semantic description template based on at least one computing unit to obtain a query semantic description, and to execute a query against the data source based on the query semantic description to obtain query result data. The chart rendering module 26 is used to render the query result data based on the chart rendering rules to obtain the query results in chart form.
[0084] In one embodiment of this application, for each geometric layer, the calculation unit construction module 24 is specifically used to: determine the basic field and the user-defined calculation field from the target column field, the target row field and the target value field, wherein the basic field is the field other than the calculation field among the target column field, the target row field and the target value field; For each calculated field, parse the calculated field into a column of calculation formulas; For each basic field, the basic field is encapsulated into a standard calculated column with metadata; the basic fields are the target column field, target row field, and target value field, excluding the calculated fields. Based on the target query control parameters, the reference line configuration information and conditional formatting configuration information of the geometric layer are determined. The reference line configuration information is parsed into a reference formula column, and the conditional formatting configuration information is parsed into a conditional formatting column. The calculation formula column, standard calculation column, reference formula column, and conditional formatting column are used as the calculation columns for this geometry layer.
[0085] In one embodiment of this application, the data query module 25 is specifically used for: If there are multiple computation units, the merging operation is performed multiple times until all computation units are traversed to obtain the first set of computation units; If there is only one computing unit, then that single computing unit is taken as the first set of computing units; Discard the valid query control parameters of each computing unit in the first computing unit set, extract the global query control parameters from the query control parameters, and write the global query control parameters into each computing unit of the first computing unit set to obtain the second computing unit set; The preset query semantic description template is filled based on the second set of computing units; The steps involved in the merging operation include: Select one computing unit from those computing units that have never participated in the merging operation as the current computing unit; If there exists a computation unit in the first computation unit set whose dimension column is exactly the same as the current computation unit, then the computation unit in the first computation unit set is taken as the matching computation unit, the union of the value column of the current computation unit and the value column of the matching computation unit is calculated, the value column of the matching computation unit is updated to the union, and the identifier of the current computation unit is merged into the identifier set of the matching computation unit. If there is no computation unit in the first set of computation units that has the same dimension column as the current computation unit, then the current computation unit is added to the first set of computation units.
[0086] In one embodiment of this application, when generating a calculated column based on the target column field, target row field, target value field, and target query control parameters, a field mapping relationship between the virtual field identifier carried in the global query control parameters and the real field ID of the corresponding calculated column is simultaneously constructed; the data query module 25 is further specifically used for: For each calculation unit in the second set of calculation units, assign corresponding type labels to the calculation formula column, standard calculation column, reference formula column, and conditional formatting column of that calculation unit; Extract the sorting rule control parameters, filtering condition control parameters, and conditional formatting configuration parameters from the global query control parameters and use them as the original query control parameters; Based on the field mapping relationship, the virtual field identifiers in the original query control parameters are replaced with the real field IDs of the corresponding calculated columns to obtain standardized query control parameters; The calculation type of each calculation unit is determined based on its dimension and value columns; calculation types include crosstabs, detail tables, and grouped tables. The preset query semantic description template is filled based on the type labels, standardized query control parameters, calculation types, dimension columns, and calculation columns corresponding to each calculation unit.
[0087] In one embodiment of this application, before discarding the valid query control parameters of each computing unit in the first computing unit set, the valid query control parameters to be discarded are pre-stored; the chart rendering module 26 is further configured to: The query result data is split based on the identifier of each computing unit to obtain the query result data corresponding to each computing unit; For each computing unit, the query result data corresponding to the computing unit is subjected to secondary filtering and sorting based on the pre-stored valid query control parameters of the computing unit to obtain the secondary processed query result data; The query result data after secondary processing corresponding to each calculation unit is rendered based on the chart rendering rules.
[0088] In one embodiment of this application, for each computing unit, the chart rendering module 26 is further configured to: The secondary processed query result data is formatted to obtain the formatted query result data. Based on the channel binding relationship and the formatted query result data, generate the primitive specification of the geometric graphics layer corresponding to the computing unit; The coordinate system specification generation logic is determined based on the coordinate system corresponding to the computing unit; the coordinate system corresponding to the computing unit is the coordinate system bound to the geometric layer corresponding to the computing unit. The coordinate system specification generation logic is invoked, and the corresponding default coordinate system configuration is loaded based on the chart rendering rules to generate the coordinate system specification. Based on the channel binding relationship, determine the field information bound to the horizontal axis channel and the vertical axis channel respectively, and generate the coordinate axis configurations corresponding to the horizontal axis and the vertical axis respectively; The formatted query result data corresponding to this calculation unit is rendered based on the primitive specification, coordinate system specification, and coordinate axis configuration.
[0089] In one embodiment of this application, the chart rendering module 26 is further configured to: The formatted query result data is padded with null values to obtain the padded query result data. Obtain browser environment information, and based on the browser environment information, complete the primitive specifications, coordinate system specifications, and coordinate axis configurations respectively; Based on the completed primitive specifications, the completed coordinate system specifications, and the completed coordinate axis configuration, the completed query result data corresponding to the calculation unit is rendered.
[0090] See Figure 4 , Figure 4 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 4The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of each module / unit in the above-described device embodiments, for example... Figure 3 The functions of the configuration information acquisition module 21, unified encoding module 22, layer binding module 23, calculation unit construction module 24, data query module 25, and chart rendering module 26 are shown.
[0091] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0092] Input device 302 may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint orientation information), a microphone, etc., and output device 303 may include a display (LCD, etc.), a speaker, etc.
[0093] The memory 304 may include read-only memory and random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store preset information such as query semantic description templates.
[0094] In specific implementations, the processor 301, input device 302, and output device 303 described in the embodiments of this application can execute the implementation method described in the visualization query method provided in the embodiments of this application, or they can execute the implementation method of the electronic device described in the embodiments of this application, which will not be repeated here.
[0095] In another embodiment of this application, a computer-readable storage medium is provided. This computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the methods described above. Alternatively, the computer program can instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0096] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., provided on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0097] This application provides a computer program product, which includes computer-executable instructions or a computer program. The computer-executable instructions or computer program are stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the visualization query method described above in this application.
[0098] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0099] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces or units, or they may be electrical, mechanical, or other forms of connection.
[0101] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0102] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0103] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A visual query method, characterized in that, include: Based on the user's triggered action, obtain the query configuration information for the data source; The query configuration information includes the target field, the type of the target chart, query control parameters, and the channel binding relationship between the target chart and the target field; Based on the channel binding relationship, each target field is classified and mapped as a column field, row field, or value field. Based on the type of the target chart, the chart rendering rules are determined, and at least one geometric shape layer and a coordinate system bound to each geometric shape layer are generated based on the chart rendering rules. A layer binding relationship is established between each geometric layer and the query control parameter based on the layer matching identifier carried by the query control parameter; For each geometric shape layer, the column field, row field, value field, and query control parameter bound to that geometric shape layer are determined based on the channel binding relationship and the layer binding relationship, and are respectively used as the target column field, target row field, target value field, and target query control parameter; Use the target column field and the target row field as dimension columns, and the target value field as value columns; A calculated column is generated based on the target column field, the target row field, the target value field, and the target query control parameters; The target query control parameters are filtered and trimmed to select the effective configuration parameters that can be applied to the calculated columns, which are then used as effective query control parameters. A calculation unit is constructed based on the dimension column, the value column, the calculated column, and the valid query control parameters; A preset query semantic description template is filled based on at least one of the computing units to obtain a query semantic description. A query against the data source is executed based on the query semantic description to obtain query result data. The query result data is rendered based on the chart rendering rules to obtain query results in chart form.
2. The visualization query method as described in claim 1, characterized in that, For each geometric layer, a calculated column for that geometric layer is generated based on the target column field, the target row field, the target value field, and the target query control parameters, including: The base field and the user-defined calculated field are determined from the target column field, the target row field and the target value field, wherein the base field is any field in the target column field, the target row field and the target value field other than the calculated field; For each calculated field, parse the calculated field into a column of calculation formulas; For each basic field, the basic field is encapsulated into a standard calculated column with metadata; the basic field is the field other than the calculated field among the target column field, the target row field, and the target value field; Based on the target query control parameters, the reference line configuration information and conditional formatting configuration information of the geometric layer are determined, the reference line configuration information is parsed into a reference formula column, and the conditional formatting configuration information is parsed into a conditional formatting column; The calculation formula column, the standard calculation column, the reference formula column, and the conditional formatting column are used as the calculation columns for this geometry layer.
3. The visualization query method as described in claim 2, characterized in that, The step of filling the preset query semantic description template based on at least one of the computing units includes: If there are multiple computing units, the merging operation is performed multiple times until all computing units are traversed to obtain the first set of computing units; If there is only one computing unit, then that single computing unit is taken as the first set of computing units; Discard the valid query control parameters of each computing unit in the first computing unit set, extract the global query control parameters from the query control parameters, and write the global query control parameters into each computing unit of the first computing unit set to obtain the second computing unit set; The preset query semantic description template is filled based on the second set of computing units; The steps of the merging operation include: Select one computing unit from those computing units that have never participated in the merging operation as the current computing unit; If there is a calculation unit in the first set of calculation units that has the same dimension column as the current calculation unit, then the calculation unit in the first set of calculation units is taken as the matching calculation unit, the union of the value column of the current calculation unit and the value column of the matching calculation unit is calculated, the value column of the matching calculation unit is updated to the union, and the identifier of the current calculation unit is merged into the identifier set of the matching calculation unit. If there is no computing unit in the first set of computing units that has the same dimension column as the current computing unit, then the current computing unit is added to the first set of computing units.
4. The visualization query method as described in claim 3, characterized in that, When generating the calculated column based on the target column field, the target row field, the target value field, and the target query control parameters, the field mapping relationship between the virtual field identifier carried in the global query control parameters and the real field ID of the corresponding calculated column is constructed simultaneously. The step of filling the preset query semantic description template based on the second set of computing units includes: For each calculation unit in the second set of calculation units, a corresponding type label is assigned to the calculation formula column, the standard calculation column, the reference formula column, and the conditional formatting column of that calculation unit; Extract the sorting rule control parameters, filtering condition control parameters, and conditional format configuration parameters from the global query control parameters, and use them as the original query control parameters; Based on the field mapping relationship, the virtual field identifier in the original query control parameters is replaced with the real field ID of the corresponding calculated column to obtain the standardized query control parameters; The calculation type of each calculation unit is determined based on its dimension and value columns; the calculation types include cross-tabs, detail tables, and grouped tables. A preset query semantic description template is filled based on the type label, standardized query control parameters, calculation type, dimension column, and calculation column corresponding to each calculation unit.
5. The visualization query method as described in claim 3, characterized in that, Before discarding the valid query control parameters of each computing unit in the first computing unit set, the valid query control parameters to be discarded are pre-stored; The rendering of the query result data based on the chart rendering rules includes: The query result data is split based on the identifier of each computing unit to obtain the query result data corresponding to each computing unit; For each computing unit, the query result data corresponding to the computing unit is subjected to secondary filtering and sorting based on the pre-stored valid query control parameters of the computing unit to obtain the secondary processed query result data; The query result data after secondary processing corresponding to each calculation unit is rendered based on the chart rendering rules.
6. The visualization query method as described in claim 5, characterized in that, For each calculation unit, the secondary processed query result data corresponding to that calculation unit is rendered based on the chart rendering rules, including: The query result data after the secondary processing is formatted to obtain formatted query result data; Based on the channel binding relationship and the formatted query result data, the primitive specification of the geometric layer corresponding to the computing unit is generated. The coordinate system specification generation logic is determined based on the coordinate system corresponding to the computing unit; the coordinate system corresponding to the computing unit is the coordinate system bound to the geometric layer corresponding to the computing unit. The coordinate system specification generation logic is invoked, and the corresponding default coordinate system configuration is loaded based on the chart rendering rules to generate the coordinate system specification. Based on the channel binding relationship, determine the field information bound to the horizontal axis channel and the vertical axis channel respectively, and generate the coordinate axis configurations corresponding to the horizontal axis and the vertical axis respectively; The formatted query result data corresponding to the calculation unit is rendered based on the primitive specification, the coordinate system specification, and the coordinate axis configuration.
7. The visualization query method as described in claim 6, characterized in that, Rendering the formatted query result data corresponding to the calculation unit based on the primitive specification, the coordinate system specification, and the coordinate axis configuration includes: The formatted query result data is padded with null values to obtain padded query result data. Obtain browser environment information, and based on the browser environment information, complete the primitive specification, the coordinate system specification, and the coordinate axis configuration respectively; Based on the completed primitive specifications, the completed coordinate system specifications, and the completed coordinate axis configuration, the completed query result data corresponding to the calculation unit is rendered.
8. A visual query device, characterized in that, include: The configuration information acquisition module retrieves query configuration information for the data source based on the user's triggered operation. The query configuration information includes the target field, the type of the target chart, query control parameters, and the channel binding relationship between the target chart and the target field; A unified encoding module is used to classify and map each target field into a column field, row field, or value field based on the channel binding relationship, determine the chart rendering rules based on the type of the target chart, and generate at least one geometric layer and a coordinate system bound to each geometric layer based on the chart rendering rules. The layer binding module is used to establish a layer binding relationship between each geometric layer and the query control parameter based on the layer matching identifier carried by the query control parameter; The calculation unit construction module is used to determine, for each geometric layer, the column field, the row field, the value field, and the query control parameter bound to that geometric layer based on the channel binding relationship and the layer binding relationship, and to use them as the target column field, target row field, target value field, and target query control parameter, respectively. Use the target column field and the target row field as dimension columns, and the target value field as value columns; A calculated column is generated based on the target column field, the target row field, the target value field, and the target query control parameters; The target query control parameters are filtered and trimmed to select the effective configuration parameters that can be applied to the calculated columns, which are then used as effective query control parameters. A calculation unit is constructed based on the dimension column, the value column, the calculated column, and the valid query control parameters; The data query module is used to fill a preset query semantic description template based on at least one of the computing units to obtain a query semantic description, and to execute a query against the data source based on the query semantic description to obtain query result data. The chart rendering module is used to render the query result data based on the chart rendering rules to obtain the query results in chart form.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
