Report configuration method and device, equipment and storage medium

Through the combination of structured query statements and preset mapping rules, the target data in the data report is automatically acquired and replaced, and the problems of low efficiency and high cost of reporting output in the prior art are solved, achieving efficient and accurate report generation.

CN119106069APending Publication Date: 2024-12-10SHANDONG CVIC SOFTWARE ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411331674.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing reports are inefficient and costly, mainly due to the need to manually take values ​​one by one and write complex code logic to check and generate data reports.

Method used

By automatically obtaining target data from preset data sources using structured query statements, and automatically replacing bookmarks in report templates using preset mapping rules, data processing is automated and manual participation is reduced.

Benefits of technology

It improves the efficiency and accuracy of report output, reduces the need for manual participation, and realizes the automation of data processing and the efficiency of report generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106069A_ABST
    Figure CN119106069A_ABST
Patent Text Reader

Abstract

The invention discloses a report configuration method and device, equipment and a storage medium, and relates to the technical field of data processing, and the method comprises the steps: obtaining a structured query statement input by a user, and obtaining target data in a preset data source through the structured query statement, utilizing the preset configuration target, the data attribute of the preset configuration target and the preset bookmark to construct a report template; analyzing a preset configuration target and the data attribute in the report template to obtain a template analysis result, and mapping the target data to a corresponding position of a preset bookmark in the report template according to the template analysis result and a preset mapping rule to obtain an initial report; and rendering the initial report by using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface. According to the method, the target data is automatically obtained, and the preset bookmark is automatically replaced with the target data through the preset mapping rule, so that the data processing process does not need manual participation, and the report generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a report configuration method, device, equipment and storage medium. Background Art

[0002] Report output refers to the process of using computers or human resources to integrate the required data to obtain the corresponding data report, and then issuing the corresponding data report for display. It has broad application prospects in the fields of computers and business.

[0003] At present, report output is achieved by using HTML (Hyper Text Markup Language) to build pages, using JSP (Java Server Pages, a web page development technology) to obtain values ​​for the items that need to be obtained one by one, and manually looking for the required information according to different functions to check the target information, and then judging and giving the results or calculating the results by writing complex code logic, and then entering the verification results into the data report. This leads to low report output efficiency and high cost. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a report configuration method, device, equipment and storage medium, which can automatically obtain target data from a preset data source by using a structured query statement, and automatically replace the preset bookmarks in the report template with the corresponding target data by using a preset mapping rule, so that the data processing process does not require manual participation, thereby improving the report output efficiency. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a report configuration method, comprising:

[0006] Obtaining a structured query statement input by a user, and using the structured query statement to obtain target data in a preset data source, and constructing a report template using a preset configuration target, data attributes of the preset configuration target, and a preset bookmark;

[0007] Parsing the preset configuration target and the data attribute in the report template to obtain a template parsing result, and mapping the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule to obtain an initial report corresponding to the target data; the preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark;

[0008] The initial report is rendered using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

[0009] Optionally, constructing a report template by using a preset configuration target, a data attribute of the preset configuration target, and a preset bookmark includes:

[0010] A mapping relationship between the preset configuration target, the data attribute and the preset bookmark is established, and the report template is constructed using the preset configuration target and the preset bookmark according to the mapping relationship.

[0011] Optionally, mapping the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule includes:

[0012] If the preset configuration information cannot meet the preset data value requirement, a corresponding instance is generated according to the preset configuration information and the target data, so as to map the target data to the corresponding position of the preset bookmark in the report template based on the value logic in the instance; the preset data value requirement is the value requirement of the target data when mapping the target data to the corresponding position of the preset bookmark;

[0013] If the preset configuration information meets the preset data value requirement, the target data is directly mapped to the corresponding position of the preset bookmark in the report template according to the obtained parsing result and the preset mapping rule.

[0014] Optionally, before using the structured query statement to obtain target data in a preset data source, the method further includes:

[0015] A template editing component is constructed using a preset ledger so that the target data can be mapped to a corresponding position of the preset bookmark in the report template using the template editing component; the preset ledger is constructed based on a preset user interface component library.

[0016] Optionally, after mapping the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule, the method further includes:

[0017] A data update instruction is obtained, and the target data corresponding to the data to be updated and the initial report are determined according to the data update instruction, so as to replace the corresponding target data with the data to be updated to obtain an updated initial report.

[0018] Optionally, after replacing the corresponding target data with the data to be updated, the method further includes:

[0019] A data snapshot is generated according to the updated initial report corresponding to the current data to be updated, and after receiving a data query instruction for a target position, a data query is performed on the target data in the updated initial report according to the data snapshot.

[0020] Optionally, performing data query on the target data in the updated initial report according to the data snapshot includes:

[0021] Querying the target data according to the data query instruction, and determining whether there is the target data corresponding to the data query instruction;

[0022] If the target data corresponding to the data query instruction exists, directly sending the target data to the preset client of the user;

[0023] If the target data corresponding to the data query instruction does not exist, the data snapshot corresponding to the current data to be updated is sent to the user's preset client, so that the user can query the target data according to the data snapshot.

[0024] In a second aspect, the present application provides a report configuration device, comprising:

[0025] A template construction module, used to obtain a structured query statement input by a user, and use the structured query statement to obtain target data in a preset data source, and use a preset configuration target, data attributes of the preset configuration target and a preset bookmark to construct a report template;

[0026] a data mapping module, configured to parse the preset configuration target and the data attribute in the report template to obtain a template parsing result, and map the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule, so as to obtain an initial report corresponding to the target data; the preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark;

[0027] The report display module is used to render the initial report using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

[0028] In a third aspect, the present application provides an electronic device, including:

[0029] Memory, used to store computer programs;

[0030] A processor is used to execute the computer program to implement the aforementioned report configuration method.

[0031] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned report configuration method when executed by a processor.

[0032] In the present application, the browser first obtains the structured query statement input by the user, and uses the structured query statement to obtain the target data in the preset data source, and uses the preset configuration target and preset bookmark to build a report template, and then parses the configuration information corresponding to the preset configuration target in the report template, and maps the target data to the corresponding position of the preset bookmark in the report template according to the obtained parsing result and the preset mapping rule, so as to obtain the initial report corresponding to the target data, and finally uses the preset front-end framework to render the initial report according to the preset rendering mechanism to obtain the target report, so as to display the target report in the preset report display interface. In this way, the target data is automatically obtained from the preset data source using the structured query statement, and the preset bookmark is automatically replaced with the corresponding target data by using the preset mapping rule, so that the data processing process does not require human participation, thereby improving the efficiency and accuracy of report generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] 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 or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0034] Figure 1 A flow chart of a report configuration method disclosed in this application;

[0035] Figure 2 A schematic diagram of a report configuration function module disclosed in this application;

[0036] Figure 3 A schematic diagram of a bookmark correspondence code disclosed in this application;

[0037] Figure 4 A schematic diagram of a report template disclosed in this application;

[0038] Figure 5 A schematic diagram of a target report disclosed in this application;

[0039] Figure 6 A schematic diagram of the overall flow of report configuration disclosed in this application;

[0040] Figure 7 A flow chart of a specific report configuration method disclosed in this application;

[0041] Figure 8 This is a schematic diagram of the structure of a report configuration device disclosed in this application;

[0042] Fig. 9This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0043] The following will be combined with the 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 without creative work are within the scope of protection of the present invention.

[0044] Since the current report output is to construct a page using HTML, use JSP to obtain the values ​​of the items that need to be obtained one by one, and manually check the information, there is a problem that the report cannot be edited online and the report output efficiency is low. To this end, the application provides a report configuration method, which automatically obtains target data from a preset data source by using a structured query statement, and automatically replaces the preset bookmark with the corresponding target data by using a preset mapping rule, so that the data processing process does not require manual participation, thereby improving the efficiency and accuracy of report generation.

[0045] See also Figure 1 As shown, an embodiment of the present invention discloses a report configuration method, including:

[0046] Step S11, obtaining a structured query statement input by a user, and using the structured query statement to obtain target data in a preset data source, and constructing a report template using a preset configuration target, data attributes of the preset configuration target and a preset bookmark.

