Data display method, device and equipment

By using scripts to map data models and report data in the back-end server, dynamically adjusting query statements and chart types, the problems of difficulty in front-end maintenance and complicated data display are solved, and dynamic expansion of code and system flexibility and ability are realized. Maintenance.

CN119248868APending Publication Date: 2025-01-03CHINA UNICOM SMART CONNECTION TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411194897.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the existing report generation and visualization technologies, front-end and back-end maintenance is difficult, and frequent code modifications are required, resulting in complex and difficult maintenance of the system. At the same time, the data display process is cumbersome and complicated and lacks flexibility.

Method used

By using scripts in the backend server to map the data model to report data, dynamically adjust query statements and chart types, reduce the number of code releases, realize the decoupling of business code and query statements, and uniformly maintain query statements and scripts, reducing the complexity of use .

Benefits of technology

It improves the dynamic expansion capability and maintainability of the code, reduces the number of service releases, simplifies the data display process, reduces the configuration complexity, and improves the flexibility and readability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248868A_ABST
    Figure CN119248868A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of databases, in particular to a data display method, device and equipment. The data display method is applied to a back-end server, and comprises the following steps: in response to a received front-end request, determining original report data from a first database based on the front-end request, and determining a first script from a second database; obtaining a target model attribute field by executing the first script; mapping the original report data as target data to the target model attribute field to obtain a report display result; and feeding back the report display result to a front end for display. According to the embodiment of the invention, the dynamic expansion capability of the code is improved, and the release times and restart times of the service are reduced. The dynamic adjustment of the query statement is realized, and meanwhile, the decoupling of the business code and the query statement change logic is realized through the configuration script, so that the readability and maintainability of the code are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and specifically to a data display method, device and equipment. Background Art

[0002] In existing report generation and visualization technologies, static reports and charts are usually used, which cannot reflect data changes in real time. In addition, although some systems provide dynamic update functions, the interaction between the backend and the frontend requires many interfaces, which makes it relatively difficult to maintain both the frontend and the backend. Moreover, the pre-configured code is not flexible enough. If you need to add new report field attributes, the backend needs to modify the code and republish it. As the report indicators continue to increase, the code will become more and more bloated and complex, and the number of interfaces that need to be maintained will increase, which will eventually make it difficult to maintain.

[0003] At the same time, the current mainstream data visualization tools are relatively cumbersome and complicated to use. For example, some products first require you to configure the view, and then configure related information such as instrument charts, which makes them relatively complicated to use. Summary of the invention

[0004] The embodiments of the present invention provide a data display method, device and equipment to solve the problems of difficult front-end and back-end maintenance and the need for repeated releases in the report generation process in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a data display method, which is applied to a backend server and includes:

[0006] In response to the received front-end request, determining original report data from the first database based on the front-end request, and determining a first script from the second database;

[0007] Obtaining the target model attribute field by executing the first script;

[0008] Mapping the original report data as target data to the target model attribute field to obtain a report display result;

[0009] The report display results are fed back to the front end for display.

[0010] Optionally, determining original report data from the first database based on the front-end request includes:

[0011] Obtaining query parameters and query statement information from the front-end request;

[0012] Determine a first query statement from the second database according to the query statement information;

[0013] Determine a target query condition according to the query parameter and the first query statement;

[0014] The original report data is determined from the first database according to the target query condition.

[0015] Optionally, determining the first script from the second database includes:

[0016] Obtaining a target chart type for the report display result from the front-end request;

[0017] A corresponding first script is determined from the second database according to the target chart type.

[0018] Optionally, after obtaining the target model attribute field by executing the first script, the method further includes:

[0019] Determining whether the determined original report data needs to be modified;

[0020] When it is determined that the original report data needs to be modified, determining a second script from the second database;

[0021] executing the second script to process the original report data into modified report data;

[0022] The report display result obtained includes:

[0023] The modified report data is used as the target data and mapped to the target model attribute field to obtain a report display result.

[0024] Optionally, the determining whether the determined original report data needs to be modified includes:

[0025] Determine whether the query statement information in the front-end request carries script information;

