Report automatic generation method and device, computer equipment and storage medium

文档序号:1156522 发布日期:2020-09-15 浏览:6次 中文

阅读说明:本技术 报表自动生成方法、装置、计算机设备及存储介质 (Report automatic generation method and device, computer equipment and storage medium ) 是由 彭易博 李冠杰 罗晶晶 于 2020-04-28 设计创作,主要内容包括:本发明公开了一种报表自动生成方法、装置、计算机设备及存储介质,通过响应第一用户操作,生成报表配置文件,报表配置文件包括自定义脚本地址和任务类型;根据自定义脚本地址通过Zabbix生成自定义脚本,采用自定义脚本从目标终端采集目标报表数据;将目标报表数据进行数据处理,并将数据处理后的目标报表数据显示到报表页面中;在接收到任务触发指令之后,通过Puppteer从报表页面中采集数据处理后的目标报表数据;对数据处理后的目标报表数据进行解析和抽取,生成数据报表。结合Zabbix的自定义脚本和Puppteer自动化采集技术,打破由于堡垒机的存在而无法访问目标终端数据库的限制,提高采集数据的准确性和效率,能够监控数据采集过程的状态,提高采集过程的容错率。(The invention discloses a method and a device for automatically generating a report, computer equipment and a storage medium, wherein a report configuration file is generated by responding to the operation of a first user, and comprises a user-defined script address and a task type; generating a custom script through Zabbix according to the custom script address, and collecting target report data from a target terminal by adopting the custom script; performing data processing on the target report data, and displaying the target report data after the data processing into a report page; after receiving a task triggering instruction, acquiring target report data after data processing from a report page through a puppeter; and analyzing and extracting the target report data after the data processing to generate a data report. The Zabbix self-defined script and the puppeter automatic acquisition technology are combined, the limitation that a target terminal database cannot be accessed due to the existence of the bastion machine is broken, the accuracy and the efficiency of data acquisition are improved, the state of the data acquisition process can be monitored, and the fault tolerance rate of the data acquisition process is improved.)

1. An automatic report generation method is characterized by comprising the following steps:

responding to the first user operation, and generating a report configuration file, wherein the report configuration file comprises a user-defined script address and a task type;

generating a custom script through Zabbix according to the custom script address, and collecting target report data from a target terminal by adopting the custom script;

performing data processing on the target report data, and displaying the processed target report data to a report page;

after receiving a task triggering instruction, acquiring the processed target report data from the report page through a puppeter;

and analyzing and extracting the processed target report data to generate a data report.

2. The method for automatically generating a report according to claim 1, wherein the step of performing data processing on the target report data and displaying the processed target report data on a report page comprises the steps of:

recombining the target report data to obtain first report data, and storing the first report data into a first file;

copying the first file to obtain a second file, and storing the second file into a readable directory of Zabbix;

reading the second file through Zabbix, and displaying the data of the second file in a report page.

3. The method for automatically generating a report according to claim 1, wherein said report configuration file further comprises an HTML generator, and said analyzing and extracting said processed target report data to generate a data report comprises:

analyzing the processed target report data by using an analyzer to obtain analyzed data;

generating a WEB page through an HTML generator corresponding to the analyzer according to the analyzed data;

sending an extraction request to the WEB page, and extracting the analyzed data from the WEB page according to a preset extraction method to obtain extracted data;

and generating a data report according to the extracted data.

4. The automatic report generation method according to claim 1, wherein said report configuration file further comprises a receiving mailbox and a copying mailbox, and after said analyzing and extracting said processed target report data and generating a data report, said automatic report generation method further comprises:

judging the execution state of the task type;

if the execution state is a first state, judging whether the data report meets a preset requirement, wherein the first state indicates that no error occurs in the task type execution process;

and if the data report meets the preset requirement, sending the data report to the receiving mailbox and the copying mailbox in a mail form.

5. The automatic report generation method according to claim 1, wherein after collecting target report data using the custom script, the automatic report generation method further comprises:

receiving task type information;

if the task type information indicates that the task type is a periodic task, setting the interval of a timer to be periodic millisecond number, wherein the periodic millisecond number takes periodic time as interval and the time unit is millisecond;

and if the task type information indicates that the task type is a timing task, setting the interval of the timer to be a fixed millisecond number, wherein the fixed millisecond number takes a fixed time period as an interval, and the time unit is millisecond.