[0047] In this embodiment, three modules are responsible for the report configuration process, such as Figure 2 As shown, they are the template editing layer, the logic processing layer, and the front-end display layer. The template editing layer is responsible for building report templates using preset configuration targets, data attributes of preset configuration targets, and preset bookmarks. In the template editing layer, users can obtain data from multiple data sources by writing structured query statements, and configure the data attributes in the query results and their correspondence with the predefined bookmarks in the report template. This configuration process ensures that the data can be accurately mapped to the corresponding position of the report template, thereby realizing dynamic loading of data and personalized editing of the template. Each configured target corresponds to a specific bookmark in the report template. This mapping relationship provides the basis for flexible editing of the template and accurate display of data. Through this design, the template editing layer improves the efficiency and accuracy of document processing and provides users with powerful document editing capabilities. During the configuration process, each configured target corresponds to a predefined bookmark in the report template. The corresponding relationship is as follows: Figure 3 After the configuration is completed, the following will be generated: Figure 4The report template shown. The above structured query statement is a SQL (Structured Query Language) statement written by the user. Before using the structured query statement to obtain the target data in the preset data source, it specifically includes: using the preset ledger to build a template editing component, so that the template editing component can be used to map the target data to the corresponding position of the preset bookmark in the report template; the preset ledger is built based on the preset user interface component library. The above preset bookmarks are essentially placeholders in the report template, representing specific locations in the report template that need to be dynamically replaced. These locations usually correspond to specific variables, such as the recipient's name, phone number, email address, etc. The values ​​of these variables will dynamically replace the corresponding bookmarks when the report is generated.

[0048] In a specific implementation, the Ant Design component library is used to build a preset ledger, and the preset ledger built by the Ant Design component library and the SQL statement input by the user can realize basic data addition, deletion, modification, and query functions. The Ant Design component library is a React user interface component library based on the Ant Design design system, which aims to provide a comprehensive and reusable set of interface components for the development of enterprise-level mid- and back-end products.

[0049] In this embodiment, constructing a report template using preset configuration targets, data attributes of preset configuration targets and preset bookmarks can specifically include: establishing a mapping relationship between preset configuration targets and data attributes and preset bookmarks, and constructing the report template using the preset configuration targets and preset bookmarks according to the above mapping relationship. In a specific implementation, if the preset configuration target is a telephone number, the data attribute corresponding to the configuration target is a string of 11-digit digital information, a mapping relationship between the telephone number, the digital information and the corresponding preset bookmark is established, and a report template is constructed according to the above mapping relationship. It should be noted that the report template contains multiple different types of information, and the above multiple different types of information are information obtained from multiple preset data sources. In this embodiment, by establishing a mapping relationship between preset configuration targets and data attributes and preset bookmarks, and constructing the report template using the preset configuration targets and preset bookmarks according to the above mapping relationship, the efficiency and accuracy of template editing are improved.

[0050] Step S12, parse the preset configuration target and the data attributes in the report template to obtain a template parsing result, and map the target data to the corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule to obtain an initial report corresponding to the target data; the preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark.

[0051] The logic processing layer in this embodiment is responsible for parsing the preset configuration targets and data attributes in the report template to obtain the template parsing results. Specifically, the configuration information of the template can be parsed first, and then combined with real-time data, according to predefined mapping rules, the bookmarks (or placeholders) in the template are replaced with corresponding content.

[0052] In this embodiment, the target data is mapped to the corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule. In a specific embodiment, if the preset configuration information cannot meet the preset data value requirements, a corresponding instance is generated according to the preset configuration information and the target data, so as to map the target data to the corresponding position of the preset bookmark in the report template based on the value logic in the instance. Among them, the above-mentioned preset data value requirements are the value requirements of the target data when mapping the target data to the corresponding position of the preset bookmark. That is to say, in the process of replacing the bookmarks in the report template, if the configuration information of the template cannot fully meet the value requirements, the logic processing layer will use special processing classes for separate processing. Specifically, it will instantiate these special processing classes and use the value logic defined internally to process the data values ​​of the report. In another specific embodiment, if the preset configuration information meets the preset data value requirements, the target data is directly mapped to the corresponding position of the preset bookmark in the report template according to the obtained parsing results and the preset mapping rules. In this embodiment, the preset configuration information can be used to separately handle situations where the preset data value requirements are met and situations where the preset configuration information cannot meet the preset data value requirements, thereby improving the reliability of the target data mapping process, and realizing dynamic generation and personalized display of documents. It can also improve the flexibility and accuracy of document processing, and provide powerful data display capabilities for upper-level applications.

