A report generation method, device and equipment and readable storage medium
By obtaining the matching results and hierarchical mapping relationship between the filtered data and the global data, the target report is generated, which solves the problem of the report data hierarchical relationship becoming invalid after switching the filter conditions, and achieves the stability and accuracy of the report display.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DUXIAOMAN TECH (BEIJING) CO LTD
- Filing Date
- 2023-02-09
- Publication Date
- 2026-07-24
AI Technical Summary
After switching the filter conditions for report data, the hierarchical relationship display logic between data may fail or become confused, resulting in messy and incorrect report content.
By obtaining the matching results between each filtered data point and the global data, the hierarchical mapping relationship of each filtered data point is obtained, and a target report containing the hierarchical mapping relationship is generated to maintain the integrity of the hierarchical relationship between data after switching filter conditions.
This effectively avoids the failure and confusion of the report data hierarchy display structure caused by switching filter conditions, ensuring the integrity and accuracy of the report display.
Smart Images

Figure CN116127934B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a report generation method, apparatus, device, and readable storage medium. Background Technology
[0002] To enrich the visualization of report data, hierarchical relationship display logic is usually added to the report. For example, the data of the parent node can be expanded to display the data of the child node, or the data of the parent node can be collapsed to hide the data of the child node.
[0003] However, after switching the filter conditions for the report data, the report data corresponding to the filter conditions will change, which may cause the display logic of the hierarchical relationship between the above data to fail or become confused, resulting in the report display content being messy and erroneous. Summary of the Invention
[0004] This application provides a report generation method, apparatus, system, electronic device, and computer storage medium that can retain the hierarchical relationship between data when the data filtering conditions change, thereby effectively avoiding the failure and confusion of the hierarchical display structure of the data in the report due to the switching of filtering conditions.
[0005] A first aspect of this application provides a report generation method, the method comprising:
[0006] Obtain the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationships for each filtering condition, and the global data is the collection of all the filtered data;
[0007] Based on the matching results, the hierarchical mapping relationship of each filtered data is obtained, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data;
[0008] Generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0009] Optionally, obtaining the matching result between each filtered data and the global data includes:
[0010] The global data is processed by field transformation to obtain a first identifier for each filtered data and a second identifier for the global data;
[0011] The matching result is determined based on the similarity between the first identifier and the second identifier.
[0012] Optionally, the step of performing field transformation processing on the global data to obtain a first identifier for each filtered data item and a second identifier for the global data includes:
[0013] Retrieve the field corresponding to each dimension enumeration value in the filtered data;
[0014] Based on the dimension mapping relationship, the fields of each dimension enumeration value are concatenated to obtain the first identifier of each filtered data;
[0015] Obtain all the first identifiers to obtain the second identifier of the global data.
[0016] Optionally, the method further includes:
[0017] Traverse the second identifier, number the second identifier sequentially, and obtain the number of each second identifier;
[0018] If the first identifier and the second identifier match, then the number of the second identifier is used as the number of the first identifier;
[0019] If the matching result between the first identifier and the second identifier is that they do not match, then the exception number of the matching result is used as the number of the first identifier.
[0020] Optionally, obtaining the hierarchical mapping relationship of each filtered data based on the matching result includes:
[0021] Obtain the node attributes of each dimension enumeration value in the global data;
[0022] Based on the node attributes, obtain the global hierarchical mapping relationship of each data in the global data;
[0023] Based on the matching results, determine the corresponding data for each of the filtered data in the global data;
[0024] The global hierarchical mapping relationship of the corresponding data is used as the hierarchical mapping relationship of each filtered data.
[0025] Optionally, before generating the target report containing the hierarchical mapping relationship, the method further includes:
[0026] Configure a default expansion format for each filtered data item to display each filtered data item in the target report based on the default expansion format.
[0027] Accordingly, a second aspect of this application provides a report generation apparatus, characterized in that the apparatus includes:
[0028] The matching result acquisition module is used to acquire the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationship under each filtering condition, and the global data is the collection of all the filtered data;
[0029] The hierarchical mapping relationship acquisition module is used to acquire the hierarchical mapping relationship of each filtered data based on the matching result, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data;
[0030] The target report generation module is used to generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0031] Optionally, the matching result acquisition module includes:
[0032] The field conversion processing submodule is used to perform field conversion processing on the global data to obtain a first identifier for each filtered data and a second identifier for the global data;
[0033] The similarity calculation submodule is used to determine the matching result based on the similarity between the first identifier and the second identifier.
[0034] An electronic device provided in the third aspect of this application includes:
[0035] Processor and storage media;
[0036] The processor is used to implement various instructions;
[0037] The storage medium is used to store multiple instructions, which are loaded by the processor and executed using the report generation method described above.
[0038] A fourth aspect of this application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the report generation methods provided in this application.
[0039] A fifth aspect of this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement any of the report generation methods provided in this application.
[0040] Therefore, this application obtains the matching results between each filtered data and the global data, thereby obtaining the hierarchical mapping relationship of each filtered data. Subsequently, the hierarchical mapping relationship of each filtered data is used as a necessary condition for generating the target report. This allows the target report to retain the hierarchical relationship between the report data even when the data filtering conditions change, thus effectively avoiding the situation where the hierarchical display structure of the report data becomes invalid or chaotic due to the switching of filtering conditions. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic diagram illustrating an application scenario of the data classification system provided in this application embodiment;
[0043] Figure 2 This is a flowchart illustrating the report generation method provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram illustrating the display of report data using the default report structure provided in this application embodiment;
[0045] Figure 4 This is a schematic diagram illustrating the display of report data using a hierarchical mapping relationship, provided in an embodiment of this application.
[0046] Figure 5 This is a schematic diagram illustrating the effective hierarchical mapping relationship of the report data provided in the embodiments of this application;
[0047] Figure 6 This is a schematic diagram illustrating the failure of the hierarchical mapping relationship of the report data provided in the embodiments of this application;
[0048] Figure 7 This is a schematic diagram of the target report configuration interface provided in an embodiment of this application;
[0049] Figure 8 This is a schematic diagram of the report generation device provided in the embodiments of this application;
[0050] Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] This application provides a report generation method, apparatus, device, and readable storage medium. The device can be an electronic device, and the readable storage medium can be a computer-readable storage medium. The report generation apparatus can be integrated into an electronic device, which can be a server, a terminal, or other similar device.
[0053] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0054] The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited herein.
[0055] For example, such as Figure 1 As shown, the server can obtain the matching results between each filtered data and global data, wherein the filtered data is report data containing dimension mapping relationships for each filtering condition, and the global data is the collection of all the filtered data; based on the matching results, the server obtains the hierarchical mapping relationship of each filtered data, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data; and generates a target report containing the hierarchical mapping relationship so that after switching the filtering conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0056] It should be noted that the steps performed on the server can also be performed on the terminal, and this embodiment does not impose any restrictions on this.
[0057] In this application's embodiments, "multiple" refers to two or more. The terms "first" and "second," etc., in this application's embodiments are used for distinguishing descriptions and should not be construed as implying relative importance.
[0058] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.
[0059] Please see Figure 2 In this embodiment, a report generation method is provided, which is applied to the data processing end, such as... Figure 2 As shown, the specific process for generating this report can be as follows:
[0060] Step 101: Obtain the matching results between each filtered data and the global data.
[0061] Please see Figure 3 and Figure 4 , Figure 3 This is a schematic diagram illustrating the display of report data using the default report structure, provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating the display of report data using a hierarchical mapping relationship, provided in an embodiment of this application.
[0062] The filtered data can include report data with dimension mapping relationships for each filter condition. The dimension mapping relationship refers to the correspondence between the enumerated values of different dimensions. For example... Figure 3 As shown, a report may have multiple dimensions, and there may be corresponding relationships between the dimension enumeration values of different dimensions. For example, the dimension enumeration value "2022-07-18" of dimension 1 corresponds to the dimension enumeration values "A" and "B" of dimension 2, so that there is a corresponding dimension mapping relationship between the dimension enumeration value "2022-07-18" and "A" and "B".
[0063] The filtering criteria can be preset conditions used to filter dimension enumeration values. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram illustrating the effective hierarchical mapping relationship of the report data provided in this application embodiment. For example... Figure 5 As shown, the report displays a filter option in the upper left corner: "Date 2023-01". This means the filter condition is January 2023, and the corresponding filtered data is: report data from January 2023 with dimensions 1 being male, 2 being product R, and 3 being A, B, and C. To further illustrate, assuming dimension 1 is gender, dimension 2 is the specific product, and dimension 3 is the product purchase price, then the filtered data would be: in January 2023, the user (male) paid A, B, and C for product R.
[0064] It should be noted that, for ease of description, each piece of filtered data in this application refers to report data in which a row or column has a dimensional mapping relationship under the filtered conditions, for example... Figure 3One of the filtered data points is "Dimension value 1 is 2022-07-18, dimension value 2 is A, dimension value 3 is 101, data value is 540619".
[0065] The global data can be a collection of all filtered data. It's understandable that a report can include multiple filter conditions and the corresponding filter data for each condition, but the report's size has an upper limit, which also limits the number and range of filter conditions. For example, if the filter condition is time, the report can limit the range of the filter condition to 2021 to 2022. Then the number of filter conditions can be divided into 2 by year, or 24 by month.
[0066] It's understandable that the filtered data displayed under different filtering conditions may differ. For example, the report data filtered for 2021 might be different from the report data filtered for 2022. Therefore, the global data is the collection of all filtered data under all filtering conditions, which can also be understood as all the data in this report. Figure 4 As shown, the data values for filtering data with the filter condition 2022-07-18 and 2022-07-17 are completely different. Global data, on the other hand, will cover all data in the report, including 2022-07-18 and 2022-07-17 in dimension 1, A and B in dimension 2, 1, 11, and 101 in dimension 3, and data values from 2644855 to 427461.
[0067] Optionally, step 101 may include:
[0068] The global data is processed by field transformation to obtain a first identifier for each filtered data and a second identifier for the global data;
[0069] The matching result is determined based on the similarity between the first identifier and the second identifier.
[0070] Field conversion processing refers to converting global data and filtered data into fields.
[0071] Optionally, the step "perform field transformation on the global data to obtain a first identifier for each filtered data item and a second identifier for the global data" includes:
[0072] Retrieve the field corresponding to each dimension enumeration value in the filtered data;
[0073] Based on the dimension mapping relationship, the fields of each dimension enumeration value are concatenated to obtain the first identifier of each filtered data;
[0074] Obtain all the first identifiers to obtain the second identifier of the global data.
[0075] In some embodiments, the fields of each dimension enumeration value can be obtained. For example Figure 5 the field of the dimension enumeration value in is the dimension enumeration value itself, such as male, product R, etc. In some embodiments, the fields of each dimension enumeration value can be concatenated by a concatenation symbol. Taking Figure 5 the filtering data in as an example, the concatenation symbol can be any similar separator symbol such as "_" or "|". Then, for the first identifier of this filtering data, it can be "male_product R_A", "male_product R_B", and "male_product R_C". Correspondingly, for the filtering data with different filtering conditions in the loop table, the second identifier of the global data is also obtained in the same way of concatenating the dimension enumeration values.
[0076] In some embodiments, the similarity between the first identifier and the second identifier can be calculated to determine the matching result. It can be understood that since the filtering data is a part of the global data, it can be determined whether two identifiers match by comparing whether the fields of the first identifier and the second identifier are exactly the same. For example, the matching result of the first identifier "male_product R_A" and the second identifier "male_product R_A" is a match, while the result of the first identifier "male_product R_A" and the second identifier "male_product R_B" is a mismatch.
[0077] Optionally, the method of the present application further includes:
[0078] Traverse the second identifier, number the second identifier in order, and obtain the number of each second identifier;
[0079] If the matching result of the first identifier and the second identifier is a match between the two, then use the number of the second identifier as the number of the first identifier;
[0080] If the matching result of the first identifier and the second identifier is a mismatch between the two, then use the abnormal number of the matching result as the number of the first identifier.
[0081] It can be understood that since the global data contains multiple filtering data, the number of second identifiers is generally multiple. Multiple second identifiers can be traversed, and the multiple second identifiers are numbered in order starting from 1 to obtain the number of each second identifier. For example, the number of the second identifier "male_product R_A" is 1, the number of "male_product R_B" is 2, the number of "male_product R_C" is 3, and so on, and the operation of numbering each second identifier in order is performed. [[ID=]26]
[0082] In some embodiments, when the matching result of the first identifier and the second identifier is that they match, the number of the second identifier is used as the number of the first identifier; if the matching result of the first identifier and the second identifier is that they do not match, the exception number of the matching result is used as the number of the first identifier. Specifically, if the first identifier and the second identifier match, the number of the second identifier is directly recorded and used as the current number of the first identifier; if the first identifier and the second identifier do not match, the value 0 or other value less than 1 is returned. It can be understood that since the numbering of the second identifier starts from 1, 0 is used to represent unsuccessful matching. Here, it can also be agreed that other numbers less than 1 or special characters can represent unsuccessful matching, and this embodiment does not limit this.
[0083] Step 102: Based on the matching results, obtain the hierarchical mapping relationship of each filtered data.
[0084] The hierarchical mapping relationship can represent the hierarchical affiliation between different filtered data, and the hierarchical affiliation can be represented by the node attributes of parent and child nodes. For example... Figure 5 In this context, dimension enumeration value A can be the parent node, and dimension enumeration values B and C can be the child nodes of A. A is the parent node of B and C, and correspondingly, B and C are the child nodes of A, creating a hierarchical mapping relationship between A, B, and C. A control at A that allows data to be expanded / collapsed can be used to control the display and hiding of B and C. For example, assuming the dimensions corresponding to A, B, and C are regions, then A can be a city, and B and C can be districts within that city.
[0085] Optionally, step 102 may include:
[0086] Obtain the node attributes of each dimension enumeration value in the global data;
[0087] Based on the node attributes, obtain the global hierarchical mapping relationship of each data in the global data;
[0088] Based on the matching results, determine the corresponding data for each of the filtered data in the global data;
[0089] The global hierarchical mapping relationship of the corresponding data is used as the hierarchical mapping relationship of each filtered data.
[0090] In some embodiments, the node attributes of each dimension enumeration value in the global data can be obtained, and the global hierarchical mapping relationship of each data in the global data can be obtained based on the node attributes. It can be understood that since the global data contains all report data with dimension mapping relationships, when obtaining the global data, the node attributes of each dimension enumeration value can be obtained simultaneously, thereby obtaining the global hierarchical mapping relationship of each data.
[0091] As an example only, Figure 5 Taking the report as an example, when obtaining global data, the node attributes between A, B and C can be obtained synchronously, with A as the parent node and B and C as child nodes of A. Furthermore, based on this, we can obtain that "Male_Product R_A" is the upper level data of "Male_Product R_B" and "Male_Product R_C", and there is a hierarchical mapping relationship between the three.
[0092] In some embodiments, when the filtered data matches the data in the global data, not only can the number of the second identifier be used as the number of the first identifier, but the global hierarchical mapping relationship of the data corresponding to the number of the second identifier can also be inherited to the filtered data corresponding to the number of the first identifier, so as to obtain the hierarchical mapping relationship of the filtered data. Continuing the previous example, the number of the second identifier "Male_Product R_A" is 1, the number of "Male_Product R_B" is 2, and the number of "Male_Product R_C" is 3. If the number of the first identifier is also 2, it means that the first identifier corresponding to the filtered data is "Male_Product R_B", and the filtered data also has a hierarchical mapping relationship where the dimension enumeration value B is a child node of the dimension enumeration value A.
[0093] Please see Figure 5 and Figure 6 , Figure 6 This is a schematic diagram illustrating the failure of the hierarchical mapping relationship of the report data provided in this application embodiment. For example... Figure 5 and Figure 6 As shown, taking the existing report logic as an example, when the filter condition is 2023-01, dimension enumeration values B and C are child nodes of dimension enumeration value A. This means that when parent node A is expanded, B and C are displayed, and when parent node A is collapsed, B and C are hidden. When the filter condition is switched to 2022-12, dimension enumeration value B does not exist. This is equivalent to B being a newly added dimension enumeration value in 2023-01. Because the data of dimension 3 has changed, the hierarchical mapping relationship that originally existed between A, B, and C becomes invalid due to the absence of B. As a result, in the filtered data with the filter condition 2022-12, because the hierarchical mapping relationship between A and C is invalid, parent node A can no longer expand or collapse its child node C.
[0094] As can be seen from the above description, this application can obtain the hierarchical mapping relationship corresponding to the filtered data, so that after switching the filter conditions, any filtered data displayed in the report still retains the corresponding hierarchical mapping relationship. Therefore, the defect described above, which causes the hierarchical mapping relationship to fail due to switching to different filter conditions and changes in the filtered data, will not occur.
[0095] Step 103: Generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0096] Optionally, prior to step 103, the method of this application may further include:
[0097] Configure a default expansion format for each filtered data item to display each filtered data item in the target report based on the default expansion format.
[0098] Please see Figure 7 , Figure 7 This is a schematic diagram of the target report configuration interface provided in this application embodiment. As can be seen, in this configuration interface, users can locate specific rows or columns by selecting specific dimension enumeration values of Dimension 1, Dimension 2, and Dimension 3. Then, the parent and child node attributes of each data are configured through hierarchical mapping relationships. By setting the default expansion form, such as whether a certain data is expanded or collapsed by default, the user can indicate whether the rows or columns configured when initially entering the report are expanded or collapsed.
[0099] In some embodiments, the system front-end can record the number corresponding to each default expansion form configured by the user based on the number corresponding to each data in the global data, and then obtain the number of the data to be filtered under the current filtering condition to match the number under the global dimension data. If the numbers of the parent node data and the child node data can be matched at the same time, the expansion / collapse style of the generated target report corresponding to the above data will take effect; otherwise, the expansion / collapse style will be invalid.
[0100] It is understandable that after generating the target report containing hierarchical mapping relationships, even if the filter conditions are frequently switched, any filtered data displayed in the report will still retain the corresponding hierarchical mapping relationship. Therefore, there will be no situation where the hierarchical mapping relationship becomes invalid due to switching to different filter conditions or changes in the filtered data, resulting in chaotic or incorrect report data display.
[0101] Therefore, this application obtains the matching results between each filtered data and the global data, thereby obtaining the hierarchical mapping relationship of each filtered data. Subsequently, the hierarchical mapping relationship of each filtered data is used as a necessary condition for generating the target report. This allows the target report to retain the hierarchical relationship between the report data even when the data filtering conditions change, thus effectively avoiding the situation where the hierarchical display structure of the report data becomes invalid or chaotic due to the switching of filtering conditions.
[0102] The method described in the above embodiments will be further described in detail below.
[0103] like Figure 6 The diagram shown is a structural schematic of a report generation device provided in an embodiment of this application. This device can be applied to a data processing end and includes:
[0104] The matching result acquisition module 201 is used to acquire the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationship under each filtering condition, and the global data is the collection of all the filtered data;
[0105] The hierarchical mapping relationship acquisition module 202 is used to acquire the hierarchical mapping relationship of each filtered data based on the matching result, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data;
[0106] The target report generation module 203 is used to generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0107] Optionally, the matching result acquisition module 201 includes:
[0108] The field conversion processing submodule is used to perform field conversion processing on the global data to obtain a first identifier for each filtered data and a second identifier for the global data;
[0109] The similarity calculation submodule is used to determine the matching result based on the similarity between the first identifier and the second identifier.
[0110] Optionally, the field conversion processing submodule is further specifically used for:
[0111] Retrieve the field corresponding to each dimension enumeration value in the filtered data;
[0112] Based on the dimension mapping relationship, the fields of each dimension enumeration value are concatenated to obtain the first identifier of each filtered data;
[0113] Obtain all the first identifiers to obtain the second identifier of the global data.
[0114] Optionally, the device further includes:
[0115] The second identifier numbering module is used to traverse the second identifier, number the second identifier sequentially, and obtain the number of each second identifier;
[0116] The first identifier numbering module is used to use the number of the second identifier as the number of the first identifier if the matching result between the first identifier and the second identifier is that they match.
[0117] If the matching result between the first identifier and the second identifier is that they do not match, then the exception number of the matching result is used as the number of the first identifier.
[0118] Optionally, the hierarchical mapping relationship acquisition module 202 is further specifically used for:
[0119] Obtain the node attributes of each dimension enumeration value in the global data;
[0120] Based on the node attributes, obtain the global hierarchical mapping relationship of each data in the global data;
[0121] Based on the matching results, determine the corresponding data for each of the filtered data in the global data;
[0122] The global hierarchical mapping relationship of the corresponding data is used as the hierarchical mapping relationship of each filtered data.
[0123] Optionally, the device further includes:
[0124] The default expansion format configuration module is used to configure the default expansion format of each filtered data, so that each filtered data is displayed in the target report based on the default expansion format.
[0125] In this application, the matching result acquisition module 201 can acquire the matching result between each filtered data and global data, wherein the filtered data is report data containing dimension mapping relationships under each filtering condition, and the global data is the collection of all the filtered data; the hierarchical mapping relationship acquisition module 202 can acquire the hierarchical mapping relationship of each filtered data based on the matching result, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data; the target report generation module 203 can generate a target report containing the hierarchical mapping relationship, so that after switching the filtering conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0126] Therefore, this application obtains the matching results between each filtered data and the global data, thereby obtaining the hierarchical mapping relationship of each filtered data. Subsequently, the hierarchical mapping relationship of each filtered data is used as a necessary condition for generating the target report. This allows the target report to retain the hierarchical relationship between the report data even when the data filtering conditions change, thus effectively avoiding the situation where the hierarchical display structure of the report data becomes invalid or chaotic due to the switching of filtering conditions.
[0127] Corresponding to the above method embodiments, this invention also provides a computer device. The computer device described below and the report generation method described above can be referred to each other.
[0128] The computer device includes:
[0129] Memory, used to store computer programs;
[0130] A processor, used to execute a computer program, implements the steps of the report generation method in the above method embodiments:
[0131] Obtain the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationships for each filtering condition, and the global data is the collection of all the filtered data;
[0132] Based on the matching results, the hierarchical mapping relationship of each filtered data is obtained, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data;
[0133] Generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
[0134] For details, please refer to Figure 7 This is a schematic diagram illustrating the specific structure of a computer device provided in this embodiment. The computer device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer application programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the data processing device. Furthermore, the central processing unit 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the computer device 301.
[0135] Computer device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0136] The steps in the report generation method described above can be implemented using the structure of a computer device.
[0137] Corresponding to the above method embodiments, this invention also provides a readable storage medium. The readable storage medium described below corresponds to and can be referred to in relation to the report generation method described above.
[0138] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the report generation method described in the above method embodiments.
[0139] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0140] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the invention.
Claims
1. A report generation method, characterized in that, The method includes: Obtain the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationships for each filtering condition, and the global data is the collection of all the filtered data; Based on the matching results, a hierarchical mapping relationship for each filtered data is obtained, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data. Obtaining the hierarchical mapping relationship for each filtered data based on the matching results includes: obtaining the node attributes of each dimension enumeration value in the global data, where the node attributes of each dimension enumeration value represent the parent-child node relationship between the various dimension enumeration values under the corresponding dimension; obtaining the global hierarchical mapping relationship for each data in the global data based on the node attributes; determining the corresponding data for each filtered data in the global data based on the matching results; and using the global hierarchical mapping relationship of the corresponding data as the hierarchical mapping relationship for each filtered data. Generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
2. The report generation method according to claim 1, characterized in that, The process of obtaining the matching results between each filtered data point and the global data includes: The global data is processed by field transformation to obtain a first identifier for each filtered data and a second identifier for the global data; The matching result is determined based on the similarity between the first identifier and the second identifier.
3. The report generation method according to claim 2, characterized in that, The step of performing field transformation processing on the global data to obtain a first identifier for each filtered data item and a second identifier for the global data includes: Retrieve the field corresponding to each dimension enumeration value in the filtered data; Based on the dimension mapping relationship, the fields of each dimension enumeration value are concatenated to obtain the first identifier of each filtered data; Obtain all the first identifiers to obtain the second identifier of the global data.
4. The report generation method according to claim 2, characterized in that, The method further includes: Traverse the second identifier, number the second identifier sequentially, and obtain the number of each second identifier; If the first identifier and the second identifier match, then the number of the second identifier is used as the number of the first identifier; If the matching result between the first identifier and the second identifier is that they do not match, then the exception number of the matching result is used as the number of the first identifier.
5. The report generation method according to any one of claims 1-4, characterized in that, Before generating the target report containing the hierarchical mapping relationship, the method further includes: Configure a default expansion format for each filtered data item to display each filtered data item in the target report based on the default expansion format.
6. A report generation device, characterized in that, The device includes: The matching result acquisition module is used to acquire the matching result between each filtered data and the global data, wherein the filtered data is report data containing dimension mapping relationships under each filtering condition, and the global data is the collection of all the filtered data; A hierarchical mapping relationship acquisition module is used to acquire the hierarchical mapping relationship of each filtered data based on the matching result, wherein the hierarchical mapping relationship represents the hierarchical affiliation between different filtered data. Acquiring the hierarchical mapping relationship of each filtered data based on the matching result includes: acquiring the node attributes of each dimension enumeration value in the global data, where the node attributes of each dimension enumeration value represent the parent-child node relationship between the various dimension enumeration values under the corresponding dimension; acquiring the global hierarchical mapping relationship of each data in the global data based on the node attributes; determining the corresponding data of each filtered data in the global data based on the matching result; and using the global hierarchical mapping relationship of the corresponding data as the hierarchical mapping relationship of each filtered data. The target report generation module is used to generate a target report containing the hierarchical mapping relationship, so that after switching the filter conditions, the target report displays the corresponding filtered data based on the hierarchical mapping relationship.
7. The report generation device according to claim 6, characterized in that, The matching result acquisition module includes: The field conversion processing submodule is used to perform field conversion processing on the global data to obtain a first identifier for each filtered data and a second identifier for the global data; The similarity calculation submodule is used to determine the matching result based on the similarity between the first identifier and the second identifier.
8. A computer device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the report generation method as described in any one of claims 1 to 5 when executing the computer program.
9. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the report generation method as described in any one of claims 1 to 5.