CN115630625A - Method and device for generating air quality report, storage medium and electronic equipment - Google Patents

Method and device for generating air quality report, storage medium and electronic equipment Download PDF

Info

Publication number
CN115630625A
CN115630625A CN202211160789.8A CN202211160789A CN115630625A CN 115630625 A CN115630625 A CN 115630625A CN 202211160789 A CN202211160789 A CN 202211160789A CN 115630625 A CN115630625 A CN 115630625A
Authority
CN
China
Prior art keywords
data
variable
air quality
report
text
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
CN202211160789.8A
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.)
Xinxiang Ecological Environment Monitoring Center Of Henan Province
3Clear Technology Co Ltd
Original Assignee
Xinxiang Ecological Environment Monitoring Center Of Henan Province
3Clear Technology Co Ltd
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 Xinxiang Ecological Environment Monitoring Center Of Henan Province, 3Clear Technology Co Ltd filed Critical Xinxiang Ecological Environment Monitoring Center Of Henan Province
Priority to CN202211160789.8A priority Critical patent/CN115630625A/en
Publication of CN115630625A publication Critical patent/CN115630625A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present disclosure relates to a method, an apparatus, a storage medium, and an electronic device for generating an air quality report, the method including: the method comprises the steps of obtaining air quality data from a database according to a designated period and a designated area in a received designated report name, storing the air quality data into a preset data template according to the designated area and the designated period to generate a target data text, establishing a corresponding relation between a designated format report template and the target data text, wherein the designated format report template comprises a variable identifier which is used for marking variable text data in the designated format report template, generating variable data according to a variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation, and replacing the variable text data in the designated format report template with the variable data to generate an air quality report. Therefore, the air quality report is automatically generated, errors caused by manual manufacturing are avoided, and the manufacturing efficiency of the air quality report is improved.

Description

