Method for report engine, report engine and storage medium
Receive user input and generate report templates through interactive interfaces, and dynamically analyze time functions and data functions, solving the problem of complicated complex report configuration in the existing technology, realizing the effect of quickly generating customized time mode reports.
Patent Information
- Application Number
- CN202311512028.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2025-05-16
AI Technical Summary
The existing technology is difficult to quickly generate reports of complex time series and data series, resulting in cumbersome report configuration process and increasing the deployment and implementation cost of the power system report module.
Receive template parameters and query parameters input by users through the interactive interface, generate report templates and parse time functions and data functions, generate reports dynamically, and support custom time modes and data sequence configurations.
It realizes rapid and dynamic design and generation of reports that are adapted to user-defined time patterns in the power system, reducing the difficulty of report production and implementation costs.
Smart Images

Figure CN120012739A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the technical field of report forms for power systems, and more particularly to a method for a report engine, a report engine and a storage medium. Background Art
[0002] In electrical systems, historical information of equipment points is usually displayed through reports. Reports are usually designed and output based on the time range of day, month, or year. Taking the daily report as an example, the point data is displayed in order by hour. In actual systems, unconventional reports are also common. For example: custom time intervals (by minute intervals); data statistics by shift. (The start time and time interval between shifts may be different).
[0003] Known report design usually requires selecting configured data sources and data attributes and binding them to specific cells in the table. Template data design and generation need to be achieved through a series of menu operations and configurations. The cell data binding process is cumbersome to configure and sometimes requires a certain degree of coding. This places high demands on on-site project report implementers.
[0004] Known reporting tools generally do not provide simple and intuitive configuration pages to help generate time series and corresponding data for unconventional reports. The more complex the time style of the report, the more entries, and the more cumbersome the report configuration process, the more manual operations the project implementers need to repeat. The time mode of the report is highly customized, and it is difficult to use the reporting tool to quickly generate reports. Report production also takes a long time, which increases the cost of deploying and implementing the power system reporting module.
[0005] The contents of the background technology section are merely the technologies known to the inventors and do not necessarily represent the prior art in the field. Summary of the invention
[0006] In view of one or more deficiencies in the prior art, the present invention provides a method for a report engine, a report engine and a storage medium.
[0007] According to one aspect of the present application, a method for a report engine is provided, comprising:
[0008] Receive template parameters input by the user through the interactive interface;
[0009] Generate a report template according to the template parameters;
[0010] Receiving query parameters input by the user through the interactive interface;
[0011] A report is generated according to the report template and the query parameters, and is presented on the interactive interface.
[0012] According to an embodiment of the present application, generating a report template according to the template parameters includes:
[0013] Defining a time function corresponding to a cell in a time dimension of the report template;
[0014] Define data functions corresponding to cells in the data dimension of the report template.
[0015] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0016] Determine the function type corresponding to the cell in the report template;
[0017] If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell;
[0018] If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell.
[0019] According to an embodiment of the present application, defining a time function corresponding to a cell in a time dimension of the report template includes:
[0020] A time function corresponding to a cell in a preset filling direction is defined according to the filling direction, wherein the filling direction is a direction of a time dimension, and wherein the template parameter includes the preset filling direction.
[0021] According to an embodiment of the present application, defining a time function corresponding to a cell in a time dimension of the report template includes:
[0022] At least one sequence of time functions corresponding to at least one time interval in the time dimension is defined.
[0023] According to an embodiment of the present application, defining at least one time function sequence corresponding to at least one time interval in a time dimension includes:
[0024] The time function sequence corresponding to the continuous cells of the time interval in the time dimension is defined.
[0025] According to an embodiment of the present application, defining the time function sequence corresponding to the continuous cells of the time interval in the time dimension in sequence includes:
[0026] The time function sequence corresponding to n consecutive cells of the time interval in sequence is configured according to a preset initial time step, time interval △t and filling quantity n, wherein the time function sequence includes n time functions, the i-th time function in the time function sequence includes a start time as a variable and an i-th time step as a constant, the i-th time function is used to calculate the time to be filled in the i-th cell of the n consecutive cells as the sum of the start time and the i-th time step, the i-th time step is determined according to the initial time step, time interval and i, wherein 1≤i≤n, wherein the template parameters include the preset initial time step, time interval △t and filling quantity n.
[0027] According to an embodiment of the present application, the i-th time step is equal to the sum of the initial time step and (i-1)×Δt.
[0028] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0029] Determine the function type corresponding to the cell in the report template;
[0030] If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell, including:
[0031] According to the time function sequence corresponding to the n consecutive cells in the report template and the set start time, the time values to be filled in the n consecutive cells are obtained and filled into the n consecutive cells, wherein the query parameter includes the set start time.
[0032] According to an embodiment of the present application, the at least one time interval includes multiple time intervals, and the multiple time intervals respectively correspond to multiple time function sequences. The multiple time function sequences correspond to a common starting time, but respectively correspond to multiple different initial time steps. The multiple different initial time steps are preset to avoid overlapping of the multiple time intervals.
[0033] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0034] Determine the function type corresponding to the cell in the report template;
[0035] If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell, including:
[0036] According to the multiple time function sequences corresponding to the multiple time intervals in the report template and the set start time, the time values to be filled in the continuous cells in the multiple time intervals are obtained and filled in the continuous cells in the multiple time intervals, wherein the query parameters include the set start time.
[0037] According to an embodiment of the present application, the data function includes a sequence data function, which includes a cell representing a start time as a variable, a preset cell range representing multiple point objects as constants, a time step, and a number of time steps, and is used to obtain a sequence data set of multiple point objects in the cell range within a time period represented by each time step within a time range represented by a time filled in the cell representing the start time as the start time and a product of the time step and the number of time steps, wherein the template parameters include the preset cell range representing multiple point objects, the time step, and the number of time steps.
[0038] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0039] Determine the function type corresponding to the cell in the report template;
[0040] If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including:
[0041] Get the time filled in the cell representing the start time;
[0042] The sequence data set is obtained according to the sequence data function and the first data in the sequence data set is written into the cell.
[0043] According to an embodiment of the present application, the data function also includes an extended function associated with the sequence data function, the extended function including a cell corresponding to the associated sequence data function as a constant and a preset coordinate in a sequence data set acquired by the associated sequence data function, and is used to acquire data at the preset coordinate in the sequence data set acquired by the associated sequence data function, wherein the template parameter includes the cell corresponding to the sequence data function associated with the extended function and the preset coordinate.
[0044] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0045] Determine the function type corresponding to the cell in the report template;
[0046] If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including:
[0047] After the sequence data function obtains the sequence data set, the data at the preset coordinates in the sequence data set is obtained according to the expansion function and written into the cell.
[0048] According to an embodiment of the present application, the data function includes a single data function, which includes a cell representing a start time as a variable, a preset cell representing a single point object as a constant, and a time step, and is used to obtain data of a single point object in the cell within a time period with the time filled in the cell representing the start time as the start time and represented by the time step, wherein the template parameters include the preset cell representing a single point object and the time step.
[0049] According to an embodiment of the present application, generating a report according to the report template and the query parameter includes:
[0050] Determine the function type corresponding to the cell in the report template;
[0051] If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including:
[0052] Get the time filled in the cell representing the start time;
[0053] The data is acquired according to the single data function and written into the cell.
[0054] According to an embodiment of the present application, the data function obtains data from the system through the data interface of the point object.
[0055] According to an embodiment of the present application, the data interface includes an API or a database interface.
[0056] According to an embodiment of the present application, the system includes an electric power business system.
[0057] According to an embodiment of the present application, the interactive interface includes an interactive page provided on a web terminal or a browser.
[0058] According to another aspect of the present application, a report engine is provided, comprising:
[0059] Processor; and
[0060] A memory is communicatively connected to the processor, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can perform the above method.
[0061] According to another aspect of the present application, a computer-readable storage medium is provided, comprising computer-executable instructions stored thereon, wherein the executable instructions are used to enable the computer to execute the above method.
[0062] According to the embodiments of the present application, template parameters input by a user are received through an interactive interface; a report template is generated based on the template parameters; query parameters input by a user are received through the interactive interface; a report is generated based on the report template and the query parameters, and is presented on the interactive interface, so that in the power system, it is possible to adapt to user-defined time modes, realize rapid dynamic design and generation of table-type reports, and improve the convenience and flexibility of dynamic data design of tables.
[0063] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0065] Figure 1 A method for a report engine according to an embodiment of the present application is shown.
[0066] Figure 2 An example of configuring a time function sequence according to an embodiment of the present application is shown.
[0067] Figure 3 An example of a time function of a report template in the time dimension according to an embodiment of the present application is shown.
[0068] Figure 4 An example of a configuration sequence data function according to an embodiment of the present application is shown.
[0069] Figure 5 An example of a data function in a data dimension of a report template according to an embodiment of the present application is shown.
[0070] Figure 6 An example of a report template according to an embodiment of the present application is shown.
[0071] Figure 7 A schematic flow chart of an application example of generating a report according to an embodiment of the present application is shown.
[0072] Figure 8 An example of a report according to an embodiment of the present application is shown.
[0073] Fig. 9 A schematic diagram showing an application example of a report engine according to an embodiment of the present application is shown.
[0074] Fig.10 A schematic structural block diagram of a system serving as a report engine according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0075] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0076] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0077] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0078] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0079] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0080] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0081] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplification and clarity, which itself does not indicate the relationship between the various embodiments and / or settings discussed.
[0082] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0083] Figure 1 A method for a report engine according to an embodiment of the present application is shown, comprising:
[0084] Step S11: receiving template parameters input by the user through the interactive interface;
[0085] Step S12: Generate a report template according to the template parameters;
[0086] Step S13: receiving query parameters input by the user through the interactive interface;
[0087] Step S14: Generate a report based on the report template and the query parameters, and present it on the interactive interface.
[0088] Optionally, the interactive interface includes an interactive page provided on a web terminal or a browser.
[0089] In the embodiment of the present application, the report engine of the system can receive template parameters input by the user through an interactive interface, and then generate a report template according to the template parameters.
[0090] Specifically, step S12 may include:
[0091] Defining a time function corresponding to a cell in a time dimension of the report template;
[0092] Define data functions corresponding to cells in the data dimension of the report template.
[0093] In the embodiment of the present application, the time function is configured in the table to be filled in the report template from the time dimension.
[0094] Optionally, defining a time function corresponding to a cell in a time dimension of the report template includes:
[0095] A time function corresponding to a cell in a preset filling direction is defined according to the filling direction, wherein the filling direction is a direction of a time dimension, and wherein the template parameter includes the preset filling direction.
[0096] Specifically, the direction of the time dimension and the data dimension can be defined. For example, the user can set the direction of the time dimension and the data dimension through the interactive interface, that is, set the direction of filling the time function and the data function in the report template, that is, the template parameters input by the user include the filling direction of the setting.
[0097] Optionally, defining a time function corresponding to a cell in a time dimension of the report template includes:
[0098] At least one sequence of time functions corresponding to at least one time interval in the time dimension is defined.
[0099] That is, multiple time intervals can be defined in the time dimension of the time template, and a time function sequence corresponding to each time interval can be defined. For example, a user can set multiple time intervals and a time function sequence corresponding to each time interval through an interactive interface.
[0100] In particular, when the at least one time interval includes multiple time intervals, the multiple time intervals respectively correspond to multiple time function sequences, and the multiple time function sequences may correspond to a common starting time, but respectively correspond to multiple different initial time steps, and the multiple different initial time steps are preset to avoid overlapping of the multiple time intervals.
[0101] Further, defining at least one time function sequence corresponding to at least one time interval in the time dimension includes:
[0102] The time function sequence corresponding to the continuous cells of the time interval in the time dimension is defined.
[0103] That is to say, the number of cells for each time interval in the report template can be set, and the time function sequence corresponding to each cell of each time interval in the report template can be defined. For example, the user can set the number of cells for each time interval and the time function sequence corresponding to each cell of each time interval through the interactive interface.
[0104] Furthermore, defining the time function sequence corresponding to the continuous cells of the time interval in the time dimension in sequence includes:
[0105] The time function sequence corresponding to n consecutive cells of the time interval in sequence is configured according to a preset initial time step, time interval △t and filling quantity n, wherein the time function sequence includes n time functions, the i-th time function in the time function sequence includes a start time as a variable and an i-th time step as a constant, the i-th time function is used to calculate the time to be filled in the i-th cell of the n consecutive cells as the sum of the start time and the i-th time step, the i-th time step is determined according to the initial time step, time interval and i, wherein 1≤i≤n, wherein the template parameters include the preset initial time step, time interval △t and filling quantity n.
[0106] Specifically, the i-th time step is equal to the sum of the initial time step and (i-1)×Δt.
[0107] Figure 2 An example of configuring a time function sequence according to an embodiment of the present application is shown.
[0108] Figure 2 The time series configuration page as an interactive interface is shown, through which users can configure the time dimension in the report template. Through the time series configuration, the rapid design of custom time mode reports can be achieved, improving the efficiency of report production.
[0109] like Figure 2 As shown, by selecting an item in the drop-down menu as an interactive control, the user sets the filling direction (i.e., the direction of the time dimension in the report template, i.e., the direction of filling the time function) to horizontal, i.e., filling the time function in the horizontal direction of the report template. Those skilled in the art will appreciate that the user may also set it in other interactive ways.
[0110] like Figure 2 As shown in the figure, the user sets time interval 1 and time interval 2, but Figure 2 As shown, through the interactive controls "+" and "-", the user can increase or decrease the time interval. Those skilled in the art will appreciate that the user can also set it through other interactive methods.
[0111] like Figure 2 As shown, for time interval 1, the user sets the start time $StartTime as a variable, the initial time step 30 minutes (i.e., 0.5 hours), the time interval 1 hour, and the fill quantity 8 (i.e., the number of cells in time interval 1) through the interactive controls on the time series configuration page. Those skilled in the art will appreciate that the user can also set it through other interactive methods.
[0112] In this example, for the time function, the function name can be $=TIME, and the parameters are the start time and the time step, such as: $=TIME($startTime,1h), which means starting from the start time $startTime and adding 1 hour to the time period. The time step supports: year (y), month (M), day (d), hour (h), minute (m), and second (s).
[0113] The time function sequence corresponding to time interval one includes eight time functions, wherein the first time function is $=TIME($StartTime,0.5h), the second time function is $=TIME($StartTime,1.5h), ..., and the eighth time function is $=TIME($StartTime,7.5h).
[0114] The start time in the time function is a variable. When the user queries a report (ie generates a report through a report template), it is specified by inputting a query parameter including the start time value.
[0115] like Figure 2 As shown, for time interval 2, the user sets the same start time $StartTime as the start time of time interval 1, the initial time step of 12.5 hours, the time interval of 1 hour, and the fill quantity of 8 (i.e., the number of cells in time interval 2) through the interactive controls on the time series configuration page. Those skilled in the art will appreciate that the user can also set it through other interactive methods.
[0116] The time function sequence corresponding to time interval two includes eight time functions, among which the first time function is $=TIME($StartTime,12.5h), the second time function is $=TIME($StartTime,13.5h), ..., and the eighth time function is $=TIME($StartTime,19.5h).
[0117] exist Figure 2 In the example, the two time function sequences corresponding to time interval one and time interval two respectively correspond to a common start time $StartTime, but correspond to two different initial time steps, namely 0.5 hours and 12.5 hours, which are set to avoid overlapping of the two time intervals.
[0118] Figure 3 An example of a time function of a report template in the time dimension according to an embodiment of the present application is shown.
[0119] like Figure 3 As shown, the report template includes shift one and shift two (i.e. two time intervals) in the time dimension. Figure 3In the time function sequence shown, for shift one, the initial time step is 0, the time interval is 1 hour, and the number of fills is 8; for shift two, the initial time step is 10 hours, the time interval is 1 hour, and the number of fills is 8. The two shifts correspond to a common start time, but correspond to two different initial time steps, namely 0 hours and 10 hours. The two different initial time steps are set to avoid overlap between the two shifts.
[0120] exist Figure 2 , 3 In the example shown, the format of the agreed variable (i.e., the start time) begins with "$", and the format of the function begins with "$=". Those skilled in the art will appreciate that the formats of agreed variables and functions are not limited to Figure 2 and Figure 3 Example shown.
[0121] In the embodiment of the present application, the data function is configured in the table to be filled in the report template from the data dimension.
[0122] Optionally, the data function includes a sequence data function, which includes a cell representing a start time as a variable, a preset cell range representing multiple point objects as constants, a time step, and a number of time steps, and is used to obtain a sequence data set of multiple point objects in the cell range within a time period represented by each time step within a time range represented by a time filled in the cell representing the start time as the start time and a product of the time step and the number of time steps, wherein the template parameters include the preset cell range representing multiple point objects, the time step, and the number of time steps.
[0123] The user can set the cell range representing multiple point objects, the time step and the number of time steps, as well as the cell representing the start time through the interactive interface.
[0124] The sequence data function can be responsible for batch querying the value results of multiple objects in different time periods within a time range. For example, the following value methods can be supported:
[0125] Maximum value: $=MAXTB(object parameter, time parameter, time step parameter, number of time steps)
[0126] Minimum value: $=MINTB(object parameter, time parameter, time step parameter, number of time steps)
[0127] Average value: $=AVGTB(object parameter, time parameter, time step parameter, number of time steps)
[0128] Latest value: $=NEWTB(object parameter, time parameter, time step parameter, number of time steps)
[0129] Sum value: $=SUMTB(object parameter, time parameter, time step parameter, number of time steps)
[0130] Difference: $=DIFFTB(object parameter, time parameter, time step parameter, number of time steps)
[0131] The time step parameter represents the duration of each time period, the time step parameter × the number of time steps represents the duration of the time range, and the time parameter represents the starting time of the time range, which is usually expressed in cells.
[0132] For example, $=AVGTB([A2:A10],B1,1h,24) means obtaining the point objects in cells A2 to A10, and querying the average value per hour (i.e. 1h) within 24 hours (i.e. 1h×24) with the time in cell B1 as the starting time.
[0133] Figure 4 An example of a configuration sequence data function according to an embodiment of the present application is shown.
[0134] Figure 4 The data sequence configuration page as an interactive interface is shown, through which users can configure the data dimensions in the report template. Through data sequence configuration, the rapid design of complex and large data reports can be achieved, and the efficiency of report production can be improved.
[0135] like Figure 4 As shown, the user sets the point objects tag1, tag2, tag3, the value method "maximum value", the start time A2 (the cell representing the start time), the time interval 1 hour (i.e., the time step), and the fill quantity 8 (i.e., the number of time steps) through the interactive controls on the data sequence configuration page. Those skilled in the art will appreciate that the user can also set it through other interactive methods.
[0136] Figure 4 The data sequence function of the example configuration shown is used to obtain the point-oriented objects tag1, tag2, and tag3, and the query uses the time in cell A2 as the starting time and the maximum value per hour (i.e., 1h) within 8 hours (i.e., 1h×8).
[0137] Further, the data function also includes an extended function associated with the sequence data function, the extended function including a cell corresponding to the associated sequence data function as a constant and a preset coordinate in a sequence data set acquired by the associated sequence data function, and is used to acquire data at the preset coordinate in the sequence data set acquired by the associated sequence data function, wherein the template parameter includes the cell corresponding to the sequence data function associated with the extended function and the preset coordinate.
[0138] The user can set the cells representing the sequence data set and the coordinates in the sequence data set through the interactive interface.
[0139] The extended function must be used in conjunction with the sequence data function. The corresponding data in the data set is obtained based on the coordinates in the data set queried by the sequence data function. Example: $=EXT(A1,0,0) means obtaining the data with coordinates [0,0] in the sequence data set in cell A1.
[0140] Figure 5 An example of a data function in a data dimension of a report template according to an embodiment of the present application is shown.
[0141] like Figure 5 As shown, the data functions of the report template in the data dimension include a sequence data function $=AVGTB(C4:C6,D3,1h,24) whose value taking mode is "average value", which means obtaining the point objects in cells C4 to C6, and querying the time in cell D3 as the starting time, and the average value per hour (i.e. 1h) within 24 hours (i.e. 1h×24).
[0142] like Figure 5 As shown, the data function of the report template in the data dimension also includes multiple extended functions, which represent obtaining the data with coordinates [0,1], [0,2], ..., [2,5] in the sequence data set in cell D4 respectively.
[0143] Optionally, the data function includes a single data function, which includes a cell representing a start time as a variable, a preset cell representing a single point object as a constant, and a time step, and is used to obtain data of a single point object in the cell within a time period with the time filled in the cell representing the start time as the start time and represented by the time step, wherein the template parameters include the preset cell representing a single point object and the time step.
[0144] The user can set the cell representing a single point object and the time step, as well as the cell representing the start time through the interactive interface.
[0145] A single data function can query the value of a single object within a certain period of time. It is used when filling a single independent report cell. For example, the following value methods are supported:
[0146] Maximum value: $=MAX(object parameter, time parameter, time step parameter)
[0147] Minimum value: $=MIN(object parameter, time parameter, time step parameter)
[0148] Average value: $=AVG(object parameter, time parameter, time step parameter)
[0149] Latest value: $=NEW(object parameter, time parameter, time step parameter)
[0150] Sum value: $=SUM(object parameter, time parameter, time step parameter)
[0151] Difference: $=DIFF(object parameter, time parameter, time step parameter)
[0152] The time step parameter indicates the length of the time period, and the time parameter indicates the start time of the time period, which is usually expressed in cells.
[0153] Figure 6 An example of a report template according to an embodiment of the present application is shown.
[0154] like Figure 6 As shown in the figure, a report template that adapts to the custom time mode is generated on the time dimension and data dimension. Figure 6 The report template shown includes shift 1 and shift 2 (i.e. two time intervals) in the time dimension. Figure 6 In the time function sequence shown, for shift 1, the initial time step is 2 hours, the time interval is 1 hour, and the number of fills is 8; for shift 2, the initial time step is 12 hours, the time interval is 1 hour, and the number of fills is 8. The two shifts correspond to a common start time, but correspond to two different initial time steps, namely 2 hours and 12 hours. The two different initial time steps are set to avoid overlap between the two shifts.
[0155] like Figure 6 As shown, in shift 1, the data functions of the report template in the data dimension include a sequence data function $=NEWTB(F3:F6,G2,1h,8) with the value taking mode of "latest value", which means obtaining the point objects in cells F3 to F6, and querying the latest value of each hour (i.e. 1h) within 8 hours (i.e. 1h×8) with the time in cell G2 as the starting time.
[0156] like Figure 6As shown, in shift 1, the data function of the report template in the data dimension also includes multiple extended functions, which represent obtaining the data with coordinates [0,1], ..., [3,7] in the sequence data set in cell G3 respectively.
[0157] like Figure 6 As shown, in shift 2, the data functions of the report template in the data dimension include a sequence data function $=NEWTB(F3:F6,L2,1h,8) with the value taking mode of "latest value", which means obtaining the point objects in cells F3 to F6, and querying the latest value of each hour (i.e. 1h) within 8 hours (i.e. 1h×8) with the time in cell L2 as the starting time.
[0158] like Figure 6 As shown, in shift 2, the data function of the report template in the data dimension also includes multiple extended functions, which represent obtaining the data with coordinates [0,1], ..., [3,7] in the sequence data set in the L3 cell respectively.
[0159] The method provided in the application embodiment can be based on the Web, and the report function can be flexibly configured on the browser. When used, the operation can be completed in the Web browser, and it can be adapted to Windows and non-Windows operating systems.
[0160] According to the embodiment of the present application, expansion is performed from two dimensions, time series and data series, and the custom time scenarios of unconventional reports can be met through simple page configuration. The data of the report is organized in a WYSIWYG design method. Through the form of class functions, the data value object and time range are set using parameters, which can intuitively display the data category and value method to be rendered, making it easy to design and understand the report.
[0161] The implementers of the power system can complete the dynamic data design of the report, that is, generate the report template, by using the simple page settings and class functions mentioned above. This method facilitates the design of unconventional custom time mode reports, and the intuitive expression of class functions also reduces the difficulty of report production, thereby reducing the implementation cost of the power system report module.
[0162] In addition to the time dimension and data series dimension, this application also supports expansion in other dimensions, such as: energy management model type, production line organizational structure, etc., to meet the user's needs for expansion in more dimensions.
[0163] In an embodiment of the present application, after the report engine of the system generates a report template, during report query, that is, when the user enters query parameters through the interactive interface, the class function of the report template will be parsed into data for display, that is, data will be dynamically generated to generate and display the report.
[0164] Specifically, step S14 may include:
[0165] Determine the function type corresponding to the cell in the report template;
[0166] If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell;
[0167] If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell.
[0168] More specifically, if the cell corresponds to a data function, the data interface is called according to the data function corresponding to the cell to obtain data and store the data in a cache, and then the corresponding data is retrieved from the cache and written into the cell.
[0169] In particular, after the data interface is called according to each data function in the report template to obtain data and store it in the cache, the corresponding data of each data function is taken out from the cache and written into the cell corresponding to each data function.
[0170] Optionally, if the cell corresponds to a time function, resolving the time function corresponding to the cell into a time value and writing the time value into the cell includes:
[0171] According to the time function sequence corresponding to the n consecutive cells in the report template and the set start time, the time values to be filled in the n consecutive cells are obtained and filled into the n consecutive cells, wherein the query parameter includes the set start time.
[0172] As mentioned above, in the time function, the start time is a variable and the time step is known. Therefore, when the user enters the value of the start time through the interactive interface, according to the time function corresponding to a cell on the time dimension in the time template, the time value to be filled in the cell can be calculated by adding the start time value and the time step.
[0173] The method provided in the embodiment of the application supports the query time being passed into the time function in the form of a parameter, which can realize dynamic query of the report.
[0174] Since a time interval includes multiple cells, these multiple cells correspond to each time function in the time function sequence, and the starting time of each time function in the time function sequence is the same, but the time step is different. When the user inputs the value of the starting time through the interactive interface, the time values to be filled in these multiple cells of the time interval can be calculated according to each time function in the time function sequence.
[0175] Optionally, if the cell corresponds to a time function, resolving the time function corresponding to the cell into a time value and writing the time value into the cell includes:
[0176] According to the multiple time function sequences corresponding to the multiple time intervals in the report template and the set start time, the time values to be filled in the continuous cells in the multiple time intervals are obtained and filled in the continuous cells in the multiple time intervals, wherein the query parameters include the set start time.
[0177] As described above, when the time dimension includes multiple time intervals, the multiple time function sequences corresponding to the multiple time intervals correspond to a common start time, but the multiple initial time steps corresponding to them are different. When the user inputs the value of the start time through the interactive interface, the time values to be filled in each cell of each time interval can be calculated according to each time function in each time function sequence.
[0178] Optionally, if the cell corresponds to a data function, obtaining a data value according to the data function corresponding to the cell and writing the data value into the cell includes:
[0179] Get the time filled in the cell representing the start time;
[0180] The sequence data set is obtained according to the sequence data function and the first data in the sequence data set is written into the cell.
[0181] If the cell corresponds to a sequence data function, as described above, in the sequence data function, the cell representing the start time is a variable. After filling the time value in the cell on the time dimension, the time filled in the cell representing the start time in the sequence data function is obtained, a sequence data set is obtained according to the sequence data function, and the first data in the sequence data set is written into the cell corresponding to the sequence data function.
[0182] Optionally, if the cell corresponds to a data function, obtaining a data value according to the data function corresponding to the cell and writing the data value into the cell includes:
[0183] After the sequence data function obtains the sequence data set, the data at the preset coordinates in the sequence data set is obtained according to the expansion function and written into the cell.
[0184] If the cell corresponds to an extended function, after the sequence data function associated with the extended function obtains a sequence data set, the data at the preset coordinates in the sequence data set is obtained according to the preset coordinates in the extended function and written into the cell.
[0185] Optionally, if the cell corresponds to a data function, obtaining a data value according to the data function corresponding to the cell and writing the data value into the cell includes:
[0186] Get the time filled in the cell representing the start time;
[0187] The data is acquired according to the single data function and written into the cell.
[0188] If the cell corresponds to a single data function, as described above, in the single data function, the cell representing the start time is a variable. After filling the time value in the cell on the time dimension, the time filled in the cell representing the start time in the single data function is obtained, data is obtained according to the single data function, and the data is written into the cell corresponding to the single data function.
[0189] In the embodiment of the present application, the data function can obtain data from the system through the data interface of the point object.
[0190] Optionally, the data interface includes an API or a database interface.
[0191] Optionally, the system includes an electric power business system.
[0192] According to the embodiment of the present application, through the front-end Web page, according to the customization requirements of the report, the report can be quickly configured and adapted to the custom time mode to dynamically design the report. By providing a quick and flexible report configuration design page, the time series and data series of the report can be quickly constructed, saving a lot of report design and production time. Through built-in functions such as sequence data functions and extension functions, the data interface can be connected to obtain report data from various data sources, and the report data can be rendered to the front-end report Web page to generate a report.
[0193] Figure 7 A schematic flow chart of an application example of generating a report according to an embodiment of the present application is shown.
[0194] After the report template is generated, when the report is queried, that is, when the user enters the query parameters through the interactive interface, the class functions in the report template will be parsed into data to generate the report. Figure 7 As shown, the application example of generating a report includes steps S71-S74.
[0195] Step S71: Start report query, for example, the user inputs query parameters such as start time through the interactive interface.
[0196] Step S72: Determine the function type corresponding to each cell in the report template, obtain the corresponding time or data according to the function type corresponding to each cell, and fill the corresponding time value in each cell corresponding to each time function.
[0197] Step S72 specifically includes:
[0198] Traverse the cells in the report template;
[0199] For the current cell, determine whether the cell corresponds to a time function;
[0200] If the cell corresponds to a time function, the time function is parsed into a specific time according to the start time input by the user, and the specific time is written into the cell;
[0201] If the cell does not correspond to a time function, determine whether the cell corresponds to a data function;
[0202] If the cell does not correspond to a data function either, the content of the cell remains unchanged;
[0203] If the cell corresponds to a data function, the data interface is called according to the data function definition to obtain the data and store it in the cache;
[0204] Continue to traverse the cells in the report template until each time function in the report template is resolved into each specific time, and write each specific time into each cell corresponding to each time function, and obtain data according to each data function in the report template and store it in the cache.
[0205] Step S73: Determine the data function type corresponding to each cell corresponding to each data function in the report template, and fill each cell corresponding to each data function with the corresponding data retrieved from the cache.
[0206] In step S72, the cells corresponding to each time function have been filled with time values, while the cells corresponding to each data function have not yet been filled with data. Therefore, in step S73, it is only necessary to determine the data function type corresponding to each cell corresponding to each data function in the report template (that is, the function cell at this time).
[0207] Step S73 specifically includes:
[0208] Traverse the cells corresponding to the data functions in the report template;
[0209] For a current cell corresponding to a data function, determining whether the cell corresponds to a single data function;
[0210] If the cell corresponds to a single data function, the corresponding data is retrieved from the cache and written into the cell;
[0211] If the cell does not correspond to a single data function, determine whether the cell corresponds to an extended function;
[0212] If the cell does not correspond to the extended function, the cell is deemed to correspond to the sequence data function, and the first data in the corresponding sequence data set is taken from the cache and written into the cell;
[0213] If the cell corresponds to an extended function, the data at the coordinates in the corresponding sequence data set is taken from the cache according to the second and third parameters in the extended function (i.e., the coordinates in the sequence data set) and written into the cell;
[0214] Continue to traverse the cells corresponding to the data functions in the report template until data is written into the cells corresponding to each data function to generate and display the report.
[0215] Step S74: Report query ends.
[0216] When querying a report, the user selects the query time to display the parsing results of the class function and the final report data, that is, the generated report. Figure 8 An example of a report according to an embodiment of the present application is shown.
[0217] Figure 8 The report shown includes Shift 1 and Shift 2 (i.e., two time intervals) in the time dimension, and the specific times of Shift 1 and Shift 2 are shown in each cell in the time dimension, and the corresponding data of Shift 1 and Shift 2 are shown in each cell in the data dimension.
[0218] According to an embodiment of the present application, a report engine is also provided, including:
[0219] Processor; and
[0220] A memory communicatively connected to the processor, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the method of any of the above embodiments.
[0221] Fig. 9 A schematic diagram showing an application example of a report engine according to an embodiment of the present application is shown.
[0222] like Fig. 9 As shown, the user inputs template parameters through the interactive interface (i.e., browser) of the web side, so that the report engine defines report functions such as time functions and data functions according to the above method embodiment to design a report template. Then, the user inputs query parameters such as query time through the interactive interface, so that the report engine parses the time function into a time value according to the above method embodiment and fills it into the corresponding cell, and obtains report data from the power business system through the API or database interface according to the data function definition, fills the data into the corresponding cell in the report template, and displays the report in the browser of the web side.
[0223] According to an embodiment of the present application, a computer-readable storage medium is also provided, including computer-executable instructions stored thereon, and the executable instructions are used to enable the computer to execute the method of any of the above embodiments.
[0224] Fig.10 A structural schematic block diagram of a system as a report engine according to an embodiment of the present application is shown. The system is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The system can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0225] like Fig.10 As shown, the system includes: one or more processors 101, a memory 102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the system, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to an interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 101 is taken as an example.
[0226] The memory 102 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the method for the report engine provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for the report engine provided in the present application.
[0227] The memory 102 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the method for the report engine in the embodiment of the present application. The processor 101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 102, that is, the method for the report engine in the above method embodiment is implemented.
[0228] The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the system, etc. In addition, the memory 102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 102 may optionally include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the system via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0229] The system may further include: an input device 103 and an output device 104. The processor 101, the memory 102, the input device 103 and the output device 104 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0230] The input device 103 can receive input digital or character information, and generate key signal input related to user settings and function control of the system, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0231] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0232] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0233] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0234] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0235] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0236] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0237] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for a report engine, comprising: Receive template parameters input by the user through the interactive interface; Generate a report template according to the template parameters; Receiving query parameters input by the user through the interactive interface; A report is generated according to the report template and the query parameters, and is presented on the interactive interface.
2. The method according to claim 1, characterized in that: Generate a report template according to the template parameters, including: Defining a time function corresponding to a cell in a time dimension of the report template; Define data functions corresponding to cells in the data dimension of the report template.
3. The method according to claim 2, characterized in that Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell; If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell.
4. The method according to claim 2, characterized in that: Defining a time function corresponding to a cell in the time dimension of the report template includes: A time function corresponding to a cell in a preset filling direction is defined according to the filling direction, wherein the filling direction is a direction of a time dimension, and wherein the template parameter includes the preset filling direction.
5. The method according to claim 2, characterized in that: Defining a time function corresponding to a cell in the time dimension of the report template includes: At least one sequence of time functions corresponding to at least one time interval in the time dimension is defined.
6. The method according to claim 5, characterized in that Defining at least one time function sequence corresponding to at least one time interval in the time dimension includes: The time function sequence corresponding to the continuous cells of the time interval in the time dimension is defined.
7. The method according to claim 6, characterized in that Defining the time function sequence corresponding to the continuous cells of the time interval in the time dimension in sequence, including: The time function sequence corresponding to n consecutive cells of the time interval in sequence is configured according to a preset initial time step, time interval △t and filling quantity n, wherein the time function sequence includes n time functions, the i-th time function in the time function sequence includes a start time as a variable and an i-th time step as a constant, the i-th time function is used to calculate the time to be filled in the i-th cell of the n consecutive cells as the sum of the start time and the i-th time step, the i-th time step is determined according to the initial time step, time interval and i, wherein 1≤i≤n, wherein the template parameters include the preset initial time step, time interval △t and filling quantity n.
8. The method according to claim 7, characterized in that The i-th time step is equal to the sum of the initial time step and (i-1)×Δt.
9. The method according to claim 7, characterized in that: Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell, including: According to the time function sequence corresponding to the n consecutive cells in the report template and the set start time, the time values to be filled in the n consecutive cells are obtained and filled into the n consecutive cells, wherein the query parameter includes the set start time.
10. The method according to claim 6, characterized in that The at least one time interval includes multiple time intervals, and the multiple time intervals respectively correspond to multiple time function sequences. The multiple time function sequences correspond to a common starting time, but respectively correspond to multiple different initial time steps. The multiple different initial time steps are preset to avoid overlapping of the multiple time intervals.
11. The method according to claim 10, characterized in that Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a time function, the time function corresponding to the cell is parsed into a time value and written into the cell, including: According to the multiple time function sequences corresponding to the multiple time intervals in the report template and the set start time, the time values to be filled in the continuous cells in the multiple time intervals are obtained and filled in the continuous cells in the multiple time intervals, wherein the query parameters include the set start time.
12. The method according to claim 2, characterized in that: The data function includes a sequence data function, which includes a cell representing a start time as a variable, a preset cell range representing multiple point objects as constants, a time step, and a number of time steps, and is used to obtain a sequence data set of multiple point objects in the cell range within a time period represented by each time step within a time range represented by a time filled in the cell representing the start time as the start time and the product of the time step and the number of time steps, wherein the template parameters include the preset cell range representing multiple point objects, the time step, and the number of time steps.
13. The method according to claim 12, characterized in that Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including: Get the time filled in the cell representing the start time; The sequence data set is obtained according to the sequence data function and the first data in the sequence data set is written into the cell.
14. The method according to claim 12, characterized in that The data function also includes an extended function associated with the sequence data function, the extended function including a cell corresponding to the associated sequence data function as a constant and preset coordinates in a sequence data set acquired by the associated sequence data function, and is used to acquire data at the preset coordinates in the sequence data set acquired by the associated sequence data function, wherein the template parameters include the cell corresponding to the sequence data function associated with the extended function and the preset coordinates.
15. The method according to claim 14, characterized in that Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including: After the sequence data function obtains the sequence data set, the data at the preset coordinates in the sequence data set is obtained according to the expansion function and written into the cell.
16. The method according to claim 2, characterized in that The data function includes a single data function, which includes a cell representing a start time as a variable, a preset cell representing a single point object as a constant, and a time step, and is used to obtain data of the single point object in the cell within a time period with the time filled in the cell representing the start time as the start time and represented by the time step, wherein the template parameters include the preset cell representing the single point object and the time step.
17. The method according to claim 16, characterized in that Generating a report according to the report template and the query parameters includes: Determine the function type corresponding to the cell in the report template; If the cell corresponds to a data function, a data value is obtained according to the data function corresponding to the cell and written into the cell, including: Get the time filled in the cell representing the start time; The data is acquired according to the single data function and written into the cell.
18. The method according to claim 3, characterized in that The data function obtains data from the system through the data interface of the point object.
19. The method according to claim 18, characterized in that The data interface includes an API or a database interface.
20. The method according to claim 18, characterized in that The system includes an electric power business system.
21. The method according to claim 1, characterized in that The interactive interface includes an interactive page provided on a web terminal or a browser.
22. A report engine, comprising: processor; as well as A memory communicatively connected to the processor, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to perform the method according to any one of claims 1 to 19.
23. A computer-readable storage medium, comprising computer-executable instructions stored thereon, wherein the executable instructions are used to cause the computer to execute the method according to any one of claims 1 to 19.