CN114185941A - Report data query method and device, electronic equipment and storage medium - Google Patents

Report data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114185941A
CN114185941A CN202111492890.9A CN202111492890A CN114185941A CN 114185941 A CN114185941 A CN 114185941A CN 202111492890 A CN202111492890 A CN 202111492890A CN 114185941 A CN114185941 A CN 114185941A
Authority
CN
China
Prior art keywords
report
query
data
identifier
data query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111492890.9A
Other languages
Chinese (zh)
Inventor
李一帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111492890.9A priority Critical patent/CN114185941A/en
Publication of CN114185941A publication Critical patent/CN114185941A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a report data query method, a report data query device, electronic equipment and a storage medium, and relates to the technical field of big data access. One embodiment of the method comprises: receiving a query request of report data, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier; acquiring the label value of each preset inquiry field in the inquiry request, and screening a target field with the label value as a target value; acquiring a field value of a target field, and generating report data query conditions based on the data query type identifier and the field value; and calling a data query model, querying the report data from the database through the report data query condition, and sending the report data. The embodiment can solve the problem that the report data query mode is usually fixed and single in query condition, so that the report generation requirement cannot be met, and the report generation efficiency is reduced.

Description

Report data query method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of big data access, in particular to a method and a device for inquiring report data, electronic equipment and a storage medium.
Background
The statistical analysis report is widely applied to enterprise management, and can display data generated in the operation process in multiple dimensions so as to obtain valuable information through data processing. For the maintenance fund service, the statistical analysis report can process the related information in each subsystem of payment, refund and income in the system, so as to generate personalized data display and meet different service requirements. In the prior art, a corresponding report data query mode is usually developed based on report display requirements to provide data for report generation. However, the demands for statistical report display are more and more diverse, and the query conditions of the report data query method developed for specific display demands are generally fixed and single, so that the report generation demand cannot be met, and the report generation efficiency is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for querying report data, which can solve the problem that a query condition of a report data query method is usually fixed and single, so that a report generation requirement cannot be met, and the report generation efficiency is reduced.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for querying report data is provided.
The report data query method of the embodiment of the invention comprises the following steps: receiving a report data query request, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier; obtaining the label value of each preset inquiry field in the inquiry request to screen the target field with the label value as a target value; acquiring a field value of the target field, and generating a report data query condition based on the data query type identifier and the field value; and calling the data query model, querying report data from a database according to the report data query condition, and sending the report data.
In one embodiment, obtaining the data query type identifier in the query request includes:
acquiring a query type field value of report data in the query request;
matching the query type field value with a preset region field value set to judge whether the query type field value belongs to the region field value set or not;
if so, determining that the data query type identifier is a region query identifier; if not, determining that the data query type identifier is a non-regional query identifier.
In another embodiment, after querying the report data from the database by the report data query condition, the method further comprises:
responding to a report generation request, acquiring a report identifier in the report generation request, and inquiring a report generation template corresponding to the report identifier;
acquiring display identifiers of report fields in the report generation request, and screening target report fields with the display identifiers being hidden so as to update the target report fields in the report generation template to be in a hidden state;
and inquiring corresponding report data based on the report identification so as to generate the report of the report identification based on the updated report generation template.
In another embodiment, querying the report generation template corresponding to the report identifier includes:
and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
In another embodiment, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier includes:
judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information;
if so, inquiring an initial report generation template corresponding to the report identification;
if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification.
In another embodiment, invoking the data query model to query the report data from the database by the report data query condition includes:
and calling the data query model to obtain a code template corresponding to the data query model, and inputting the query condition into the code template to query report data from a database.
In yet another embodiment, generating report data query conditions based on the data query type identifier and the field value includes:
and acquiring a corresponding query condition generation template based on the data query type identifier, and adding the field value to the query condition generation template based on the field identifier of the target field to generate a report data query condition.
In yet another embodiment, the target fields include one or more of a query time range, a query region range, a query house range, a repair funding attribute.
In order to achieve the above object, according to another aspect of the embodiments of the present invention, an apparatus for querying report data is provided.
The device for inquiring the report data in the embodiment of the invention comprises the following components: the acquisition unit is used for receiving a report data query request, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier; the screening unit is used for acquiring the label value of each preset inquiry field in the inquiry request so as to screen the target field with the label value as a target value; the generating unit is used for acquiring the field value of the target field and generating report data query conditions based on the data query type identifier and the field value; and the query unit is used for calling the data query model, querying the report data from a database according to the report data query condition, and sending the report data.
In one embodiment, the obtaining unit is specifically configured to:
acquiring a query type field value of report data in the query request;
matching the query type field value with a preset region field value set to judge whether the query type field value belongs to the region field value set or not;
if so, determining that the data query type identifier is a region identifier; if not, determining that the data query type identifier is a non-region identifier.
In another embodiment, the obtaining unit is further configured to, in response to a report generation request, obtain a report identifier in the generation request, so as to query a report generation template corresponding to the report identifier;
the screening unit is further configured to obtain a display identifier of each report field in the generation request, screen the target report field of which the display identifier is hidden, and update the target report field in the report generation template to a hidden state;
the generating unit is further configured to query corresponding report data based on the report identifier, so as to generate a report of the report identifier based on the updated report generating template.
In another embodiment, the obtaining unit is specifically configured to:
and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
In another embodiment, the obtaining unit is specifically configured to:
judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information;
if so, inquiring an initial report generation template corresponding to the report identification;
if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for querying the report data provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
The computer readable medium of the embodiment of the present invention stores a computer program thereon, and the program, when executed by a processor, implements the method for querying report data provided by the embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer program product.
The computer program product of the embodiment of the invention comprises a computer program, and when the computer program is executed by a processor, the processing method for inquiring the report data provided by the embodiment of the invention is realized.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, the data query models corresponding to different data query types are preset to meet the data query requirements of different types of reports, and the query conditions corresponding to the report data query are generated through the tag values of the query fields, so that when the report data is queried, the report data query conditions can be determined individually through the data query types and the tag values of the query fields, the requirements of different report generation can be met, and the method has better usability and convenience, thereby simplifying the time and cost of report data query development and improving the efficiency of report generation.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a report data query method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a main flow of a report generation method according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating another main flow of a report generation method according to a third embodiment of the present invention;
FIG. 4 is a schematic diagram of the main elements of an apparatus for reporting data queries according to a fourth embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
The embodiment of the invention provides a report data query system, which can be used for querying the report data required by report generation, and particularly can be used for querying the report data required by report generation corresponding to house maintenance funds.
The embodiment of the invention provides a method for querying report data, which can be executed by a report data query system, and as shown in figure 1, the method comprises the following steps:
s101: receiving a query request of report data, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier.
The query request of the report data can be sent when the report needs to be generated. When a report needs to be generated, a user can access the report data query system through a terminal or a front-end application interface so as to send a query request to the report data query system. In the embodiment of the invention, the query request can include a data query type identifier to indicate the type of the report data query. The data query types may be partitioned based on demand, such as region-based queries, time-based queries, range-based queries, and so forth.
Specifically, the embodiment of the present invention may be used to query the report data of the report corresponding to the house maintenance fund, and the query fields that may be involved include various fields, such as areas (province, city, county, district, etc.), time (year, quarter, month, real time), targets (building, unit, house, center name, property area, house usage, manager, building area, charging type, charging date, etc.). In the report corresponding to the house maintenance fund, different data query types can be determined according to different query dimensions, and the report can be divided into 'nationwide', 'provincial level/autonomous region/direct administration city', 'district/county', 'property area', 'building block', 'unit' and 'house' according to different query areas; the query time can be divided into "year", "quarter", "month", "real time"; according to different divisions of query targets, the query targets can be classified into "center name", "property area name", "building name", "unit name", "house name", "report year", "report quarter", "report month", "report start/stop time", and some special query conditions such as "house usage", "sponsor", "building area", "charge type", "charge date", and the like.
Based on the query field, the embodiment of the present invention may divide the data query type into a region query and a non-region query (e.g., a target query), and set corresponding identifiers for each data query type, i.e., a region query identifier and a non-region query identifier. Thus, in the embodiment of the invention, after the query request is received, the data query type identifier in the query request can be obtained.
In the embodiment of the invention, for different data query types, corresponding data query models can be set so as to facilitate the data query process corresponding to each data query type in real time.
The data query model may be pre-developed, which may include a corresponding code template, so that after the fields used by the query are determined, the fields are input into the code template and run, and the query of the report data can be realized.
It should be noted that, in the embodiment of the present invention, a region field value set corresponding to a region query type may be preset, and after receiving a query request, a query type field value may be obtained to determine whether the query type field value belongs to the region field value set, that is, the query type field value is matched with the preset region field value set to determine whether the query type field value belongs to the region field value set; if so, determining the data query type identifier as a region query identifier; if not, determining that the data query type identifier is a non-regional query identifier.
It should be noted that the set of region field values may include the names of regions such as province, city, county, district, etc. included in the database to be queried. In the embodiment of the invention, the data query types are divided, query contents corresponding to different report names do not need to be memorized when the report data is queried, but query conditions are generated based on the query requests, namely the query conditions can be adjusted based on the input query requests, relevant data of a certain entity (such as a property area, a unit, a house and the like) at a certain time point or within a certain time range can be queried on the whole, and the query requests can be input according to actual needs in the query process of the report data to generate different query conditions, so that query of different report data is realized.
S102: and obtaining the label value of each preset query field in the query request to screen the target field with the label value as the target value.
In the embodiment of the invention, the label corresponding to each preset query field can be set in the interface displayed at the front end, so that a user can input the corresponding label value based on the label corresponding to each preset query field to indicate whether the report data query includes the data of the query field. Therefore, in this step, the tag value of each preset query field can be obtained from the query request, and then the target field included in the current report data query is screened out based on the tag value.
Specifically, in the embodiment of the present invention, the parameter corresponding to the tag may be set to be HouseFlag, and when the tag value is set to be the target value, the query field corresponding to the tag is set to be the target field, and when the tag value is not the target value, the query field corresponding to the tag is not the target field. Therefore, in this step, the target field with the tag value as the target value can be screened out based on the tag value.
It should be noted that the target value may be set based on the demand, and may be set to 1, for example.
S103: and acquiring a field value of the target field, and generating report data query conditions based on the data query type identifier and the field value.
For a target field with a tag value as a target value, a field value of the target field may be obtained in the query request to indicate specific data of the report data query, for example, if the target field is a time range, the field value is a start time and an end time, so that in this step, a report data query condition may be generated by combining the data query type identifier and the field value.
Specifically, the query condition for generating report data may be executed as: and acquiring a corresponding query condition generation template based on the data query type identifier, and adding a field value to the query condition generation template based on the field identifier of the target field so as to generate a report data query condition.
In the embodiment of the invention, because each data query type can develop a corresponding code template, in order to adapt to different code templates, a corresponding query condition generation template can be set for each data query type. The query condition generation template may be set based on a code template to convert field values of template fields into characters recognizable by the code template through the query condition code template. Therefore, in this step, the corresponding query condition generation template can be obtained based on the data query type identifier, and then the field value is added to the query condition generation template by taking the field identifier of the target field as an index, so as to generate the report data query condition.
S104: and calling a data query model, querying the report data from the database through the report data query condition, and sending the report data.
After the query condition is generated, the query condition can be input into the data query model, the data query model is further operated, the report data is queried from the database, the queried report data is returned to the query request terminal, and meanwhile, the queried report data can be stored so as to facilitate report generation.
In this step, the code template corresponding to each data query model can be queried in advance to realize the report data query of the personalized report. Taking a region query type as an example, the query regions are different in general, and other query fields are fixed, so after a target field of data to be queried in a report is determined, a featured background database code query logic is compiled according to different query regions, and the example queries the total number of residents, the total number of buildings, the total number of units, initial payment of maintenance funds, continuous payment, payment information and the like of each cell in different region ranges. When the background code template is written, database query conditions of different regions can be reserved so as to be convenient for subsequent expansion. Generally, the main area query logic in the database is to query relevant information of intra-provincial cells, such as city and districts for personalized area query, when a field value of the city is input, data query accurate to city level is performed, and if a field value of the districts is further input, data query accurate to district level is performed, so that free control of query conditions is realized.
In the embodiment of the invention, the data query models corresponding to different data query types are preset to meet the data query requirements of different types of reports, and the report data required by the report data query is determined according to the label value of each query field, so that when the report data is queried, the report data query mode can be determined individually according to the data query type and the label value of each query field, the requirements of different report generation can be met, and the method has better usability and convenience, thereby simplifying the development time and cost of the report data query and improving the efficiency of report generation.
The following describes, in detail, a method for generating a report in the embodiment of the present invention with reference to the embodiment shown in fig. 1, and as shown in fig. 2, the method includes:
s201: and responding to the report generation request, acquiring the report identification in the report generation request, and inquiring the report generation template corresponding to the report identification.
The report generation request may be sent after the report data is queried, so as to generate a corresponding report, and the report generation request may include a report identifier, so as to determine which report is generated.
In the embodiment of the invention, in order to facilitate the personalized generation of the report, a report generation template corresponding to each report can be preset, each report field included in the report can be included in the report generation template, and a corresponding display identifier is set for each report field to indicate whether the data of the report field is displayed or not when the report is generated. The value corresponding to the specific display identifier may be displayed or hidden. And when the display identifier is hidden, the report field is hidden when the report is generated. In this step, after the report identifier in the report generation request is obtained, the corresponding report generation template can be queried based on the report identifier.
S202: and acquiring the display identifier of each report field in the report generation request, and screening the target report field with the display identifier being hidden so as to update the target report field in the report generation template to be in a hidden state.
The report generation request can also comprise the display identifier of each report field, so that the target report field with the hidden display identifier can be screened out based on the report generation request, namely, the report field needing to be hidden is generated by the report at this time, and the target report field in the report generation template can be updated to be in a hidden state, so that the required report can be generated conveniently.
S203: and inquiring corresponding report data based on the report identification so as to generate a report of the report identification based on the updated report generation template.
After the report generation template is updated, the corresponding report may be generated based on the report data queried in the embodiment shown in fig. 1 in combination with the updated report generation template.
It should be noted that, in the embodiment of the present invention, usually, the report generation request is automatically triggered after the report data query is completed in the embodiment shown in fig. 1, so the report data queried in the embodiment shown in fig. 1 is the data to be displayed in the report generated this time, and therefore, the target field determined in step S103 may be determined as the report field to be displayed in the report generation template, so as to update the report generation template.
In the embodiment of the present invention, a corresponding initial report generation template may be configured for each report at an initial conversion stage, and the updated report generation template is also stored after each report generation, and since report fields to be displayed in the report are usually not changed when the reports are generated twice, querying the report generation template in step S201 may be specifically performed as: and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
It should be noted that, if the interval between the previous report generation and the next report generation is long, the report field to be displayed in the report is usually changed, so on the basis of the above process, the step of querying the report generation template may also be executed as: judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information; if so, inquiring an initial report generation template corresponding to the report identification; if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification. Wherein the preset threshold may be set based on demand, e.g. 1 month.
In the embodiment of the invention, the data query models corresponding to different data query types are preset to meet the data query requirements of different types of reports, and the report data required by the report data query is determined according to the label value of each query field, so that when the report data is queried, the report data query mode can be determined individually according to the data query type and the label value of each query field, the requirements of different report generation can be met, and the method has better usability and convenience, thereby simplifying the development time and cost of the report data query and improving the efficiency of report generation.
Referring to the embodiment shown in fig. 1 and fig. 2, a report data query method for a report corresponding to house maintenance funds is specifically described, as shown in fig. 3, where the method includes:
s301: receiving a report data query request of a house maintenance fund report, and acquiring a field value of a query area field of report data in the query request.
In the embodiment of the invention, the query region field set in the query request is determined as the query type field, and the field value of the query region field is the field value of the query type.
S302: matching the field value of the query area field with a preset area field value set to judge whether the field value of the query area field belongs to the area field value set or not; if yes, go to step S303; if not, go to step S304.
In the embodiment of the present invention, the set of region field values may be preconfigured, and if the region field value obtained in step S401 belongs to the set of region field values, it may be determined that the data query type identifier is a region query identifier; if the region field value acquired in step S401 does not belong to the region field value set (e.g., is empty), it may be determined that the data query type identifier is a non-region query identifier.
S303: and determining the data query type identifier as a region query identifier, and querying the corresponding data query model.
S304: and determining the data query type identifier as a non-regional query identifier, and querying the corresponding data query model.
S305: and obtaining the label value of each preset query field in the query request to screen the target field with the label value as the target value.
In the embodiment of the invention, corresponding query fields can be preset for different query types, for example, for a regional query type, fields such as query time, query target and the like can be configured as corresponding preset query fields; for the non-regional query type, the query time, the query region and other fields can be set as corresponding preset query fields. In this step, for the preset query field corresponding to each query type, whether the field value is null may be used as the tag value of the field, if the preset query field value is null, it may be determined that the tag value of the preset query field is not the target value, and if the preset query field value is not null, it may be determined that the tag value of the preset query field is the target value, so as to perform the screening of the target field.
S306: and acquiring a field value of the target field, acquiring a corresponding query condition generation template based on the data query type identifier, and adding the field value to the query condition generation template based on the field identifier of the target field so as to generate a report data query condition.
S307: and calling the data query model to obtain a code template corresponding to the data query model, and inputting query conditions into the code template to query report data from the database.
It should be noted that the data processing principle in the embodiment of the present invention is the same as the corresponding data processing principle in the embodiment shown in fig. 1 or fig. 2, and is not described herein again.
When the report data is inquired, the inquiry mode of the report data can be determined in a personalized mode through the data inquiry type and the label value of each inquiry field, the requirements of different report generation can be met, and the report inquiry method has better usability and convenience, so that the development time and cost of the report data inquiry are simplified, and the report generation efficiency is improved.
In order to solve the problems in the prior art, an embodiment of the present invention provides an apparatus 400 for querying report data, as shown in fig. 4, the apparatus 400 includes:
an obtaining unit 401, configured to receive a report data query request, obtain a data query type identifier in the query request, and query a corresponding data query model based on the data query type identifier;
a screening unit 402, configured to obtain a tag value of each preset query field in the query request, so as to screen a target field of which the tag value is a target value;
a generating unit 403, configured to obtain a field value of the target field, and generate a report data query condition based on the data query type identifier and the field value;
the query unit 404 is configured to invoke the data query model, query report data from a database according to the report data query condition, and send the report data.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 1, and the description thereof is omitted.
In an implementation manner of the embodiment of the present invention, the obtaining unit is specifically configured to:
acquiring a query type field value of report data in the query request;
matching the query type field value with a preset region field value set to judge whether the query type field value belongs to the region field value set or not;
if so, determining that the data query type identifier is a region identifier; if not, determining that the data query type identifier is a non-region identifier.
In another implementation manner of the embodiment of the present invention, the obtaining unit is further configured to obtain, in response to a report generation request, a report identifier in the generation request, so as to query a report generation template corresponding to the report identifier;
the screening unit is further configured to obtain a display identifier of each report field in the generation request, screen the target report field of which the display identifier is hidden, and update the target report field in the report generation template to a hidden state;
the generating unit is further configured to query corresponding report data based on the report identifier, so as to generate a report of the report identifier based on the updated report generating template.
In another implementation manner of the embodiment of the present invention, the obtaining unit is specifically configured to:
and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
In another implementation manner of the embodiment of the present invention, the obtaining unit is specifically configured to:
judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information;
if so, inquiring an initial report generation template corresponding to the report identification;
if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification.
It should be understood that the embodiment of the present invention is implemented in the same manner as the embodiment shown in fig. 2 or fig. 3 of fig. 1, and is not repeated herein.
In the embodiment of the invention, the data query models corresponding to different data query types are preset to meet the data query requirements of different types of reports, and the report data required by the report data query is determined according to the label value of each query field, so that when the report data is queried, the report data query mode can be determined individually according to the data query type and the label value of each query field, the requirements of different report generation can be met, and the method has better usability and convenience, thereby simplifying the development time and cost of the report data query and improving the efficiency of report generation.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic device of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor, so that the at least one processor executes the method for querying report data provided by the embodiment of the invention.
Fig. 5 illustrates an exemplary system architecture 500 of a method of reporting data queries or an apparatus of reporting data queries to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. Various client applications may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be, but are not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, and the server may analyze and process data such as a received product information query request, and feed back a processing result (for example, product information — just an example) to the terminal device.
It should be noted that the method for querying report data provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for querying report data is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a screening determination unit, a generation unit, and a query unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, e.g., a unit of a query function identified by a data query type ".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method for querying report data provided by the present invention.
The embodiment of the invention provides a computer program product, which comprises a computer program, wherein the computer program is used for realizing a method for inquiring report data when being executed by a processor.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A method for querying report data is characterized by comprising the following steps:
receiving a query request of report data, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier;
obtaining the label value of each preset inquiry field in the inquiry request to screen the target field with the label value as a target value;
acquiring a field value of the target field, and generating a report data query condition based on the data query type identifier and the field value;
and calling the data query model, querying report data from a database according to the report data query condition, and sending the report data.
2. The method of claim 1, wherein obtaining the data query type identifier in the query request comprises:
acquiring a query type field value of report data in the query request;
matching the query type field value with a preset region field value set to judge whether the query type field value belongs to the region field value set or not;
if so, determining that the data query type identifier is a region query identifier; if not, determining that the data query type identifier is a non-regional query identifier.
3. The method according to claim 1, further comprising, after querying the report data from the database by the report data querying condition:
responding to a report generation request, acquiring a report identifier in the report generation request, and inquiring a report generation template corresponding to the report identifier;
acquiring display identifiers of report fields in the report generation request, and screening target report fields with the display identifiers being hidden so as to update the target report fields in the report generation template to be in a hidden state;
and inquiring corresponding report data based on the report identification so as to generate the report of the report identification based on the updated report generation template.
4. The method according to claim 3, wherein querying the report generation template corresponding to the report identification comprises:
and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
5. The method of claim 4, wherein determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification comprises:
judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information;
if so, inquiring an initial report generation template corresponding to the report identification;
if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification.
6. The method of claim 1, wherein invoking the data query model to query report data from a database via the report data query condition comprises:
and calling the data query model to obtain a code template corresponding to the data query model, and inputting the query condition into the code template to query report data from a database.
7. The method of claim 1, wherein generating report data query conditions based on the data query type identifier and the field value comprises:
and acquiring a corresponding query condition generation template based on the data query type identifier, and adding the field value to the query condition generation template based on the field identifier of the target field to generate a report data query condition.
8. The method of any one of claims 1-7, wherein the target fields include one or more of a query time range, a query region range, a query house range, and a repair funding attribute.
9. An apparatus for reporting data queries, comprising:
the acquisition unit is used for receiving a query request of report data, acquiring a data query type identifier in the query request, and querying a corresponding data query model based on the data query type identifier;
the screening unit is used for acquiring the label value of each preset inquiry field in the inquiry request so as to screen the target field with the label value as a target value;
the generating unit is used for acquiring the field value of the target field and generating report data query conditions based on the data query type identifier and the field value;
and the query unit is used for calling the data query model, querying the report data from a database according to the report data query condition, and sending the report data.
10. The apparatus according to claim 9, wherein the obtaining unit is specifically configured to:
acquiring a query type field value of report data in the query request;
matching the query type field value with a preset region field value set to judge whether the query type field value belongs to the region field value set or not;
if so, determining that the data query type identifier is a region identifier; if not, determining that the data query type identifier is a non-region identifier.
11. The apparatus according to claim 9, wherein the obtaining unit is further configured to, in response to a report generation request, obtain a report identifier in the generation request, so as to query a report generation template corresponding to the report identifier;
the screening unit is further configured to obtain a display identifier of each report field in the generation request, screen the target report field of which the display identifier is hidden, and update the target report field in the report generation template to a hidden state;
the generating unit is further configured to query corresponding report data based on the report identifier, so as to generate a report of the report identifier based on the updated report generating template.
12. The apparatus according to claim 11, wherein the obtaining unit is specifically configured to:
and acquiring time information of the historical report corresponding to the report identifier from the historical log to screen a target historical report closest to the current time, and determining a report generation template corresponding to the target historical report as the report generation template corresponding to the report identifier.
13. The apparatus according to claim 12, wherein the obtaining unit is specifically configured to:
judging whether the time length of the target historical report form from the current time is greater than a preset threshold value or not based on the time information;
if so, inquiring an initial report generation template corresponding to the report identification;
if not, determining the report generation template corresponding to the target historical report as the report generation template corresponding to the report identification.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
15. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
16. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-8 when executed by a processor.
CN202111492890.9A 2021-12-08 2021-12-08 Report data query method and device, electronic equipment and storage medium Pending CN114185941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111492890.9A CN114185941A (en) 2021-12-08 2021-12-08 Report data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111492890.9A CN114185941A (en) 2021-12-08 2021-12-08 Report data query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114185941A true CN114185941A (en) 2022-03-15

Family

ID=80542775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111492890.9A Pending CN114185941A (en) 2021-12-08 2021-12-08 Report data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114185941A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114743384A (en) * 2022-03-25 2022-07-12 京东方科技集团股份有限公司 Alarm method and device
CN115314751A (en) * 2022-08-08 2022-11-08 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114743384A (en) * 2022-03-25 2022-07-12 京东方科技集团股份有限公司 Alarm method and device
CN114743384B (en) * 2022-03-25 2024-03-08 京东方科技集团股份有限公司 Alarm method and device
CN115314751A (en) * 2022-08-08 2022-11-08 北京达佳互联信息技术有限公司 Data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109299348B (en) Data query method and device, electronic equipment and storage medium
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
CN111125496B (en) Price query method, device and system
CN111813804B (en) Data query method and device, electronic equipment and storage medium
CN111427971B (en) Business modeling method, device, system and medium for computer system
CN114185941A (en) Report data query method and device, electronic equipment and storage medium
CN112258306B (en) Account information checking method, device, electronic equipment and storage medium
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
CN111984234A (en) Method and device for processing work order
CN112947919A (en) Method and device for constructing service model and processing service request
CN114281663A (en) Test processing method, test processing device, electronic equipment and storage medium
CN112102099A (en) Policy data processing method and device, electronic equipment and storage medium
CN110895536A (en) Big data-based power information retrieval method and power information retrieval device
CN115982148A (en) Database table processing method and device, electronic equipment and storage medium
CN114997977B (en) Data processing method, device, electronic equipment and computer readable medium
CN113515332B (en) Data generation method, device, equipment and storage medium
CN112131257B (en) Data query method and device
CN115268734A (en) Quotation generation method, device, equipment and storage medium based on quotation tool
CN114817347A (en) Business approval method and device, electronic equipment and storage medium
CN114817297A (en) Method and device for processing data
CN114722108A (en) Customer service data processing method and device, electronic equipment and storage medium
CN114239519A (en) Credit investigation data processing method and device, electronic equipment and computer readable medium
CN112767013A (en) Business report splitting method, device, server and storage medium
CN113434754A (en) Method and device for determining recommended API (application program interface) service, electronic equipment and storage medium
CN113763025B (en) Pricing management method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination