Report generation method, device, terminal equipment and storage medium
Through preset report generation process and identification information, the automatic filling and generation of report data is realized, and the problems of redundancy in the existing technology and the cumbersome user operations are solved, and the efficiency of report generation and user satisfaction are improved.
Patent Information
- Application Number
- CN202010356066.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-29
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2040-04-29
AI Technical Summary
In the existing report generation method, the code is redundant, and the user's operations are cumbersome, and the background modification and release are required every time the report structure or data is changed, which increases the risk of code modification and the waiting time of users, and reduces user satisfaction.
By obtaining the identification information corresponding to the report type of the report to be generated, the preset report generation process corresponding to the identification information is called, the target data includes report data and preset report templates, and the report data is filled into the preset report template to generate a data report.
It realizes simplified interface calling logic, reduces code redundancy, increases the universality and scalability of general processes, and reduces the complexity of user operations and the risk of code modification.
Smart Images

Figure CN111611784B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a report generation method, apparatus, terminal equipment and storage medium. Background Art
[0002] With the rapid development of computer technology, the business network of enterprises is also expanding. In order to better use business data, business data is displayed in the form of various reports. For different report structures, it is currently necessary to write a set of data processing and report drawing logic for each report, which makes user operations cumbersome and code redundant. When changing the report structure or data, it is currently necessary to change the code logic and add code to obtain data. In this way, each change requires background modification and release, which increases the risk of code modification and the waiting time of users, thereby reducing user satisfaction. Summary of the invention
[0003] The embodiments of the present application provide a report generation method, apparatus, terminal device and storage medium, which can solve the problem of code redundancy in the existing report generation method.
[0004] In a first aspect, an embodiment of the present application provides a report generation method, comprising:
[0005] Obtain identification information corresponding to the report type of the report to be generated;
[0006] Call the preset report generation process corresponding to the identification information;
[0007] According to the preset report generation process, the target data corresponding to the identification information is obtained, and the target data includes report data and a preset report template;
[0008] According to the preset report generation process, the report data is filled into the preset report template to obtain the data report corresponding to the report data.
[0009] The embodiment of the present application obtains the report generation instruction carrying the identification information and calls the preset report generation process corresponding to the identification information. Compared with the existing creation of multiple interfaces for multiple different reports, the present application can be implemented with only one interface, simplifying the interface call logic; compared with the existing logic of writing a set of data processing and report drawing for each report for different report structures, all reports of the present application share a common set of preset report generation processes, complete the operation of extracting common logic and splitting exception logic, and reduce code redundancy; and facilitate the addition of common logic to the common process without writing code for each report logic, thereby increasing the commonality and extensibility of the common process. According to the preset report generation process, the report data and the preset report template are obtained, and according to the preset report generation process, the report data is filled into the preset report template, and the preset report template filled with the report data is generated as a data report, so that there is no need to read the report template row by row and column by column when writing code using poi (API gives Java programs the function of reading and writing Microsoft Office format files) as in the traditional way.
[0010] In a second aspect, an embodiment of the present application provides a report generation device, including:
[0011] A first acquisition module, used to acquire identification information corresponding to the report type of the report to be produced;
[0012] A calling module, used to call a preset report generation process corresponding to the identification information;
[0013] A second acquisition module is used to acquire target data corresponding to the identification information according to a preset report generation process, where the target data includes report data and a preset report template;
[0014] The generation module is used to fill the report data into the preset report template according to the preset report generation process to obtain a data report corresponding to the report data.
[0015] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a report generation method as described in any one of the first aspects above when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the report generation method as described in any one of the above-mentioned first aspects is implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device executes the report generation method described in any one of the above-mentioned first aspects.
[0018] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 It is a flowchart of a report generation method provided by an embodiment of the present application;
[0021] Figure 2 is a flowchart of a report generation method provided by another embodiment of the present application;
[0022] Figure 3 is a flowchart of a report generation method provided by another embodiment of the present application;
[0023] Figure 4 It is a structural schematic diagram of a report generating device provided in an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] As described in the related background technology, currently for reports with different structures, a set of report generation logic for data processing and drawing reports needs to be written for each report, which requires users to spend a lot of time and energy to write code, and each report has a set of code, which makes the code redundant. When changing the report structure or data, it is currently necessary to change the code logic and add the code for obtaining data, so each change requires background modification and release, which increases the risk of code modification and the waiting time of users, thereby reducing user satisfaction.
[0032] Therefore, the embodiment of the present application provides a report generation method that can be implemented with only one interface, simplifying the interface calling logic; compared with the existing method of writing a set of data processing and report drawing logic for each report according to different report structures, all reports of the present application share a common set of preset report generation processes, complete the operations of extracting common logic and splitting exception logic, and reduce code redundancy; and it is convenient to add common logic to the common process without writing code for each report logic, thereby increasing the commonality and extensibility of the common process.
[0033] Figure 1 A schematic flow chart of the report generation method provided by the present application is shown. As an example but not limitation, the method can be applied to terminal devices, including but not limited to mobile phones, tablet computers, wearable devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks or personal digital assistants (PDAs), servers and other terminal devices. The embodiments of the present application do not impose any restrictions on the specific types of terminal devices.
[0034] S101, obtaining identification information corresponding to the report type to be produced;
[0035] In the above S101, the identification information may be a report ID number (tmpkey) corresponding to the report type, such as the ID number corresponding to the expense report is key1, and the ID number corresponding to the income report is key2. Optionally, the terminal device receives a report generation instruction input by a user, and the report generation instruction carries tmpkey; the terminal device responds to the report generation instruction, passes tmpkey to a preset interface, and is received by the map of the preset interface; and obtains a preset report generation process corresponding to tmpkey returned by the preset interface.
[0036] S102, calling a preset report generation process corresponding to the identification information;
[0037] In the above S102, the above preset report generation process defines the steps for generating a report, which may include a first generation process for all reports and a second generation process for some reports, the first generation process includes the steps common to all reports when generating, and the second generation process includes the steps required for some reports when generating themselves.
[0038] Optionally, the first generation process can be defined as follows: define a general processing mode framework class JxlsCommon, which contains the steps generally required to generate a report: get the output file name String ouputName = getOutputExcelName(); determine whether to save to the server saveOnServer(ouputName); get the required data Map<String,Object> dataMap = getData(); put the acquired data into jxlsBuilder and actually generate the report file setData(dataMap); returnthis.jxlsBuilder.build().getOutFile().
[0039] Optionally, the second generation process can be defined as follows: define an exception template Jxlsexception, which contains the steps of adding to the first generation process: determine whether to add the mark this.alarm() to the first generation process; when it is necessary to add to the first generation process, private booleanalarmFlag = true, add the execution function of the exception template to the first generation process and execute public void start(){isAlarm()}.
[0040] Compared with the existing system that creates multiple interfaces for multiple different reports, this embodiment can be implemented with only one interface, simplifying the interface call logic. Compared with the existing system that writes a set of data processing and report drawing logic for each report according to different report structures, all reports share a set of common templates to complete the operations of extracting common logic and dividing exception logic, reducing code redundancy. It is also convenient to add common logic to the common template without writing code for each report logic, increasing the commonality and extensibility of the common template.
[0041] S103, according to a preset report generation process, obtaining target data corresponding to the identification information, the target data including report data and a preset report template;
[0042] In the above S103, the report data can be the business data of the report to be generated, such as the financial data constituting the financial report. The preset report template can be a visual jxls template, which is an execl template based on the preset jxls engine in which each table and code have a corresponding relationship. Among them, when the report itself is relatively complex, the jxls template can be drawn manually, and jxls can be used as a generation tool; when the jxls template is expanded horizontally according to the data transfer object (DataTransferObject, DTO), the jxls template can be automatically generated, specifically including: calling the jxls tool, templated reading of the excel template, so that there is no need to write code and read excel row by row and column by column like the traditional poi; and extracting the corresponding logic of the business bean and excel, customizing it into an annotation configuration, and defining the annotation configuration on the corresponding business bean, so that there is no need to handwrite code for the corresponding relationship between each business bean and excel.
[0043] S104, according to a preset report generation process, filling the report data into a preset report template to obtain a data report corresponding to the report data.
[0044] In the above S104, a DomainDtoAutoScanServiceImpl service class is defined based on jxls. When the service starts, the business domain package is scanned and the class, attribute information and annotation configuration are obtained through reflection. The above information is imported into the freemarker template to generate the jxls xml of the business domain.
[0045] Specifically, by using the preset functions in the preset report generation template, the report data is filled into the cells with corresponding cell attributes according to the correspondence between the report data and the cell attributes in the jxls template. Based on the jxls engine, the report data in the cells is assigned to the code statements according to the correspondence between the code and the cell attributes, and a data report is generated.
[0046] This embodiment fills the report data into the jxls template, and there is no need to draw different reports in the code through poi; even if the user needs to modify the template later, it only needs to be modified on the jxls template (excel file), without changing the poi code or the data acquisition logic in the code, which is simpler and more convenient.
[0047] exist Figure 1 Based on the embodiment shown, Figure 2 FIG. 1 is a flow chart of another report generation method provided in an embodiment of the present application. Figure 1 The same steps as those in the embodiment will not be repeated here.
[0048] like Figure 2As shown, in a possible implementation, the above S102 includes S201 and S202.
[0049] S201, if the identification information is not the preset identification information, calling the first generation process corresponding to the identification information, and using the first generation process as the preset report generation process;
[0050] S202: If the identification information is preset identification information, call the first generation process and the second generation process corresponding to the identification information, and combine the first generation process and the second generation process into a preset report generation process.
[0051] In the above S201 and S202, most reports have common steps, but it cannot be ruled out that some reports have steps that are not required by other reports. In order to avoid adding non-common steps to the common template and making the generation steps of the common template cumbersome, the non-common steps are separated out, thereby separating the common logic and the exception logic, making the report generation logic clearer and more reasonable.
[0052] Specifically, when tmpkey (identification information) is not a preset tmpkey, that is, when the report to be generated is a general report, only the first generation process is needed to implement the generation process of the general report, so the first generation process corresponding to tmpkey is called, and the first generation process is used as the preset report generation process. It should be understood that the first generation process may include a code function corresponding to each identification information.
[0053] When tmpkey is the preset tmpkey, that is, when the report to be generated is a special report, the second generation process corresponding to tmpkey in the code library is queried according to tmpkey; according to the preset hook mechanism corresponding to the second generation process, the function position in the first generation process that can be added by the function of the second generation process is found, and the function of the second generation process is added to the function of the first generation process to obtain the preset report generation process.
[0054] Optionally, in Figure 2 Based on the embodiment, the first generation process corresponding to the calling identification information includes:
[0055] S2011, calling the data acquisition process in the first generation process, and based on the identification information, calling the data filling process and the data report generation process corresponding to the identification information in the first generation process.
[0056] In the above S2011, the first generation process is written as the first generation function as the parent class, and the fixed function, abstract function and default function in the first generation function are defined. The fixed function can be directly executed without rewriting the function, the abstract function can be executed after rewriting the function, and the default function can be directly executed without rewriting the function or after rewriting the function.
[0057] For example, the data acquisition process is written as a data acquisition function that executes a fixed function, and the data acquisition function is used as a subclass that inherits the parent class, so the fixed function can be executed without rewriting it; the data filling process is written as a data filling function that rewrites the abstract function, and the data filling function is used as a subclass that inherits the parent class, so the abstract function can be rewritten and the function after the abstract function is rewritten can be executed; the data report generation process is written as a data report generation function that can optionally rewrite the default function, and the data report generation function is used as a subclass that inherits the parent class, so the default function can be rewritten and the function after the default function is rewritten can be executed, or the default function can be executed without rewriting it, wherein the data report generation function is implemented based on the hook mechanism.
[0058] It should be understood that the above examples are only for illustration. In other embodiments, the data acquisition process can also be written as an abstract function or a default function, the data filling process can also be written as a fixed function or a default function, and the data report generation process can also be written as a fixed function or an abstract function.
[0059] This embodiment divides the report generation function in the first generation process into three functional functions with different functions, thereby achieving the executability and reusability of the report generation function.
[0060] Optionally, in Figure 2 Based on the embodiment, the first generation process and the second generation process are combined into a preset report generation process, including:
[0061] S2021, determining the preset process nodes in the first generation process that can be added to the second generation process according to the correspondence between the identification information and the preset process nodes;
[0062] S2022, adding the second generation process to the preset process node in the first generation process to obtain a preset report generation process.
[0063] In the above S2021 and S2022, based on the hook mechanism, the preset process nodes in the first generation process that can be added by the second generation process are determined. Optionally, based on the hook mechanism, the first address of a function (process node) in the first generation process is modified in advance to the function address of the second generation process, so that when the first generation function is running, it can be determined whether the identification information is the preset identification information. If so, the process node in the first generation process that can be added by the second generation process is queried according to the correspondence between the identification information and the process node, and according to the first address of the function corresponding to the process node, it will jump to the execution function corresponding to the second generation process before the function corresponding to the process node is executed. When the execution function of the second generation process is completed, it will jump back to the function corresponding to the above process node, thereby realizing the addition of the second generation process to the first generation process.
[0064] exist Figure 1 Based on the embodiment shown, Figure 3 FIG. 1 is a flow chart of another report generation method provided in an embodiment of the present application. Figure 1 The same steps as those in the embodiment will not be repeated here.
[0065] like Figure 3 As shown, in a possible implementation, the above-mentioned preset report generation process includes a first generation process, and the first generation process includes a data acquisition process, a data filling process and a data report generation process;
[0066] Accordingly, the above S103 includes S301, according to the data acquisition process, transferring the identification information to a preset data interface, and acquiring target data corresponding to the identification information returned by the data interface;
[0067] In the above S301, the data acquisition process is a step that needs to be executed in each report generation process and is not differentiated. Therefore, tmpkey can be passed into the first report generation function, and the fixed function in the first report generation function can be executed to obtain the report data and jxls template corresponding to tmpkey.
[0068] Correspondingly, the above S104 includes S302 and S303.
[0069] S302, according to the data filling process, filling the report data into a table in the preset report template whose table attributes correspond to the data attributes of the report data;
[0070] In the above S302, the data filling process belongs to the data processing process, which is a step that needs to be executed for each report generation process and may have differential execution. For example, in Table 1, the data "Zhang San" is filled into the cell with the cell attribute "student", and in Table 2, the data "Zhang San" is filled into the cell with the cell attribute "teacher". Therefore, the report data can be passed into the data filling function, and according to the data filling process, the report data is used as a parameter to rewrite the abstract function in the first report generation function, and the abstract function containing the report data is executed to fill the report data into the cell corresponding to the jxls template.
[0071] S303: According to the report data generation process, the preset report template filled with the report data is generated into a data report in a preset format.
[0072] In the above S303, the data report generation process is a step that needs to be executed in each report generation process and may or may not be executed in a differentiated manner. For example, Table 1 can generate a horizontal table or a vertical table. Therefore, according to the data report generation process, a horizontal table can be generated by executing the default function in the first report generation function, or a vertical table can be generated by rewriting and executing the default function in the first report generation function.
[0073] Optionally, in Figure 3 Based on the embodiment, if the identification information is preset identification information, the preset report generation process further includes a second generation process;
[0074] Accordingly, before or after the above S303, the following steps may also be included:
[0075] S3031: Process the report data or the preset report template according to the second generation process.
[0076] In the above S3031, the process of processing the table is not a step that needs to be executed in every report generation process. For example, after the data report is generated, the name of the student with the best grades needs to be marked in the student score table, or before the data report is generated, the average score of the student with the best grades needs to be calculated. For these steps that are not required to be executed for every report, these steps are distinguished from the first generation process as the second generation process, and the execution function corresponding to each identification information in the second generation process is written, and the report data or the preset report template is processed according to the corresponding execution function.
[0077] In one possible implementation, Figures 1 to 3 Based on any one of the embodiments, the report generation method further includes S104 to S106.
[0078] S104, obtaining template modification information, where the template modification information carries parameters to be modified;
[0079] S105, configuring a correspondence between table attributes of a preset report template in a preset mapping table and parameters to be modified;
[0080] S106: According to the corresponding relationship, the cell parameters corresponding to the table attributes of the preset report template are updated to the parameters to be modified.
[0081] In the above S104 to S106, when there is no new data to be displayed in the report, it can be easily modified by modifying the jxls template without modifying the code and publishing. However, if there is new data to be displayed in the report, the current method still needs to modify the code logic for obtaining data in the report class. Therefore, in view of this situation, the embodiment of the present application adds a data mapping function.
[0082] Specifically, the system administrator has the authority to set the relationship between the data key value and the SQL. Through such a mapping pool, there is no need to modify the code in the background, but to maintain such a mapping relationship on the page. Even if the report has new data requirements later, add a mapping here, and then obtain the corresponding report data through the key value in the jxls template for display.
[0083] For example, taking the seat cost statistics (SeatStatic) as an example, if a new column of seat number seatnumber is needed later, the seat number can be added in the report page (i.e. the parameter to be modified), and the background automatically obtains the sql (database) mapping table corresponding to SeatStatic through the system administrator's authority. The sql mapping table records the table attributes of the template (such as table coordinates), and the seat number seatnumber is added to the sql mapping table to set the mapping relationship between seatnumber and the template table attributes. The system will also put seatnumber into the jxls template according to the mapping relationship. In this way, you only need to modify it on the report page, and the background will automatically change the jxls template according to the mapping relationship, without updating the code and redeploying it.
[0084] In order to further ensure the privacy and security of all the above data, all the above data (such as the above preset report generation process) can also be stored in a blockchain node, that is, the database in this solution can use a database on a blockchain node.
[0085] It should be noted that the blockchain referred to in the present invention is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.
[0086] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0087] Corresponding to the report generation method described in the above embodiment, Figure 4 The structural block diagram of the report generation device provided in the embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown.
[0088] Reference Figure 4 , the device comprises:
[0089] The first acquisition module 401 is used to acquire identification information corresponding to the report type of the report to be generated;
[0090] A calling module 402 is used to call a preset report generation process corresponding to the identification information;
[0091] A second acquisition module 403 is used to acquire target data corresponding to the identification information according to the preset report generation process, wherein the target data includes report data and a preset report template;
[0092] The generating module 404 is used to fill the report data into the preset report template according to the preset report generating process to obtain a data report corresponding to the report data.
[0093] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0094] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0095] Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 5 As shown, the terminal device 5 of this embodiment includes: at least one processor 50 ( Figure 5 Only one is shown in the figure) a processor, a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, and when the processor 50 executes the computer program 52, the steps in any of the above method embodiments are implemented.
[0096] The terminal device 5 may be a computing device such as a mobile phone, a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include but is not limited to a processor 50 and a memory 51. Those skilled in the art will understand that Figure 5 It is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0097] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0098] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. In other embodiments, the memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0099] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0100] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0101] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0104] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A report generation method, It is characterized in that include: Obtain identification information corresponding to the report type of the report to be generated; Calling a preset report generation process corresponding to the identification information; According to the preset report generation process, obtaining target data corresponding to the identification information, the target data including report data and a preset report template; According to the preset report generation process, the report data is filled into the preset report template to obtain a data report corresponding to the report data; The calling of the preset report generation process corresponding to the identification information includes: If the identification information is not the preset identification information, calling the first generation process corresponding to the identification information, and using the first generation process as the preset report generation process; If the identification information is preset identification information, the first generation process and the second generation process corresponding to the identification information are called, and the first generation process and the second generation process are combined into the preset report generation process; the first generation process includes steps common to all report generation, and the second generation process includes steps required for the generation of some reports themselves; The method further comprises: Acquire template modification information, where the template modification information carries parameters to be modified; Configure the corresponding relationship between the table attributes of the preset report template in the preset mapping table and the parameters to be modified; According to the corresponding relationship, the cell parameters corresponding to the table attributes of the preset report template are updated to the parameters to be modified.
2. The report generation method according to claim 1, It is characterized in that The calling of the first generation process corresponding to the identification information includes: The data acquisition process in the first generation process is called, and according to the identification information, the data filling process and the data report generation process corresponding to the identification information in the first generation process are called.
3. The report generation method according to claim 1, It is characterized in that The step of combining the first generation process and the second generation process into the preset report generation process includes: Determining, according to the correspondence between the identification information and the preset process nodes, the preset process nodes in the first generation process that can be added to the second generation process; The second generation process is added to the preset process node in the first generation process to obtain the preset report generation process.
4. The report generation method according to claim 1, It is characterized in that The preset report generation process includes a first generation process, and the first generation process includes a data acquisition process, a data filling process and a data report generation process; Accordingly, the step of acquiring the target data corresponding to the identification information according to the preset report generation process includes: according to the data acquisition process, transferring the identification information to a preset data interface, and acquiring the target data corresponding to the identification information returned by the data interface; Correspondingly, according to the preset report generation process, the report data is filled into the preset report template to obtain a data report corresponding to the report data, including: According to the data filling process, the report data is filled into a table in the preset report template whose table attributes correspond to the data attributes of the report data; According to the data report generation process, the preset report template filled with the report data is generated into a data report in a preset format.
5. The report generation method according to claim 4, It is characterized in that If the identification information is preset identification information, the preset report generation process further includes a second generation process; Accordingly, before or after generating a data report in a preset format from a preset report template filled with the report data according to the data report generation process, the process further includes: According to the second generation process, the report data or the preset report template is processed.
6. A report generating device, It is characterized in that include: A first acquisition module, used to acquire identification information corresponding to the report type of the report to be produced; A calling module, used for calling a preset report generation process corresponding to the identification information; A second acquisition module, configured to acquire target data corresponding to the identification information according to the preset report generation process, wherein the target data includes report data and a preset report template; A generating module, used to fill the report data into the preset report template according to the preset report generating process, and obtain a data report corresponding to the report data; The calling module is specifically used for: if the identification information is not the preset identification information, calling the first generation process corresponding to the identification information, and using the first generation process as the preset report generation process; if the identification information is the preset identification information, calling the first generation process and the second generation process corresponding to the identification information, and combining the first generation process and the second generation process as the preset report generation process; the first generation process includes steps shared by all report generation, and the second generation process includes steps required for the generation of some reports themselves; The report generation device is also used to obtain template modification information, which carries the parameters to be modified; configure the correspondence between the table attributes of the preset report template in the preset mapping table and the parameters to be modified; and according to the correspondence, update the cell parameters corresponding to the table attributes of the preset report template to the parameters to be modified.
7. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Stock valuation report generating system and stock valuation report template format
CN102194195A
A method and apparatus for generating an electronic report
CN109241511A