6. The automatic report generation method according to claim 1, wherein said automatic report generation method further comprises:

performing a minimization operation, the minimization operation indicating that a task of the task type is running in the background;

and triggering a task completion prompt after the data report is successfully sent to the receiving mailbox and the copying mailbox.

7. An apparatus for automatically generating a report, comprising:

the response operation module is used for responding to the first user operation and generating a report configuration file, and the report configuration file comprises a user-defined script address and a task type;

the first acquisition module is used for generating a custom script through Zabbix according to the custom script address and acquiring target report data from a target terminal by adopting the custom script;

the first display module is used for carrying out data processing on the target report data and displaying the processed target report data into a report page;

the second acquisition module is used for acquiring the processed target report data from the report page through a puppeter after receiving a task triggering instruction;

and the first report generation module is used for analyzing and extracting the processed target report data to generate a data report.

8. The report automatic generation apparatus of claim 7, wherein the first display module further comprises:

the data recombination module is used for recombining the target report data to obtain first report data and storing the first report data into a first file;

the file copying module is used for copying the first file to obtain a second file and storing the second file into a readable directory of Zabbix;

and the second display module is used for reading the second file through Zabbix and displaying the data of the second file in a report page.

9. Computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor, when executing said computer program, carries out the steps of the automatic report generation method according to any one of claims 1 to 6.

10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for automatic generation of reports according to any one of claims 1 to 6.

Technical Field

The invention relates to the technical field of data processing, in particular to a method and a device for automatically generating a report, computer equipment and a storage medium.

Background

With the development of computer technology, in the technical field of data processing, data reports are widely applied in the aspect of system operation and maintenance, and as the final link of data acquisition, data source evaluation, report data generation and report data transmission to a target user need to meet the requirements of timing, fixed point, accuracy, high efficiency and the like.

According to the traditional method for generating the data report, the steps of establishing connection in a database and exporting the report are complex, in many application scenes, the existence of a bastion machine can limit or disallow an external machine to be connected with an IP address of a local machine, so that the external machine cannot acquire data, and the data report is manually processed and manufactured in an earlier stage.

Disclosure of Invention

The embodiment of the invention provides a method and a device for automatically generating a report, computer equipment and a storage medium, which are used for solving the problem that an external machine cannot acquire data.

An automatic report generation method comprises the following steps:

responding to the first user operation, and generating a report configuration file, wherein the report configuration file comprises a user-defined script address and a task type;

generating a custom script through Zabbix according to the custom script address, and collecting target report data from a target terminal by adopting the custom script;

performing data processing on the target report data, and displaying the processed target report data to a report page;

after receiving a task triggering instruction, acquiring the processed target report data from the report page through a puppeter;

and analyzing and extracting the processed target report data to generate a data report.

An automatic report generation device, comprising:

the response operation module is used for responding to the first user operation and generating a report configuration file, and the report configuration file comprises a user-defined script address and a task type;

the first acquisition module is used for generating a custom script through Zabbix according to the custom script address and acquiring target report data from a target terminal by adopting the custom script;

the first display module is used for carrying out data processing on the target report data and displaying the processed target report data into a report page;

the second acquisition module is used for acquiring the processed target report data from the report page through a puppeter after receiving a task triggering instruction;

and the first report generation module is used for analyzing and extracting the processed target report data to generate a data report.

A computer device comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the steps of the report automatic generation method when executing the computer program.

A computer-readable storage medium, which stores a computer program, which, when executed by a processor, implements the steps of the above report automatic generation method.

The report automatic generation method, the report automatic generation device, the computer equipment and the storage medium generate a report configuration file by responding to the first user operation, wherein the report configuration file comprises a user-defined script address and a task type; generating a custom script through Zabbix according to the custom script address, and collecting target report data from a target terminal by adopting the custom script; performing data processing on the target report data, and displaying the target report data after the data processing into a report page; after receiving a task triggering instruction, acquiring target report data after data processing from a report page through a puppeter; and analyzing and extracting the target report data after the data processing to generate a data report. The Zabbix self-defined script and the automatic collection technology of the puppeter are combined, the limitation that a database of a target terminal cannot be accessed due to the existence of a fort machine is broken, the accuracy and the efficiency of data collection are improved under the condition that a third party is not required to access a machine or install an additional proxy machine, the state of a data collection process can be monitored, when the collection process is abnormal, a breakpoint is returned to continue collection, and the fault tolerance rate of the collection process is improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.