[0026] When the query statement information carries script information, it is determined that the original report data needs to be modified, and the script information is used to determine the second script from the second server.

[0027] Optionally, before responding to the received front-end request, the method further includes:

[0028] Configure query statements in the second database and configure several scripts.

[0029] In a second aspect, an embodiment of the present invention provides a data display device, the device comprising:

[0030] A determination module, in response to the received front-end request, determines the original report data from the first database based on the front-end request, and determines the first script from the second database;

[0031] An execution module, which obtains a target model attribute field by executing the first script;

[0032] A mapping module maps the original report data as target data to the target model attribute field to obtain a report display result;

[0033] The display module feeds back the report display results to the front end for display.

[0034] Optionally, after obtaining the target model attribute field by executing the first script, the method further includes:

[0035] Determining whether the determined original report data needs to be modified;

[0036] When it is determined that the original report data needs to be modified, determining a second script from the second database;

[0037] executing the second script to process the original report data into modified report data;

[0038] The report display result obtained includes:

[0039] The modified report data is used as the target data and mapped to the target model attribute field to obtain a report display result.

[0040] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0041] at least one processor; and

[0042] at least one memory in communication with the processor, wherein:

[0043] The memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method as described in any one of the first aspects.

[0044] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any method described in the first aspect.

[0045] In the embodiment of the present invention, by storing the data models of different types of icons in the database in the form of scripts and mapping the data to different models by executing the scripts, the dynamic expansion capability of the code is improved, and the number of service releases and restarts is reduced. The query statement is dynamically adjusted through the configuration script and parameter information, and the business code and query statement change logic are decoupled through the configuration script, which improves the readability and maintainability of the code.

[0046] Maintaining query statements and scripts in a unified manner in a preset database facilitates centralized management and dynamic changes of query statements and scripts. It also reduces usage complexity and avoids processes such as configuring views and configuring instruments. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 The figure shows a structural schematic diagram of a data display system provided in an embodiment of the present application;

[0049] Figure 2 Shown is a flow chart of a data display method provided in an embodiment of the present application;

[0050] Figure 3 The figure shows a schematic diagram of the structure of a data display device provided in an embodiment of the present application;

[0051] Figure 4 Shown is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0053] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0054] like Figure 1 FIG. 1 is a schematic diagram of a data display system provided by an embodiment of the present invention. Figure 1The data display system includes: a front-end server 110, a back-end server 120, a first database 130 and a second database 140. The back-end server establishes connections with the front-end server, the first database and the second database through an interface to achieve data interaction.

[0055] The front-end server 110 is used to receive user instructions, generate a front-end request according to the user instructions, and send it to the back-end server, so that the back-end server can query the corresponding report data from the database for display.

[0056] The first database 130 is used to store report data.

[0057] The second database 140 is used to store pre-configured query statements and scripts. The query statements are used to execute various query functions in the first database based on different configurations. The scripts are used to dynamically change the target model attribute fields in the report display results, and process the queried original report data to enhance the dynamic expansion capability of the report.

[0058] The back-end server 120 is used to receive the front-end request sent by the front-end server, and retrieve the corresponding first query statement and the first script from the second database according to the front-end request. The corresponding original report data is queried from the first database through the first query statement, and the target model attribute field is obtained by executing the first script. The original report data is mapped to the target model attribute field to obtain the report display result, which is fed back to the front-end server for display.

[0059] The back-end server is further used to obtain a second script from the second database according to the front-end request sent by the front-end server, and to modify the original report data obtained from the first database by executing the second script to implement some complex business logic.

[0060] like Figure 2 FIG. 1 is a flow chart of a data display method provided by an embodiment of the present invention. Figure 1 The data display system shown is shown in Figure 2 , this method is applied to Figure 1 The backend server 120 shown in the figure, the specific steps of the method include:

[0061] S201 , in response to a received front-end request, determining original report data from a first database based on the front-end request, and determining a first script from a second database.

[0062] Specifically, in response to the front-end request sent by the front-end server, the data display process is started. The front-end request includes query parameters, query statement information, and chart type.

[0063] The query parameters are specific conditions for executing data query in the first database, such as time range, data range, specific indicators, etc. The query statement information is the ID information of the Structured Query Language (SQL), which is used to determine the first query statement to be executed, that is, to determine the SQL statement to be executed. Generally, the SQL statement is stored in the second database in JSON format.

[0064] According to the query statement information, the first query statement to be executed is determined from the second database, and the target query condition is determined by the query parameter and the first query statement to limit the scope of the retrieved data. The original report data is determined by querying the first database according to the target query condition.

[0065] The icon type is the style in which the report display result is presented to the user, and generally may include a bar chart, a pie chart, a line chart, etc. The corresponding first script is determined from the second database according to the icon type.

[0066] Before executing S201, the query statements and scripts need to be configured in the second database in advance. Optionally, when a target model attribute field of a certain chart type needs to be added, a new script can be directly configured, or the existing script can be directly modified to achieve it.

[0067] In the embodiment of the present invention, the first database may be a StarRocks database, or other implementable databases. The second database may be a MySQL database, or other implementable databases. The script may be a Groovy script, or other implementable scripts.

[0068] S202, obtaining a target model attribute field by executing a first script.

[0069] S203, mapping the original report data as target data to the target model attribute field to obtain a report display result.

[0070] Specifically, when there is no need to perform further processing on the original report data, the original report data is directly mapped to the target model attribute field as the target data to obtain the report display result.

[0071] In some embodiments, since the original report data needs to be adjusted by executing some complex business logic, in addition to directly mapping the original report data to the target model attribute field to obtain the report display result, it is also necessary to determine whether the original report data needs to be modified. When it is determined that the original report data needs to be modified, a second script is determined from the second database, and the modification of the original report data is implemented by executing the second script, and the original report data is processed into modified report data. Further, the modified report data is mapped to the target model attribute field as the target data to obtain the report display result.

[0072] When determining whether the original report data needs to be modified, it is necessary to determine whether the query statement information in the front-end request carries script information. Generally, when the query statement cannot directly execute some complex business logic, it will carry script information and execute these operations by specifying the script.

[0073] When it is determined that the query statement information carries script information, it is determined that the original report data needs to be further modified. The corresponding second script is determined from the second database through the script information, and the second script is executed to process the original report data into modified report data.

[0074] S204, feeding back the report display result to the front end for display.

[0075] In the embodiment of the present invention, by storing the data models of different types of icons in the database in the form of scripts and mapping the data to different models by executing the scripts, the dynamic expansion capability of the code is improved, and the number of service releases and restarts is reduced. The query statement is dynamically adjusted through the configuration script and parameter information, and the business code and query statement change logic are decoupled through the configuration script, which improves the readability and maintainability of the code.

[0076] Maintaining query statements and scripts in a unified manner in a preset database facilitates centralized management and dynamic changes of query statements and scripts. It also reduces usage complexity and avoids processes such as configuring views and configuring instruments.

[0077] Corresponding to the above data display method, the present application embodiment also provides a data display device. Figure 3 , is a structural diagram of a data display device provided in an embodiment of the present application. The data display device may include: a determination module 301, an execution module 302, a mapping module 303 and a display module 304.

[0078] The determination module 301, in response to the received front-end request, determines the original report data from the first database based on the front-end request, and determines the first script from the second database.

[0079] The execution module 302 obtains the target model attribute field by executing the first script.

[0080] The mapping module 303 maps the original report data as target data to the target model attribute field to obtain a report display result.

[0081] The display module 304 feeds back the report display result to the front end for display.

[0082] Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present specification. Figure 4 As shown, the electronic device may include at least one processor; and at least one memory communicatively connected to the processing unit, wherein the memory stores program instructions that can be executed by the processing unit, and the processor calls the program instructions to execute the data display method provided in this embodiment.

[0083] The electronic device can be a device capable of intelligently communicating with a user, such as a cloud server, and the specific form of the electronic device is not limited in the embodiments of this specification. It can be understood that the electronic device here is the machine mentioned in the method embodiment.

[0084] Figure 4 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present description is shown. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of this specification.

