Method and system for displaying data
By using the combination technology of auth_token and jinja templates in the report service platform, the shortcomings of data analysis report tools in data presentation level and permission control are solved, adaptive data display and permission isolation are achieved, and reports in the existing technology are solved. Problems with tools not adaptable and permission control.
Patent Information
- Application Number
- CN202110495342.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-07
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-05-07
AI Technical Summary
The existing data analysis report tools lack design and technical support at the data presentation level, especially in terms of reporting capabilities and permission control, they cannot adapt to PC and mobile phones, and cannot effectively isolate users' data permissions and integration. In other applications or services.
When an embedded page is generated in a third-party system, the report service platform sends auth_token of permission authentication information, uses iframe embedding to embed pages, combines pre-configured user templates and jinja templates to filter data based on identity information, and provides different users with Data report page and adjust the operation mode according to version information.
It realizes seamless data report display, avoids user login and cross-domain problems, provides convenient embedded reporting tools, supports PC and mobile phone adaptation, and performs permission isolation and data permission control for different users.
Smart Images

Figure CN113420194B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method and system for displaying data. Background Art
[0002] People have very limited ways to obtain information, and more than 80% of the information we get from the outside world comes from the visual system. When data is presented in the form of visual charts through visualization tools, people can more concisely and clearly identify the characteristics of the graphics and convert them into specified information. Data visualization reports are presented to different groups of people in various charts after data analysts use and analyze the data. The content presented varies, such as pie charts, bar charts, curve charts, perspective charts, etc. The presentation methods need to be diversified, such as client, mobile app, web terminal, system integration. Content and different presentation methods can provide intuitive and clear data display for data.
[0003] Visual charts are an intuitive way to present data, using data to directly reflect the business process of units, companies, and enterprises, and gain insights into business problems. Based on digital business concepts such as business growth, user operations, transaction records, and growth trends, they can seamlessly connect to enterprise data and output full-link data indicators, helping enterprises and users quickly analyze the current business situation, achieve data-driven development, and boost business growth.
[0004] In order to make better use of big data, many well-known foreign universities such as MIT and Harvard University have taken big data visualization as a research topic. The research team at MIT specializes in the visualization of urban information and has published 744 widely cited papers. Stanford's ongoing projects include new languages for interactive visualization, theoretical models, exploratory analysis and design tools, perceptual experiments to evaluate visualization effects, and visualization analysis systems for large-scale text analysis, population genomics and other fields, thereby promoting the research progress of data visualization tools.
[0005] Many universities in China have also established relevant data visualization tool research teams, such as the Visualization and Visualization Analysis Research Group of Peking University and the Visualization Analysis Research Group of Zhejiang University. In addition to academic research institutions, enterprises, media, individuals and studios are actively involved in data visualization research, especially new media. They spontaneously began to try to present data to the target audience through narrative. With the development of data visualization tool research, many domestic scholars have written summary papers on big data visualization. By analyzing the basic theories supporting big data visualization analysis, including the analysis process supporting cognitive theory, information visualization theory, and the user interface of human-computer interaction, the big data information visualization technology discussed on this basis is applied to the mainstream: text-oriented, network, time and space, and multi-dimensional visualization technology.
[0006] Although the existing data visualization platforms have relatively comprehensive presentation forms and contents, they do not provide much design and technical support at the data presentation level. This is mainly reflected in the following two aspects:
[0007] 1. Externalize reporting capabilities
[0008] Most of the data analysis and reporting tools currently available are single-platform tools that require login to view and access data reports, and are not adaptable to PC and mobile devices.
[0009] 2. Permission control
[0010] 1) Conventional report services need to create different report panels for different users, which increases the workload of data analysts and report developers. In addition, the data permissions of users of the same type cannot be effectively isolated.
[0011] 2) Anyone who has permission to view data needs to enter their account and password to log in and access, and cannot be effectively integrated into other applications or services. Summary of the invention
[0012] In view of the above problems in the related art, the present invention proposes a method and system for displaying data.
[0013] According to one aspect of the present invention, a method for displaying data is provided, comprising: when a third-party system generates an embedded page for displaying data, a reporting service platform sends an auth_token (authentication token) including authority authentication information to the third-party system; page embedding access is performed using an iframe embedding method and the third-party system generates an access URL according to the auth_token, wherein the iframe embedding method uses a header including the auth_token to transmit the authority authentication information; the reporting service platform performs authority authentication according to the auth_token of the URL, and assembles data query statements through a pre-configured user template, and returns a corresponding data report page for the corresponding user; according to the version information of the third-party system, a corresponding data report page is provided and the operation mode is changed to an operation mode that complies with the version information.
[0014] According to an embodiment of the present invention, the user template is a jinja template using python technology to ensure that different users only see data of their own authority based on identity information during data query.
[0015] According to an embodiment of the present invention, the method for displaying data further includes: customizing parameters of the jinja template to filter the data corresponding to the parameters.
[0016] According to an embodiment of the present invention, the permission authentication information of auth_token includes chart permissions and chart data permissions, and after successful authentication, data query statements are assembled by configuring the user's jinja template to return different data report pages for different users.
[0017] According to an embodiment of the present invention, the operation mode includes at least one of time selection, drop-down box, and single-selection and multiple-selection modes.
[0018] According to another aspect of the present invention, a system for displaying data is provided, including a third-party system and a report service platform. When the third-party system generates a page for displaying data, the report service platform sends an auth_token (authentication token) including authority authentication information to the third-party system; the page is embedded and accessed using an iframe embedding method, and the third-party system generates an access URL according to the auth_token, wherein the iframe embedding method uses a header including the auth_token to transmit the authority authentication information; the report service platform performs authority authentication according to the auth_token of the URL, and assembles a data query statement through a pre-configured user template, and returns a corresponding data report page for the corresponding user; according to the version information of the third-party system, a corresponding data report page is provided and the operation mode is changed to an operation mode that conforms to the version information.
[0019] According to an embodiment of the present invention, the user template is a jinja template using python technology to ensure that different users only see data of their own authority based on identity information during data query.
[0020] According to an embodiment of the present invention, the report service platform is further used to: customize the parameters of the jinja template to filter the data corresponding to the parameters.
[0021] According to an embodiment of the present invention, the permission authentication information of auth_token includes chart permissions and chart data permissions, and after successful authentication, data query statements are assembled by configuring the user's jinja template to return different data report pages for different users.
[0022] According to an embodiment of the present invention, the operation mode at least includes time selection and a drop-down box. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flowchart of a method for displaying data according to an embodiment of the present invention.
[0025] Figure 2 It is a flowchart of a method for displaying data according to a specific embodiment of the present invention.
[0026] Figure 3A A schematic diagram of a configuration scheme is shown; Figure 3B A schematic diagram showing the display method is shown.
[0027] Figure 4A A schematic diagram showing data display on a PC side is shown; Figure 4B A schematic diagram showing data display on a mobile app is shown.
[0028] Figure 5 It is an architectural design for implementing the data display method of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0030] In view of the problems and shortcomings in the prior art, the present invention provides a method for displaying data. Figure 1 is a flow chart of a method for displaying data according to an embodiment of the present invention. Figure 1 As shown, the method for displaying data of the present invention comprises the following steps:
[0031] S12, when the third-party system generates a page for displaying data, the report service platform sends an auth_token including authority authentication information to the third-party system.
[0032] S14, using an iframe embedding method to embed the page for access and the third-party system generates an access url (uniform resource locator) according to the auth_token, wherein the iframe embedding method uses a header including the auth_token to transmit the authority authentication information.
[0033] S16, the report service platform performs permission authentication according to the auth_token of the URL, assembles data query statements through pre-configured user templates, and returns the corresponding data report page for the corresponding user.
[0034] S18, according to the version information of the third-party system (such as PC browser and mobile phone app), provide a corresponding data report page and change the operation mode to an operation mode that complies with the version information.
[0035] The present invention uses the above technical solution to perform web display through direct URL access. After obtaining the URL, the verification parameters are parsed, user authority judgment, report authority judgment, data source judgment and data filtering are performed, and then the display page is assembled and returned to the user for display, avoiding problems such as user login, cross-domain, and adaptation. Thus, a convenient embedded report display tool is provided, which can be seamlessly embedded in other services or applications to provide page adaptation problems for PCs and apps. Different personnel permissions (such as administrators, report developers, report viewers, etc.) are processed in a hierarchical manner, and report isolation and data authority isolation are provided for different viewers, providing users with data service capabilities with improved authority management.
[0036] Figure 2 1 is a flow chart of a specific embodiment of the present invention. Figure 2 The data display method of the present invention is specifically described.
[0037] First, you can do the preparatory work in advance. At this point, according to the data requirements, analysts can analyze the data, develop data results, and configure the viewing rules of the personnel according to the report viewing requirements, that is, configure the Jinja template to generate a visual data report. The Jinja template can ensure that different users only see the data of their own authority based on identity information when querying data.
[0038] Specifically, using Python's Jinja template, you can customize parameter variables when making data reports. You can use {{cache_key_wrapper(current_username())}} to represent the currently logged-in user when querying the data source. This condition can be used as a parameter to filter the data during different data processing.
[0039] In addition, you can customize the Jinja template to support more parameter configurations, filtering conditions, etc. For example, you can get the selected time period as follows:
[0040]
[0041] Furthermore, you can use technical expressions to handle more complex requirements, such as displaying different types of charts. Use {{}} expressions to customize parameter templates. You can get data parameters from the system or context.
[0042] For example, get the system indicator zb parameter from the filter condition filter_values, as shown in the following example:
[0043] SELECT*,case when{{"'"+"','".join(filter_values('zb'))+"'"}}='Transaction amount'then total_trans_amt when{{"'"+"','".join(filter_values('zb'))+"'"}}='Transaction number'then total_trans_cnt end as trans_metrics,case when{{"'"+"','".join(filter_values('zb'))+"'"}}='Transaction amount'then'Transaction amount'when{{"'"+"','".join(filter_values('zb'))+"'"}}='Transaction number'then'Transaction number'end as t from hyq_prd.s1_mer_trans_sum. As an example, Figure 4A A schematic diagram showing data display on a PC side is shown; Figure 4B A schematic diagram showing data display on a mobile app is shown.
[0044] Then, refer to Figure 2 , make an embedding page url request. When the third-party system (embedder front end) generates an embedding page for the user, it can call the report service platform (embedder back end and data cube) through steps S202, S204, and S206 to obtain and generate auth_token containing authority authentication information.
[0045] In one embodiment, at step S208, the third-party system may <iframe src="https: ip:port iframe {auth_token}”>Embed the page in the form of access and display the data report in the customer service application or service. The present invention uses iframe embedding mode to embed data, but the current iframe data embedding has a more serious cross-domain solution, especially in the information authentication process, information such as cookie and session cannot be transmitted, and effective verification cannot be done to the user's information. Therefore, in order to solve the data cross-domain problem, the present invention uses header to combine the custom auth_token verification mode to transmit sensitive information, as shown below, so that data security and report embedding access can be guaranteed.
[0047] Next, the third-party system performs front-end embedded data display. As in step S210 , the third party generates an access url based on the auth_token containing authority authentication information to perform a data report platform report request, that is, to access the report page. At step S210, the report platform backend performs auth_token authority authentication. The authentication information of auth_token includes chart authority and chart data authority. In addition, after successful authentication, the data query statement is assembled through the configured user jinja template, and different data report pages are returned for different users. Finally, at step S212 , adaptive data display is performed. Here, users can embed pages in different applications or services, and the returned page supports PC web and mobile app access, and provides different pages according to different types of access methods, so as to achieve data adaptation. Existing adaptive technology only makes adaptive adjustments in page size and position layout, but does not adapt to APP at the level of controls (time selection, drop-down box, single-select multiple-selection, etc.). The adaptation of the data cube not only integrates layout adaptation, presents a better visualization effect, but also carries out secondary adaptation development for the operation control, and performs customized configuration according to the version information of the acquisition system, the browser or the APP situation. The operation mode is changed to the operation mode commonly used by APP.As an example, Figure 3A shows a schematic diagram of a configuration solution; Figure 3B shows a schematic diagram of a display method.
[0050] Figure 5 is an architectural design for implementing the method of data display of the present invention. As shown in Figure 5, the architectural design includes a management unit, permission management, user management, data source management, and data report module management. Moreover, three external data layers, namely a configuration layer (represented by configuring data sources), a permission layer (represented by a permission management interface), and a report embedding layer (represented by cross-application embedding), are abstracted on the module.
[0051] Among them, the functions of the management unit include user group management, permission management, report production, etc. The functions of the permission management include user group permissions. The functions of the user module include administrator users, configuration users, and report viewing users. The functions of the data source management include source data configuration and data management for report viewing users. The functions of the data report module include analyzing data by configuration users, generating reports, and viewing reports by report viewing users. In addition, block 50 can be used to implement the above method of displaying data of the present invention.
[0052] According to another aspect of the present invention, a system for displaying data is provided, and the system is used to form the above method of data display. The system may include a third-party system and a report service platform.When the third-party system generates a page for displaying data, the report service platform sends the auth_token including the authorization authentication information to the third-party system; the third-party system generates the access URL based on the auth_token; the report service platform performs authorization authentication based on the auth_token of the URL, assembles the data query statement through the pre-configured user template, and returns the corresponding data report page for the corresponding user. According to the version information of the third-party system, the corresponding data report page is provided and the operation mode is changed to the operation mode that conforms to the version information. In summary , the present invention has the following benefits: 1. Data authority filtering jinja configuration implementation scheme Jinja is the template engine under Python, mainly for sandbox execution function and optional automatic escape function.The present invention mainly realizes the diversification of data parameter transmission with the automatic escape function of jinja, brings identity information into when data query, ensures that the data that different people see only have the data of their own authority. 2. Solution to the web embedding cross-domain problem
[0057] Common web embedding cannot transmit the problem of cookies, and the operation of authority authentication cannot be performed in the embedded page. This patent utilizes header and custom auto_token verification methods to solve the authority authentication of embedded pages and solve the cross-domain problem during embedding. The above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.< / iframe>
Claims
1. A method for displaying data, characterized in that: include: Customize the parameters of the jinja template, indicate the current logged-in user through the jinja template when querying the data source, and use the current logged-in user as a parameter in different data processing to filter the data corresponding to the parameter; When the third-party system generates an embedded page for displaying data, the report service platform sends an authentication token including authority authentication information to the third-party system; Using an iframe embedding method to embed page access and the third-party system generates an access URL according to the authentication token, wherein the iframe embedding method uses a header including the authentication token to transmit the authority authentication information; The report service platform performs permission authentication according to the authentication token of the URL, and assembles data query statements through the pre-configured Jinja template of Python technology, and returns the corresponding data report page for the corresponding user, wherein, when querying data, according to the identity information, the Jinja template ensures that different users only see the data of their own authority; According to the version information of the third-party system, a corresponding data report page is provided and the operation mode is changed to an operation mode that complies with the version information.
2. The method for displaying data according to claim 1, characterized in that: The permission authentication information of the authentication token includes chart permissions and chart data permissions, and after successful authentication, the data query statement is assembled by configuring the user's Jinja template to return different data report pages for different users.
3. The method for displaying data according to claim 1, characterized in that: The operation mode includes at least one of time selection, drop-down box, single selection and multiple selection.
4. A system for displaying data, characterized in that: Including third-party systems and reporting service platforms, Wherein, when the third-party system generates a page for displaying data, the report service platform sends an authentication token including authority authentication information to the third-party system; Using an iframe embedding method to embed page access and the third-party system generates an access URL according to the authentication token, wherein the iframe embedding method uses a header including the authentication token to transmit the authority authentication information; The report service platform performs permission authentication according to the authentication token of the URL, and assembles data query statements through the pre-configured Jinja template of Python technology, and returns the corresponding data report page for the corresponding user, wherein, when querying data, according to the identity information, the Jinja template ensures that different users only see the data of their own authority; According to the version information of the third-party system, a corresponding data report page is provided and the operation mode is changed to an operation mode that complies with the version information. The report service platform is also used to customize the parameters of the jinja template, indicate the current logged-in user through the jinja template when querying the data source, and use the current logged-in user as a parameter in different data processing to filter the data corresponding to the parameters.
5. The system for displaying data according to claim 4, characterized in that: The permission authentication information of the authentication token includes chart permissions and chart data permissions, and after successful authentication, the data query statement is assembled by configuring the user's Jinja template to return different data report pages for different users.
6. The system for displaying data according to claim 4, characterized in that: The operation mode at least includes time selection and a drop-down box.