[0053] Step S13: Render the initial report using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

[0054] In this embodiment, the front-end display layer renders the initial report according to a preset rendering mechanism to obtain a target report to display the target report in a preset report display interface. In a specific implementation, the front-end display layer is constructed using the React front-end framework. React is a JavaScript library for Web (World Wide Web) development that focuses on building high-performance, maintainable user interfaces. It provides a declarative programming paradigm that allows developers to build complex user interfaces in a componentized manner. The rendering mechanism of the React front-end framework is then used to render and intuitively display the templates and real-time data processed by the logic layer on the web page. In this way, the processed data is converted into user-visual interface elements so that users can intuitively view and use these templates. For example, the height of the initial report is set to 800 pixels and the width is set to 1200 pixels. The following is obtained by rendering. Figure 5 The target report shown in the figure. The specific code implementation of its rendering part is as follows:

[0055] apiPreviewContractExcel({key, callback}, { call, put}) {

[0056] Let url = `${window.location.origin} / api / contract / excel?token=${sessionStorage.getItem('currentToken')}&redisKey=${key}&service=contract`

[0057] callJosnHTML();

[0058] POBrowser.openWindowModeless(url, 'width=1200px; height=800px;')

[0059] return

[0060] }.

[0061] like Figure 6As shown, the main process framework of this embodiment is as follows: first, the report template is edited in the template editing layer, and after the editing is completed, the data logic is processed by the logic processing layer. When the data logic processing is completed, the report is displayed to the user in the front-end display layer. In this embodiment, by using a preset rendering mechanism to render the initial report and display it to the user, the user's human-computer interaction experience is improved, allowing the user to view and use the target report more intuitively. In the template editing stage, the user first edits the bookmark in the report template, configures the corresponding data source, and establishes a mapping relationship between data attributes and bookmarks. After this step is completed, the logic processing layer will parse the configuration completed by the template editing layer, and then obtain real-time data, and construct a data structure suitable for front-end display. Finally, with the help of the rendering mechanism of the React front-end framework, the processed data is presented to the user in an intuitive visual form. This process realizes the complete process from template editing to data display, ensuring the accuracy of the data and the effect of visual display.

[0062] It can be seen that the embodiment of the present application automatically obtains target data from a preset data source by using structured query statements, and automatically replaces preset bookmarks with corresponding target data by using preset mapping rules, so that the data processing process does not require human intervention, thereby improving the efficiency and accuracy of report generation. In addition, the embodiment of the present application also constructs a preset ledger by using a preset component library, so that users can use structured query statements to implement data addition, deletion, modification, and query functions.

[0063] When different positions view the same target report, it is possible that one position updates the target data in the report. In this case, other positions may not be able to obtain the updated target data in time. For the above problem, see Figure 7 As shown, the embodiment of the present invention discloses a specific report configuration method, which enables any position to query the latest target data after the target data is updated, including:

[0064] Step S21, obtaining a structured query statement input by a user, and using the structured query statement to obtain target data in a preset data source, and constructing a report template using a preset configuration target, data attributes of the preset configuration target and a preset bookmark.

[0065] Step S22, parse the preset configuration target and the data attribute in the report template to obtain a template parsing result, and map the target data to the corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule to obtain an initial report corresponding to the target data.

[0066] Step S23: obtaining a data update instruction, determining the data to be updated and the corresponding target data in the initial report according to the data update instruction, replacing the corresponding target data with the data to be updated, and obtaining an updated initial report.

