Page chart generation method, system, device and medium based on configuration relationship
By decoupling the data source and the page through a four-level layered architecture based on configuration relationships, the system can verify the online status of metrics, solve the problem of strong coupling between the page and the data logic, and improve the stability and security of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MIRATTERY CO LTD
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-12
Smart Images

Figure CN122196013A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a method, system, device, and medium for generating page charts based on configuration relationships. Background Technology
[0002] With the deepening of enterprise informatization and digital transformation, the demand for indicator analysis, data visualization, and interactive display in business systems has shown a significant growth trend. Currently, the commonly used technical solutions in the industry typically employ a method of directly binding data source information and embedding SQL query statements in the configuration of visualization pages and charts. Data is then extracted from the database in real time by executing SQL statements during the page rendering phase.
[0003] However, this technical solution has significant limitations: the page and data logic are tightly coupled, requiring modifications to the configuration parameters of multiple related pages when the metric logic changes. This significantly increases system maintenance costs and results in poor metric reusability. Furthermore, problems with the data source or metric can easily lead to abnormal chart rendering on the page. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the prior art, this application provides a method, system, device and medium for generating page charts based on configuration relationships, which effectively solves the problem of page chart rendering failure caused by abnormal indicators or data sources.
[0005] Firstly, this application provides a method for generating page charts based on configuration relationships, the method comprising: Configure the data source, generate a data source identifier based on the data source information, and store the data source information in a hierarchical and encrypted manner; Based on the data source identifier, the configured metrics include at least an SQL query statement and an initial state, wherein the initial state is an offline state. The indicators are verified to be online, and the indicators that pass the verification are set to the online state to obtain the indicator status of each indicator. Configure a target page and a target chart, wherein the target page includes at least a page identifier, the target chart includes at least a chart identifier, and the chart identifier is associated with the page identifier and the indicator identifier; Receive a page rendering request, obtain the corresponding target chart identifier based on the target page identifier, and determine the target metric based on the target chart identifier; Based on the status of the target indicator, perform data query and page chart rendering to generate the target page chart.
[0006] In an optional implementation, configuring the data source and generating a data source identifier based on the data source information includes: Configure the data source and obtain the data source information, which includes at least the database type, database connection address, port number, database name, username, and password. Generate a globally unique identifier based on the data source information to obtain the data source identifier.
[0007] In an optional implementation, the data source information is stored with hierarchical encryption, including: An asymmetric encryption algorithm is used to encrypt the database type, the database connection address, the port number, and the database name to obtain encrypted connection information; The username and password are encrypted using a symmetric encryption algorithm to obtain encrypted authentication information; The encrypted connection information, the encrypted authentication information, and the data source identifier are associated and stored in the database.
[0008] In an optional implementation, the configuration metric based on the data source identifier includes: Obtain the target data source identifier; Obtain the indicator name input by the user, and configure the SQL query statement to retrieve indicator data based on the indicator name; Establish a relationship between the indicator name, the SQL query statement, and the target data source identifier so that the target data source can be located when the indicator executes a query. Set the initial state of the indicator to offline.
[0009] In an optional implementation, the step of performing online verification on the indicators, setting the indicators that pass the verification to an online state, and obtaining the indicator status of each indicator includes: Obtain the SQL query statement for the metric, and establish a connection with the corresponding target database based on the associated target data source identifier; An automated testing process is executed on the SQL query statement. The automated testing process includes at least syntax validity verification, execution plan generation verification, and query result set structure verification. If the target database returns a valid response, the online verification passes and the indicator status is set to online; otherwise, the indicator status remains offline.
[0010] In an optional implementation, data querying and page chart rendering are performed based on the indicator status of the target indicator to generate a target page chart, including: If the target metric is online, then perform the data query and the page chart rendering to obtain the target page chart; If the target indicator is offline or the data source is abnormal, the data query process will be blocked or empty data will be returned.
[0011] In an optional implementation, if the target metric is online, then performing the data query and rendering the page chart to obtain the target page chart includes: Obtain the target data source identifier and target SQL query statement for the target metric; Obtain encrypted connection information and encrypted authentication information based on the target data source identifier, decrypt the encrypted connection information and the encrypted authentication information, and establish a connection with the target database; Execute the target SQL query statement in the target database to obtain the data query results; The data query results are encapsulated into structured data, and charts are rendered based on the structured data to obtain the target page chart.
[0012] Secondly, this application provides a page chart generation system based on configuration relationships, the system comprising: The data source configuration module is used to configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encrypted storage of the data source information; The indicator configuration module is used to configure indicators based on the data source identifier. The indicator includes at least an SQL query statement and an initial state, wherein the initial state is an offline state. The status verification module is used to verify the online status of the indicators. The indicators that pass the verification are set to the online status, and the status of each indicator is obtained. The page chart configuration module is used to configure the target page and the target chart. The target page includes at least a page identifier, and the target chart includes at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier. The indicator identification module is used to receive page rendering requests, obtain the corresponding target chart identifier based on the target page identifier, and determine the target indicator based on the target chart identifier. The page chart generation module is used to perform data query and page chart rendering based on the status of the target indicator, and generate the target page chart.
[0013] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the page diagram generation method based on configuration relationships as described in any of the foregoing embodiments.
[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the page diagram generation method based on configuration relationships as described in any of the foregoing embodiments.
[0015] This application provides a configuration-based page chart generation method, system, device, and medium. By constructing a four-level layered architecture centered on configuration relationships for data source configuration, indicator configuration, chart configuration, and page configuration, it achieves deep decoupling between indicator management and visualization. The page acts as a container, and the chart serves as the mapping link between indicators and pages. All data logic converges into independently controllable indicator units. Indicators have clearly defined online and offline states, and online verification is enforced when the state changes, ensuring that only fully verified indicators participate in runtime queries. This significantly reduces the risk of configuration redundancy and discrepancies when multiple pages reuse the same business indicator. In the event of data source anomalies or indicator logic failures, data requests are proactively intercepted or a safe empty state is returned, effectively preventing page rendering anomalies. This significantly improves the system's stability, maintainability, and security, providing reliable technical support for indicator governance systems in digital operation scenarios. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the page chart generation method based on configuration relationship provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of a page chart generation system based on configuration relationships provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0018] Explanation of key component symbols: 200. Page chart generation system based on configuration relationship; 210. Data source configuration module; 220. Indicator configuration module; 230. Status verification module; 240. Page chart configuration module; 250. Indicator recognition module; 260. Page chart generation module; 300. Electronic device; 310. Processor; 320. Communication interface; 330. Memory; 340. Communication bus. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be further described clearly and completely below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0020] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0022] Existing data analysis or metric display systems directly bind data source information and SQL query statements to page or chart configurations. This results in strong coupling between the page and data logic. When the metric logic changes, multiple page configurations need to be modified simultaneously, leading to high maintenance costs. Furthermore, metric reusability is poor; the same business metric is repeatedly configured on different pages, easily causing inconsistencies in metric definitions. Additionally, metrics lack independent lifecycle management. When the data source is abnormal or the metric has problems, it can directly cause page rendering errors, resulting in insufficient system stability.
[0023] Example 1 This application provides a method for generating page charts based on configuration relationships, which effectively solves the problem of page chart rendering failure due to abnormal indicators or data sources. Figure 1 This is a schematic diagram of the page chart generation method based on configuration relationships provided in the embodiments of this application, such as... Figure 1 As shown, the method includes the following steps: S100 Configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encryption storage of the data source information.
[0024] In this embodiment, the data source is a physical or logical database instance that can be connected to and queried in the business system. It can be a structured database, used to provide underlying data support for metrics. It is referenced by the metric configuration through a unique identifier, achieving unified management and secure isolation of data access. The specific configuration of the data source is as follows: First, configure the data source and obtain the data source information, which includes, but is not limited to, the database type, database connection address, port number, database name, username, and password.
[0025] For example, if a certain "Asset Overview Page" is used to display the "Daily New Asset Blocks" metric, the database type is configured as MySQL. Based on the MySQL database, the database connection address and port number of the corresponding data source can be configured, and the database name, username, and password can be set according to the actual situation.
[0026] Then, a globally unique identifier is generated based on the data source information to obtain the data source identifier. After completing the data source configuration, a unique data source identifier can be generated based on the data source information: obtain the basic connection parameters of the data source, including database type, connection address, port number, and database name. A globally unique identifier is generated based on these basic connection parameters as the data source identifier, used to uniquely identify the corresponding data source and serve as the unique reference for establishing a relationship between subsequent metric configurations and the data source, facilitating data source location during subsequent metric queries. This data source identifier can be generated using a universally unique identifier (UUID), such as 3f8a9c2e-7b41-4c9d-a0e2-5f6b9a1d4c72.
[0027] Finally, the data source information is stored with hierarchical encryption. Asymmetric encryption algorithms are used to encrypt database connection information, including database type, database connection address, port number, and database name, to obtain encrypted connection information. Usernames and passwords are also encrypted using asymmetric encryption algorithms to generate encrypted authentication information. The encrypted connection information, encrypted authentication information, and data source identifier are associated and stored in the database. During system operation, the username and password are retrieved using asymmetric decryption only when a database connection needs to be established, and the database connection information is retrieved using symmetric decryption. Furthermore, the decryption process is performed only in memory, avoiding the security risks associated with plaintext storage. This hierarchical encrypted storage of data source information improves the security of data source configuration.
[0028] S200. Configure metrics based on data source identifiers. Metrics include at least an SQL query statement and an initial state, with the initial state being offline.
[0029] In this embodiment, an indicator is a data calculation unit oriented towards business semantics and possessing an independent lifecycle. It is used to decouple data logic from the presentation layer, achieving a unified and reusable controlled data supply. The specific configuration of the indicator is as follows: First, obtain the target data source identifier. Based on the configured data source list, the user selects the target data source and obtains the unique target data source identifier for that target data source.
[0030] Then, the indicator name input by the user is obtained. This indicator name is used to identify the business meaning of the indicator. Based on the indicator name, an SQL query statement is configured to retrieve the indicator data. This SQL query statement is used to retrieve the data results corresponding to the indicator from the target data source.
[0031] It is understood that this SQL query statement includes, but is not limited to, one or more query contents such as data statistics query based on time conditions, filtering query based on business conditions, and aggregate statistics query based on business fields.
[0032] Then, establish a relationship between the indicator name, the SQL query statement, and the target data source identifier so that the target data source can be located when the indicator executes the query.
[0033] Finally, the initial state of the metric is set to offline. When a metric is configured but has not yet passed the online verification, its initial state is offline, and it does not participate in page data queries in this initial state. When the metric passes the online verification and the verification result meets the preset online conditions, the metric state is automatically switched from offline to online. When the SQL query statement corresponding to the metric or the associated data source configuration changes, the metric state is automatically reset to offline to avoid using unverified data configurations.
[0034] For example, a metric configuration is created based on MySQL data source information, and a corresponding SQL query statement is configured for the "Daily New Asset Block Count" metric. This SQL query statement is used to count the number of new asset blocks added within a specified date, as shown in the example below: SELECT COUNT( AS asset_block_count FROM asset_blocks WHERE create_date = CURRENT_DATE Among them, asset_blocks is the asset block data table, and create_date is the asset block creation date field. When the "Daily New Asset Block Count" metric is first created, its initial state is offline.
[0035] S300: Perform online verification on the indicators. Set the indicators that pass the verification to the online status and obtain the indicator status of each indicator.
[0036] In this embodiment of the application, an online verification operation is performed before the indicator switches from an offline state to an online state, as follows: First, obtain the SQL query statement for the metric. In a controlled environment, establish a connection with the corresponding target database based on the associated target data source identifier.
[0037] Then, an automated testing process is executed on the SQL query statement. This automated testing process includes, but is not limited to, SQL syntax validity verification, SQL execution plan generation verification, and SQL query result set structure verification.
[0038] Understandably, SQL syntax validity checks ensure that the SQL queries configured for the metrics conform to the syntax specifications of the target database, preventing page query failures due to syntax errors. SQL execution plan generation and validation simulate the database parsing and execution process, analyzing the execution efficiency and potential performance bottlenecks of the query statements to prevent complex or inefficient SQL from slowing down system response. SQL query result set structure validation focuses on verifying whether the column names, data types, and formats of the returned data meet the display requirements of the front-end page or charts, ensuring that the data can be correctly parsed and rendered.
[0039] Finally, if all the above checks pass, and the target database connection is successful and returns a valid response result that is not empty and has no error code, then the online verification passes, the indicator status is set to online, and the indicator is allowed to participate in page data query and chart display. If any check fails, the indicator status remains offline, and the error information is recorded.
[0040] Based on the automated testing process of online verification, the logic of indicators can be verified from multiple dimensions before the indicators are launched, problems can be discovered and fixed in a timely manner, the impact of abnormal indicators on the system can be reduced, and the quality of indicator reuse and the overall stability of the system can be improved.
[0041] S400, Configure target page and target chart. The target page must include at least a page identifier, and the target chart must include at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier.
[0042] In this embodiment, the page is configured as a pure front-end presentation layer definition, containing no data logic. That is, the page is not associated with data sources, SQL, metrics, or chart logic; it exists solely as a display container. The target page is configured with a page name, such as "Asset Overview Page," for interface display. Simultaneously, a page identifier is configured, using a globally unique string, such as "asset-overview-v1," which serves as the primary key reference for the page instance within the system.
[0043] Based on this, the page structure is dynamically rendered by the front-end framework, and the back-end only provides configuration data and chart mapping relationships. This design achieves complete decoupling between the page and the data, and supports zero-code reuse and rapid refactoring of the page.
[0044] In this embodiment of the application, the configuration chart includes, but is not limited to, information such as chart name and chart identifier. For example, the chart name is set to "Daily New Asset Block Count Trend Chart" and the chart identifier is set to "chart-asset-daily-count". At the same time, the chart identifier is associated with the corresponding indicator identifier, which is used to point to the defined indicator that is online. The chart identifier is also associated with the corresponding page identifier, which is used to bind to the relevant page in reverse.
[0045] For example, a chart identifier based on the "Daily New Asset Blocks Trend Chart" is associated with the "Daily New Asset Blocks" indicator and the "Asset Overview Page" page, and the chart display type is specified as a line chart. Based on this, the chart serves as an intermediate mapping unit, used to determine the indicator data that the page needs to display during system operation.
[0046] S500 receives the page rendering request, obtains the corresponding target chart identifier based on the target page identifier, and determines the target metric based on the target chart identifier.
[0047] In this embodiment, when a user accesses a page, a page rendering request is triggered to obtain the target page identifier. The corresponding target chart identifier is then obtained based on the target page identifier, and the target metric is determined based on the target chart identifier.
[0048] For example, when a user visits the "Asset Overview" page, the corresponding "Daily New Asset Blocks Trend Chart" identifier is obtained based on the page identifier of the page. Based on the association between the chart identifier and the corresponding indicator identifier, the indicator identifier associated with the chart identifier can be obtained. Based on the indicator identifier, the target indicator is determined to be the "Daily New Asset Blocks" indicator.
[0049] Based on this, the chart itself does not store SQL or data source information, but only indirectly obtains the query logic through the associated indicator identifier. This design enables the reuse of one indicator in multiple charts and the reuse of one chart across pages, completely decoupling the display format from the data semantics.
[0050] S600: Perform data query and page chart rendering based on the indicator status of the target indicator to generate the target page chart.
[0051] In this embodiment, if the target metric is online, data querying and page chart rendering are performed to obtain the target page chart. If the target metric is offline or the data source is abnormal, the data query process is blocked or empty data is returned. The data querying and page chart rendering are specifically as follows: First, when the target metric is online, obtain the target data source identifier and the target SQL query statement for the target metric.
[0052] Then, based on the target data source identifier, the encrypted connection information and encrypted authentication information are obtained, stored in memory, and decrypted to establish a connection with the target database.
[0053] Next, the target SQL query is executed in the target database to obtain the data query results. These data query results include, but are not limited to, data types such as numerical statistical data, time-based data, and categorical statistical data.
[0054] Finally, the data query results are encapsulated into structured data, which is then used as the data input for chart rendering to obtain the target page chart, such as the "Daily New Asset Blocks Line Chart" on the "Asset Overview" page.
[0055] The page chart generation method based on configuration relationships provided in this application constructs a four-level hierarchical architecture centered on configuration relationships for data source configuration, indicator configuration, chart configuration, and page configuration, achieving deep decoupling between indicator management and visualization. Indicators have clearly defined online and offline states, and online verification is enforced when the state changes, ensuring that only fully verified indicators participate in runtime queries. This significantly reduces the risk of configuration redundancy and discrepancies when reusing the same business indicator across multiple pages. In the event of data source anomalies or indicator logic failures, data requests are proactively intercepted or a safe empty state is returned, effectively preventing page rendering anomalies and significantly improving system stability, maintainability, and security.
[0056] Example 2 Based on the same technical concept as Embodiment 1 above, this application provides a page chart generation system based on configuration relationships. Figure 2 This is a schematic diagram of the page chart generation system structure based on configuration relationships provided in the embodiments of this application, such as... Figure 2 As shown, the page chart generation system 200 based on configuration relationships includes: The data source configuration module 210 is used to configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encryption storage of the data source information.
[0057] The indicator configuration module 220 is used to configure indicators based on the data source identifier. The indicator includes at least an SQL query statement and an initial state, with the initial state being offline.
[0058] The status verification module 230 is used to verify the online status of indicators. Indicators that pass the verification are set to the online status, and the status of each indicator is obtained.
[0059] The page chart configuration module 240 is used to configure the target page and the target chart. The target page includes at least a page identifier, and the target chart includes at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier.
[0060] The indicator recognition module 250 is used to receive page rendering requests, obtain the corresponding target chart identifier based on the target page identifier, and determine the target indicator based on the target chart identifier.
[0061] The page chart generation module 260 is used to query data and render page charts based on the indicator status of the target indicator, and generate the target page chart.
[0062] The page chart generation system based on configuration relationships provided in this application embodiment achieves deep decoupling between indicator management and visualization display, effectively avoids page rendering anomalies, significantly improves the stability, maintainability and security of the system, and provides reliable technical support for the indicator governance system in digital operation scenarios.
[0063] It is understood that the implementation method of page chart generation based on configuration relationship in the above embodiment 1 is also applicable to this embodiment and can achieve the same technical effect, so it will not be described again here.
[0064] Example 3 Based on the same concept, this application also provides an electronic device. Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 3 As shown, the electronic device 300 may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute the steps of the page graph generation method based on configuration relationships as described in the above embodiments. For example, this includes: S100. Configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encrypted storage of the data source information; S200. Configure metrics based on data source identifiers. Metrics must include at least an SQL query statement and an initial state, with the initial state being offline. S300: Perform online verification on the indicators, set the indicators that pass the verification to the online status, and obtain the indicator status of each indicator. S400, configure the target page and target chart. The target page must include at least a page identifier, and the target chart must include at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier. S500: Receives a page rendering request, obtains the corresponding target chart identifier based on the target page identifier, and determines the target metric based on the target chart identifier; S600: Perform data query and page chart rendering based on the indicator status of the target indicator to generate the target page chart.
[0065] The processor 310 can be a central processing unit (CPU). The processor can also 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, or combinations of the above types of chips.
[0066] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0067] The memory 330 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0068] Example 4 Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program containing at least one piece of code executable by a master control device to control the master control device to implement the steps of the page chart generation method based on configuration relationships as described in the above embodiments. For example, it includes: S100. Configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encrypted storage of the data source information; S200. Configure metrics based on data source identifiers. Metrics must include at least an SQL query statement and an initial state, with the initial state being offline. S300: Perform online verification on the indicators, set the indicators that pass the verification to the online status, and obtain the indicator status of each indicator. S400, configure the target page and target chart. The target page must include at least a page identifier, and the target chart must include at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier. S500: Receives a page rendering request, obtains the corresponding target chart identifier based on the target page identifier, and determines the target metric based on the target chart identifier; S600: Perform data query and page chart rendering based on the indicator status of the target indicator to generate the target page chart.
[0069] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the above-described method embodiments.
[0070] The computer program may be stored, in whole or in part, on a computer-readable storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
[0071] Based on the same technical concept, this application also provides a processor for implementing the above-described method embodiments. The processor can be a chip.
[0072] In summary, the page chart generation method, system, device, and medium based on configuration relationships provided in this application achieve deep decoupling of indicator management and visualization by constructing a four-level layered architecture centered on configuration relationships for data source configuration, indicator configuration, chart configuration, and page configuration. The page is used as a container, and the chart serves as the mapping link between indicators and pages, with all data logic converging into independently controllable indicator units. Indicators have clearly defined online and offline states, and online verification is enforced when the state changes, ensuring that only fully verified indicators participate in runtime queries. This significantly reduces the risk of configuration redundancy and caliber discrepancies when multiple pages reuse the same business indicator. When the data source is abnormal or the indicator logic fails, data requests are proactively intercepted or a safe empty state is returned, effectively preventing page rendering anomalies and significantly improving the system's stability, maintainability, and security. This provides reliable technical support for indicator governance systems in digital operation scenarios.
[0073] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0074] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating page charts based on configuration relationships, characterized in that, The method includes: Configure the data source, generate a data source identifier based on the data source information, and store the data source information in a hierarchical and encrypted manner; Based on the data source identifier, the configured metrics include at least an SQL query statement and an initial state, wherein the initial state is an offline state. The indicators are verified to be online, and the indicators that pass the verification are set to the online state, thereby obtaining the indicator status of each indicator. Configure a target page and a target chart, wherein the target page includes at least a page identifier, the target chart includes at least a chart identifier, and the chart identifier is associated with the page identifier and the indicator identifier; Receive a page rendering request, obtain the corresponding target chart identifier based on the target page identifier, and determine the target metric based on the target chart identifier; Based on the status of the target indicator, perform data query and page chart rendering to generate the target page chart.
2. The page chart generation method based on configuration relationship according to claim 1, characterized in that, The configured data source generates a data source identifier based on the data source information, including: Configure the data source and obtain the data source information, which includes at least the database type, database connection address, port number, database name, username, and password. Generate a globally unique identifier based on the data source information to obtain the data source identifier.
3. The page chart generation method based on configuration relationship according to claim 2, characterized in that, The data source information is stored in a hierarchical encrypted manner, including: An asymmetric encryption algorithm is used to encrypt the database type, the database connection address, the port number, and the database name to obtain encrypted connection information; The username and password are encrypted using a symmetric encryption algorithm to obtain encrypted authentication information; The encrypted connection information, the encrypted authentication information, and the data source identifier are associated and stored in the database.
4. The page chart generation method based on configuration relationship according to claim 1, characterized in that, The metric configured based on the data source identifier includes: Obtain the target data source identifier; Obtain the indicator name input by the user, and configure the SQL query statement to retrieve indicator data based on the indicator name; Establish a relationship between the indicator name, the SQL query statement, and the target data source identifier so that the target data source can be located when the indicator executes a query. Set the initial state of the indicator to offline.
5. The page chart generation method based on configuration relationship according to claim 4, characterized in that, The process of performing online verification on the metrics, setting the metrics that pass the verification to an online state, and obtaining the metric status of each metric includes: Obtain the SQL query statement for the metric, and establish a connection with the corresponding target database based on the associated target data source identifier; An automated testing process is executed on the SQL query statement. The automated testing process includes at least syntax validity verification, execution plan generation verification, and query result set structure verification. If the target database returns a valid response, the online verification passes and the indicator status is set to online; otherwise, the indicator status remains offline.
6. The page chart generation method based on configuration relationship according to claim 1, characterized in that, Based on the status of the target metric, data querying and page chart rendering are performed to generate the target page chart, including: If the target metric is online, then perform the data query and the page chart rendering to obtain the target page chart; If the target indicator is offline or the data source is abnormal, the data query process will be blocked or empty data will be returned.
7. The page chart generation method based on configuration relationship according to claim 6, characterized in that, If the target metric is online, then the data query and page chart rendering are performed to obtain the target page chart, including: Obtain the target data source identifier and target SQL query statement for the target metric; Obtain encrypted connection information and encrypted authentication information based on the target data source identifier, decrypt the encrypted connection information and the encrypted authentication information, and establish a connection with the target database; Execute the target SQL query statement in the target database to obtain the data query results; The data query results are encapsulated into structured data, and charts are rendered based on the structured data to obtain the target page chart.
8. A page chart generation system based on configuration relationships, characterized in that, The system includes: The data source configuration module is used to configure the data source, generate a data source identifier based on the data source information, and perform hierarchical encrypted storage of the data source information; The indicator configuration module is used to configure indicators based on the data source identifier. The indicator includes at least an SQL query statement and an initial state, wherein the initial state is an offline state. The status verification module is used to verify the online status of the indicators, and set the indicators that pass the verification to the online status, thereby obtaining the indicator status of each indicator. The page chart configuration module is used to configure the target page and the target chart. The target page includes at least a page identifier, and the target chart includes at least a chart identifier. The chart identifier is associated with the page identifier and the indicator identifier. The indicator identification module is used to receive page rendering requests, obtain the corresponding target chart identifier based on the target page identifier, and determine the target indicator based on the target chart identifier. The page chart generation module is used to perform data query and page chart rendering based on the status of the target indicator, and generate the target page chart.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the page diagram generation method based on configuration relationships as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the page diagram generation method based on configuration relationships as described in any one of claims 1 to 7.