Report generation method and device, equipment, medium and program product
By processing report generation subtasks in parallel and updating the front-end page in real time, the problems of low report generation efficiency and poor user experience in the existing technology are solved, and more efficient report generation and better user experience are achieved.
Patent Information
- Application Number
- CN202411731029.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art requires waiting for all data calculations to be completed before the existing technology can generate visual charts, resulting in long wait times for users, poor user experience and low report generation efficiency.
By responding to the user's report generation instructions, the report generation task is determined and decomposed into multiple subtasks. Multiple threads in the thread pool process these subtasks in parallel, and the front-end page is updated in real time to display the report sub-results.
Improves the efficiency and response speed of report generation, reduces user waiting time, improves user experience, and allows instant feedback on the generation progress when some subtasks are completed.
Smart Images

Figure CN119647434A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of communication technology and financial technology, and in particular to a report generation method, apparatus, device, medium and program product. Background Art
[0002] Online analysis of reports is a software function that allows users to preview newly generated data results online. Users can complete the calculation output results by configuring the required templates, calculation benchmarks, and indicators, and analyze the output results online, dynamically splice the data result set, and use the drawing plug-in to produce visual charts in real time for intuitive preview. Users can conduct specific analysis of data through real-time trial calculations and online previews, which can solve related business tasks more intuitively and efficiently.
[0003] In the process of implementing the present disclosure, the inventors found that the prior art has at least the following problems: when generating a report, it is usually necessary to wait for the calculation results of all data to be completed before generating a visual chart for the user to preview. The user will wait for a long time without getting any feedback, resulting in poor user experience and low report generation efficiency. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a report generation method, apparatus, device, medium and program product.
[0005] According to a first aspect of the present disclosure, a report generation method is provided, comprising: in response to receiving a report generation instruction sent by a user, determining a report generation task corresponding to the report generation instruction, wherein the report generation task includes a plurality of report generation subtasks; utilizing a plurality of threads in a thread pool to process the plurality of report generation subtasks, and for each report generation subtask, processing target data according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask; determining display content of the report subresult on a front-end page; updating the front-end page based on the display content; and determining a report based on the front-end page after the plurality of report generation subtasks have completed updating the front-end page.
[0006] According to an embodiment of the present disclosure, determining the display content of the report sub-result on the front-end page includes: determining the table content in the data table on the front-end page based on the report sub-result; determining the graph content in the data graph on the front-end page based on the report sub-result; and determining the display content based on the table content and the graph content.
[0007] According to an embodiment of the present disclosure, based on the report sub-results, determining the graph content in the data graph on the front-end page includes: determining one or more result values of the report sub-results; determining the graph type of the data graph, wherein the graph types include line graphs, bar graphs, and pie charts; and calculating the one or more result values based on a calculation method corresponding to the graph type to obtain the graph content.
[0008] According to an embodiment of the present disclosure, the front-end page is updated based on the display content, including: when the graph type is a line graph or a bar graph, based on the value range of one or more result values, determining whether the result value range of the data graph needs to be adjusted; when it is determined that the result value range needs to be adjusted, adjusting the result value range based on the value range of one or more result values; based on the adjusted result value range, proportionally adjusting the size of the existing historical graph content in the data graph; representing the one or more result values on the data graph; and / or when the graph type is a pie chart, based on the one or more result values and the historical result values corresponding to the historical graph content, re-determining the update ratio of each of the one or more result values and the historical result values; and updating the data graph based on the update ratio.
[0009] According to an embodiment of the present disclosure, the report generation method further includes: when the display content is the first display content in the front-end page, based on one or more result values and graph types, displaying the display content on a data graph.
[0010] According to an embodiment of the present disclosure, target data is processed according to a report generation subtask to obtain report subresults, including: based on the report generation subtask, determining task requirements, wherein the task requirements include a calculation method for target data and report subresults; according to the task requirements, determining a target database; based on the task requirements, obtaining target data from the target database; and based on the calculation method, processing the target data to obtain report subresults.
[0011] According to an embodiment of the present disclosure, the report generation method also includes: in response to receiving a report query instruction sent by a user, determining a target report corresponding to the report query instruction; determining whether the target report has been completely generated, wherein, if there is an unfinished report generation subtask in the report generation instruction corresponding to the target report, determining that the target report has not been completely generated, and if the report subresult of the report generation subtask has not updated the front-end page, determining that the report generation subtask is not completed; if the target report has been completely generated, sending the target report to the user; if the target report has not been completely generated, determining the generation progress of the target report, and determining an intermediate report based on the update of the front-end page by the completed report generation subtask, wherein the generation progress is determined according to the number of completed report generation subtasks and the number of all report generation subtasks; and sending the generation progress and the intermediate report to the user.
[0012] A second aspect of the present disclosure provides a report generation device, including: a task segmentation module, for determining a report generation task corresponding to a report generation instruction in response to receiving a report generation instruction sent by a user, wherein the report generation task includes multiple report generation subtasks; a data processing module, for processing multiple report generation subtasks using multiple threads in a thread pool, and for each report generation subtask, processing target data according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask; a content determination module, for determining the display content of the report subresult on a front-end page; a page update module, for updating the front-end page based on the display content; and a report determination module, for determining a report based on the front-end page after multiple report generation subtasks have completed the update of the front-end page.
[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0014] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0015] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.
[0016] According to an embodiment of the present disclosure, in response to a report generation instruction sent by a user, multiple report generation subtasks included therein are determined, and multiple report generation subtasks are processed in parallel using multithreading, thereby improving the response speed of each report generation subtask and improving the efficiency of report generation. For each completed report generation subtask, the front-end page is updated using its report subresults and the display content on the front-end page, which can ensure that when there are uncompleted report generation subtasks, the front-end page can correctly display the data. In addition, when there are uncompleted report generation subtasks, the results corresponding to the completed report generation subtasks can be queried, thereby improving the feedback efficiency of the report, thereby improving the efficiency of report generation and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 A diagram schematically illustrates an application scenario of a report generation method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a report generation method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3A A schematic diagram schematically shows a front-end page before the report generation subtask according to an embodiment of the present disclosure is completed;
[0021] Figure 3B A schematic diagram schematically shows a front-end page after the report generation subtask according to an embodiment of the present disclosure is executed;
[0022] Figure 4 A structural block diagram of a report generating device according to an embodiment of the present disclosure is schematically shown; and
[0023] Figure 5 A block diagram of an electronic device suitable for implementing a report generating method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0027] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0029] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0031] An embodiment of the present disclosure provides a report generation method, which, in response to receiving a report generation instruction sent by a user, determines a report generation task corresponding to the report generation instruction, wherein the report generation task includes multiple report generation subtasks; uses multiple threads in a thread pool to process the multiple report generation subtasks, and for each report generation subtask, processes target data according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask; determines display content of the report subresult on a front-end page; updates the front-end page based on the display content; and determines a report based on the front-end page after multiple report generation subtasks have completed the update of the front-end page.
[0032] Figure 1 The application scenario diagram of the report generation method, apparatus, device, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0033] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0034] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0036] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0037] It should be noted that the report generation method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the report generation device provided in the embodiment of the present disclosure can generally be set in the server 105. The report generation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the report generation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0039] The following will be based on Figure 1 The scene described by Figure 2 , Figure 3A , Figure 3B The report generation method of the disclosed embodiment is described in detail.
[0040] Figure 2 The flowchart of the report generation method according to the embodiment of the present disclosure is schematically shown.
[0041] like Figure 2 As shown, the report generation method of this embodiment includes operations S210 to S250.
[0042] In operation S210 , in response to receiving a report generation instruction sent by a user, a report generation task corresponding to the report generation instruction is determined.
[0043] According to an embodiment of the present disclosure, a report generation task includes multiple report generation subtasks. After receiving a report generation instruction sent by a user, multiple data included in the report to be generated can be determined according to the report generation instruction, and multiple report generation subtasks can be determined according to the multiple data, thereby determining the report generation task.
[0044] In operation S220, multiple threads in the thread pool are used to process multiple report generation subtasks, and for each report generation subtask, target data is processed according to the report generation subtask to obtain a report subresult.
[0045] According to an embodiment of the present disclosure, multiple threads in a thread pool are used to perform parallel processing on multiple report generation subtasks. For each report generation subtask, one thread is used to process target data corresponding to the report generation subtask in accordance with the data format or data calculation method required by the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask.
[0046] In operation S230, the display content of the report sub-result on the front-end page is determined.
[0047] According to an embodiment of the present disclosure, the front-end page can be used to display a report generated according to a report generation instruction, and the display content includes the content of the report sub-results displayed on the front-end page. For example, if the report sub-results need to be filled in a data table on the front-end page, the display content includes the corresponding data rows in the data table.
[0048] In operation S240, the front page is updated based on the displayed content.
[0049] According to an embodiment of the present disclosure, a method for updating a front-end page is determined based on displayed content, and the front-end page is updated.
[0050] In operation S250 , after the plurality of report generation subtasks have completed updating the front-end page, a report is determined based on the front-end page.
[0051] According to an embodiment of the present disclosure, after the multiple report generation subtasks included in the report generation task have completed the update of the front-end page, it is characterized that the report generation task has been completed, and the data in the corresponding report sub-results has been filled in on the front-end page. Therefore, the generated report can be determined based on the content in the current front-end page.
[0052] According to an embodiment of the present disclosure, in response to a report generation instruction sent by a user, multiple report generation subtasks included therein are determined, and multiple report generation subtasks are processed in parallel using multithreading, thereby improving the response speed of each report generation subtask and improving the efficiency of report generation. For each completed report generation subtask, the front-end page is updated using its report subresults and the display content on the front-end page, which can ensure that when there are uncompleted report generation subtasks, the front-end page can correctly display the data. In addition, when there are uncompleted report generation subtasks, the results corresponding to the completed report generation subtasks can be queried, thereby improving the feedback efficiency of the report, thereby improving the efficiency of report generation and improving the user experience.
[0053] According to an embodiment of the present disclosure, determining the display content of the report sub-result on the front-end page includes: determining the table content in the data table on the front-end page based on the report sub-result; determining the graph content in the data graph on the front-end page based on the report sub-result; and determining the display content based on the table content and the graph content.
[0054] According to an embodiment of the present disclosure, the displayed content may include table content and graph content, wherein the table content may be represented as data rows in a data table on the front page, and the graph content may be represented as elements on a data graph on the front page, such as a broken line.
[0055] According to an embodiment of the present disclosure, based on the report sub-results, the content of the data row that needs to be filled into the data table, i.e., the table content, and the elements that need to be represented on the data graph, i.e., the graph content, are determined. Based on the table content and the graph content, the display content that needs to be displayed on the front-end page is determined.
[0056] According to the embodiments of the present disclosure, the display content of the report sub-results is determined according to the graph content and the table content, and the report sub-results can be displayed in multiple forms, thereby enriching the dimension of the report and improving the availability of data.
[0057] According to an embodiment of the present disclosure, based on the report sub-results, determining the graph content in the data graph on the front-end page includes: determining one or more result values of the report sub-results; determining the graph type of the data graph, wherein the graph types include line graphs, bar graphs, and pie charts; and calculating the one or more result values based on a calculation method corresponding to the graph type to obtain the graph content.
[0058] According to an embodiment of the present disclosure, a calculation method for one or more result values of a report sub-result and a representation method for the result are determined according to the graph type of the data graph, and one or more result values are calculated according to the data graph and the calculation method. According to the calculated one or more result values, the calculated one or more result values are plotted according to the representation method to obtain graph content.
[0059] For example, when the graph type is a bar graph, the representation method is to draw data columns corresponding to the result values. Then, one or more data columns corresponding to the size relationship can be determined according to the size of one or more calculated result values.
[0060] According to the embodiments of the present disclosure, according to different graph types, the graph content corresponding to the result value can be accurately and quickly determined, thereby improving the efficiency and accuracy of report generation.
[0061] According to an embodiment of the present disclosure, the front-end page is updated based on the display content, including: when the graph type is a line graph or a bar graph, based on the value range of one or more result values, determining whether the result value range of the data graph needs to be adjusted; when it is determined that the result value range needs to be adjusted, adjusting the result value range based on the value range of one or more result values; based on the adjusted result value range, proportionally adjusting the size of the existing historical graph content in the data graph; representing the one or more result values on the data graph; and / or when the graph type is a pie chart, based on the one or more result values and the historical result values corresponding to the historical graph content, re-determining the update ratio of each of the one or more result values and the historical result values; and updating the data graph based on the update ratio.
[0062] According to an embodiment of the present disclosure, when the graph type is a line graph or a bar graph, based on the value ranges of one or more result values and the current value range of the data graph, it is determined whether the result value range of the data graph needs to be adjusted, wherein, when the current result value range of the data graph includes the value ranges of one or more result values, it can be determined that the result value range does not need to be adjusted, and when the value ranges of one or more result values are not completely included by the current result value range of the data graph, it can be determined that the result value range needs to be adjusted.
[0063] According to an embodiment of the present disclosure, when it is determined that the result value range needs to be adjusted, the adjusted result value range is determined based on the value range of one or more result values and the current value range of the data graph, wherein the result value range can be determined by calculating the intersection between the value range of one or more result values and the current value range of the data graph, and the result value range is adjusted using the adjusted result value range.
[0064] According to an embodiment of the present disclosure, the size of the existing historical graph content in the data graph is adjusted based on the proportional relationship between the adjusted result value range and the value range of the data graph before the adjustment.
[0065] According to an embodiment of the present disclosure, when the graph type is a pie chart, based on one or more result values and historical result values corresponding to the historical graph content, the update proportions of the one or more result values and the historical result values are calculated respectively, and the data graph is updated.
[0066] According to an embodiment of the present disclosure, when the report generation subtask is not completed, the historical data corresponding to the report generation subtask can be displayed on the front-end page, and a mark can be used to indicate that the report generation subtask is not yet completed.
[0067] According to the embodiments of the present disclosure, based on the display content and the graph type of the data graph, the update status of the data graph is determined, and the data graph is updated. Through the data graph update method, when some report generation subtasks are completed and the remaining report generation subtasks are not completed, the display content corresponding to the completed report generation subtasks can be displayed on the data graph first, and the data graph can be updated in time after the new report generation subtask is completed, thereby improving the response speed of report generation, avoiding waiting for all report generation subtasks to be completed before generating reports, and improving the efficiency of report generation.
[0068] Figure 3A The schematic diagram schematically shows the front-end page before the report generation subtask according to the embodiment of the present disclosure is executed.
[0069] like Figure 3A As shown, the front-end page 310 before the update may include a data table 311 before the update, a bar chart 312 before the update, and a pie chart 313 before the update. Among them, the report generation task currently being executed includes six report generation subtasks, namely, task A, task B, task C, task D, task E, and task F. Each report generation subtask includes four field values, namely, field 1 to field 4. The bar chart 312 before the update is a bar chart of field 3, and the pie chart 313 before the update is a pie chart of field 2. Since the current report generation subtask, that is, task F, has not been completed yet, the historical data of the current report generation subtask is obtained by querying the historical data, and it is displayed on the front-end page, and the data rows or data tables related to the report generation subtask are marked to prompt the user to pay attention to the reliability of the data.
[0070] Figure 3B The schematic diagram schematically shows the front-end page after the report generation subtask according to the embodiment of the present disclosure is executed.
[0071] like Figure 3BAs shown, the updated front-end page 320 may include an updated data table 321, an updated bar chart 322, and an updated pie chart 323. Task F has been calculated, and the values of fields 1 to 4 are F1', F2', F3', and F4', respectively. The data table 311 before the update is updated using the above result values to obtain the updated data table 321, and the bar chart 312 before the update and the pie chart 313 before the update are updated using F3' and F2', respectively, to obtain the updated bar chart 322 and the updated pie chart 323.
[0072] According to an embodiment of the present disclosure, when updating the bar chart, the relationship between the value of F3' and the current value range of the data chart is determined, and it is determined that the value of F3' does not fall within the current value range of the data chart. Therefore, the value range of the data chart can be modified according to the value of F3', and the adjusted result value range is [10, 200]. After adjusting the result value range, the size of the historical graph content corresponding to A3~E3 is adjusted, and the graph content corresponding to F3' is determined and added to the data chart to obtain an updated bar chart 322.
[0073] According to an embodiment of the present disclosure, when updating the pie chart, the sum of the value of F2' and the values of A2-E2 is determined, and the update proportions corresponding to A2-E2 and F2' are determined respectively, and the data graph is updated to obtain an updated pie chart 323.
[0074] According to an embodiment of the present disclosure, the report generation method further includes: when the display content is the first display content in the front-end page, based on one or more result values and graph types, displaying the display content on a data graph.
[0075] According to an embodiment of the present disclosure, when the display content is the first display content in the front-end page, the display content is directly displayed on the data graph, and then the historical data corresponding to other report generation subtasks are read, and multiple historical data are adjusted according to the value range of the current data graph and displayed on the data graph respectively.
[0076] According to the embodiments of the present disclosure, since the display content is the first display content in the front-end page, among multiple report generation subtasks, only the display content corresponding to the currently executed report generation subtask is real and accurate data, and other data are determined based on historical data. Therefore, the historical data of other report generation subtasks need to be adjusted based on accurate data to reduce the update amplitude that needs to be adjusted and updated when new display content is obtained after the execution of other report generation subtasks, thereby improving the efficiency of report generation.
[0077] According to an embodiment of the present disclosure, target data is processed according to a report generation subtask to obtain report subresults, including: based on the report generation subtask, determining task requirements, wherein the task requirements include a calculation method for target data and report subresults; according to the task requirements, determining a target database; based on the task requirements, obtaining target data from the target database; and based on the calculation method, processing the target data to obtain report subresults.
[0078] According to an embodiment of the present disclosure, based on a report generation subtask, the type of data item that needs to be determined for the report generation subtask can be determined, such as the inventory of a product in a warehouse. According to task requirements, the target database can be determined, and the target data required to calculate the report subresults can be obtained from the target database.
[0079] According to an embodiment of the present disclosure, based on the report generation subtask, the calculation method of the report subresult can also be determined. For example, if the change rate of the product inventory in a certain quarter needs to be calculated, the acquired target data can be processed according to the calculation method to obtain the report subresult.
[0080] According to an embodiment of the present disclosure, based on the report generation subtask, the target database is determined and the target data is obtained, and the target data is correctly processed according to the report generation subtask, thereby ensuring that the report subresults are correctly obtained and improving the accuracy of report generation.
[0081] According to an embodiment of the present disclosure, the report generation method also includes: in response to receiving a report query instruction sent by a user, determining a target report corresponding to the report query instruction; determining whether the target report has been completely generated, wherein, if there is an unfinished report generation subtask in the report generation instruction corresponding to the target report, determining that the target report has not been completely generated, and if the report subresult of the report generation subtask has not updated the front-end page, determining that the report generation subtask is not completed; if the target report has been completely generated, sending the target report to the user; if the target report has not been completely generated, determining the generation progress of the target report, and determining an intermediate report based on the update of the front-end page by the completed report generation subtask, wherein the generation progress is determined according to the number of completed report generation subtasks and the number of all report generation subtasks; and sending the generation progress and the intermediate report to the user.
[0082] According to an embodiment of the present disclosure, whether the target report has been completely generated can be determined by obtaining the front-end page corresponding to the target report and judging whether there is a mark in the front-end page indicating that the report generation subtask has not been completed yet. For example, when there is a mark in the front-end page indicating that the report generation subtask has not been completed yet, it can be determined that there are unfinished report generation subtasks in the report generation instruction corresponding to the target report, thereby determining that the target report has not been completely generated yet.
[0083] According to an embodiment of the present disclosure, when it is determined that the target report has been completely generated, the target report is acquired and sent to the user.
[0084] According to the embodiments of the present disclosure, when it is determined that the target report has not been completely generated, the generation progress is determined according to the number of report generation subtasks included in the report generation task and the number of report generation subtasks that have been executed in the target report, and the intermediate report is determined based on the update of the front-end page by the completed report generation subtasks, and the intermediate report is sent to the user. For example, in the case of the current target report, Figure 3A In the case shown, it can be determined that the number of report generation subtasks included in the report generation task is 6, and the number of report generation subtasks that have been executed in the target report is 5, so the generation progress is 5 / 6≈83.3%. Figure 3A The intermediate reports shown are sent to the user together with the generation progress.
[0085] According to the embodiments of the present disclosure, although multiple report generation subtasks are executed in parallel using multiple threads, since the complexity of different report generation subtasks may be different, it may be the case that some report generation subtasks have been completed while the remaining report generation subtasks have not been completed. In this case, the user can query the results corresponding to the completed report generation subtasks at any time by sending a report query instruction, and obtain the report generation progress, thereby improving the response speed and improving the user experience.
[0086] Based on the above report generation method, the present disclosure also provides a report generation device. Figure 4 The device is described in detail.
[0087] Figure 4 The structure block diagram of the report generation device according to the embodiment of the present disclosure is schematically shown.
[0088] like Figure 4 As shown, the report generating device 400 of this embodiment includes a task segmentation module 410 , a data processing module 420 , a content determination module 430 , a page updating module 440 and a report determination module 450 .
[0089] The task segmentation module 410 is used to determine the report generation task corresponding to the report generation instruction in response to receiving the report generation instruction sent by the user, wherein the report generation task includes multiple report generation subtasks. In one embodiment, the task segmentation module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0090] The data processing module 420 is used to process multiple report generation subtasks using multiple threads in the thread pool, and for each report generation subtask, the target data is processed according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask. In one embodiment, the data processing module 420 can be used to perform the operation S220 described above, which will not be repeated here.
[0091] The content determination module 430 is used to determine the display content of the report sub-result on the front-end page. In one embodiment, the content determination module 430 can be used to perform the operation S230 described above, which will not be described in detail here.
[0092] The page update module 440 is used to update the front-end page based on the displayed content. In one embodiment, the page update module 440 can be used to perform the operation S240 described above, which will not be described in detail here.
[0093] The report determination module 450 is used to determine a report based on the front-end page after the multiple report generation subtasks have completed the update of the front-end page. In one embodiment, the report determination module 450 can be used to perform the operation S250 described above, which will not be repeated here.
[0094] According to an embodiment of the present disclosure, the content determination module 430 includes a table content determination submodule, a graph content determination submodule, and a content determination submodule.
[0095] The table content determination submodule is used to determine the table content in the data table on the front-end page based on the report sub-results.
[0096] The graph content determination submodule is used to determine the graph content in the data graph on the front-end page based on the report sub-results.
[0097] The content determination submodule is used to determine the display content based on the table content and the image content.
[0098] According to an embodiment of the present disclosure, the graph content determination submodule includes a result value determination unit, a graph type determination unit and a graph content determination unit.
[0099] The result value determination unit is used to determine one or more result values of the report sub-result.
[0100] The graph type determination unit is used to determine the graph type of the data graph, wherein the graph types include line graphs, bar graphs, and pie charts.
[0101] The graph content determination unit is used to calculate one or more result values based on a calculation method corresponding to the graph type to obtain the graph content.
[0102] According to an embodiment of the present disclosure, the page update module 440 includes an adjustment determination submodule, a range adjustment submodule, a history graph adjustment submodule, a result value representation submodule, a proportion adjustment submodule and a data graph update submodule.
[0103] The adjustment determination submodule is used to determine whether the result value range of the data graph needs to be adjusted based on the value range of one or more result values when the graph type is a line graph or a bar graph.
[0104] The range adjustment submodule is used to adjust the result value range based on the value range of one or more result values when it is determined that the result value range needs to be adjusted.
[0105] The history graph adjustment submodule is used to proportionally adjust the size of the existing history graph content in the data graph based on the adjusted result value range.
[0106] The result value representation submodule is used to represent one or more result values on the data graph.
[0107] The proportion adjustment submodule is used to re-determine the update proportion of one or more result values and the historical result values corresponding to the historical graph content based on the one or more result values and the historical result values when the graph type is a pie graph.
[0108] The data graph update submodule is used to update the data graph based on the update ratio.
[0109] According to an embodiment of the present disclosure, the report generating apparatus 400 further includes a content display module.
[0110] The content display module is used to display the display content on the data graph based on one or more result values and graph types when the display content is the first display content in the front-end page.
[0111] According to an embodiment of the present disclosure, the data processing module 420 includes a demand determination submodule, a database determination submodule, a data acquisition submodule and a data processing submodule.
[0112] The requirement determination submodule is used to determine the task requirements based on the report generation subtask, wherein the task requirements include the calculation method of the target data and the report subresult.
[0113] The database determination submodule is used to determine the target database according to task requirements.
[0114] The data acquisition submodule is used to obtain target data from the target database based on task requirements.
[0115] The data processing submodule is used to process the target data based on the calculation method to obtain the report sub-result.
[0116] According to an embodiment of the present disclosure, the report generating apparatus 400 further includes a report determining module, a report checking module, a first report sending module, an intermediate report generating module and a second report sending module.
[0117] The report determination module is used to determine a target report corresponding to the report query instruction in response to receiving the report query instruction sent by the user.
[0118] The report checking module is used to determine whether the target report has been completely generated. If there is an unfinished report generation subtask in the report generation instruction corresponding to the target report, it is determined that the target report has not been completely generated. If the report subresult of the report generation subtask has not updated the front-end page, it is determined that the report generation subtask has not been completed.
[0119] The first report sending module is used to send the target report to the user when the target report has been completely generated.
[0120] The intermediate report generation module is used to determine the generation progress of the target report when the target report is not completely generated, and to determine the intermediate report based on the update of the front-end page by the completed report generation subtasks, wherein the generation progress is determined based on the number of completed report generation subtasks and the number of all report generation subtasks.
[0121] The second report sending module is used to send the generation progress and intermediate reports to the user.
[0122] According to an embodiment of the present disclosure, any multiple modules of the task segmentation module 410, the data processing module 420, the content determination module 430, the page update module 440, and the report determination module 450 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the task segmentation module 410, the data processing module 420, the content determination module 430, the page update module 440, and the report determination module 450 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the task segmentation module 410, the data processing module 420, the content determination module 430, the page update module 440 and the report determination module 450 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0123] Figure 5 A block diagram of an electronic device suitable for implementing a report generating method according to an embodiment of the present disclosure is schematically shown.
[0124] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0125] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0126] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0127] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0128] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0129] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the report generation method provided by the embodiment of the present disclosure.
[0130] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0131] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0132] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0133] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0134] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0135] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0136] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A report generation method, characterized in that: The method comprises: In response to receiving a report generation instruction sent by a user, determining a report generation task corresponding to the report generation instruction, wherein the report generation task includes a plurality of report generation subtasks; Using multiple threads in a thread pool to process the multiple report generation subtasks, for each of the report generation subtasks, processing target data according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask; Determine the display content of the report sub-results on the front-end page; Based on the displayed content, updating the front-end page; and After the multiple report generation subtasks have completed updating the front-end page, a report is determined based on the front-end page.
2. The method according to claim 1, characterized in that: Determining the display content of the report sub-result on the front-end page includes: Based on the report sub-result, determining the table content in the data table on the front-end page; Determining the content of the graph in the data graph on the front-end page based on the report sub-result; and The display content is determined based on the table content and the graph content.
3. The method according to claim 2, characterized in that Determining the content of the graph in the data graph on the front-end page based on the report sub-result includes: Determining one or more result values of the report sub-results; Determining a graph type of the data graph, wherein the graph type includes a line graph, a bar graph, and a pie chart; and The one or more result values are calculated based on a calculation method corresponding to the graph type to obtain the graph content.
4. The method according to claim 3, characterized in that The updating of the front-end page based on the displayed content includes: In the case where the graph type is a line graph or a bar graph, determining whether a result value range of the data graph needs to be adjusted based on the value range of the one or more result values; In the event that it is determined that the result value range needs to be adjusted, Based on the value range of the one or more result values, adjusting the result value range; Based on the adjusted result value range, proportionally adjust the size of the existing historical graph content in the data graph; representing the one or more result values on the data graph; and / or In the case where the graph type is a pie graph, based on the one or more result values and the historical result values corresponding to the historical graph content, re-determining the update proportions of the one or more result values and the historical result values; and Based on the update ratio, the data graph is updated.
5. The method according to claim 4, characterized in that The method further comprises: In a case where the display content is the first display content in the front-end page, the display content is displayed on the data graph based on the one or more result values and the graph type.
6. The method according to claim 1, characterized in that The processing of the target data according to the report generation subtask to obtain a report subresult includes: Based on the report generation subtask, determining task requirements, wherein the task requirements include the calculation method of the target data and the report subresult; Determining the target database according to the task requirements; Based on the task requirements, acquiring the target data from the target database; and Based on the calculation method, the target data is processed to obtain the report result.
7. The method according to claim 1, characterized in that The method further comprises: In response to receiving a report query instruction sent by the user, determining a target report corresponding to the report query instruction; Determining whether the target report has been completely generated, wherein if there is an unfinished report generation subtask in the report generation instruction corresponding to the target report, it is determined that the target report has not been completely generated, and if the report subresult of the report generation subtask has not updated the front-end page, it is determined that the report generation subtask has not been completed; When the target report has been completely generated, sending the target report to the user; In the case where the target report is not completely generated, determining the generation progress of the target report, and determining an intermediate report based on the update of the front-end page by the completed report generation subtask, wherein the generation progress is determined according to the number of the completed report generation subtasks and the number of all the report generation subtasks; and The generation progress and the intermediate report are sent to the user.
8. A report generation device, characterized in that: The device comprises: A task segmentation module, configured to determine, in response to receiving a report generation instruction sent by a user, a report generation task corresponding to the report generation instruction, wherein the report generation task includes a plurality of report generation subtasks; The data processing module is used to process the multiple report generation subtasks using multiple threads in the thread pool, and for each of the report generation subtasks, Processing the target data according to the report generation subtask to obtain a report subresult, wherein the target data is obtained from a target database corresponding to the report generation subtask according to the report generation subtask; A content determination module, used to determine the display content of the report sub-result on the front-end page; A page update module, used to update the front-end page based on the displayed content; and The report determination module is used to determine a report based on the front-end page after the multiple report generation subtasks have completed the update of the front-end page.
9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for generating static page
CN102831249A
Dynamic page generation method and system based on MVC
CN106990970A
Report graph generation method and apparatus, computer device and storage medium
CN107908604A
PDF report generation method and device
CN112257403A
Webpage generation method, system and equipment based on associated report and storage medium
CN112269961A