[0067] In this embodiment, the data to be updated can be any number. In a specific implementation, one data to be updated is determined according to the data update instruction, for example, 1500 (ship purchase price), and the target price data corresponding to the ship purchase price is determined, for example, 1000. After the data to be updated and the corresponding target data in the initial report are determined, 1000 is replaced with 1500 to obtain the updated initial report. In another specific implementation, two data to be updated are determined according to the data update instruction, for example, the first data to be updated is 1500 (ship purchase price), and the target price data corresponding to the ship purchase price is determined, for example, 1000. After the data to be updated and the corresponding target data in the initial report are determined, 1000 is replaced with 1500; the second data to be updated is 36 (lease term), and the target time data corresponding to the lease term is determined, for example, 12. After the data to be updated and the corresponding target data in the initial report are determined, 36 is replaced with 12 to obtain the updated lease term data and the updated ship purchase price data, thereby obtaining the updated initial report. It is understandable that the above data update instruction includes but is not limited to the data to be updated, the corresponding target data in the initial report, the location of the target data in the initial report, etc. In this embodiment, by determining the data to be updated and the corresponding target data in the initial report according to the data update instruction, and replacing the corresponding initial data with the data to be updated, the timeliness of the initial report is guaranteed and the reliability of the report data is improved.

[0068] Step S24, generating a data snapshot according to the updated initial report corresponding to the current data to be updated, and after receiving a data query instruction for the target position, performing a data query on the target data in the updated initial report according to the data snapshot.

[0069] In this embodiment, after the data replacement is completed, a data snapshot is generated according to the updated initial report corresponding to the current data to be updated. It is understandable that the above data replacement operation can be any number of times, and the above data snapshot is a data snapshot corresponding to the current data to be updated. It should be noted that, according to different application scenarios, the above data snapshot can be a global data snapshot, or it can be a data snapshot corresponding only to the current data to be updated. In a specific embodiment, the purchase price of the ship 1000 in the initial report is replaced with 1500, and a local data snapshot corresponding only to the replaced purchase price of the ship 1500 is generated. In another specific embodiment, if multiple target data are replaced in the initial report, a global data snapshot is generated according to the updated initial report corresponding to the current data to be updated. It is understandable that the global data snapshot contains all the latest data information in the initial report. A table structure is used in the logic processing layer, and its core fields include process number, report identifier and position identifier for storing and managing data. To ensure the timeliness and integrity of the data, a latest data snapshot is generated and saved each time the data is updated. In terms of data query mechanism, this solution follows the principle of position priority: if a specific position already has relevant data records, the data of the position will be directly retrieved and returned; conversely, if no data records have been established for the position, the system will instead query and return the most recently updated global data snapshot. This design can ensure the accessibility and currency of the data while optimizing query efficiency. Specifically, data query is performed on the target data in the initial report based on the data snapshot, which can specifically include: querying the target data according to the data query instruction, and determining whether there is target data corresponding to the data query instruction; if there is target data corresponding to the data query instruction, the target data is directly sent to the user's preset client; if there is no target data corresponding to the data query instruction, the data snapshot corresponding to the current data to be updated is sent to the user's preset client, so that the user can query the target data according to the data snapshot. Its specific code implementation is as follows:

[0070] String condStr = configObject.getString("condition");

[0071] String queryFixationWhereStr = configObject.getString("queryFixationWhere");

[0072] / / Replace the dynamic part and convert to JSONArray

[0073] condStr = JsonUtil.replaceText(condStr, param);

[0074] queryFixationWhereStr = JsonUtil.replaceText(queryFixationWhereStr,param);

[0075] JSONObject paramObj = new JSONObject();

[0076] paramObj.put("command", condStr);

[0077] paramObj.put("queryFixationWhere", queryFixationWhereStr);

[0078] / / Execute the query

[0079] JSONObject result = executeSqlService.executeQueryByCodePageOffice(paramObj);

[0080] / / Get the table flag, if the result is not displayed in a table

[0081] String showAsTableInner = configObject.getString("showAsTableInner");

[0082] String showAsTable = configObject.getString("showAsTable");

[0083] if (!result.getJSONArray("content").isEmpty()) {

[0084] if (null != showAsTableInner && "true".equals(showAsTableInner)) {

[0085] int forLen = result.getJSONArray("content").size();

[0086] for (int i = 0; i < forLen; i++) {

[0087] JSONObject resultTable = (JSONObject) JSONObject.toJSON(result.getJSONArray("content").get(i));

[0088] if(null != resultTable.getString("operstation")) {

[0089] resultTable.put("operstation", resultTable.getString("operstation").replace("\\n",""));

[0090] }

[0091] resultSet.add(resultTable);

[0092] }

[0093] } else {

[0094] result = (JSONObject) JSONObject.toJSON(result.getJSONArray("content").get(0));

[0095] resultSet.add(result);

[0096] }

[0097] }