[0085] like Figure 4 As shown, the electronic device is in the form of a general computing device. The components of the electronic device may include but are not limited to: one or more processors 410, communication interface 420, memory 430, and a communication bus 440 connecting different system components (including memory 430, communication interface 420 and processor 410).

[0086] The communication bus 440 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0087] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.

[0088] The memory 430 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 430 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of each embodiment of the present specification.

[0089] A program / utility having a set (at least one) of program modules may be stored in memory 430, such program modules including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules generally perform the functions and / or methods of the embodiments described in this specification.

[0090] The processor 410 executes various functional applications and data processing by running the programs stored in the memory 430, such as implementing the data display method provided in the embodiments shown in this specification.

[0091] An embodiment of the present specification provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the data display method provided by the embodiment shown in the present specification.

[0092] The above-mentioned non-transitory computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (Read Only Memory; hereinafter referred to as: ROM), an erasable programmable read-only memory (Erasable Programmable Read Only Memory; hereinafter referred to as: EPROM) or flash memory, optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0093] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0094] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0095] Computer program code for performing the operations of this specification may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0096] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0097] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this specification, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0098] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of this specification includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of this specification belong.

[0099] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0100] It should be noted that the terminals involved in the embodiments of this specification may include but are not limited to personal computers (Personal Computer; hereinafter referred to as: PC), personal digital assistants (Personal Digital Assistant; hereinafter referred to as: PDA), wireless handheld devices, tablet computers (Tablet Computer), mobile phones, MP3 players, MP4 players, etc.

[0101] In the embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0102] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0103] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of this specification.

[0104] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A data display method, characterized in that: The method is applied to a backend server, and the method comprises: In response to the received front-end request, determining original report data from the first database based on the front-end request, and determining a first script from the second database; Obtaining the target model attribute field by executing the first script; Mapping the original report data as target data to the target model attribute field to obtain a report display result; The report display results are fed back to the front end for display.

2. The method according to claim 1, characterized in that The determining the original report data from the first database based on the front-end request includes: Obtaining query parameters and query statement information from the front-end request; Determine a first query statement from the second database according to the query statement information; Determine a target query condition according to the query parameter and the first query statement; The original report data is determined from the first database according to the target query condition.

3. The method according to claim 1, characterized in that Determining the first script from the second database includes: Obtaining a target chart type for the report display result from the front-end request; A corresponding first script is determined from the second database according to the target chart type.

4. The method according to claim 1, characterized in that: After obtaining the target model attribute field by executing the first script, the method further includes: Determining whether the determined original report data needs to be modified; When it is determined that the original report data needs to be modified, determining a second script from the second database; executing the second script to process the original report data into modified report data; The report display result obtained includes: The modified report data is used as the target data and mapped to the target model attribute field to obtain a report display result.

5. The method according to claim 4, characterized in that The determining whether the determined original report data needs to be modified includes: Determine whether the query statement information in the front-end request carries script information; When the query statement information carries script information, it is determined that the original report data needs to be modified, and the script information is used to determine the second script from the second server.

6. The method according to claim 1, characterized in that Before responding to the received front-end request, the method further includes: Configure query statements in the second database and configure several scripts.

7. A data display device, characterized in that: The device comprises: A determination module, in response to the received front-end request, determines the original report data from the first database based on the front-end request, and determines the first script from the second database; An execution module, which obtains a target model attribute field by executing the first script; A mapping module maps the original report data as target data to the target model attribute field to obtain a report display result; The display module feeds back the report display results to the front end for display.

8. The method according to claim 7, characterized in that After obtaining the target model attribute field by executing the first script, the method further includes: Determining whether the determined original report data needs to be modified; When it is determined that the original report data needs to be modified, determining a second script from the second database; executing the second script to process the original report data into modified report data; The report display result obtained includes: The modified report data is used as the target data and mapped to the target model attribute field to obtain a report display result.

9. An electronic device, characterized in that: include: at least one processor; as well as at least one memory in communication with the processor, wherein: The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 6 by calling the program instructions.

10. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 6.