FIG. 1 is a schematic diagram of an application environment of a report automatic generation method according to an embodiment of the present invention;

FIG. 2 is a flowchart of an automatic report generation method according to an embodiment of the present invention;

FIG. 3 is another flowchart of a report automatic generation method according to an embodiment of the present invention;

FIG. 4 is another flowchart of a report automatic generation method according to an embodiment of the present invention;

FIG. 5 is another flowchart of a method for automatically generating reports according to an embodiment of the present invention;

FIG. 6 is a schematic block diagram of an automatic report generation apparatus according to an embodiment of the present invention;

FIG. 7 is another schematic block diagram of an automatic report generation apparatus according to an embodiment of the present invention;

FIG. 8 is another schematic block diagram of an automatic report generation apparatus according to an embodiment of the present invention;

FIG. 9 is another schematic block diagram of an automatic report generation apparatus according to an embodiment of the present invention;

FIG. 10 is a schematic diagram of a computer device according to an embodiment of the invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The report automatic generation method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. Specifically, the report automatic generation method is applied to a report automatic generation system, the report automatic generation system comprises a client, a server and a target terminal shown in fig. 1, the target terminal is communicated with the server through a network and used for solving the problem that an external machine cannot acquire data, the client is communicated with the server through the network, and the server sends the data to the client. The client is also called a user side, and refers to a program corresponding to the server and providing local services for the client. The client may be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers. The target terminal is an external terminal, data stored by the target terminal cannot be directly accessed through a client or a server, and the target terminal can be installed on but not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices.

In an embodiment, as shown in fig. 2, an automatic report generation method is provided, which is described by taking the example that the method is applied to the server in fig. 1, and includes the following steps:

s11: and responding to the first user operation to generate a report configuration file, wherein the report configuration file comprises a self-defined script address and a task type.

The first user operation is the operation of the terminal when the user fills in the report configuration file according to the configuration file template in the server. The report configuration file is a file of user-defined configuration parameters, and further, the report configuration file can comprise a data source type, a Zabbix account number and a corresponding password, a user-defined script address, a report view, a task type, a mail receiver, a mail transcriber, a generator and the like. The task types comprise a periodic task and a timing task, wherein the periodic task refers to a task executed according to a period, and the timing task refers to a task executed in a fixed time period.

Specifically, a user fills in a report configuration file according to a configuration file template in the server, parameters in the configuration file are set, and after the user fills in the report configuration file, the server stores the report configuration file in the database.

S12: and generating a custom script through Zabbix according to the custom script address, and collecting target report data from the target terminal by adopting the custom script.

Wherein Zabbix is an enterprise-level open source solution providing distributed system monitoring and network monitoring functions based on a WEB interface. The target terminal is a terminal for storing target report data, and the target terminal can be a personal computer, a notebook computer, a smart phone, a tablet computer or a portable wearable device. The target report data is data used to generate a data report.

The target report data is stored in the database of the target terminal, and due to the existence of the bastion machine, the server cannot directly access the database of the target terminal to collect the target report data, so that the target report data is collected from the target terminal by generating a custom script through Zabbix. Specifically, a user logs in the Zabbix according to a Zabbix account number and a password in a report configuration file, the user adds a custom script corresponding to a custom script address in the Zabbix according to the custom script address set in the report configuration file after logging in, and the server identifies the custom script in the Zabbix and collects target report data from a target terminal through the custom script.

S13: and carrying out data processing on the target report data, and displaying the processed target report data to a report page.

The data processing may be direct superposition or serialization of the target report data according to the order of the collected target report data. The report page is a page for displaying the target report data after the data processing.

Specifically, after a user-defined script generated by Zabbix accesses a database of the target terminal and target report data is collected from the database of the target terminal, the server directly superimposes or serializes the collected target report data according to the collection sequence to obtain report data to be copied, copies the report data to be copied, stores the copied target report data to be copied into a readable file of Zabbix, reads the readable file through Zabbix, and displays the read superimposed or serialized target report data to a report page.

S14: and after receiving the task triggering instruction, acquiring the processed target report data from the report page through the Puppteer.

The task triggering instruction is an instruction for triggering a collection event. Puppeter is a chrome operation library produced by Google officials, and can control chrome navigation pages, sending, receiving and positioning elements with higher fine granularity.

Specifically, the report configuration file comprises task types, wherein the task types comprise a timing task and a periodic task, according to the task type set in the report configuration file by a user, after the user manually starts a report generation task in a server, a prompt of 'timing task starting or periodic task starting' is output in a status bar of the server, after a collection event is triggered, namely after the server receives a task triggering instruction, a collection instance task is initialized in a memory of an operating system and maintained, the collection instance task accesses a report page through a puppeter, and target report data after data processing is collected from the report page.

The time when the server receives the task triggering instruction can be set in the report configuration file, and the server receives the task triggering instruction and can trigger at a certain fixed time point or periodically trigger at fixed time intervals after the report generation task is started. Because the instance task is not interrupted in the execution process, an abnormal point self-healing function is set in the abnormal part of the instance task, namely, the running state of the instance task is collected when the abnormality occurs is recorded, and the collection instance task returns to the abnormal breakpoint to continue collection after the abnormality occurs.

S15: and analyzing and extracting the processed target report data to generate a data report.

The data report is generated after analyzing and extracting the processed target report data.

Specifically, after the target report data after data processing is collected from the report page through the puppeter, the processed target report data is analyzed by the analyzer, and the analyzer can analyze all fields and contents in the processed target report data, classify, integrate and store all the fields and contents, and obtain the analyzed data. Generating a WEB page through an HTML generator corresponding to the analyzer according to the analyzed data; after the WEB page is generated, an extraction request is sent to the WEB page, after an extraction approval instruction is received, analyzed data are extracted from the WEB page according to a preset extraction method, and a data report is generated according to the extracted data.

The preset extraction method may be a method for locating any element in a WEB page, specifically, the element in the WEB page may include a response, a title, a tag element, and the like, and exemplarily, the preset extraction method may be that the tag element is located as an extracted element, after the WEB page is generated by an HTML generator corresponding to a parser according to the sorted and stored data, the data including the tag element is extracted from the WEB page, and then report data is generated according to the data including the tag element obtained by extraction.

In the embodiment, a report configuration file is generated by responding to the first user operation, wherein the report configuration file comprises a user-defined script address and a task type; generating a custom script through Zabbix according to the custom script address, and collecting target report data from a target terminal by adopting the custom script; performing data processing on the target report data, and displaying the target report data after the data processing into a report page; after receiving a task triggering instruction, acquiring processed target report data from a report page through a puppeter; and analyzing and extracting the processed target report data to generate a data report. The Zabbix self-defined script and the automatic collection technology of the puppeter are combined, the limitation that a database of a target terminal cannot be accessed due to the existence of a fort machine is broken, the accuracy and the efficiency of data collection are improved under the condition that a third party is not required to access a machine or install an additional proxy machine, the state of a data collection process can be monitored, when the collection process is abnormal, a breakpoint is returned to continue collection, and the fault tolerance rate of the collection process is improved.

In an embodiment, as shown in fig. 3, in step S13, the data processing is performed on the target report data, and the processed target report data is displayed in a report page, which specifically includes the following steps:

s131: and recombining the target report data to obtain first report data, and storing the first report data into a first file.

The target report data is re-integrated according to a certain format, and the certain format can be the data type of the target report data, the data length of the target report data, the sequence order of the target report data, or the like. The first report data is obtained by recombining the target report data. The first file is a file for storing first report data, and the first file is an unreadable file and is stored in a database of the server.

Specifically, after target report data are collected from a target terminal by using a custom script, the target report data are recombined, specifically, the target report data are directly overlapped or serialized according to the collection sequence to obtain first report data, and the first report data are stored in a first file.

S132: and copying the first file to obtain a second file, and storing the second file into a readable directory of Zabbix.

The second file is a file which can be accessed by other servers, terminals or systems and can be used for reading data, and the second file is stored in a readable directory of Zabbix.

Specifically, after directly overlaying or serializing target report data according to the collecting sequence to obtain first report data, storing the first report data in a server in a file form, copying the first file to obtain a second file, and storing the second file in a readable directory of Zabbix. Wherein the data in the first file and the second file are the same.

S133: and reading the second file through Zabbix, and displaying the data of the second file in a report page.

And the report page is a page for displaying the target report data after the data processing, namely a page for displaying the data of the second file.

Specifically, because the second file is stored in a readable directory of Zabbix, Zabbix can access and read the second file, read data in the second file through Zabbix, where the data is the first report data, and display the data in the report page after reading the data in the second file.