[0098] DataRegion dataRegion = null;

[0099] if (null != field.getString("target")) {

[0100] dataRegion = doc.openDataRegion(field.getString("target"));

[0101] dataRegion.setValue(value);

[0102] dataRegion.setEditing(false);

[0103] }.

[0104] In this embodiment, a data snapshot is generated through the updated initial report corresponding to the current data to be updated, and the data snapshot is used to perform subsequent data query operations, thereby ensuring the timeliness of the target data in the data snapshot and thus ensuring the reliability of the data query result.

[0105] Step S25, obtaining an initial report corresponding to the target data, rendering the initial report using a preset front-end framework according to a preset rendering mechanism to obtain a target report, and displaying the target report on a preset report display interface.

[0106] Among them, the specific processes of the above-mentioned steps S21, S22, and S25 can refer to the corresponding contents disclosed in the above-mentioned embodiments, and will not be repeated here.

[0107] It can be seen that in the embodiment of the present application, the corresponding target data in the initial report can be updated through the data update instruction. After the update is completed, a data snapshot is made of the updated initial report so that the data search function can be performed using the above data snapshot. The above operation ensures the timeliness of the target data in the data snapshot, thereby ensuring the reliability of the data query results.

[0108] See also Figure 8 As shown, the embodiment of the present invention also discloses a report configuration device, including:

[0109] The template construction module 11 is used to obtain a structured query statement input by a user, and use the structured query statement to obtain target data in a preset data source, and use a preset configuration target, data attributes of the preset configuration target and a preset bookmark to construct a report template;

[0110] A data mapping module 12 is used to parse the preset configuration target and the data attribute in the report template to obtain a template parsing result, and map the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule to obtain an initial report corresponding to the target data; the preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark;

[0111] The report display module 13 is used to render the initial report using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

[0112] It can be seen that the embodiment of the present application automatically obtains target data from a preset data source by using a structured query statement, and automatically replaces the preset bookmark with the corresponding target data by using the preset mapping rules, so that the data processing process does not require human participation, thereby improving the efficiency and accuracy of report generation.

[0113] In some specific embodiments, the template construction module 11 may specifically include:

[0114] The template construction unit is used to establish a mapping relationship between the preset configuration target and the data attribute and the preset bookmark, and construct the report template using the preset configuration target and the preset bookmark according to the mapping relationship.

[0115] In some specific embodiments, the data mapping module 12 may specifically include:

[0116] a first data mapping unit, configured to generate a corresponding instance according to the preset configuration information and the target data, if the preset configuration information cannot meet the preset data value requirement, so as to map the target data to the corresponding position of the preset bookmark in the report template based on the value logic in the instance; the preset data value requirement is the value requirement of the target data when mapping the target data to the corresponding position of the preset bookmark;

[0117] The second data mapping unit is used to directly map the target data to the corresponding position of the preset bookmark in the report template according to the obtained parsing result and the preset mapping rule if the preset configuration information meets the preset data value requirement.

[0118] In some specific embodiments, the report configuration device further includes:

[0119] A component construction module is used to construct a template editing component using a preset ledger, so as to map the target data to the corresponding position of the preset bookmark in the report template using the template editing component; the preset ledger is constructed based on a preset user interface component library.

[0120] In some specific embodiments, the report configuration device further includes:

[0121] The data replacement submodule is used to obtain a data update instruction, determine the data to be updated and the corresponding target data in the initial report according to the data update instruction, and use the data to be updated to replace the corresponding target data to obtain an updated initial report.

[0122] The data query submodule is used to generate a data snapshot according to the updated initial report corresponding to the current data to be updated, and after receiving the data query instruction of the target position, perform data query on the target data in the updated initial report according to the data snapshot.

[0123] In some specific embodiments, the data query submodule may specifically include:

[0124] a data judgment unit, configured to query the target data according to the data query instruction, and judge whether the target data corresponding to the data query instruction exists;

