CN114816352A - Report data processing method and device - Google Patents
Report data processing method and device Download PDFInfo
- Publication number
- CN114816352A CN114816352A CN202210585897.3A CN202210585897A CN114816352A CN 114816352 A CN114816352 A CN 114816352A CN 202210585897 A CN202210585897 A CN 202210585897A CN 114816352 A CN114816352 A CN 114816352A
- Authority
- CN
- China
- Prior art keywords
- data
- report
- cache
- target
- thread pool
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 43
- 238000009877 rendering Methods 0.000 claims abstract description 163
- 238000012545 processing Methods 0.000 claims abstract description 39
- 238000000034 method Methods 0.000 claims abstract description 32
- 238000004590 computer program Methods 0.000 claims description 15
- 238000013500 data storage Methods 0.000 claims description 13
- 238000012163 sequencing technique Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000011161 development Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a report data processing method and a report data processing device, relates to the technical field of business data processing, and can be used in the financial field or other technical fields. The method comprises the following steps: generating metadata report parameters according to the configuration information of each report; distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters; and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data. The device performs the above method. The report data processing method and the report data processing device provided by the embodiment of the invention reduce the workload of personnel and improve the efficiency through the configuration information, and in addition, the concurrency capability of data processing and the resource consumption can be independently and flexibly controlled accurately.
Description
Technical Field
The invention relates to the technical field of business data processing, in particular to a report data processing method and device.
Background
The report forms are widely applied to various services, and have various forms according to the properties and the contents of various service lines. For report application, each report is developed, needs to be communicated with business personnel to know the requirements, a program is designed again for development, the workload is large, the efficiency is low, the report development period is long, and the business requirements are difficult to meet.
With the development of the technology, some new report rendering engines gradually appear, which brings confusion to business personnel to select, and with the diversity of report data, the concurrency capability of the system for processing data and the resource consumption need to be accurately controlled.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for processing report data, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides a report data processing method, including:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
Before the step of generating metadata report parameters according to the configuration information of each report, the report data processing method further comprises the following steps of:
and acquiring data type information of the report, and determining a target thread pool corresponding to the data type information.
Wherein the data type information comprises a first data type which can be queried serially; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the first data type as a special thread pool; the special thread pool is a thread pool configured with executable single thread.
The data type information comprises a second data type of which the data structure index parameter is greater than a preset index parameter threshold value and the data volume is greater than a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the second data type as a special thread pool; the special thread pool is a thread pool which can control the concurrency quantity.
The data type information comprises a third data type of which the data structure index parameter is less than or equal to a preset index parameter threshold value and the data volume is less than or equal to a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining that a target thread pool corresponding to the third data type is a general thread pool; the general thread pool is a thread pool with uncontrollable concurrency quantity.
Before the step of generating metadata report parameters according to the configuration information of each report, the report data processing method further comprises the following steps of:
if the metadata identifier corresponding to the metadata report parameter is determined to exist in the cache, acquiring the metadata report parameter configuration completion time in the cache;
and if the metadata report parameter configuration completion time in the cache is the same as the metadata report parameter configuration completion time in the configuration information, directly reading the metadata report parameters from the cache.
Before the step of allocating the report file task to the target thread pool, the report data processing method further includes:
if the rendering data identifier corresponding to the rendering report data exists in the cache, obtaining the time for storing the rendering report data corresponding to the rendering data identifier into the cache;
if the time difference between the time for storing the rendering report data into the cache and the current time is less than or equal to the preset cache overtime, acquiring the request state of the report file task;
if the request state is not a rerun task; and directly reading the rendering report data from the cache.
After the step of obtaining the rendered report data, the report data processing method further includes: storing the rendering report data to a cache; correspondingly, the storing the rendering report data to a cache includes:
obtaining the size of a used memory in a cache;
if the sum of the size of the memory and the rendered report data exceeds a preset cache storage threshold value, cache data information is obtained; the cache data information comprises cache data storage duration and/or cache data use times;
determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information;
and deleting the target cache data, and storing the rendering report data to a cache.
Determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information, wherein the determining comprises the following steps:
if the cache data information comprises cache data storage duration, sorting the cache data according to the order of the cache data storage duration from long to short, and determining the cache data which is in the front of the sorting and is equal to the data size of the rendered report data as the target cache data;
if the cache data information comprises the use times of the cache data, the cache data are sequenced according to the use times of the cache data from small to large, and the cache data which is sequenced earlier and is equal to the data volume of the rendered report data is determined as the target cache data.
If the cache data information comprises cache data storage duration and cache data use times; correspondingly, the determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information includes:
sorting the cache data according to the sequence of the storage duration of the cache data from long to short, and sorting the cache data according to the sequence of the use times of the cache data from small to large;
and determining part of target cache data from two sequencing sequences in batches and successively until the total data amount of the part of target cache data is larger than or equal to the data amount of the rendered report data, and determining the total data amount of the part of target cache data at the moment as the target cache data.
In one aspect, the present invention provides a report data processing apparatus, including:
the generating unit is used for generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
the acquisition unit is used for distributing the report file task to the target thread pool and acquiring target rendering engine parameters required by the target rendering engine according to the metadata report parameters;
and the rendering unit is used for calling the target rendering engine after the parameters of the target rendering engine are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform a method comprising:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
According to the report data processing method and device provided by the embodiment of the invention, the metadata report parameters are generated according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task; distributing the report file task to the target thread pool, and acquiring a target rendering engine parameter required by using the target rendering engine according to the metadata report parameter; and calling the target rendering engine after the target rendering engine parameters are acquired, rendering the report data in the report file task through the target thread pool to obtain rendered report data, reducing the workload of personnel through configuration information, improving the efficiency, and independently and flexibly realizing accurate control on the concurrency capability of processing data and resource consumption.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a flowchart illustrating a report data processing method according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating steps of a method executed by a metadata processing module according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating steps of a method performed by a scheduler engine module according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating steps of a metadata report parameter read-write cache execution method according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating steps of a method for executing a read-write cache of rendered report data according to an embodiment of the present invention.
FIG. 6 is a flowchart illustrating a method for processing report data modularly according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a report data processing apparatus according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a schematic flow chart of a report data processing method according to an embodiment of the present invention, and as shown in fig. 1, the report data processing method according to the embodiment of the present invention includes:
step S1: generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine used for executing the report file task.
Step S2: and distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters.
Step S3: and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
In the step S1, the apparatus generates metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine used for executing the report file task. The apparatus may be a computer device that performs the method. The target thread pool may include the thread pools listed in the field threadPoolName in table 1. The target rendering engines may include the rendering engines listed in the field engineType in table 1.
It should be noted that, the embodiment of the present invention implements independent configuration of a corresponding target thread pool and a target rendering engine for each report, so that the thread pool and the rendering engine can be flexibly configured.
The configuration information includes the information in table 1 and table 2.
TABLE 1
TABLE 2
As shown in fig. 2, generating metadata report parameters according to the configuration information of each report includes:
step B1: reading the report deployed in the module from the database, traversing all report ids, and searching all corresponding report configuration files under the corresponding directory, wherein each report id corresponds to one report configuration file. And then reading the content of the configuration file, and serializing the content into report metadata. The report configuration file corresponds to the configuration information of each report, the report metadata can be divided into two major parts, and the report basic configuration information and the parameter basic configuration information respectively correspond to the contents in the table 1 and the table 2.
Step B2: the time stamp of the configuration file is marked on the serialized report metadata, and then the report metadata is stored in a cache module, and the specific cache storage logic is shown in fig. 4.
Step B3: after receiving the user request, according to the report id and the version number of the user request, the report metadata is taken out from the cache, and the specific cache taking-out logic is shown in fig. 4.
Step B4: analyzing each parameter information in the report metadata, executing a corresponding storage process or method according to the access logic specified by the parameters to generate a value range, splicing required js code blocks or program blocks according to the data check logic, and finally generating an initial front-end code object according to the parameter information related to ui, namely generating the metadata report parameters in the step.
Step B5: and converting the initial front-end code object into a code which is really adapted to the front-end framework of the user according to the front-end platform information transmitted by the user. This step generates code adapted vue, for example if the platform front end used by the user uses vue frames, and front end code adapted to the CTP format if CTP (some bank internal front end frame).
An example of the definition data for report metadata is as follows:
in the step S2, the device allocates the report file task to the target thread pool, and obtains the target rendering engine parameters required for using the target rendering engine according to the metadata report parameters. Namely, the target rendering engine executes the report file task by calling the resources of the target thread pool. Referring to step B4 and the name field in table 2, the target rendering engine parameters are obtained.
In the step S3, the device invokes the target rendering engine after obtaining the target rendering engine parameters, and renders the report data in the report file task through the target thread pool to obtain rendered report data. Before this step, report generation pre-logic steps may also be performed.
The pre-logic step is used for processing some specific requirements, for example, for a report with a large data volume, preliminary data screening can be performed through metadata report parameters before data is delivered to a target rendering engine for rendering, so that the total data volume is reduced, and the rendering efficiency of the target rendering engine is improved. Therefore, if the report is configured with the previous value logic step, the previous value logic step is executed first, and then the target rendering engine is called to draw the report.
As shown in fig. 3, the execution flow for calling the target rendering engine is explained as follows:
step C1: and receiving a task request returned by the user front-end platform, analyzing all parameters in the request, taking out and sequencing the parameters required by the target rendering engine, and then solving a hash value with a fixed length as a unique task id according to the parameters.
Step C2: inquiring whether the cache module has a correct cache or not according to the hash value, if so, taking out the cache module from the cache, and executing the step C6; and if the cache is not correct, allocating the task to a target thread pool for execution. The store fetch logic for the cache module is shown in FIG. 5.
Step C3: the thread pool comprises a general thread pool and a special thread pool, and the target thread pool used by the report configuration is determined in the configuration information. And after the target thread pool is distributed, executing the specific generation logic of the report.
Step C4: and executing report generation preposition logic. The prepositive logic is used for processing some specific requirements, for example, for a report with large data volume, preliminary data screening can be performed through report parameters before data is delivered to a rendering engine for drawing, so that the total data volume is reduced, and the rendering efficiency of the rendering engine is improved. Therefore, if the report is configured with the previous value logic, the previous value logic is executed first, and then the rendering engine is called to draw the report.
Step C5: and determining a target rendering engine configured and used by the report in the configuration information, and then selecting target rendering engine parameters required by the target rendering engine from the metadata report parameters.
Step C6: and after the rendering report data from the target rendering engine or the cache module is received, executing a post-processing step. After the generation of the partial report is completed, further processing is required, such as logic of splitting, encrypting, data deforming and the like can be executed at this step, and then the logic is stored in the cache module, wherein the specific logic is shown in fig. 5.
Step C7: and performing floor filing on the finally generated report file, and returning a task execution success mark. After the file is filed, a user can search the query information executed before on the front-end platform and directly acquire the report file, so that repeated query on the same report can be reduced, and the system pressure is reduced.
According to the report data processing method provided by the embodiment of the invention, metadata report parameters are generated according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task; distributing the report file task to the target thread pool, and acquiring a target rendering engine parameter required by using the target rendering engine according to the metadata report parameter; and calling the target rendering engine after the target rendering engine parameters are acquired, rendering the report data in the report file task through the target thread pool to obtain rendered report data, reducing the workload of personnel through configuration information, improving the efficiency, and independently and flexibly realizing accurate control on the concurrency capability of processing data and resource consumption.
Further, before the step of generating metadata report parameters according to the configuration information of each report, the report data processing method further includes:
and acquiring data type information of the report, and determining a target thread pool corresponding to the data type information. The data type information may include a first data type that can be serially queried, a second data type that the data structure index parameter is greater than a preset index parameter threshold and the data volume is greater than a preset data volume, and a third data type that the data structure index parameter is less than or equal to the preset index parameter threshold and the data volume is less than or equal to the preset data volume, where the first data type that can be serially queried may be understood as a data type that cannot be concurrently queried.
The data structure index parameter can be understood as a parameter capable of evaluating the complexity of the data structure index, and the larger the value of the parameter is, the more complex the data structure is; the smaller the parameter value is, the simpler the data structure is represented, and the preset index parameter threshold value can be set independently according to the actual situation. The preset data volume can be set independently according to actual conditions.
The thread pool can comprise a general thread pool and a special thread pool, and the thread pool can support a single report to select a target thread pool in a self-defined mode due to the fact that the difference of report generation processes is large, the complexity between reports and the size of data volume are greatly different.
It is understood that the target thread pool corresponds one-to-one to the three data types described above.
The report data processing method provided by the embodiment of the invention matches the corresponding target thread pool, and further can independently and flexibly realize accurate control on the concurrency capability of data processing and resource consumption.
Further, the data type information comprises a first data type which can be queried serially; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the first data type as a special thread pool; the special thread pool is a thread pool configured with executable single thread. For reports with special requirements (such as serial query only and non-concurrency), a thread pool implementation which can only execute a single thread can be configured.
The report data processing method provided by the embodiment of the invention matches the corresponding target thread pool, and further can independently and flexibly realize accurate control on the concurrency capability of data processing and resource consumption.
Further, the data type information comprises a second data type of which the data structure index parameter is greater than a preset index parameter threshold value and the data volume is greater than a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the second data type as a special thread pool; the special thread pool is a thread pool which can control the concurrency quantity. For special reports, the complexity is high and the data size is huge, and a special thread pool can be used to strictly control the concurrency number.
The report data processing method provided by the embodiment of the invention matches the corresponding target thread pool, and further can independently and flexibly realize accurate control on the concurrency capability of data processing and resource consumption.
Further, the data type information includes a third data type in which the data structure index parameter is less than or equal to a preset index parameter threshold value, and the data volume is less than or equal to a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining that a target thread pool corresponding to the third data type is a general thread pool; the general thread pool is a thread pool with uncontrollable concurrency quantity. For a common report, the data size and complexity are general, and a general thread pool with uncontrollable concurrency quantity can be selected.
The report data processing method provided by the embodiment of the invention matches the corresponding target thread pool, and further can independently and flexibly realize accurate control on the concurrency capability of data processing and resource consumption.
Further, before the step of generating metadata report parameters according to the configuration information of each report, the report data processing method further includes:
if the metadata identifier corresponding to the metadata report parameter is determined to exist in the cache, acquiring the metadata report parameter configuration completion time in the cache;
and if the metadata report parameter configuration completion time in the cache is the same as the metadata report parameter configuration completion time in the configuration information, directly reading the metadata report parameters from the cache. And if the time is the same, indicating that the report configuration in the hashmap is not modified, taking out the corresponding metadata report parameters from the hashmap for subsequent use. Acquiescent metadata report parameters of the latest version are acquired, and if version number information is also transmitted, the metadata report parameters of the specified version number are tried to be acquired.
And if the metadata identifier corresponding to the metadata report parameter does not exist in the cache, the metadata report parameter is not directly read from the cache. A cache tool class hashmap may be used, i.e., a cache data processing core maintains a hashmap for administration. Referring to logic D3 of FIG. 4:
when reading data, it is necessary to first determine whether the requested key value (corresponding to the metadata identifier) exists in the hashmap, and if not, return null information, and re-execute the step of generating the metadata report parameters according to the configuration information of each report, that is, the metadata report parameters are not directly read from the cache.
And if the metadata report parameter configuration completion time in the cache is different from the metadata report parameter configuration completion time in the configuration information, the metadata report parameters are not directly read from the cache. As shown in logic D3 of fig. 4:
and further judging whether the metadata report parameter configuration completion time in the hashmap is the same as the metadata report parameter configuration completion time in the configuration information, if not, indicating that the report configuration is modified and needs to be reloaded, continuing to execute the step of generating the metadata report parameters according to the configuration information of each report, and covering the original record, namely, not directly reading the metadata report parameters from the cache.
The report data processing method provided by the embodiment of the invention can quickly realize the reading process of the metadata report parameters.
Referring to FIG. 4, before logic D3, the steps of logic D1 and logic D2 are also included, as explained below:
logic D1: inside the metadata cache, the core maintains a hashmap for management.
Logic D2: when the metadata report parameters are stored, the metadata report parameters are generated in the metadata module (a 3 in fig. 2), and then are directly stored in hashmap, and if the key values are equal, the previous values (i.e. the original metadata report parameters) are covered by new values (i.e. the new metadata report parameters).
Further, before the step of allocating the report file task to the target thread pool, the report data processing method further includes:
if the rendering data identifier corresponding to the rendering report data exists in the cache, obtaining the time for storing the rendering report data corresponding to the rendering data identifier into the cache;
if the time difference between the time for storing the rendering report data into the cache and the current time is less than or equal to the preset cache overtime, acquiring the request state of the report file task;
if the request state is not a rerun task; and directly reading the rendering report data from the cache.
And if the rendering data identifier corresponding to the rendering report data does not exist in the cache, directly reading the rendering report data from the cache. A cache tool class hashmap may be used, i.e., a cache data processing core maintains a hashmap for administration. Referring to logic D6 of FIG. 5:
when the rendering report data is read, whether the requested key value (corresponding to the rendering data identifier) exists in the hashmap is judged, if not, a null value is returned, namely, the rendering report data is not directly read from the cache.
And if the time difference between the time for storing the rendering report data into the cache and the current time is greater than the preset cache overtime, directly reading the rendering report data from the cache. If the time is longer than the preset cache timeout time, the record is overtime, the cache is deleted, and a null value is returned, namely the data of the rendered report form is not directly read from the cache.
The preset cache timeout time can be set autonomously according to actual conditions.
Sometimes, report data needs to be manually corrected, and after the data is corrected, the report cache needs to be manually refreshed when the report is requested again.
If the request state is a rerun task; and not directly reading the rendering report data from the cache. If the record is not overtime, checking the request state of the task, if the task is specified as a rerun task, clearing the buffer memory of the report, returning a null value, and continuing the task rerun processing, namely not directly reading the rendered report data from the buffer memory.
The report data processing method provided by the embodiment of the invention can quickly realize the process of reading the rendered report data.
Further, after the step of obtaining the rendered report data, the report data processing method further includes: storing the rendering report data to a cache; correspondingly, the storing the rendering report data to the cache includes:
and acquiring the used memory size in the cache.
If the sum of the size of the memory and the rendered report data exceeds a preset cache storage threshold value, cache data information is obtained; the cache data information comprises cache data storage duration and/or cache data use times; as shown in logic D5 in fig. 5, when storing the rendered report data, first obtaining the generated rendered report data in the scheduling engine module (a 6 in fig. 3), counting the size of the rendered report data, then adding the size of the used memory in the cache to determine whether the total cache capacity exceeds a preset cache storage threshold, and if so, reading the statistical data inside the cache module to obtain cache data information; the cache data information comprises cache data storage duration and/or cache data use times. The preset cache storage threshold value can be set independently according to actual conditions.
And determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information. The cache data with longer storage time or less use times of the cache data can be deleted.
And deleting the target cache data, and storing the rendering report data to a cache. Namely, the target cache data equal to the rendered report data is deleted firstly, and then the rendered report data is stored in the cache, so that the storage time of the record can be recorded.
The report data processing method provided by the embodiment of the invention can smoothly store the rendered report data into the cache and ensure the validity of the rendered report data stored in the cache.
Further, the determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information includes:
if the cache data information comprises cache data storage duration, sorting the cache data according to the sequence of the cache data storage duration from long to short, and determining the cache data which is in the front of the sorting and is equal to the data volume of the rendering report data as the target cache data; examples are as follows:
and recording an ordering sequence for ordering the cache data as X { X1, X2, … xn } according to the sequence of the storage duration of the cache data from long to short, and if the data volume corresponding to X1-xi is equal to the data volume of the rendered report data, determining X1-xi as the target cache data.
If the cache data information comprises the use times of the cache data, sequencing the cache data according to the use times of the cache data from small to large, and determining the cache data which is arranged in the front and is equal to the data volume of the rendered report data as the target cache data; and recording a sequencing sequence for sequencing the cache data from a small number to a large number of times of using the cache data as Y { Y1, Y2, … yn }, and determining Y1-yi as target cache data if the data volume corresponding to Y1-yi is equal to that of the rendered report data.
The report data processing method provided by the embodiment of the invention not only can smoothly store the rendered report data into the cache, but also can further ensure the validity of the stored rendered report data in the cache.
Further, if the cache data information includes cache data storage duration and cache data usage times; correspondingly, the determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information includes:
sorting the cache data according to the sequence of the storage duration of the cache data from long to short, and sorting the cache data according to the sequence of the use times of the cache data from small to large;
and determining part of target cache data from two sequencing sequences in batches and successively until the total data amount of the part of target cache data is larger than or equal to the data amount of the rendered report data, and determining the total data amount of the part of target cache data at the moment as the target cache data. Referring to the above example, the batch data processed in each batch may be set autonomously according to actual conditions, and may be selected as 20 pieces of data. The method comprises the steps of carrying out first batch processing, extracting x 1-x 10 and y 1-y 10, wherein the total data amount is the sum of x 1-x 10 and y 1-y 10, carrying out second batch processing if the total data amount is less than the data amount of rendered report data, extracting x 11-x 20 and y 11-y 20, wherein the total data amount is the sum of x 1-x 20 and y 1-y 20, carrying out third batch processing until the mth batch processing if the total data amount is less than the data amount of the rendered report data, wherein the total data amount (the sum of x 1-xm 0 and y 1-ym 0) is more than or equal to the data amount of the rendered report data, and taking the sum of x 1-xm 0 and y 1-ym 0 as target cache data.
It should be noted that the batch data processed in each batch in the two sorting sequences may be the same or different, for example, 10 before the first sorting sequence X is allocated and processed, 10 before the first sorting sequence Y is allocated and processed, 12 before the second sorting sequence X is allocated and processed, and 8 before the second sorting sequence Y is allocated and processed, so that it is sufficient to ensure that the total number of the two sorting sequences is equal to 20.
The report data processing method provided by the embodiment of the invention not only can smoothly store the rendered report data into the cache, but also can further ensure the validity of the stored rendered report data in the cache.
As shown in fig. 6, the following is illustrated:
step A1: initializing frame data and report data, wherein the frame data comprises data (such as data sources, availability monitoring and the like) required by the frame, and the report data is configuration information of each report.
Step A2: and receiving a report request sent by a user, matching the information of the currently used front-end platform of the user, combining the requests, sending the combined requests to the metadata module, and initializing the metadata report parameters returned by A3.
Step A3: and the metadata processing module is initialized by the metadata module to generate metadata report parameters, specifically generating logic as shown in figure 2, and storing the metadata report parameters into the cache module, wherein the cache module stores the specific logic as shown in figure 4.
Step A4: and generating a parameter selection interface according to the initialized metadata report parameters, and returning to the front-end platform where the user is located. After the user selects the parameters, whether the parameters input by the user are legal is checked, and then the parameter information is packaged into a report file task.
Step A5: and receiving a report file task, and handing the report file task to a scheduling engine to process the report file task.
Step A6: the scheduling engine module, the specific logic is shown in fig. 3.
Step A7: and the cache module caches the data of the metadata module and the scheduling engine module respectively. The specific logic is shown in fig. 5.
Step A8: and receiving the report running result and returning the result to the user platform.
It should be noted that the report data processing method provided by the embodiment of the present invention may be used in the financial field, and may also be used in any technical field other than the financial field.
Fig. 7 is a schematic structural diagram of the report data processing apparatus according to an embodiment of the present invention, and as shown in fig. 7, the report data processing apparatus according to the embodiment of the present invention includes a generating unit 701, an obtaining unit 702, and a rendering unit 703, where:
the generating unit 701 is used for generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task; the obtaining unit 702 is configured to allocate the report file task to the target thread pool, and obtain a target rendering engine parameter required by using the target rendering engine according to the metadata report parameter; the rendering unit 703 is configured to invoke the target rendering engine after obtaining the target rendering engine parameter, and render the report data in the report file task through the target thread pool to obtain rendered report data.
Specifically, the generating unit 701 in the apparatus is configured to generate metadata report parameters according to configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task; the obtaining unit 702 is configured to allocate the report file task to the target thread pool, and obtain a target rendering engine parameter required by using the target rendering engine according to the metadata report parameter; the rendering unit 703 is configured to invoke the target rendering engine after obtaining the target rendering engine parameter, and render the report data in the report file task through the target thread pool to obtain rendered report data.
The report data processing device provided by the embodiment of the invention generates the metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task; distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters; and calling the target rendering engine after the target rendering engine parameters are acquired, rendering the report data in the report file task through the target thread pool to obtain rendered report data, reducing the workload of personnel through configuration information, improving the efficiency, and independently and flexibly realizing accurate control on the concurrency capability of processing data and resource consumption.
The embodiment of the report data processing apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the embodiment are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 8, the electronic device includes: a processor (processor)801, a memory (memory)802, and a bus 803;
the processor 801 and the memory 802 complete communication with each other through a bus 803;
the processor 801 is configured to call program instructions in the memory 802 to perform the methods provided by the above-described method embodiments, including for example:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (13)
1. A report data processing method is characterized by comprising the following steps:
generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
distributing the report file task to the target thread pool, and acquiring target rendering engine parameters required by using the target rendering engine according to the metadata report parameters;
and calling the target rendering engine after the target rendering engine parameters are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
2. The reporting data processing method as set forth in claim 1, wherein prior to the step of generating metadata reporting parameters based on the configuration information of each report, the reporting data processing method further comprises:
and acquiring data type information of the report, and determining a target thread pool corresponding to the data type information.
3. A report data processing method according to claim 2, characterized in that said data type information includes a first data type which can be serially queried; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the first data type as a special thread pool; the special thread pool is a thread pool configured with executable single thread.
4. A report data processing method according to claim 2, characterized in that said data type information includes a second data type in which the data structure index parameter is greater than a preset index parameter threshold and the data volume is greater than a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the second data type as a special thread pool; the special thread pool is a thread pool which can control the concurrency quantity.
5. A report data processing method according to claim 2, characterized in that said data type information includes a third data type in which the data structure index parameter is less than or equal to a preset index parameter threshold and the data volume is less than or equal to a preset data volume; correspondingly, the determining the target thread pool corresponding to the data type information includes:
determining a target thread pool corresponding to the third data type as a general thread pool; the general thread pool is a thread pool with uncontrollable concurrency quantity.
6. The report data processing method according to any of claims 1 to 5, wherein before the step of generating the metadata report parameters according to the configuration information of each report, the report data processing method further comprises:
if the metadata identifier corresponding to the metadata report parameter is determined to exist in the cache, acquiring the metadata report parameter configuration completion time in the cache;
and if the metadata report parameter configuration completion time in the cache is the same as the metadata report parameter configuration completion time in the configuration information, directly reading the metadata report parameters from the cache.
7. The report data processing method according to any of claims 1 to 5, wherein before the step of allocating the report file task to the target thread pool, the report data processing method further comprises:
if the rendering data identifier corresponding to the rendering report data exists in the cache, obtaining the time for storing the rendering report data corresponding to the rendering data identifier into the cache;
if the time difference between the time for storing the rendering report data into the cache and the current time is less than or equal to the preset cache overtime, acquiring the request state of the report file task;
if the request state is not a rerun task; and directly reading the rendering report data from the cache.
8. The report data processing method according to any of claims 1 to 5, wherein after the step of obtaining rendered report data, the report data processing method further comprises: storing the rendering report data to a cache; correspondingly, the storing the rendering report data to a cache includes:
obtaining the size of a used memory in a cache;
if the sum of the size of the memory and the rendered report data exceeds a preset cache storage threshold value, cache data information is obtained; the cache data information comprises cache data storage duration and/or cache data use times;
determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information;
and deleting the target cache data, and storing the rendering report data to a cache.
9. The report data processing method according to claim 8, wherein the determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information comprises:
if the cache data information comprises cache data storage duration, sorting the cache data according to the order of the cache data storage duration from long to short, and determining the cache data which is in the front of the sorting and is equal to the data size of the rendered report data as the target cache data;
if the cache data information comprises the use times of the cache data, the cache data are sequenced according to the use times of the cache data from small to large, and the cache data which is sequenced earlier and is equal to the data volume of the rendered report data is determined as the target cache data.
10. A report data processing method according to claim 8, characterized in that if said cache data information includes cache data storage duration and cache data usage times; correspondingly, the determining target cache data to be deleted according to the data volume of the rendered report data and the cache data information includes:
sorting the cache data according to the sequence of the storage duration of the cache data from long to short, and sorting the cache data according to the sequence of the use times of the cache data from small to large;
and determining part of target cache data from two sequencing sequences in batches and successively until the total data amount of the part of target cache data is larger than or equal to the data amount of the rendered report data, and determining the total data amount of the part of target cache data at the moment as the target cache data.
11. A report data processing apparatus, comprising:
the generating unit is used for generating metadata report parameters according to the configuration information of each report; the configuration information comprises a target thread pool and a target rendering engine which are used for executing the report file task;
the acquisition unit is used for distributing the report file task to the target thread pool and acquiring target rendering engine parameters required by the target rendering engine according to the metadata report parameters;
and the rendering unit is used for calling the target rendering engine after the parameters of the target rendering engine are obtained, and rendering the report data in the report file task through the target thread pool to obtain rendered report data.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 10 are implemented by the processor when executing the computer program.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210585897.3A CN114816352A (en) | 2022-05-27 | 2022-05-27 | Report data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210585897.3A CN114816352A (en) | 2022-05-27 | 2022-05-27 | Report data processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114816352A true CN114816352A (en) | 2022-07-29 |
Family
ID=82518541
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210585897.3A Pending CN114816352A (en) | 2022-05-27 | 2022-05-27 | Report data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114816352A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119149842A (en) * | 2024-08-23 | 2024-12-17 | 上海市大数据中心 | Report rendering method and system based on data analysis |
-
2022
- 2022-05-27 CN CN202210585897.3A patent/CN114816352A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119149842A (en) * | 2024-08-23 | 2024-12-17 | 上海市大数据中心 | Report rendering method and system based on data analysis |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11681564B2 (en) | Heterogeneous computing-based task processing method and software and hardware framework system | |
US10114682B2 (en) | Method and system for operating a data center by reducing an amount of data to be processed | |
CN108280150B (en) | Distributed asynchronous service distribution method and system | |
CN111258565B (en) | Mini-program generation method, system, server and storage medium | |
CN112559525B (en) | Data checking system, method, device and server | |
US11321090B2 (en) | Serializing and/or deserializing programs with serializable state | |
CN111597035A (en) | Simulation engine time advancing method and system based on multiple threads | |
CN115934316A (en) | Database-based task processing method, device, equipment and storage medium | |
CN107977275B (en) | Task processing method based on message queue and related equipment | |
CN111736907B (en) | Data analysis method of self-adaptive low-delay memory computing engine | |
CN114816352A (en) | Report data processing method and device | |
US8024374B2 (en) | Computer object conversion using an intermediate object | |
CN110222046B (en) | List data processing method, device, server and storage medium | |
US9659041B2 (en) | Model for capturing audit trail data with reduced probability of loss of critical data | |
CN110275771B (en) | A business processing method, an Internet of Things billing infrastructure system, and a storage medium | |
CN118519781A (en) | Resource allocation method, apparatus, device, storage medium and program product | |
CN113126968A (en) | Task execution method and device, electronic equipment and storage medium | |
CN113326311A (en) | Data conversion method and device | |
CN112181825A (en) | Test case library construction method and device, electronic equipment and medium | |
CN110020359B (en) | Data processing method, device and storage medium applied to front end of webpage | |
CN113704297B (en) | Processing method, module and computer readable storage medium for business processing request | |
CN117707607B (en) | Concurrent management system and method for multi-version memory of data | |
CN118708384B (en) | Method and system for optimizing GPU remote call performance based on pre-analysis and calculation service | |
CN110879747B (en) | Resource management method and device | |
CN110134691B (en) | Data verification method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |