Report display method, device, computer equipment and storage medium
By introducing dynamic configuration input boxes for report fields in the enterprise management system, and using report templates to link objects with data source model objects, dynamic expansion and display of reports are achieved, solving the problems of high development costs and inconvenient maintenance in the existing technology, and improving the flexibility and scalability of the system.
Patent Information
- Application Number
- CN202111212012.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-10-18
AI Technical Summary
In the existing enterprise management system, the method of expanding business reports through secondary development through plug-in interfaces is high in development and is not conducive to later maintenance.
Provide a report display method. By displaying the dynamic configuration input box of the report field, the input box is generated based on the object association information of the report template and the data source model, and in response to the display field selection instruction, the value of the target data source field is obtained, so as to realize the dynamic expansion and display of the report.
It reduces development and maintenance costs, simplifies the customized development process, improves the flexibility and scalability of reports, and reduces dependence on professional R&D personnel.
Smart Images

Figure CN113988004B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of report display, and in particular to a report display method, device, computer equipment and storage medium. Background Art
[0002] As business operations develop, users will have the need to expand the business reports preset in the existing enterprise management system. Currently, plug-in interface technology is used to perform secondary development through the plug-in interface provided by the ERP platform to meet the needs of different business scenarios.
[0003] To implement extended functions by developing plug-ins, you need to inherit the preset interfaces provided by the platform, and then mount the plug-ins on the platform reports for use.
[0004] The functions are implemented through plug-in interface development, which has a high development cost. Each expansion needs to be developed and then replaced. When replacing the application, it may be necessary to wait for a period of time when no one is using it for maintenance, which is not conducive to later maintenance. Summary of the invention
[0005] Based on this, it is necessary to provide a report display method, device, computer equipment and storage medium that are easy to expand in order to solve the above technical problems.
[0006] A report display method, the method comprising:
[0007] Displaying a dynamic configuration input box of a report field, wherein the dynamic configuration input box of the report field is generated according to object association information between the report template and the data source model;
[0008] In response to a display field selection instruction, a target display field is obtained from the dynamic configuration input box, and according to the target display field, a candidate associated field corresponding to the target display field is obtained to obtain a target associated field, and according to the target associated field, a candidate data source field corresponding to the target associated field is determined to obtain a target data source field;
[0009] The value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field.
[0010] In one embodiment, obtaining the value corresponding to the target data source field includes:
[0011] It is detected that the target display field represents a target field group, and the target field group includes a plurality of target display fields;
[0012] According to the target field group, the identifier of the target field group is used as the target associated field, and the data to be displayed is obtained from the target data source according to the target associated field.
[0013] In one embodiment, realizing report display according to the value corresponding to the target data source field includes:
[0014] Acquire first data to be displayed from the target data source;
[0015] splicing the first data to be displayed, and generating second data to be displayed after the spliced data reaches a corresponding length;
[0016] A report display is realized according to at least one of the second data to be displayed.
[0017] In one embodiment, before obtaining the report candidate field input box, a step of constructing a dynamic configuration input box for the report field is also included, and the step includes:
[0018] Generate candidate display fields according to the fields and field attributes of the report template and / or data source model, wherein the attributes of the candidate display fields include candidate field description information;
[0019] The candidate display fields are aggregated, and the candidate display field description information is used as the index of the candidate field to generate a report candidate field list.
[0020] In one embodiment, the method further includes the step of generating object association information between the report template and the data source model, and the step specifically includes:
[0021] Acquire a first field from a data source model, where the first field includes a primary key field of the data source model;
[0022] Acquire a second field from the report template, where the second field includes a primary key field of the report template;
[0023] The second field is used as an associated object of the first field to generate primary key associated information.
[0024] In one embodiment, the method further comprises the step of generating a report template, specifically comprising:
[0025] Acquire a report set, the report set including a report structure set and field attribute set information;
[0026] Generate a report template according to the report structure information and the report field attributes, wherein the report template includes at least one report template field;
[0027] At least one of the report template fields is used as an associated field of the report template, and the associated field of the report template is used to establish object association information with the data source model.
[0028] In one embodiment, the method further comprises the step of constructing a data source, specifically comprising:
[0029] Acquire the used report data, and generate the field information of the data source according to the used report data, wherein the field information of the data source includes the attributes of the data source field;
[0030] According to the attribute of the data source field, an associated field of the data source is established, and the associated field of the data source is used to establish object association information with the report template.
[0031] A report display device, comprising:
[0032] A first association module, used to display a dynamic configuration input box of a report field, wherein the dynamic configuration input box of the report field is generated according to object association information between the report template and the data source model;
[0033] The second association module is used to respond to the display field selection instruction, obtain the target display field from the dynamic configuration input box, obtain the candidate association field corresponding to the target display field according to the target display field, obtain the target association field, determine the candidate data source field corresponding to the target association field according to the target association field, obtain the target data source field, obtain the value corresponding to the target data source field, and realize report display according to the value corresponding to the target data source field.
[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] Displaying a dynamic configuration input box of a report field, wherein the dynamic configuration input box of the report field is generated according to object association information between the report template and the data source model;
[0036] In response to a display field selection instruction, a target display field is obtained from the dynamic configuration input box, and according to the target display field, a candidate associated field corresponding to the target display field is obtained to obtain a target associated field, and according to the target associated field, a candidate data source field corresponding to the target associated field is determined to obtain a target data source field;
[0037] The value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field.
[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0039] Displaying a dynamic configuration input box of a report field, wherein the dynamic configuration input box of the report field is generated according to object association information between the report template and the data source model;
[0040] In response to a display field selection instruction, a target display field is obtained from the dynamic configuration input box, and according to the target display field, a candidate associated field corresponding to the target display field is obtained to obtain a target associated field, and according to the target associated field, a candidate data source field corresponding to the target associated field is determined to obtain a target data source field;
[0041] The value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field.
[0042] The above-mentioned report display method, device, computer equipment and storage medium display a dynamic configuration input box of a report field, and the dynamic configuration input box of the report field is generated according to the object association information of the report template and the data source model; in response to the display field selection instruction, the target display field is obtained from the dynamic configuration input box, and the candidate association field corresponding to the target display field is obtained according to the target display field, and the target association field is obtained, and the candidate data source field corresponding to the target association field is determined according to the target association field, and the target data source field is obtained, and the value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field. Thus, the object hierarchy is associated through the field attributes of the report template and the data source field attributes, and then the data source associated with the field is determined through the field hierarchy, and then displayed. The user can directly use the template to perform a customized development process without using an interface or component, and can reuse the association of the object hierarchy to display the field. Further, only the metadata such as the template and model extracted by the feature need to be focused on, which can reduce the research and development cost, and in most cases, only the template and model need to be maintained, and the maintenance cost is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 An application environment diagram of a report display method in an embodiment;
[0044] Figure 2 A flowchart of a report display method in one embodiment;
[0045] Figure 3 A schematic diagram of an interface for field settings in an embodiment;
[0046] Figure 4 A schematic diagram of an interface for field settings in another embodiment;
[0047] Figure 5 A schematic diagram of a process of filling a target data source field in one embodiment;
[0048] Figure 6 A schematic diagram of a report interface in an embodiment;
[0049] Figure 7 A schematic diagram of a flow chart for realizing report display in an embodiment;
[0050] Figure 8 A schematic diagram of a process of setting an input box for a construction field in an embodiment;
[0051] Fig. 9 is a schematic diagram of a process of generating object association information in an embodiment;
[0052] Fig.10 A schematic diagram of a process for generating a report template in an embodiment;
[0053] Fig.11 A schematic diagram of a process of constructing a data source in an embodiment;
[0054] Fig.12 A flowchart of a report display method in an embodiment;
[0055] Fig.13 is a structural block diagram of a report display device in an embodiment;
[0056] Fig.14 It is a structural block diagram of a report display device in another embodiment;
[0057] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] In traditional technology, there are generally two ways to expand preset business reports: one is to perform secondary development through the plug-in interface provided by the ERP platform to meet the needs of different scenarios. Plug-ins refer to some preset interface execution logic of the platform system in specific business scenarios. Third-party application users implement a mechanism to mount customized business logic on the platform system to run by implementing the preset interface. This method is to achieve extended functions by developing plug-ins. This method inherits the preset interface provided by the platform, and then mounts the plug-in on the platform report. When the platform runs the report, it will load the relevant plug-in for use.
[0060] Another way to expand the preset business reports is to directly develop specific reports through the source code of the corresponding reports to meet the needs of different scenarios. The above development through plug-in interfaces and through the source code of business reports require development and replacement every time an expansion is needed, which has high R&D costs. If there are multiple reports that need to be customized, this report expansion method is extremely inconvenient and not easy to maintain later, which greatly increases the development cost and later maintenance cost.
[0061] Based on this, in order to simplify the customized development process and reduce R&D and maintenance costs, a configuration method is provided for customers' extended applications. The configuration is simple and easy to use, and does not require professional R&D personnel to develop, which greatly improves the customer's customized application experience. Through the unified configuration tool of the report, the field display of each report can be customized and combined. Customers only need to configure according to the business scenario to realize the dynamic expansion display of the report.
[0062] The report display method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 displays a dynamic configuration input box of a report field, and the dynamic configuration input box of the report field is generated according to the object association information of the report template and the data source model; the terminal 102 responds to the display field selection instruction, obtains the target display field from the dynamic configuration input box, obtains the candidate association field corresponding to the target display field according to the target display field, obtains the target association field, determines the candidate data source field corresponding to the target association field according to the target association field, obtains the target data source field, obtains the value corresponding to the target data source field, and realizes the report display according to the value corresponding to the target data source field. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0063] In one embodiment, Figure 2 As shown, a report display method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0064] Step 202 : Display a dynamic configuration input box of a report field. The dynamic configuration input box of a report field is generated according to object association information between a report template and a data source model.
[0065] A report is a tool used to analyze, summarize, and display business data characteristics from different dimensions. It can be a financial report, which can be understood as a special document.
[0066] The dynamic configuration input box of the report field is used to select certain information or receive input information. It can be used for dynamic expansion, and the content to be displayed can be adjusted in real time as needed to achieve data interaction. It can include a table list for receiving the selected instructions of the report field; it can include an input box for custom fields for the report field to increase the convenience of expansion. Optionally, the dynamic configuration input box of the report field includes candidate display fields, candidate data source fields, and candidate association fields. The candidate association fields are used to establish an association relationship between candidate display fields and candidate data source fields to achieve more flexible data acquisition.
[0067] A report template is a template generated after feature extraction of one or more reports and other documents. It includes one or more field attributes such as field identifiers, associated fields corresponding to fields, field types, etc. It can also include a corresponding report structure to display the report. The method of generating a report template mainly extracts the features of field attributes and / or table structures of certain documents, which can be a template for a certain field.
[0068] The data source model is a model generated by extracting features from an information set that can serve as a data source. It includes one or more of the field attributes such as field identifiers, associated fields corresponding to fields, and field types. The information set that serves as a data source can include any number of historical report data, basic data, or business object data.
[0069] The object association information between the report template and the data source model can also be called the object association information between the report metadata and the basic metadata. Object association information is used to indicate that the report template and the data source model are associated objects. Object association information indicates the association information between the field attributes of the report template and at least one field attribute of the data source, that is, a mapping relationship is established between the report template and the data source model through a certain field, so that the data in the two objects becomes dynamically associated and data can be called.
[0070] Therefore, after displaying the dynamic configuration input box of the report field, the fields to be displayed can be freely adjusted. Since the dynamic configuration input box of the report field is generated according to the object association information, it has the advantage of being expandable, so as to realize the free configuration of the report to be displayed.
[0071] Specifically, based on the report platform, the report features are extracted to abstract simple metadata objects, namely report templates. The basic data and business documents of the ERP system also have data models, which are also metadata, namely data source models. Based on this, a configuration tool can be provided to establish the association between the current report and the basic data or business documents, and can also be used to configure the association between extended fields and store the association between extended columns in the configuration table.
[0072] Step 204, in response to the display field selection instruction, obtain the target display field from the dynamic configuration input box, obtain the candidate associated field corresponding to the target display field according to the target display field, obtain the target associated field, determine the candidate data source field corresponding to the target associated field according to the target associated field, and obtain the target data source field.
[0073] The target display field is the field that will be displayed in the report. Based on its affiliation, it can be a field in a report template, or a field composed of a report template combined with fields entered in a dynamic configuration input box. Based on its quantity, it can be one or more fields.
[0074] The candidate association field has some mapping relationship with some display fields and some data source fields, which is equivalent to a bridge for display fields to obtain data. The target association field can be at least one field determined from the candidate association fields, which has some mapping relationship with the target display field. The target association field and the target display field may be stored in a report template at the same time; at the same time, the target association field should also have some mapping relationship with the target data source field.
[0075] The candidate data source field is a field extracted from the data source model and has corresponding field attributes. The target data source field is a field selected from the candidate data source field and has a mapping relationship with the target associated field.
[0076] Therefore, the target associated field corresponding to the target display field is determined through the relationship between the target display field and the candidate associated field of the report template, and then the candidate data source field in the data source template is determined through the target associated field.
[0077] Specifically, after the above two metadata generation configuration tools are used, the primary key fields and other fields on the current report can be used as associated fields, and the primary key fields of the corresponding basic data objects or business document objects can be selected as associated fields. In this way, the relationship between the report data and the data objects that need to be expanded can be established, and then the field information that needs to be displayed can be associated. According to the actual situation, multiple field columns that need to be displayed can be established as display information, and the same report can also be associated with different business data for display. Based on this, when loading a report, if it is a system-preset business report, the business report component is first called to load the data package. If it is a platform-general report, the platform data retrieval logic is directly used, so that the report template consisting of the report data package and field column information can be obtained.
[0078] Step 206, obtaining the value corresponding to the target data source field, and realizing report display according to the value corresponding to the target data source field.
[0079] Optionally, when loading dynamically configured data such as dynamic extension configuration information, the target display field and associated configuration information are passed to the relational model parsing tool to parse the data acquisition SQL for each extended display field column, where the target display field can be a field in the report template or an extended field. Then, the actual data acquisition logic is dynamically constructed based on the current report data package and the data acquisition SQL of the associated display field, and batch data acquisition can be selected to reduce the time consumption of data acquisition and improve data loading performance.
[0080] Optionally, the configuration tool interface can be as follows Figure 3 As shown in the figure, "Table" can be a report template, a document template, or a specific report. The selected report can be called the current report; "Display Field" is a candidate display field, which can come from multiple report templates or multiple data sources. The selected display field can be called the target display field; "Associated Field" is a candidate associated field, which is used to build the field association relationship between the report template and the data source. "Table Positioning" and "Field Positioning" are both performed on the input box close to this label. They can be used to find the corresponding fields from their respective input boxes, and can also be used to obtain custom fields. Figure 4 As shown, "field" indicates a candidate display field, and whether it is displayed can be determined by "selecting" the field.
[0081] Optionally, the configuration tool corresponds to a parsing tool, which is used to parse the data entered by the configuration tool. The parsing tool receives the incoming metadata package and traverses according to the target display field. If an extended custom field is encountered, the method of dynamically building SQL is called for each custom field column to obtain the data acquisition SQL of the associated display field. Specifically, after receiving the data entered by the configuration tool, there are at least two steps. First, when receiving the data entered by the configuration tool, the conditional value in the data acquisition SQL of the associated display field is marked with a variable. In this way, according to the returned SQL, a data set is established according to the keyword identifier of the custom field. The primary key is the custom field identifier, and the value is the corresponding data acquisition SQL. Then this data set is used as the return result of the parsing tool; next, when displaying, fill the target display field when traversing each piece of data; in the process of filling the target display field, traverse the row data, use the value of the associated field as the value of the condition field, and replace the variable value in the data acquisition SQL.
[0082] Optionally, when realizing report display, after processing in any of the above embodiments, a data packet of display data can be obtained, and then dynamic expansion can be realized by rendering display, etc. If it is necessary to increase or decrease the target display field, it can also be set through the configuration tool.
[0083] In the above report display method, the above report display method, device, computer equipment and storage medium display a dynamic configuration input box of a report field, and the dynamic configuration input box of the report field is generated according to the object association information of the report template and the data source model; in response to the display field selection instruction, the target display field is obtained from the dynamic configuration input box, and the candidate association field corresponding to the target display field is obtained according to the target display field, and the target association field is obtained, and the candidate data source field corresponding to the target association field is determined according to the target association field, and the target data source field is obtained, and the value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field. Thus, the object hierarchy is associated through the field attributes of the report template and the data source field attributes, and then the data source associated with the field is determined through the field hierarchy, and then displayed. The user can directly use the template for a customized development process without using an interface or component, and can reuse the association of the object hierarchy to display the field. Further, only the metadata such as the template and model extracted by the feature extraction need to be focused on, which can reduce the R&D cost, and in most cases, only the template and model need to be maintained, and the maintenance cost is low.
[0084] In a further embodiment, in order to better control the display of fields, they can be classified according to strategies such as field categories, and field groups can be formed by combining candidate display fields. A field group may include one or more candidate display fields; and a field group may also include one or more field groups. For example, in a primary logistics category field group, a secondary logistics category field group may be included, which may also include specific logistics field names.
[0085] In one embodiment, Figure 5 As shown, get the value corresponding to the target data source field, including:
[0086] Step 502: It is detected that a target display field represents a target field group, and the target field group includes a plurality of target display fields.
[0087] The target field group, which can also be called the category field, has a certain correlation with the data of the same category. For example, it can be grouped according to the associated fields corresponding to the display fields, and the target display fields with the same associated fields can be grouped into the same group; it can also be grouped in multiple levels according to the content of the display fields, for example, the first-level logistics category includes the second-level logistics category, the second-level logistics category includes the third-level logistics category, and the third-level logistics category includes the specific logistics name.
[0088] Step 504: according to the target field group, the identifier of the target field group is used as the target associated field, and the data to be displayed is obtained from the target data source according to the target associated field.
[0089] The target field group grouping strategy is to group according to the associated fields corresponding to the display fields to avoid using the same associated field for multiple matches, thereby reducing the number of data reads and improving the speed of data matching; multi-level grouping is performed according to the content of the display fields to improve the overall data call efficiency, so that data at each level can be called at will and improve data granularity.
[0090] Specifically, if the first-level logistics category is used as the target display field and the target association field, data at all levels in this category can be obtained at the same time. For example, when the first-level logistics category is machinery-diesel engine, the second-level logistics category is the abbreviation of the first-level logistics category - diesel engine, and the third-level logistics category is categories such as "low-value consumables" or diesel engine attributes such as "hexagonal nuts" or diesel engine parts.
[0091] Further specific reports, such as Figure 6As shown, when a material template is selected, after displaying all the data of the template, eight target display fields can be obtained, namely "Level 1 Logistics Category", "Level 2 Logistics Category", "Level 3 Logistics Category", "Difference", "Unit (Quantity)", "Cost Amount", "TT20" and "TTTT". Among them, there are two different types of field groups as a whole. One type of field group is: "Level 1 Logistics Category", "Level 2 Logistics Category", "Level 3 Logistics Category", which are displayed separately to better compare the fields; the other type is the classification method of "Unit (Quantity)" and "Cost Amount" under the "Difference" field to better calculate data.
[0092] In this embodiment, by combining candidate display fields into field groups, the levels of field display are increased, making the hierarchical structure of data clearer.
[0093] Furthermore, after obtaining the value corresponding to the target data source field, the obtained data can be directly transferred back to the report for display to reduce code complexity and data maintenance difficulty. Other data acquisition strategies can also be used, and multiple strategies can be combined.
[0094] In one embodiment, Figure 7 As shown, according to the value corresponding to the target data source field, the report display includes:
[0095] Step S702: Acquire first data to be displayed from a target data source.
[0096] The first data to be displayed is data obtained through a database query language such as SQL and / or a programming language, which corresponds to at least one target data source field and is the value corresponding to the target data source field. It should be noted that the first data to be displayed may come from multiple reports or databases, and each database has a corresponding data acquisition statement. Therefore, after the first data to be displayed is obtained from the target data source, the first display data will not be directly transmitted to the front end, but will be used as cache data.
[0097] Specifically, the data retrieval statement can be constructed through methods such as INSERT and SELECT in SQL. For example, when there is only one target data source and the target data source is a database, one or more fields of a target data source are used as the target data source fields, and the first data to be displayed of multiple fields is directly obtained from this target data source. For each identical field name, a dynamic data retrieval SQL is constructed. Among them, dynamic data retrieval SQL refers to selecting associated fields to construct SQL statements for the target display field. Since the condition value in the dynamic data retrieval SQL can be any associated field and this condition value can be adjusted according to the corresponding rules, it is possible to dynamically obtain data. Furthermore, a data set can be established according to the keyword identifier of the target display field, and the target display field can be used as the primary key of the dynamic data retrieval SQL to improve the efficiency of data acquisition. It should be understood that when the target display field is a custom field, data can also be quickly acquired by constructing dynamic data retrieval SQL.
[0098] Step S704: splice the first data to be displayed, and generate second data to be displayed after the spliced data reaches a corresponding length.
[0099] The second data to be displayed is formed by splicing the first data to be displayed. When the spliced first data to be displayed reaches a corresponding threshold, it can be used as an independent display data set, that is, the second data to be displayed can be obtained. The second data to be displayed can be data corresponding to one or more associated fields, which is used for data display. Constructing the second data to be displayed can reduce the number of data transmissions and improve the efficiency of data acquisition.
[0100] Specifically, when choosing a programming method for splicing, you can apply any programming method such as the plus method, the concat method, the StringBuffer append method, and the StringBuilder append method. Each splicing method has its own advantages and disadvantages and will not be elaborated here. In terms of the spliced data, you can use the method of splicing SQL statements; you can also obtain the corresponding content through SQL statements and then perform splicing. As long as the first data to be displayed corresponding to the same target data source field can be spliced, it should be considered to be within the scope of protection of this application.
[0101] Step S706: Display the report according to at least one second data to be displayed.
[0102] Specifically, each data to be displayed is a part of the report to be displayed. By using the second data to be displayed to obtain data, corresponding field values can be obtained in batches. Any second data to be displayed may correspond to a row of fields or a part of a row of fields.
[0103] In this embodiment, according to the target display field, the first data to be displayed is spliced into the second data to be displayed of a specific threshold value, so as to obtain data from the database in batches, reduce the time consumption of data acquisition, and improve data loading performance. It is understandable that when the first data to be displayed is not enough to be spliced with the second data to be displayed, the spliced first data to be displayed can also be directly displayed through the corresponding mark.
[0104] In addition to obtaining data from the target data source, certain strategies may also be used to further improve the efficiency and accuracy of data input. Figure 8 As shown, before obtaining the report candidate field input box, the step of constructing a dynamic configuration input box for the report field is also included, and the steps include:
[0105] Step S802: Generate candidate display fields according to the fields and field attributes of the report template and / or data source model, where the attributes of the candidate display fields include candidate field description information.
[0106] Report templates, also known as report metadata or report models, are data sets with specific field attributes generated by historical reports or certain function formulas. A report template can be configured for each field, or multiple fields can share a report template.
[0107] The data source model can also be called the metadata model of the data source; it is obtained by extracting basic data and / or existing report data, aggregating data through certain means, and obtaining field attributes. Basic data is a general term for the most basic data and information that reflects the meaning of business and industry characteristics in the ERP (Enterprise Resource Planning) system. Basic data refers to the most basic data information in the information management system, and a database can include multiple basic data. The identification of a complete basic data can be composed of a code, a name, and a mnemonic code. Of course, it can also contain the information corresponding to the basic data. The code is a code that allows the basic data to be better classified and to improve the efficiency of keyboard entry. The mnemonic code is a code that is easier to understand and remember than the code to make the basic data easier to remember. The mnemonic code cannot be repeated in the same type of basic data. The mnemonic code can be customized by the user, for example, it can be the pinyin abbreviation of the Chinese character name, or it can be its English word or abbreviation, etc. For basic data, any number of codes, names, and mnemonics can be used as primary keys.
[0108] The attributes of a field are equivalent to the shared variables of a class, which may include whether it is a null value; it may include any number of primary keys, unique keys, and auto-increment keys corresponding to the field to form a field identifier at the data structure level; it may also include traditional field descriptions. Traditional field descriptions refer to fields that can be displayed when viewing the data table creation statement but will not be displayed in the report, thereby describing the meaning of the field.
[0109] Field description information refers to the identifier of the field, which can be the primary key, unique key and / or auto-increment key corresponding to the field, or the field description in the traditional sense. Field description information is used to represent the specific meaning of the field, which can also be some code or some machine language.
[0110] Specifically, the candidate display field may be a field of the report template or the data source model, or may be a combination of the fields of the report template and the data source model, or may be generated by performing certain operations on the fields of the report template and the data source model.
[0111] Step S804: Aggregate the candidate display fields, and use the candidate display field description information as the index of the candidate field to generate a report candidate field list.
[0112] The report candidate field list refers to a displayed list, which includes description information of at least one candidate display field. The candidate display field can be easily selected through the description information of the candidate display field.
[0113] In this embodiment, a configuration tool is constructed using the fields and field properties of a report template and / or a data source model. Through the configuration tool, field hierarchical associations can be performed based on object associations, and the field association relationships originally configured in the database can be moved to the front end, making the dynamic configuration of the field hierarchy more flexible, more effectively realizing report reuse, and improving the efficiency of report generation and data call efficiency.
[0114] It should be understood that there are many ways to build object associations, one of which is to build through data dependency between the two objects, and in this embodiment, there may be other strategies. In one embodiment, the method further includes the step of generating object association information between the report template and the data source model, and the steps specifically include:
[0115] Step S902: Obtain a first field from the data source model, where the first field includes a primary key field of the data source model.
[0116] The first field is a field obtained from the data source model, which may include one field or multiple fields, may include the real primary key of the data source model, may also be the logical primary key of the data source model, or may also be a combination of multiple fields. The first field has a corresponding relationship with at least one field in the data source model.
[0117] Step S904: Acquire a second field from the report template, where the second field includes a primary key field of the report template.
[0118] The second field has a corresponding matching relationship with the first field, so that the two can establish an association relationship. The second field can have different contents and / or attributes from the first field. For example, when the first field is a code, the second field can be the value corresponding to the code; when the first field is "ID" and the value of "ID" is 1, under a certain translation mechanism, the second field can be "encoding" and the value of "encoding" is 1. At this time, the first field and the second field still have a certain matching relationship.
[0119] Step S906: Use the second field as an associated object of the first field to generate primary key associated information.
[0120] The primary key association information may be association information composed of any one or more fields of the primary key, unique key, self-increment key, etc., which can be used to characterize data association at the object level. The primary key in this embodiment may be a business primary key or a logical primary key.
[0121] In this embodiment, primary key association information is generated by associating the first field with the second field, and a configuration tool is constructed through the object association information, thereby making data selection more convenient.
[0122] Optionally, the second field is used as the associated object of the first field, and the first field is used as the associated object of the second field, thereby using the primary key association to build a one-way object association, thereby avoiding reverse lookup and ensuring data security.
[0123] Furthermore, the above embodiment clarifies the method of building object associations. This embodiment will discuss the method of building a report template, which can use a component replacement template method or plug-in, or other means. In one embodiment, the method also includes the step of generating a report template, specifically including:
[0124] Step S1002: Acquire a report set, which includes at least one report structure set and field attribute set information.
[0125] A report set refers to a report for a certain type or certain types of data; a report structure set is used to construct a report, which may include the method of constructing a report, the number of rows and columns in a report, and certain statistical charts. Field attribute set information refers to the fields filled in the report structure and the attributes of each field.
[0126] Step S1004: Obtain a report template according to the report structure information and the report field attributes, where the report template includes report template fields.
[0127] Step S1006: Use at least one report template field as an associated field of the report template. The associated field of the report template is used to establish object association information with the data source model.
[0128] From the report template fields, select a field as the associated field of the report template. Then, you can select a data source model to establish an association through the associated field of the report template. A data source model may be an abstract database obtained by extracting features from one or more data sources. This makes it easier to reuse reports.
[0129] Specifically, you can create a special report template for objects such as customers and departments, and then select one or more template fields from the report template as the associated fields of the template to achieve the reuse of report data.
[0130] In this embodiment, the data object is determined through the report template, and the target display field can be selected so that the new field appears on the report template, so that various reports can be better reused to increase the efficiency of software development.
[0131] The above embodiments focus on the construction of report templates, and in one embodiment, they focus on the construction of data sources. It should be understood that the data source can be a database that stores data, or it can be a historical report generated by the database, so as to better realize the reuse of historical reports. The data source model is generated after the field features of the data source are extracted. It can be the data source itself or a set of feature fields associated with multiple data sources. When the data source model is a set of feature fields associated with multiple data sources, a target display field may obtain data from multiple data sources at the same time and display it in a report.
[0132] In one embodiment, the method further includes the step of constructing a data source, specifically including:
[0133] Step S1102: Acquire the used report data, and generate field information of the data source according to the used report data. The field information of the data source includes attributes of the data source fields.
[0134] By using the used report data as a new data source, the number of data sources can be continuously increased, the data levels in the data source can be further enriched, and new data sources can be obtained by combining more types of data.
[0135] Specifically, a new data source can be generated based on historical reports, and the corresponding data source can be generated according to the fields and field attributes of the historical reports; or after synchronizing data with other devices, report data used by other devices can be obtained to generate a new data source.
[0136] Step S1104: establishing an associated field of the data source according to the attribute of the data source field, and the associated field of the data source is used to establish object association information with the report template.
[0137] The associated fields of a data source refer to fields in a data source that have a corresponding relationship with at least some of the fields of the data source. They can be any type of index such as a primary key or a unique key, which can be used to identify a series of corresponding data source fields.
[0138] Specifically, in a certain field, the used reports can be stored in a collection, and the associated fields of the data source can be generated or determined through one or more key fields in the field attributes of the used reports. The associated fields of the data source are then used to establish an object-level association with the report template.
[0139] In this embodiment, the used reports are used as new data sources to improve the selectivity of data calling; thus, historical reports are aggregated to form multiple levels, thereby achieving flexible calling and report reuse.
[0140] Furthermore, in order to better understand the technical solution of the present application, the above content is briefly described. In the present invention, the parsing process of the configuration information adopts the parsing according to the target display fields such as custom fields. A target display field only needs to be parsed once, and a sharable and reusable configuration tool and parsing tool are abstracted to improve scalability. At the same time, by obtaining the display value of the custom field in batches in the present invention, the cost of associated data acquisition can be reduced exponentially, thereby improving operating efficiency.
[0141] For further information, please refer to Fig.12, using a flow chart to discuss the flow of the overall data of this application. First, the terminal enters the ERP main program, and then enters the ERP report platform, and loads a data set; wherein the data set includes data source data and report template data, and the data set includes data source data and report template data from the business report application in this embodiment. Next, determine whether extended configuration is required. If no configuration is performed, the data can be displayed directly according to the data set; if configuration is performed, the above-mentioned technical solution of this application is used to form a new data set, and then the report is displayed according to the new data set.
[0142] It should be understood that although Figure 2 , 5 The steps in the flowcharts of 7-11 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , 5 , at least part of the steps in 7-11 may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0143] In one embodiment, Fig.13 As shown, a report display device is provided, including: a first association module 1302, a second association module 1304 and a report display module 1306, wherein:
[0144] The first association module 1302 is used to display a dynamic configuration input box of a report field, where the dynamic configuration input box of a report field is generated according to object association information between a report template and a data source model;
[0145] The second association module 1304 is used to respond to the display field selection instruction, obtain the target display field from the dynamic configuration input box, obtain the candidate association field corresponding to the target display field according to the target display field, obtain the target association field, determine the candidate data source field corresponding to the target association field according to the target association field, and obtain the target data source field;
[0146] The report display module 1306 is used to obtain the value corresponding to the target data source field and realize report display according to the value corresponding to the target data source field.
[0147] In one embodiment, the report display module 1306 includes: a field decomposition unit and a data acquisition unit;
[0148] A field decomposition unit, used for detecting that a target display field represents a target field group, wherein the target field group includes a plurality of target display fields;
[0149] The associated field matching unit is used to obtain the data to be displayed from the target data source according to the target field group and the identifier of the target field group as the target associated field.
[0150] In one embodiment, the report display module 1306 includes: a data acquisition unit, a data splicing unit and a data display unit;
[0151] A data acquisition unit, used for acquiring first data to be displayed from a target data source;
[0152] A data splicing unit, used for splicing the first data to be displayed, and generating the second data to be displayed after the spliced data reaches a corresponding length;
[0153] The data display unit is used to realize report display according to at least one second data to be displayed.
[0154] In one embodiment, Fig.14 As shown, the report display device includes a tool generation module 1401, a first association module 1302, a second association module 1304 and a report display module 1306. The tool generation module 1401 includes a field generation unit and a dynamic configuration unit:
[0155] A field generation unit, used to generate candidate display fields according to the fields and field attributes of the report template and / or data source model, wherein the attributes of the candidate display fields include candidate field description information;
[0156] The dynamic configuration unit is used to aggregate the candidate display fields and use the candidate display field description information as the index of the candidate field to generate a report candidate field list.
[0157] In one embodiment, the tool generation module 1401 further includes a first field acquisition unit, a second field acquisition unit, and a primary key association unit;
[0158] A first field acquisition unit, used to acquire a first field from a data source model, where the first field includes a primary key field of the data source model;
[0159] A second field acquisition unit, used to acquire a second field from the report template, where the second field includes a primary key field of the report template;
[0160] The primary key association unit is used to use the second field as an associated object of the first field to generate primary key association information.
[0161] In one embodiment, the tool generation module 1401 includes a report set acquisition unit, a template construction unit, and an associated field determination unit;
[0162] A report set acquisition unit, used to acquire a report set, the report set includes a report structure set and field attribute set information;
[0163] A template building unit, used to generate a report template according to the report structure information and the report field attributes, wherein the report template includes at least one report template field;
[0164] The first associated field selection unit is used to use at least one report template field as an associated field of the report template, and the associated field of the report template is used to establish object association information with the data source model.
[0165] In one embodiment, the tool generation module 1401 includes a data source construction unit and a second associated field selection unit;
[0166] A data source construction unit is used to obtain the used report data and generate field information of the data source according to the used report data. The field information of the data source includes the attributes of the data source field.
[0167] The second associated field selection unit is used to establish associated fields of the data source according to the attributes of the data source field, and the associated fields of the data source are used to establish object association information with the report template.
[0168] For the specific definition of the report display device, please refer to the definition of the report display method above, which will not be repeated here. Each module in the above report display device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0169] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.15As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a report display method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0170] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0173] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0174] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0175] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A report display method, characterized in that: The method comprises: A dynamic configuration input box for displaying a report field is generated based on object association information between a report template and a data source model, wherein the data source model includes features of an information set serving as a data source; the data source model is metadata; and the object association information refers to a mapping relationship between the report template and the data source model in field attributes; In response to a display field selection instruction, a target display field is obtained from the dynamic configuration input box, and according to the target display field, a candidate associated field corresponding to the target display field is obtained to obtain a target associated field, and according to the target associated field, a candidate data source field corresponding to the target associated field is determined to obtain a target data source field; the target associated field is a candidate associated field that has a mapping relationship with the target display field, and the target associated field has a mapping relationship with the target data source field; The value corresponding to the target data source field is obtained, and the report display is realized according to the value corresponding to the target data source field.
2. The method according to claim 1, characterized in that The obtaining a value corresponding to the target data source field includes: It is detected that the target display field represents a target field group, and the target field group includes a plurality of target display fields; According to the target field group, the identifier of the target field group is used as the target associated field, and the data to be displayed is obtained from the target data source according to the target associated field.
3. The method according to claim 1, characterized in that The realizing report display according to the value corresponding to the field of the target data source includes: Acquire first data to be displayed from the target data source; splicing the first data to be displayed, and generating second data to be displayed after the spliced data reaches a corresponding length; A report display is realized according to at least one of the second data to be displayed.
4. The method according to claim 1, characterized in that: Before obtaining the report candidate field input box, the step of constructing a dynamic configuration input box for the report field is also included, and the step includes: Generate candidate display fields according to the fields and field attributes of the report template and / or data source model, wherein the attributes of the candidate display fields include candidate field description information; The candidate display fields are aggregated, and the candidate display field description information is used as the index of the candidate field to generate a report candidate field list.
5. The method according to claim 1, characterized in that The method further comprises the step of generating object association information between the report template and the data source model, and the step specifically comprises: Acquire a first field from a data source model, where the first field includes a primary key field of the data source model; Acquire a second field from the report template, where the second field includes a primary key field of the report template; The second field is used as an associated object of the first field to generate primary key associated information.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises the step of generating a report template, specifically comprising: Acquire a report set, the report set including a report structure set and field attribute set information; Generate a report template according to the report structure information and the report field attributes, wherein the report template includes at least one report template field; At least one of the report template fields is used as an associated field of the report template, and the associated field of the report template is used to establish object association information with the data source model.
7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises the step of constructing a data source, specifically comprising: Acquire the used report data, and generate the field information of the data source according to the used report data, wherein the field information of the data source includes the attributes of the data source field; According to the attribute of the data source field, an associated field of the data source is established, and the associated field of the data source is used to establish object association information with the report template.
8. A report display device, characterized in that: The device comprises: A first association module is used to display a dynamic configuration input box of a report field, wherein the dynamic configuration input box of the report field is generated according to object association information between a report template and a data source model, wherein the data source model includes features of an information set serving as a data source; the data source model is metadata; and the object association information refers to a mapping relationship between the report template and the data source model in field attributes; A second association module is configured to, in response to a display field selection instruction, obtain a target display field from the dynamic configuration input box, obtain a candidate association field corresponding to the target display field according to the target display field, obtain the target association field, determine a candidate data source field corresponding to the target association field according to the target association field, and obtain the target data source field; the target association field is a candidate association field that has a mapping relationship with the target display field, and the target association field has a mapping relationship with the target data source field; The report display module is used to obtain the value corresponding to the target data source field and realize report display according to the value corresponding to the target data source field.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Building Reports
CN107111639A
Report generation method and device, terminal and storage medium
CN109657214A
Data acquisition method and device, computer equipment and computer readable storage medium
CN112787978A