[0125] A first data sending unit, configured to directly send the target data to a preset client of the user if the target data corresponding to the data query instruction exists;

[0126] The second data sending unit is used to send the data snapshot corresponding to the current data to be updated to the preset client of the user if the target data corresponding to the data query instruction does not exist, so that the user can query the target data according to the data snapshot.

[0127] Furthermore, the present application also discloses an electronic device. Fig. 9 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the report configuration method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0128] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0129] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0130] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the report configuration method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0131] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed report configuration method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.

[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0134] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0135] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0136] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A report configuration method, It is characterized in that include: Obtaining a structured query statement input by a user, and using the structured query statement to obtain target data in a preset data source, and constructing a report template using a preset configuration target, data attributes of the preset configuration target, and a preset bookmark; Parsing the preset configuration target and the data attribute in the report template to obtain a template parsing result, and mapping the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule to obtain an initial report corresponding to the target data; The preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark; The initial report is rendered using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

2. The report configuration method according to claim 1, It is characterized in that The step of constructing a report template by using a preset configuration target, a data attribute of the preset configuration target and a preset bookmark includes: A mapping relationship between the preset configuration target, the data attribute and the preset bookmark is established, and the report template is constructed using the preset configuration target and the preset bookmark according to the mapping relationship.

3. The report configuration method according to claim 1, It is characterized in that The mapping the target data to the corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule includes: If the preset configuration information cannot meet the preset data value requirement, a corresponding instance is generated according to the preset configuration information and the target data, so as to map the target data to the corresponding position of the preset bookmark in the report template based on the value logic in the instance; the preset data value requirement is the value requirement of the target data when mapping the target data to the corresponding position of the preset bookmark; If the preset configuration information meets the preset data value requirement, the target data is directly mapped to the corresponding position of the preset bookmark in the report template according to the obtained parsing result and the preset mapping rule.

4. The report configuration method according to claim 1, It is characterized in that Before using the structured query statement to obtain the target data in the preset data source, the method further includes: A template editing component is constructed using a preset ledger so that the target data can be mapped to a corresponding position of the preset bookmark in the report template using the template editing component; the preset ledger is constructed based on a preset user interface component library.

5. The report configuration method according to any one of claims 1 to 4, It is characterized in that After mapping the target data to the corresponding position of the preset bookmark in the report template according to the template parsing result and the preset mapping rule, the method further includes: A data update instruction is obtained, and the target data corresponding to the data to be updated and the initial report are determined according to the data update instruction, so as to replace the corresponding target data with the data to be updated to obtain an updated initial report.

6. The report configuration method according to claim 5, It is characterized in that After replacing the corresponding target data with the data to be updated, the method further includes: A data snapshot is generated according to the updated initial report corresponding to the current data to be updated, and after receiving a data query instruction for a target position, a data query is performed on the target data in the updated initial report according to the data snapshot.

7. The report configuration method according to claim 6, It is characterized in that The performing data query on the target data in the updated initial report according to the data snapshot includes: Querying the target data according to the data query instruction, and determining whether there is the target data corresponding to the data query instruction; If the target data corresponding to the data query instruction exists, directly sending the target data to the preset client of the user; If the target data corresponding to the data query instruction does not exist, the data snapshot corresponding to the current data to be updated is sent to the user's preset client, so that the user can query the target data according to the data snapshot.

8. A report configuration device, It is characterized in that include: A template construction module, used to obtain a structured query statement input by a user, and use the structured query statement to obtain target data in a preset data source, and use a preset configuration target, data attributes of the preset configuration target and a preset bookmark to construct a report template; A data mapping module, used to parse the preset configuration target and the data attribute in the report template to obtain a template parsing result, and map the target data to a corresponding position of the preset bookmark in the report template according to the template parsing result and a preset mapping rule to obtain an initial report corresponding to the target data; The preset mapping rule is a rule determined based on the preset configuration target, the data attribute and the preset bookmark; The report display module is used to render the initial report using a preset front-end framework according to a preset rendering mechanism to obtain a target report, so as to display the target report on a preset report display interface.

9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the report configuration method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that Used to store a computer program, which, when executed by a processor, implements the report configuration method according to any one of claims 1 to 7.