In the embodiment, the target report data is recombined to obtain first report data, and the first report data is stored in a first file; copying the first file to obtain a second file, and storing the second file into a readable directory of Zabbix; and reading a second file in the readable file through Zabbix, and displaying the data of the second file in a report page. Due to the existence of the bastion machine, the server cannot directly access the database of the target terminal to collect the target report data. In Zabbix, a first file is copied, a second file obtained by copying is stored in a readable directory, the limitation of a bastion machine on access data is broken by copying the file while the safety of original data is guaranteed, and the second file is displayed in a report page, so that target report data is displayed more clearly and accurately, the subsequent acquisition of the target report data is facilitated, and the convenience of data acquisition is improved.

In an embodiment, as shown in fig. 4, the report configuration file further includes an HTML generator, in step S15, the analyzing and extracting the processed target report data to generate the data report specifically includes the following steps:

s151: and analyzing the processed target report data by using an analyzer to obtain analyzed data.

The parser is used for parsing the processed target report data, the parser may be a MySQL query result parser, a PostgreSQL parser, a Redis parser, or the like, and the parsed data is data obtained by parsing the processed target report data through the parser.

Illustratively, the processed target report data is analyzed by using a MySQL query result analyzer, specifically, the processed target report data is queried by the analyzer to obtain a MySQL query result, and the MySQL query result is analyzed by the analyzer to obtain analyzed data.

The MySQL query result may be a table with m rows and n columns, data in the table is processed target report data, and the parsing of the MySQL query result by the parser may be other parsing manners such as splicing, splitting, filtering, shielding or combining the data in the MySQL query result.

S152: and generating a WEB page through an HTML generator corresponding to the analyzer according to the analyzed data.

The HTML generator is used for generating a WEB page and is matched with the parser in the report configuration file. The WEB page is a page generated by an HTML generator matched with the analyzer according to the analyzed data, and the page displays the analyzed data.

Specifically, after the target report data processed by the data processing is analyzed by the analyzer to obtain the analyzed data, a WEB page is generated by an HTML generator corresponding to the analyzer according to the analyzed data, and the analyzed data is displayed on the WEB page.

Exemplarily, in step S152, the parser adopts a MySQL query result parser, parses the processed target report data to obtain parsed data, where the parsed data is displayed in a table form, and a WEB page is generated by an HTML generator corresponding to the MySQL query result parser, so that the parsed data is displayed on the WEB page in a table form, and a table of the parsed data can be rendered as a color table on the WEB page.

S153: and sending an extraction request to the WEB page, and extracting the analyzed data from the WEB page according to a preset extraction method to obtain extracted data.

The extraction request is a request for extracting analyzed data from a WEB page. The preset extraction method may be to locate any element in the WEB page, and for example, the element in the WEB page may include a response, a title, or a tag element. And the extracted data is extracted from the analyzed data in the WEB page according to a preset extraction method.

Specifically, after a WEB page is generated through an HTML generator corresponding to the parser according to parsed data, an extraction request is sent to the WEB page, and after an extraction approval instruction is received, data is extracted from the WEB page according to a preset extraction method to obtain extracted data.

Illustratively, the WEB page includes response, title, and tag elements, in a specific implementation method, the preset extraction method may be to locate the tag element as an extracted element, and after generating the WEB page through an HTML generator corresponding to the parser according to the sorted and stored data, send an extraction request to the WEB page, and extract data including the tag element in the parsed data from the WEB page.

S154: and generating a data report according to the extracted data.

The data report is generated according to the extracted data, and the data report can be a webpage report or a data table.

Specifically, after the analyzed data is extracted from the WEB page according to a preset extraction method to obtain extracted data, a data report is generated according to the extracted data. Illustratively, according to the extracted data, a data report is generated through an HTML generator corresponding to the parser, and then the data report is a web page report.

In the embodiment, the processed target report data is analyzed by the analyzer to obtain analyzed data; generating a WEB page through an HTML generator corresponding to the analyzer according to the analyzed data; sending an extraction request to a WEB page, and extracting the analyzed data from the WEB page according to a preset extraction method to obtain extracted data; and generating a data report according to the extracted data. The target report data after the data processing is analyzed through the analyzer, the target report data after the data processing can be integrated, the effectiveness of data extraction in the subsequent steps is improved, a WEB page is generated through an HTML generator corresponding to the analyzer, the WEB page can be rendered into a color table, the data can be displayed more visually, and the data display is clearer and clearer.