Method and device for generating air quality report, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method and an apparatus for generating an air quality report, a storage medium, and an electronic device.
Background
In the related technology, the ecological environment department establishes a four-level air quality monitoring and forecasting system from the state, province, city and district, and enables the social public to know the local air quality condition through an air quality condition report. The air quality report describes the air quality condition of a certain area within a period of time, the content of a report document comprises character description, tables, charts and the like, and air quality report templates of different areas and different purposes are different, when an air quality information publisher publishes information, the air quality information publisher needs to manually calculate the air quality value through different template contents, fill descriptive characters in the air quality report, and make a statistical table and a chart. The air quality report needs to perform statistical analysis on a large amount of air quality data and process the data, and the manual processing mode results in huge workload and lower manufacturing efficiency of the air quality report.
Disclosure of Invention
The present disclosure provides a method, an apparatus, a storage medium, and an electronic device for generating an air quality report, so as to solve the technical problem of low efficiency in generating an air quality report in the related art.
In order to achieve the above object, a first aspect of the embodiments of the present disclosure provides a method for generating an air quality report, including:
acquiring air quality data from a database according to a specified period and a specified area in a received specified report name;
storing the air quality data into a preset data template according to the designated area and the designated period to generate a target data text;
establishing a corresponding relation between a report template in a specified format and the target data text, wherein the report template in the specified format comprises a variable identifier which is used for marking variable text data in the report template in the specified format;
based on the corresponding relation, generating variable data according to a variable calculation function corresponding to the variable identifier and the target data text;
replacing the variable data in the specified format report template with the variable data to generate an air quality report.
Optionally, the generating variable data according to the variable calculation function corresponding to the variable identifier and the target data text based on the correspondence includes:
determining the variable calculation function corresponding to the variable identifier according to a preset writing rule of the target data text;
and determining the variable data according to the variable calculation function and the target data text based on the corresponding relation.
Optionally, the method further comprises:
acquiring an environmental Air Quality Index (AQI) technical specification;
generating said preset data template according to said AQI technique specification.
Optionally, the method further comprises:
acquiring a historical report template;
identifying formatting data and text data in the historical report template;
and according to the format data and the text data, applying a specified grammar rule to convert the historical report template into the specified format report template.
Optionally, the applying a specified grammar rule to convert the historical report template into the report template with the specified format according to the format data and the text data includes:
identifying fixed text data and the variable text data in the text data;
converting the format data into a specified format code according to the specified grammar rule, and determining the variable identifier corresponding to the variable text data;
and generating the report template with the specified format according to the fixed text data, the specified format code and the variable identifier.
Optionally, the method further comprises:
in response to receiving the target format, translating the air quality report into a target air quality report in the target format.
Optionally, the specified format report template comprises an extensible markup language report template
According to a second aspect of the embodiments of the present disclosure, there is provided an air quality report generation apparatus, including:
the acquisition module is used for acquiring air quality data from a database according to the designated period and the designated area in the received designated report name;
the first generation module is used for storing the air quality data into a preset data template according to the designated area and the designated period so as to generate a target data text;
the establishing module is used for establishing a corresponding relation between a report template in a specified format and the target data text, wherein the report template in the specified format comprises a variable identifier, and the variable identifier is used for marking variable text data in the report template in the specified format;
the second generation module is used for generating variable data according to the variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation;
a third generation module to replace the variable text data in the specified format report template with the variable data to generate an air quality report.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspects of the present disclosure.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspect of the present disclosure.
According to the technical scheme, according to the designated period and the designated area in the name of the received designated report, air quality data are obtained from a database, the air quality data are stored in a preset data template according to the designated area and the designated period to generate a target data text, a corresponding relation between the designated format report template and the target data text is established, the designated format report template comprises a variable identifier, the variable identifier is used for marking variable text data in the designated format report template, variable data are generated according to a variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation, and the variable text data in the designated format report template are replaced by the variable data to generate the air quality report. Therefore, variable data are obtained from the preset data template written with the air quality data through the report template with the specified format, and the air quality report is automatically generated after the variable text data in the report template with the specified format are replaced by the variable data. The error caused by manual manufacturing is avoided, and the manufacturing efficiency of the air quality report is improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, but do not constitute a limitation of the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of generating an air quality report according to an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a method of generating a specified report template in accordance with an exemplary embodiment.
Fig. 3 is a flow chart illustrating another method of generating an air quality report in accordance with an exemplary embodiment.
FIG. 4 is a block diagram illustrating an air quality report generation apparatus in accordance with an exemplary embodiment.
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
It should be noted that all the actions of acquiring signals, information or data in the present disclosure are performed under the premise of complying with the corresponding data protection regulation policy of the country of the location and obtaining the authorization given by the owner of the corresponding device.
Fig. 1 is a flow chart illustrating a method of generating an air quality report according to an exemplary embodiment, as shown in fig. 1, including the following steps.
And step S101, acquiring air quality data from a database according to the specified period and the specified area in the received specified report name.
It should be noted that the present disclosure applies to a server, which can receive a specified report name sent by a user end by communicating with the user end, and can also input the specified report name by the user through an input end of the server. The designated report name is the name of an air quality report, and comprises a designated period and a designated area, wherein the designated period is a period of time in the historical time period, and the designated area is an area needing to collect air quality data. For example, if a report name is specified: the XX city environmental air quality quarter report of the first quarter of 2022, the server identifies the designated report name by fields, thereby determining the corresponding designated period from 1 month of 2022 to 3 months of 2022, and the designated area is the administrative division range of the XX city.
It can be understood that, in order to monitor the air quality change conveniently, air quality monitoring instruments are installed in all areas of a city, and air quality data is generated by collecting and analyzing air in the environment, wherein the air quality data can comprise PM 2.5 、PM 10 、O 3 、CO、SO 2 And the concentration information of each pollutant. The air quality monitoring instrument needs to collect air quality data every day, and pushes the data into a database of a server after the data is subjected to quality control and processing. For example, a sending period may be set on the air quality monitoring apparatus, the air quality monitoring apparatus monitors the daily air quality condition in real time to determine the current pollutant concentration data, generates the daily air quality data at a fixed time point every day, and in the early morning of the first day of each month, takes the collected and processed pollutant concentration data of the city in the month as the air quality data of the month in the city, and sends the data to the server. And after receiving the air quality data, the server stores the air quality data into a database corresponding to the city according to the city where the data is located.
It is worth mentioning that based on the monitoring property of the air quality monitoring, the air quality report needs to reflect the change of the current air quality situation, and therefore, the current air quality data and the last year contemporaneous air quality data need to be included in the air quality data. The term "contemporaneous period" refers to a period of the last year corresponding to the current period, and for example, the specified period in the specified report name is 2022 year 1 month, and the corresponding contemporaneous period is 2021 year 1 month. After receiving the appointed report name, the server determines a database corresponding to the appointed region through the appointed region in the appointed report name, and acquires air quality data in the corresponding period and air quality data in the same period in the last year from the database according to the appointed period in the appointed report name.
And S102, storing the air quality data into a preset data template according to the designated area and the designated period to generate a target data text.
It should be noted that, a preset data template is configured in advance in the server, and is used for storing the air quality data extracted from the database in the above steps. The preset data template comprises an area identifier and a period identifier, and the air quality data are sequentially written into the preset data template by comparing the area identifier with the period identifier according to a preset sequence. For example, the preset data templates may be set as:
currently:
Figure BDA0003859816120000061
Figure BDA0003859816120000071
and (3) synchronization:
name of city Date Air quality index 1 Air quality index 2
After the air quality data is determined through the steps, the air quality data is written into the preset data template according to the collection time period, the city name and the corresponding air quality index and the sequence of the collection time, and therefore a target data text is generated. For example, the report name is specified as: after acquiring air quality data of each city belonging to Shanxi province and belonging to each city in 2022 in 5 months and air quality data of each city in 2021 in the same period in the last year in 5 months, writing the air quality data into a preset data template so as to generate the following target data texts:
currently: 2022 month 5
Figure BDA0003859816120000072
Figure BDA0003859816120000081
And (3) synchronously: 2021 year 5 month
Name of city Date PM 2.5 PM 10 O 3 SO 2 NO 2 CO
Taiyuan 5.1 30 34 17 25 12 7
Da Tong (great identity) 5.1 29 18 10 33 18 8
Shuozhou (a city of ancient China) 5.1 50 46 13 32 33 7
Xinzhou tea 5.1 43 62 37 57 39 5
... ... ... ... ... ... ... ...
Taiyuan 5.2 31 31 20 22 14 6
Da Tong (great identity) 5.2 29 15 9 30 19 8
Syzygium 5.2 53 45 9 32 17 7
Xinzhou tea 5.2 44 61 35 56 30 8
... ... ... ... ... ... ... ...
Taiyuan 5.31 82 94 73 63 41 3
Dao Tong (great homology of medicine) 5.31 52 72 43 63 63 7
Shuozhou (a city of ancient China) 5.31 106 91 63 77 76 6
Xinzhou tea 5.31 112 102 78 83 73 7
... ... ... ... ... ... ... ...
Optionally, before the step S102, the method further includes:
and acquiring an ambient Air Quality Index (AQI) technical specification.
And generating a preset data template according to the AQI technical specification.
It should be noted that, in the embodiment, the AQI technology is defined as a preset monitoring standard in the air quality monitoring, and the AQI technology is defined to indicate that pollutant items in the ambient air need to be collected when the air quality monitoring is performed, where the pollutant items include PMs 2.5 、PM 10 、O 3 、SO 2 、NO 2 And CO concentration. For example, the AQI technical specification may be configured in a server, and a preset data template is generated according to pollutant items in the AQI specification, so that corresponding air quality data is extracted from a database through the preset data template. The AQI specification can also be sent to the server by the user via an input device of the user equipment or the server, so that the server generates the preset data template according to the AQI specification.
Step S103, establishing a corresponding relation between the report template with the specified format and the target data text, wherein the report template with the specified format comprises a variable identifier, and the variable identifier is used for marking the variable text data in the report template with the specified format.
It is worth mentioning that when the air quality report is generated in each region, different types of report templates can be manufactured according to different manufacturing habits of each region, each type of report template comprises fixed text data and variable text data, and service personnel calculate and determine the variable text data in the report template according to the air quality data acquired by the monitoring instrument and fill the data in the corresponding position of the report template to generate the air quality report. Based on various types of air quality reports, service personnel need to read air quality data in the reports and then summarize and unify the data, and since more data need to be summarized and the making efficiency of the air quality reports is low, in the embodiment, a report template with a specified format is configured in advance in a server to ensure the unification of the air quality reports, the report template with the specified format comprises fixed text data used for performing fixed description and variable text data needing to be filled through the air quality data, wherein the variable text data in the report template with the specified format can be labeled through variable identifiers, and the variable identifiers corresponding to different variable text data are different. For example, the report template of the specified format may be a report template of xml (eXtensible Markup Language) format in which variable text data may be represented by: the variable names in the report template are labeled, for example, { period }, { average }, { good days }, etc.
The variable text data in the specified format report template is calculated and determined by establishing the corresponding relation between the specified format report template and the target data text, so that the specified format report template acquires corresponding air quality data from the target data text book.
Fig. 2 is a flowchart illustrating a method for generating a specific report template according to an exemplary embodiment, and as shown in fig. 2, in an implementation manner, before the step S103, the method further includes:
in step S201, a history report template is acquired.
In step S202, the format data and the text data in the history report template are identified.
And step S203, converting the historical report template into a report template with a specified format by applying a specified grammar rule according to the format data and the text data.
For example, in this embodiment, a history report template uploaded by a specified area in a history time period is acquired through a database, and format data and text data in a history report target are determined by identifying the history report template, where the format data is used to indicate a text format corresponding to each text in the history report template, and includes: paragraph, space, table, text block, graph, bar graph, discount graph, etc., and the text data is the specific text in the history report template. And converting the historical report template into a report template with a specified format by applying specified grammar rules through the format data and the text data. Illustratively, the grammatical rules may be OpenXML, which is an office document format based on XML, and the historical report template is converted to an XML formatted report template according to the grammatical rules of OpenXML, e.g., in an XML formatted report template, the document processing section is identified by a < w: document > identifier, the document processing section is identified by a < w: body > identifier, the document processing section is identified by a < w: p > identifier, the document processing section is identified by a < w: r > identifier, the text processing section is identified by a < w: r > identifier, the document processing section is identified by a < w: tbl > identifier, the document processing section is identified by a < w: tr > identifier, the table lines of the table are identified by a < w: tc > identifier, the columns of the table are identified by a < c: chart > identifier, the chart content of the document is identified by a < c: title of the chart, the chart is identified by a < c: title of the chart, and the like. And converting format data in the historical report template according to the grammar rule of the OpenXML, so that the historical report template is converted into a report template in an XML format. And converting the historical report template into a report template with a specified format according to the position of the text data in the historical report template.
Optionally, step S203 includes:
fixed text data and variable text data in the text data are identified.
And converting the format data into a specified format code according to a specified grammar rule, and determining a variable identifier corresponding to the variable text data.
And generating a report template with a specified format according to the fixed text data, the code with the specified format and the variable identifier.
It is worth mentioning that the history report template includes fixed text data for content description and variable text data that needs to be determined by calculating the air quality data, for example, the variable text data may be a statistical cycle range corresponding to the report, an average index of the comprehensive ambient air quality in a specified area, a good days of ambient air, a good days proportion, and the like. The format data is converted into a format-designated code according to a designated syntax rule, the format-designated code in this embodiment is the same as the format code in step S203, and reference may be made to step S203, which is not described again. According to the designated grammar rule, the variable identifier corresponding to the variable text data is determined, and it is worth mentioning that the variable text in the historical report templateThe data having corresponding variable calculation modes, e.g. PM 2.5 The average concentration of (2) requires calculating the PM within the period in the target data text 2.5 Mean value of concentration, NO 2 The rate of change of (c) needs to be according to the formula: (currently NO) 2 Concentration value of (2) - (-) -contemporaneously NO 2 Concentration value of) ÷ contemporaneous NO 2 The concentration value of (2) is determined. Different variable text data correspond to different calculation modes, variable identifiers corresponding to the variable text data in the historical text template can be determined according to the calculation modes of the variable text data and the designated grammar rules, and the designated format report template is generated according to the fixed text data, the designated format codes and the variable identifiers. By way of example, the present embodiment provides a specified format report template as follows:
Figure BDA0003859816120000111
Figure BDA0003859816120000121
Figure BDA0003859816120000131
Figure BDA0003859816120000141
wherein, "< >" is a format identifier determined according to a specified grammar rule and is used for marking a text format in a specified format template, a text part is a fixed text in the specified format template, and "{ }" is a variable identifier in the specified format template.
And step S104, generating variable data according to the variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation.
It is worth mentioning that, according to the specified grammar rule, the variable identifier in the specified format template corresponds to the corresponding variable calculation function,for example, variable identifier { pro _ o 3 - "diff" represents O 3 The corresponding variable calculation function is: (number of current period-number of same period) ÷ number of same period. Variable identifier pro pm 2.5 Denotes PM 2.5 The corresponding variable calculation function is: total ÷ number of entries. And determining variable data corresponding to the variable text data according to the variable calculation function and the corresponding relation between the target data text and the report template with the specified format.
In step S105, the variable data in the report template of the specified format is replaced with variable data to generate an air quality report.
For example, after the variable data is generated through the above steps, the variable text data in the report template of the specified format is replaced with the variable data, so that the air quality report including the specific numerical value is generated.
According to the technical scheme, according to the designated period and the designated area in the name of the received designated report, air quality data are obtained from a database, the air quality data are stored in a preset data template according to the designated area and the designated period to generate a target data text, a corresponding relation between the designated format report template and the target data text is established, the designated format report template comprises a variable identifier, the variable identifier is used for marking variable text data in the designated format report template, variable data are generated according to a variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation, and the variable data in the designated format report template are replaced by the variable data to generate the air quality report. Therefore, variable data are obtained from the preset data template written with the air quality data through the report template with the specified format, and the air quality report is automatically generated after the variable text data in the report template with the specified format are replaced by the variable data. The error caused by manual manufacturing is avoided, and the manufacturing efficiency of the air quality report is improved.
Fig. 3 is a flow chart illustrating another method of generating an air quality report according to an exemplary embodiment, as shown in fig. 3, including the steps of:
step S301, according to the designated period and the designated area in the received designated report name, acquiring air quality data from a database.
For example, the manner of acquiring the air quality data in this embodiment is the same as that in step S101, and reference may be made to step S101, which is not described again.
Step S302, storing the air quality data into a preset data template according to a designated area and a designated period to generate a target data text.
For example, the manner of generating the target data text in this embodiment is the same as that in step S102, and reference may be made to step S102, which is not described again.
Step S303, establishing a corresponding relation between the report template with the specified format and the target data text, wherein the report template with the specified format comprises a variable identifier, and the variable identifier is used for marking the variable text data in the report template with the specified format.
For example, the manner of establishing the corresponding relationship in this embodiment is the same as that in step S103, and reference may be made to step S103, which is not described again.
And step S304, based on the corresponding relation, generating variable data according to the variable calculation function corresponding to the variable identifier and the target data text.
For example, the manner of generating the variable data in this embodiment is the same as that in step S104, and reference may be made to step S104, which is not described again.
Optionally, in another embodiment, the step S304 may include:
step S3041, determining a variable calculation function corresponding to the variable identifier according to a preset writing rule of the target data text.
Step S3042, based on the correspondence, determining variable data according to the variable calculation function and the target data text.
It should be noted that, in the embodiment, the specifying of the format report template needs to extract the air quality data from the target data text, and determine the variable data corresponding to the variable identifier according to the air quality data, so that the variable data can be determined according to the preset writing rule of the target data textA variable calculation function corresponding to the variable identifier is determined, for example, the target data text is a table text, a first column of the table text is used for recording the area name of each sub-area in the designated area, for example, the designated area is shanxi province, and the corresponding sub-area is taiyuan, great identity, houshuizhou, or the like; the second column in the target data text is used for recording the date of air quality data generation; the third column in the target data text is used to record the PM in the ambient air at that date for the corresponding sub-region 2.5 Average daily concentration. And determining a variable calculation function of the variable identifier in the target data text according to the preset writing rule, and determining variable data corresponding to the variable identifier according to the corresponding relation between the report template in the specified format and the target data text.
In step S305, the variable text data in the specified format report template is replaced with variable data to generate an air quality report.
For example, the manner of generating the air quality report in this embodiment is the same as that in step S105, and reference may be made to step S105, which is not described again.
Optionally, after the step S305, the method further includes:
in response to receiving the target format, the air quality report is converted to a target air quality report in the target format.
It should be noted that, in this embodiment, the air quality report is a report file in a specified format, and in order to meet the editing and viewing requirements of the user on the air quality report, the air quality report needs to be converted into a target format file. For example, when the specified format is XML format, the air quality report may be converted into a PDF format or word format report file according to the target format requirement sent by the user.
According to the technical scheme, the air quality report is made by using the text file and the XML format file, so that the copy, the edition and the sharing of the air quality report text are facilitated, the variable data is obtained from the preset data template written with the air quality data through the specified format report template, and the air quality report is automatically generated after the variable text data in the specified format report template is replaced by the variable data. The error caused by manual manufacturing is avoided, and the manufacturing efficiency of the air quality report is improved.
Fig. 4 is a block diagram illustrating an apparatus for generating an air quality report according to an exemplary embodiment, and as shown in fig. 4, the apparatus 100 includes: an acquisition module 110, a first generation module 120, a setup module 130, a second generation module 140, and a third generation module 150.
And the acquisition module 110 is configured to acquire the air quality data from the database according to the specified period and the specified area in the received specified report name.
And the first generation module 120 is used for storing the air quality data into a preset data template according to the specified area and the specified period so as to generate a target data text.
The establishing module 130 is configured to establish a corresponding relationship between a report template in a specified format and a target data text, where the report template in the specified format includes a variable identifier, and the variable identifier is used to label variable text data in the report template in the specified format.
And a second generating module 140, configured to generate variable data according to the variable calculation function corresponding to the variable identifier and the target data text based on the correspondence relationship.
A third generating module 150 for replacing the variable text data in the specified format report template with variable data to generate an air quality report.
Optionally, the second generating module 140 is configured to:
and determining a variable calculation function corresponding to the variable identifier according to a preset writing rule of the target data text.
And determining variable data according to the variable calculation function and the target data text based on the corresponding relation.
Optionally, the apparatus 100 further includes a fourth generating module, configured to:
and acquiring the technical specification of the ambient air quality index AQI.
And generating a preset data template according to the AQI technical specification.
Optionally, the apparatus 100 further comprises a first conversion module comprising:
and the acquisition submodule is used for acquiring the historical report template.
And the identification submodule is used for identifying the format data and the text data in the historical report template.
And the conversion submodule is used for applying a specified grammar rule to convert the historical report template into a specified format report template according to the format data and the text data.
Optionally, the transformation module can be further used for:
fixed text data and variable text data in the text data are identified.
And converting the format data into a specified format code according to a specified grammar rule, and determining a variable identifier corresponding to the variable text data.
And generating a report template with a specified format according to the fixed text data, the code with the specified format and the variable identifier.
Optionally, the apparatus 100 further comprises a second conversion module, configured to:
in response to receiving the target format, the air quality report is converted to a target air quality report in the target format.
Optionally, the specified format report template comprises an extensible markup language report template.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an electronic device 5 according to an example embodiment. For example, the electronic device 500 may be provided as a server. Referring to fig. 5, the electronic device 500 comprises a processor 522, which may be one or more in number, and a memory 532 for storing computer programs executable by the processor 522. The computer program stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processor 522 may be configured to execute the computer program to perform the method of generating an air quality report described above.
Additionally, the electronic device 500 may also include a power component 526 and a communication component 550, the power component 526 may be configured to perform power management of the electronic device 500, and the communication component 550 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 500. In addition, the electronic device 500 may also include input/output (I/O) interfaces 558. The electronic device 500 may operate based on an operating system stored in the memory 532.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the method of generating an air quality report described above is also provided. For example, the non-transitory computer readable storage medium may be the memory 532 described above including program instructions executable by the processor 522 of the electronic device 500 to perform the method of generating an air quality report described above.
In another exemplary embodiment, a computer program product is also provided, which contains a computer program executable by a programmable apparatus, the computer program having code portions for performing the method of generating an air quality report described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details in the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure. It should be noted that the various features described in the foregoing embodiments may be combined in any suitable manner without contradiction.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A method of generating an air quality report, comprising:
acquiring air quality data from a database according to a specified period and a specified area in a received specified report name;
storing the air quality data into a preset data template according to the designated area and the designated period to generate a target data text;
establishing a corresponding relation between a report template with a specified format and the target data text, wherein the report template with the specified format comprises a variable identifier, and the variable identifier is used for marking variable text data in the report template with the specified format;
based on the corresponding relation, generating variable data according to a variable calculation function corresponding to the variable identifier and the target data text;
replacing the variable text data in the specified format report template with the variable data to generate an air quality report.
2. The generation method according to claim 1, wherein generating variable data from the variable calculation function corresponding to the variable identifier and the target data text based on the correspondence includes:
determining the variable calculation function corresponding to the variable identifier according to a preset writing rule of the target data text;
and determining the variable data according to the variable calculation function and the target data text based on the corresponding relation.
3. The generation method according to claim 1, characterized in that the further method comprises:
acquiring an environmental Air Quality Index (AQI) technical specification;
generating said preset data template according to said AQI technique specification.
4. The generation method according to claim 1, characterized in that it further comprises:
acquiring a historical report template;
identifying formatting data and text data in the historical report template;
and according to the format data and the text data, applying a specified grammar rule to convert the historical report template into the specified format report template.
5. The method of claim 4, wherein applying a specified grammar rule to transform the historical report template into the specified format report template based on the format data and the text data comprises:
identifying fixed text data and the variable text data in the text data;
converting the format data into a specified format code according to the specified grammar rule, and determining the variable identifier corresponding to the variable text data;
and generating the report template with the specified format according to the fixed text data, the code with the specified format and the variable identifier.
6. The generation method according to claim 1, characterized in that the further method comprises:
in response to receiving the target format, translating the air quality report into a target air quality report in the target format.
7. The generation method of any of claims 1-6, wherein the specified format report template comprises an extensible markup language report template.
8. An air quality report generation apparatus, comprising:
the acquisition module is used for acquiring air quality data from a database according to the designated period and the designated area in the received designated report name;
the first generation module is used for storing the air quality data into a preset data template according to the designated area and the designated period so as to generate a target data text;
the establishing module is used for establishing a corresponding relation between a report template in a specified format and the target data text, wherein the report template in the specified format comprises a variable identifier, and the variable identifier is used for marking variable text data in the report template in the specified format;
the second generation module is used for generating variable data according to the variable calculation function corresponding to the variable identifier and the target data text based on the corresponding relation;
a third generation module to replace the variable text data in the specified format report template with the variable data to generate an air quality report.
9. A non-transitory computer readable storage medium, having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the steps of the method of any one of claims 1-7.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 7.
CN202211160789.8A 2022-09-22 2022-09-22 Method and device for generating air quality report, storage medium and electronic equipment Pending CN115630625A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211160789.8A CN115630625A (en) 2022-09-22 2022-09-22 Method and device for generating air quality report, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211160789.8A CN115630625A (en) 2022-09-22 2022-09-22 Method and device for generating air quality report, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115630625A true CN115630625A (en) 2023-01-20

Family

ID=84902302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211160789.8A Pending CN115630625A (en) 2022-09-22 2022-09-22 Method and device for generating air quality report, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115630625A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN110032720A (en) * 2018-12-28 2019-07-19 万康源(天津)基因科技有限公司 A kind of visualization report typesetting and automatic generation method and system based on XML
CN113723747A (en) * 2021-07-16 2021-11-30 北京房江湖科技有限公司 Analysis report generation method, electronic device and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032720A (en) * 2018-12-28 2019-07-19 万康源(天津)基因科技有限公司 A kind of visualization report typesetting and automatic generation method and system based on XML
CN109948134A (en) * 2019-03-21 2019-06-28 润电能源科学技术有限公司 A kind of report automatic generation method, system and electronic equipment and storage medium
CN113723747A (en) * 2021-07-16 2021-11-30 北京房江湖科技有限公司 Analysis report generation method, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN101739390B (en) Data transformation based on a technical design document
CN110688830B (en) Credit investigation template conversion method and device
CN109766085B (en) Method and device for processing enumeration type codes
Bishop et al. Measuring FAIR principles to inform fitness for use
CN107220274A (en) One kind visualization data-interface fairground implementation method
CN112883692A (en) Automatic generation method of PPT data report
CN103246963A (en) Staff training system based on Internet of Things
CN115794934A (en) Production facility monitoring data and digital twin model integration system and method
CN111401023B (en) Report generation method, report generation device, server and storage medium
CN110889261A (en) Method for automating electronic official document service processing
CN102227727A (en) Method and device for distributed configuration of remote data processing services in motor vehicle systems
CN115630625A (en) Method and device for generating air quality report, storage medium and electronic equipment
CN112527818A (en) Report generation method, device, equipment and storage medium
CN112559514B (en) Information processing method and system
CN112947939B (en) Data reporting method, device, equipment and storage medium
CN111882419B (en) Method and device for quality inspection of files and server
CN106777025B (en) Analysis method and system of database physical model
CN114328616A (en) Statistical method and device for power line loss detail information combining RPA and AI
CN113539518A (en) Medicine data processing method and device based on RPA and AI and electronic equipment
CN106021380A (en) Method and device for compiling aircraft technical publication based on maintenance engineering analysis data
CN110909098A (en) Cloud geographic information data analysis method and system
CN114024849B (en) Intelligent AI operation and maintenance perception method and device
Östman et al. GeoTest: A Testing Environment for Swedish Geodata
CN112767516B (en) Method and device for determining dot diagram of nuclear power test procedure and computer equipment
CN112561737A (en) Universal equipment energy monitoring system

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