In an embodiment, as shown in fig. 5, the report configuration file further includes a receiving mailbox and a copying mailbox, and after the processed target report data is analyzed and extracted and a data report is generated, the automatic report generation method further includes:

s16: and judging the execution state of the task type.

Wherein the execution state is the running state of the task type.

Specifically, when a task of a task type starts to be executed, the server monitors the execution state of the task type, determines the execution state of the task type, and determines whether the task type is executed incorrectly.

S17: if the execution state is the first state, whether the data report meets the preset requirement is judged, and the first state indicates that no error occurs in the task type execution process.

The first state is a state that the task in the task type is executed without error in the execution process. The preset requirements indicate that the data of the data report is error free.

Specifically, in the process of executing a periodic task or a timing task in the task type, whether the state in the task executing process is a correct state or an incorrect state is judged, and if the state in the task executing process is the correct state, whether the data report meets the preset requirement is judged; if the state in the task execution process is an error state, the specific condition of the error state is corrected without judging whether the data report meets the preset requirement. The error state may be: the method comprises the following steps of network connection error, failure in accessing a report page or WEB page, empty acquired target report data, format error of acquired target report data or error in an analysis process and the like.

S18: and if the data report meets the preset requirement, sending the data report to a receiving mailbox and a copying mailbox in a mail form.

The report configuration file further comprises a receiving mailbox and a copying mailbox. The receiving mailbox is the mailbox address of the receiver. The copy mailbox is the mailbox address of the copy person. The preset requirements indicate that the data of the data report is error free.

Specifically, after the execution state is judged to be the first state, whether the data report meets the preset requirement is judged, and if the data report meets the preset requirement, namely the data of the data report has no error, the data report is sent to a receiving mailbox and a copying mailbox in a mail form. The data report meets the preset requirement, namely the data report has no error. The condition that the data report does not meet the preset requirement may include that the data in the data report is empty, the format in the data report is wrong, or an error occurs in the data report generation process, etc.

Further, a boolean variable may be set, and whether the data report meets preset requirements, that is, whether to send the data report to a receiving mailbox or a copying mailbox in the form of mail, is determined according to the value of the boolean variable. If the boolean variable is ismail shouldbesent, if the data report does not meet the preset requirement, the value returned by ismail shouldbesent is false, that is, the step of sending the data report to a receiving mailbox and a copying mailbox in the form of mail is not executed.

Further, in the present embodiment, the method of sending a mail does not use a designated mail account as a mailbox of the sender, but sends the mail by directly calling the method of Outlook. The method for calling Outlook can not only automatically send the mail to the receiving mailbox and the copying mailbox, but also receive the mail, automatically reply and process the mail meeting the conditions, automatically write the draft of the mail, automatically modify the signature, automatically identify the content of the alarm mail, process the alarm mail and store the mail in batch.

In the embodiment, the execution state of the task type is judged; if the execution state is the first state, judging whether the data report meets the preset requirement, wherein the first state indicates that no error occurs in the task type execution process; and if the data report meets the preset requirement, sending the data report to a receiving mailbox and a copying mailbox in a mail form. By judging whether the execution state of the task type and the data report meet the preset requirements or not, the data of the data report can meet the requirements, the accuracy of the data report is improved, the mail can be sent more efficiently by directly calling an Outlook method, the flexibility of sending the mail is improved, a third-party mail account, namely a sender mail account, is not needed, and the existing account can be efficiently utilized while the mail service cost is saved.

In an embodiment, after collecting target report data by using the custom script, the method for automatically generating a report further includes:

receiving task type information;

if the task type information indicates that the task type is a periodic task, setting the interval of a timer to be periodic millisecond number, wherein the periodic millisecond number is periodic time, and the time unit is millisecond;

and if the task type information indicates that the task type is a timing task, setting the interval of a timer to be a fixed millisecond number, wherein the fixed millisecond number is a fixed time period, and the time unit is millisecond.

The task type comprises a periodic task and a timing task, and if the set task type is the periodic task, the interval of a timer of the task type is set to be a periodic millisecond number; if the set task type is a timed task, the interval of the timer of the task type will be set to a fixed number of milliseconds. Further, in the process of executing the task, as the acquired data in the executed task is less and less, the configuration of the interval parameter of the task type can be changed in the report configuration file, and the method for changing the configuration can be used for directly carrying out assignment change on the set interval parameter.

In an embodiment, the method for automatically generating the report further includes the following steps:

and executing a minimization operation, wherein the minimization operation indicates that the task of the task type runs in the background.

During the process of executing the task, the execution of the window for executing the task can be minimized, and an icon is kept in the taskbar, wherein the minimization refers to the execution of the task type in the background.

And after the data report is successfully sent to the receiving mailbox and the copying mailbox, triggering a task completion prompt.

Wherein the task completion prompts a result of task execution.

When the data report is successfully sent to a receiving mailbox and a copying mailbox in the form of mails, a task completion prompt is triggered, and the task completion prompt indicates that the task is completed.

Specifically, after the datagram table is successfully sent in the form of an email, the completion of the task execution can be notified in a pop-up window manner, and the task completion prompt can be a voice prompt, an interface text display prompt, an interface animation prompt or other effective prompt manners.

In this embodiment, by performing minimization, the task indicating the task type is run in the background; and triggering a task completion prompt after the data report is successfully sent in the form of the mail. By the method, the task can be continuously executed, the screen display position is not occupied in the task execution process, and the task completion prompt can be triggered after the task is executed.

It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

In an embodiment, an automatic report generation device is provided, and the automatic report generation device corresponds to the automatic report generation method in the embodiment one to one. As shown in fig. 6, the report automatic generation apparatus includes a response operation module 11, a first collection module 12, a first display module 13, a second collection module 14, and a report generation module 15. The functional modules are explained in detail as follows:

and the response operation module 11 is configured to respond to the first user operation, and generate a report configuration file, where the report configuration file includes a custom script address and a task type.

And the first acquisition module 12 is configured to generate a custom script through Zabbix according to the custom script address, and acquire target report data from a target terminal by using the custom script.

And the first display module 13 is configured to perform data processing on the target report data, and display the processed target report data in a report page.

And the second acquisition module 14 is configured to acquire the processed target report data from the report page through a puppeter after receiving the task triggering instruction.

And the first report generation module 15 is configured to analyze and extract the processed target report data to generate a data report.

Preferably, as shown in fig. 7, the first display module 13 further includes:

the data reorganization module 131 is configured to reorganize the target report data to obtain first report data, and store the first report data in a first file.

The file copying module 132 is configured to copy the first file to obtain a second file, and store the second file in a readable directory of Zabbix.

The second display module 133 is configured to read the second file through Zabbix, and display data of the second file in a report page.

Preferably, as shown in fig. 8, the report generating module 15 includes:

and the data analysis module 151 is configured to analyze the processed target report data by using an analyzer to obtain analyzed data.

And a page generating module 152, configured to generate a WEB page through an HTML generator corresponding to the parser according to the parsed data.

The data extraction module 153 is configured to send an extraction request to the WEB page, and extract the parsed data from the WEB page according to a preset extraction method to obtain extracted data.

And a second report generating module 154, configured to generate a data report according to the extracted data.

Preferably, as shown in fig. 9, the report automatic generation apparatus further includes:

and a state judgment module 16, configured to judge an execution state of the task type.

And the data judgment module 17 is configured to judge whether the data report meets a preset requirement if the execution state is a first state, where the first state indicates that no error occurs in the task type execution process.

And the mail sending module 18 is used for sending the data report to the receiving mailbox and the copying mailbox in a mail form if the data report meets the preset requirement.

Preferably, the report automatic generation device further includes:

and the information receiving module is used for receiving the task type information.

And the first setting module is used for setting the interval of the timer to be a cycle millisecond number if the task type information indicates that the task type is a cycle task, wherein the cycle millisecond number is cycle time, and the time unit is millisecond.

And the second setting module is used for setting the interval of the timer to be a fixed millisecond number if the task type information indicates that the task type is a timing task, wherein the fixed millisecond number is a fixed time period, and the time unit is a millisecond.

Preferably, the report automatic generation device further includes:

a minimization module to perform a minimization operation, the minimization operation indicating that the task of the task type is running in the background.

And the task completion prompting module is used for triggering task completion prompting after the data report is successfully sent to the receiving mailbox and the copying mailbox.

For specific limitations of the report automatic generation apparatus, reference may be made to the above limitations of the report automatic generation method, which is not described herein again. All modules in the report automatic generation device can be completely or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the data used in the report automatic generation method in the embodiment. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an automatic report generation method.

In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the automatic report generation method in the above embodiments is implemented.

In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the report automatic generation method in the above embodiments.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:报单保存管理方法及其系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!