Report document automatic generation method and system

CN122840001APending Publication Date: 2026-09-29NORTHWEST ENGINEERING CORPORATION LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611313216.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

当报告涉及大量监测资源和书签时,对照关系的建立、录入和更新工作量较大,容易出现漏配或错配,导致图表、表格或分析文字与所在章节的监测对象不一致

Benefits of technology

根据本示例实施例中的报告文档自动生成方法,一方面,通过按照预设书签生成规则对目标监测资源的资源名称进行名称规范化处理,得到符合预设书签命名规范的书签名称,使原本包含不规范字符、以数字开头或者不满足书签命名要求的资源名称能够转换为可用于文档模板的书签名称;同时,在报告生成阶段对书签名称进行名称净化处理,并按照预设匹配名称生成规则处理监测资源列表中的各个资源名称,使待匹配名称与比对名称具有统一的比较格式。因此,无需在文档模板之外人工建立和维护书签名称与资源名称之间的对照关系,能够减少人工录入和维护过程中产生的错配、漏配问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122840001A_ABST
    Figure CN122840001A_ABST
Patent Text Reader

Abstract

The present disclosure provides a report document automatic generation method and system, and relates to the technical field of data processing. The method comprises the following steps: obtaining a document template and a monitoring resource list, determining a target monitoring resource in response to a resource selection operation; performing standardized processing on the resource name of the target monitoring resource according to a preset rule, and inserting a corresponding bookmark at a target insertion position of the document template; in response to a report generation instruction, traversing the bookmarks in the document template, obtaining the bookmark name and the position range, purifying the bookmark name to obtain a to-be-matched name, and processing each resource name according to a preset matching name generation rule to obtain a comparison name; matching the to-be-matched name with the comparison name to establish an association relationship between the bookmark and the monitoring resource; obtaining the resource content of the associated monitoring resource according to the start and end times of the report period; determining a target insertion engine according to the resource type, replacing the original content in the position range with the resource content through the target insertion engine, and obtaining a report document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more specifically, to a method and system for automatically generating report documents. Background Technology

[0002] In the field of hydropower station safety monitoring, it is necessary to regularly analyze monitoring data on deformation, seepage, stress, and strain of hydraulic structures such as dams, slopes, underground powerhouses, and spillway structures, and to prepare monthly, quarterly, and annual data analysis reports. These reports typically include monitoring process diagrams, statistical tables of monitoring data, and monitoring analysis text, with each section organized into predetermined chapters within the report document.

[0003] Related technologies typically reserve bookmarks or other placeholders in each chapter of the document template, and then use the names of the placeholders to find the corresponding monitoring resources before filling in the content of the retrieved resources in the appropriate locations. However, bookmark names must meet naming conventions such as not starting with numbers, not containing specific characters, and having length restrictions. Monitoring resource names are usually formed by combining the engineering location, instrument type, and measuring point number, and are prone to containing separators, spaces, or starting with numbers, making them difficult to use directly as bookmark names.

[0004] To establish the correspondence between bookmarks and monitoring resources, it is usually necessary to manually redraft bookmark names and maintain the correspondence between bookmark names and resource names outside of the document template. When the report involves a large number of monitoring resources and bookmarks, the workload of establishing, entering, and updating the correspondence is significant, and mismatches or omissions are prone to occur, resulting in inconsistencies between charts, tables, or analytical text and the monitoring objects in the relevant chapters. In addition, after changes in the reporting cycle or adjustments to the document template, it is necessary to re-verify the correspondence between bookmarks and monitoring resources and query and populate resource content item by item, resulting in a large number of repetitive operations in the report generation process, affecting the efficiency and accuracy of report document generation. Summary of the Invention

[0005] The purpose of this disclosure is to provide a method, system, electronic device, and computer-readable storage medium for automatically generating report documents. This method can establish a relationship between bookmarks and monitored resources by processing resource names and bookmark names, and obtain resource content according to the reporting cycle and fill the resource content into the corresponding location range by selecting a target insertion engine according to the resource type. This improves the efficiency and accuracy of report document generation.

[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.

[0007] According to a first aspect of the present disclosure, a method for automatically generating report documents is provided, comprising: acquiring a document template and a list of monitoring resources, and in response to a selection operation on at least one monitoring resource in the list of monitoring resources, determining at least one target monitoring resource; for each target monitoring resource, performing name normalization processing on the resource name of the target monitoring resource according to a preset bookmark generation rule to obtain a bookmark name that conforms to a preset bookmark naming specification, and inserting a bookmark named with the bookmark name at a target insertion position in the document template; in response to a report generation instruction, traversing each bookmark in the document template to obtain the bookmark name and corresponding position range of each bookmark; and renaming the bookmark name of each bookmark. The process involves purification to obtain names to be matched, and processing each resource name in the monitoring resource list according to a preset matching name generation rule to obtain the comparison name corresponding to each monitoring resource. The names to be matched for each bookmark are then matched with the comparison names corresponding to each monitoring resource, and the successfully matched monitoring resources are identified as the monitoring resources associated with the bookmarks. Based on the start and end times of the reporting period, the resource content corresponding to each bookmark is obtained. Based on the resource type of each bookmark, the target insertion engine corresponding to each bookmark is determined, and the original content within the corresponding location range is replaced with the resource content using the target insertion engine to obtain the report document.

[0008] In some embodiments of this disclosure, the preset bookmark generation rules include: deleting preset illegal characters from the resource name of the target monitored resource to obtain a cleaned name; filling the end of the cleaned name with preset padding characters until the length of the cleaned name reaches a preset length; and when the first character of the cleaned name is a number, replacing the first character with a Chinese numeral corresponding to the first character to obtain the bookmark name.

[0009] In some embodiments of this disclosure, the preset bookmark generation rule further includes: when there is a prior bookmark with the same name as the bookmark in the document template, updating the fill character of the preset identifier in the bookmark name to a duplicate name identifier generated in a preset order, until the updated bookmark name is different from the bookmark names of all prior bookmarks in the document template; when the duplicate name identifiers generated in the preset order reach a preset upper limit, and there is still a prior bookmark with the same name as the updated bookmark in the document template, outputting a bookmark insertion error message.

[0010] In some embodiments of this disclosure, the step of performing name purification processing on the bookmark names of each bookmark to obtain the name to be matched includes: when there is a duplicate name identifier in the preset identifier position of each bookmark name, deleting the duplicate name identifier, and continuously deleting the fill characters from the end of the bookmark name after deleting the duplicate name identifier to obtain the name to be matched corresponding to each bookmark; The resource names in the monitoring resource list are processed according to the preset matching name generation rules to obtain the comparison name corresponding to each monitoring resource. This includes: standardizing the resource names of each monitoring resource by deleting preset illegal characters, filling in preset filler characters, and replacing the first character to obtain a standardized name; and continuously deleting the filler characters from the end of the standardized name to obtain the comparison name corresponding to each monitoring resource.

[0011] In some embodiments of this disclosure, the step of traversing each bookmark in the document template to obtain the bookmark name and corresponding position range of each bookmark includes: obtaining a bookmark set of the document template; traversing the bookmark set and reading the name attribute, start position attribute and end position attribute of each bookmark; and determining the position range corresponding to each bookmark based on the start position attribute and end position attribute of each bookmark.

[0012] In some embodiments of this disclosure, obtaining the resource content corresponding to the monitoring resources associated with each bookmark based on the start and end times of the reporting period includes: converting the start date and end date of the reporting period into timestamps; sending a resource acquisition request to the server for each bookmark, the resource acquisition request carrying the timestamp corresponding to the start date, the timestamp corresponding to the end date, and the resource identifier of the monitoring resource associated with the bookmark; and receiving the resource content queried and returned by the server based on the resource identifier and the two timestamps.

[0013] In some embodiments of this disclosure, the automatic report document generation method further includes: when no monitoring resource associated with any of the bookmarks is determined from the monitoring resource list, recording the bookmark name and corresponding location range of the bookmark to the alarm list; and outputting the alarm list after obtaining the report document.

[0014] In some embodiments of this disclosure, the automatic report document generation method further includes: when the resource acquisition request times out, resending the resource acquisition request; and if the resource content is still not received after a preset number of resending attempts, recording the resource identifier and the location range of the corresponding bookmark carried in the resource acquisition request to the alarm list, and continuing to acquire the resource content corresponding to the next bookmark; and when the received resource content does not conform to the content format corresponding to the resource type of the monitoring resource associated with the corresponding bookmark, recording the resource identifier of the corresponding monitoring resource and the location range of the corresponding bookmark to the alarm list, and continuing to acquire the resource content corresponding to the next bookmark.

[0015] In some embodiments of this disclosure, the resource types include image types, table types, and text types; determining the target insertion engine corresponding to each bookmark based on the resource type of the monitoring resource associated with each bookmark includes: when the resource type of the monitoring resource associated with the bookmark is the image type, determining the image insertion engine as the target insertion engine corresponding to the bookmark; when the resource type of the monitoring resource associated with the bookmark is the table type, determining the table insertion engine as the target insertion engine corresponding to the bookmark; and when the resource type of the monitoring resource associated with the bookmark is the text type, determining the text insertion engine as the target insertion engine corresponding to the bookmark.

[0016] In some embodiments of this disclosure, the resource content includes markup language strings; when the target insertion engine is the image insertion engine, the markup language strings are parsed to obtain image tags, image encoding data is extracted from the source attribute values ​​of the image tags, the image encoding data is decoded to obtain image data, and the image data is inserted into the position range of the corresponding bookmark; when the target insertion engine is the table insertion engine, the markup language strings are parsed to obtain table tags, a table is created in the position range of the corresponding bookmark according to the number of row nodes and cell nodes in the table tags, the text content in each of the cell nodes is filled into the corresponding cell in the created table, and a preset table format is applied to the created table; when the target insertion engine is the text insertion engine, the resource content is written into the position range of the corresponding bookmark, and a preset paragraph format is applied to the paragraph in the position range.

[0017] In some embodiments of this disclosure, obtaining the monitoring resource list and determining the at least one target monitoring resource includes: sending a resource classification request carrying an authentication token and a project identifier to a server; receiving a monitoring resource list returned by the server, wherein the monitoring resources in the monitoring resource list are classified in two levels according to engineering location and instrument type; displaying the monitoring resource list in a tree structure according to the two-level classification; and determining the selected monitoring resource as the target monitoring resource in response to a selection operation of at least one monitoring resource in the tree structure.

[0018] In some embodiments of this disclosure, the automatic report document generation method further includes: when inserting a bookmark named with the bookmark name into the document template, associating the resource identifier and resource type of the target monitored resource with the bookmark and storing them in the metadata of the bookmark; responding to a resource tracing instruction carrying the target resource identifier, traversing the metadata of each bookmark in the document template; determining the location range corresponding to each bookmark whose resource identifier stored in the metadata matches the target resource identifier as the resource reference location corresponding to the target resource identifier, and outputting the resource reference location.

[0019] In some embodiments of this disclosure, the automatic report document generation method further includes: after replacing the original content in the corresponding position range with the resource content through the target insertion engine, retaining or re-establishing the bookmark in the position range corresponding to the replaced resource content, and retaining the metadata of the bookmark; in response to the refresh instruction of the report document, re-acquiring the resource content corresponding to the monitoring resources associated with each bookmark according to the start and end time of the updated report period, and replacing the current content in the position range corresponding to each bookmark with the re-acquired resource content through the target insertion engine corresponding to each bookmark.

[0020] According to a second aspect of the present disclosure, an automatic report document generation system is provided. The system includes a client and a server, the client communicating with the server via a Hypertext Transfer Protocol (HTTP). The client includes a name normalization module, a bookmark creation module, a bookmark scanning module, a resource matching module, a content acquisition module, and a report generation module. The name normalization module is used to normalize input names according to preset bookmark generation rules to obtain output names conforming to preset bookmark naming conventions. The bookmark creation module is used to acquire a document template and a list of monitoring resources, and in response to a selection operation of at least one monitoring resource in the list, determine at least one target monitoring resource, call the name normalization module to obtain bookmark names using the resource names of each target monitoring resource, and insert bookmarks named with the bookmark names at target insertion positions in the document template. The bookmark scanning module is used to, in response to a report generation instruction, traverse each bookmark in the document template to obtain the bookmark names and corresponding position ranges of each bookmark. The resource matching module is used to perform name purification processing on the bookmark names of each bookmark to obtain names to be matched, and then use the bookmark names from the list of monitoring resources to obtain the matching names. The system calls the name normalization module to obtain the comparison name corresponding to each monitoring resource, matches each name to be matched with each comparison name, and identifies the monitoring resource that is successfully matched as the monitoring resource associated with the bookmark. The content acquisition module converts the start date and end date of the report period into timestamps and sends a resource acquisition request to the server for each bookmark. The resource acquisition request carries two timestamps and the resource identifier of the monitoring resource associated with the bookmark. The report generation module determines the target insertion engine corresponding to each bookmark based on the resource type of the monitoring resource associated with each bookmark, and replaces the original content in the corresponding position range with the resource content returned by the server through the target insertion engine to obtain a report document. The server responds to the resource acquisition request, determines the corresponding data query conditions based on the resource identifier carried in the resource acquisition request, queries the monitoring data corresponding to the resource identifier according to the two timestamps, generates the monitoring data as resource content according to the resource type corresponding to the resource identifier, and returns the resource content to the client.

[0021] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing computer-readable instructions that, when executed by the processor, implement the report document automatic generation method as described in the first aspect.

[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the report document automatic generation method as described in the first aspect.

[0023] The technical solutions provided in this disclosure may have the following beneficial effects: According to the automatic report document generation method in this example embodiment, on the one hand, the resource names of the target monitored resources are normalized according to preset bookmark generation rules to obtain bookmark names that conform to preset bookmark naming specifications. This allows resource names that originally contained non-standard characters, started with numbers, or did not meet bookmark naming requirements to be converted into bookmark names that can be used in document templates. Simultaneously, during the report generation stage, the bookmark names are cleaned up, and each resource name in the monitored resource list is processed according to preset matching name generation rules, ensuring that the names to be matched and the comparison names have a unified comparison format. Therefore, there is no need to manually establish and maintain the correspondence between bookmark names and resource names outside of document templates, which can reduce mismatch and omission problems caused during manual input and maintenance.

[0024] On the other hand, by traversing each bookmark in the document template in response to report generation instructions, the bookmark name and corresponding location range of each bookmark are obtained. Based on the matching results between the name to be matched and the comparison name, the association between the bookmark and the monitored resource is established. This allows each content location in the document template to automatically determine the corresponding monitored resource based on the name processing results. Therefore, when a chapter or bookmark in the document template changes, bookmark identification and resource matching can be re-completed based on the current document template, reducing the need for item-by-item verification of the correspondence between bookmarks and monitored resources, and lowering the probability of resource content being entered into the wrong chapter or omitted.

[0025] On the other hand, by obtaining the resource content corresponding to the monitoring resources associated with each bookmark based on the start and end time of the reporting cycle, the same document template can obtain the resource content for the corresponding time period according to different reporting cycles. This avoids modifying the data query period or reorganizing the monitoring data item by item when switching between monthly, quarterly or annual reports, thereby reducing repeated queries and manual filling operations under different reporting cycles.

[0026] Furthermore, by determining the corresponding target insertion engine based on the resource type of the monitored resource, and using the target insertion engine to replace the resource content in the corresponding bookmark location range, resource content of different resource types can be filled into the predetermined position according to their respective applicable processing methods. This reduces content type errors and positional deviations caused by manual copying, pasting, and adjustment. Therefore, it has the advantage of improving the efficiency and accuracy of report document generation.

[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0029] Figure 1 The illustration shows a flowchart of a method for automatically generating report documents according to some embodiments of the present disclosure.

[0030] Figure 2 The illustration shows a schematic diagram of a document bookmark list display interface according to some embodiments of the present disclosure.

[0031] Figure 3 The illustration shows a schematic diagram of the report cycle selection and report generation interface according to some embodiments of the present disclosure.

[0032] Figure 4 The diagram illustrates a client login and function operation interface according to some embodiments of the present disclosure.

[0033] Figure 5 A schematic diagram of a monitoring resource list interface according to some embodiments of the present disclosure is shown.

[0034] Figure 6 The illustration shows a schematic diagram of the structure of a report document automatic generation system according to some embodiments of the present disclosure.

[0035] Figure 7 The schematic diagram illustrates the structural schematic of a computer system of an electronic device according to some embodiments of the present disclosure.

[0036] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of systems and methods consistent with some aspects of this specification as detailed in the appended claims.

[0038] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0039] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0040] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, systems, steps, etc., can be employed. In other instances, well-known methods, systems, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0041] Furthermore, the accompanying drawings are for illustrative purposes only and are not necessarily drawn to scale. The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0042] In the field of hydropower station safety monitoring, it is necessary to regularly analyze monitoring data on deformation, seepage, stress, and strain of hydraulic structures such as dams, slopes, underground powerhouses, and spillway structures, and compile monthly, quarterly, and annual data analysis reports based on this data. These reports typically include monitoring process diagrams, statistical tables of monitoring data, and textual analysis, with each section organized into predetermined chapters within the report document. As the number of monitoring points increases, the number of monitoring resources and content insertion points in the report also increases, making the report compilation process quite complex.

[0043] Related technologies typically employ document templates with pre-defined report formats and placeholders such as bookmarks in each chapter. When generating the report, the corresponding monitoring resource is located based on the name of the placeholder, and the retrieved charts, tables, or text are then filled into the appropriate positions. However, bookmark names are usually limited by naming conventions such as the first character, special characters, and name length. Monitoring resource names are generally formed by combining information such as the engineering location, instrument type, and measuring point number, and are prone to containing separators, spaces, or starting with numbers, making them difficult to use directly as bookmark names.

[0044] To establish the correspondence between bookmarks and monitoring resources, the relevant technologies typically require manual revision of bookmark names and maintenance of the mapping relationship between bookmark names, resource names, and resource identifiers outside of document templates. When reports involve a large number of monitoring resources and bookmarks, the workload of establishing, entering, and updating the mapping relationship is substantial, and mismatches or omissions are prone to occur, leading to inconsistencies between monitoring process diagrams, monitoring data statistical tables, or monitoring analysis text and the monitoring objects in the respective chapters.

[0045] Furthermore, when the reporting cycle changes or the chapters and bookmarks in the document template are adjusted, it is usually necessary to re-verify the correspondence between bookmarks and monitoring resources, and then query and populate the resource content item by item according to the new reporting cycle. Different types of resource content also require different processing and insertion methods, further increasing the amount of manual work. Therefore, the report generation process in related technologies suffers from problems such as repetitive operations, easy mismatch between bookmarks and monitoring resources, and inaccurate placement of resource content, affecting the efficiency and accuracy of report document generation.

[0046] To address all or part of the technical problems in the aforementioned related technologies, this disclosure provides an example embodiment of a method for automatically generating report documents. This method can be implemented by a report document automatic generation system. Figure 1 The schematic diagram illustrates a flowchart of a method for automatically generating report documents according to some embodiments of the present disclosure. References Figure 1 As shown, the method for automatically generating this report document may include the following steps: Step S110: Obtain the document template and the list of monitoring resources, and in response to the selection operation of at least one monitoring resource in the list of monitoring resources, determine at least one target monitoring resource; Step S120: For each target monitoring resource, the resource name of the target monitoring resource is normalized according to the preset bookmark generation rules to obtain a bookmark name that conforms to the preset bookmark naming rules, and a bookmark named with the bookmark name is inserted at the target insertion position in the document template. Step S130: In response to the report generation instruction, traverse each bookmark in the document template and obtain the bookmark name and corresponding position range of each bookmark; Step S140: Perform name purification on the bookmark name of each bookmark to obtain the name to be matched, and process each resource name in the monitoring resource list according to the preset matching name generation rules to obtain the comparison name corresponding to each monitoring resource. Step S150: Match the name to be matched for each bookmark with the comparison name for each monitoring resource, and determine the monitoring resource that is successfully matched as the monitoring resource associated with the bookmark. Step S160: Based on the start and end times of the reporting period, obtain the resource content corresponding to the monitoring resources associated with each bookmark; Step S170: Based on the resource type of the monitored resources associated with each bookmark, determine the target insertion engine corresponding to each bookmark, and replace the original content in the corresponding location range with the resource content through the target insertion engine to obtain the report document.

[0047] According to the automatic report document generation method in this example embodiment, on the one hand, the resource names of the target monitoring resources are normalized according to preset bookmark generation rules to obtain bookmark names that conform to preset bookmark naming specifications. During the report generation stage, the bookmark names are cleaned and processed according to preset matching name generation rules, ensuring a unified comparison format between the names to be matched and the comparison names. This eliminates the need for manual maintenance of the correspondence between bookmark names and resource names, reducing mismatches and omissions. On the other hand, by traversing each bookmark in the document template, bookmark names and corresponding location ranges are obtained. The association between bookmarks and monitoring resources is established based on the matching results of the names to be matched and the comparison names, enabling each location range to automatically determine the corresponding monitoring resource, thereby reducing item-by-item verification operations and errors or omissions in resource content. Furthermore, by obtaining resource content based on the start and end times of the reporting period, the same document template can adapt to different reporting periods, reducing repeated queries and manual data entry. Furthermore, by determining the target insertion engine based on the resource type and replacing the resource content with the corresponding location range, resource content of different resource types can be filled into the predetermined location in the appropriate way, thereby reducing content type errors and location deviations, and improving the efficiency and accuracy of report document generation.

[0048] The automatic report document generation method in this example embodiment will be further explained below.

[0049] Step S110: Obtain the document template and the list of monitoring resources, and in response to the selection operation of at least one monitoring resource in the list of monitoring resources, determine at least one target monitoring resource.

[0050] The document template can represent a document with a pre-set report chapter structure, document format, and content insertion positions. For example, the document template can be a monthly, quarterly, or annual report template for hydropower station safety monitoring. The monitoring resource list can represent a resource set consisting of multiple candidate monitoring resources. For example, the monitoring resource list can include monitoring resources corresponding to monitoring objects such as dam deformation, seepage, or stress-strain. The target monitoring resource can represent the monitoring resource selected from the monitoring resource list that needs to be written into the document template.

[0051] Specifically, the document template used for the report to be generated can be loaded, and a list of available monitoring resources can be obtained. After detecting a selection operation on at least one monitoring resource, the selected monitoring resource is determined as the target monitoring resource. This limits the monitoring resources that need to be processed in this report document, reducing the processing of irrelevant monitoring resources.

[0052] Step S120: For each target monitoring resource, the resource name of the target monitoring resource is normalized according to the preset bookmark generation rules to obtain a bookmark name that conforms to the preset bookmark naming specifications, and a bookmark named with the bookmark name is inserted at the target insertion position in the document template.

[0053] The preset bookmark generation rules represent the processing rules for converting resource names into bookmark names that conform to preset bookmark naming specifications. For example, a resource name can be a name formed by combining the engineering part, monitoring object, and measurement point number. Name normalization processing can represent adjusting the name format of the resource name according to the preset bookmark generation rules. A bookmark can represent a positioning object set in the document template to identify the insertion position of resource content. The target insertion position can represent the bookmark insertion position in the document template determined by the current cursor position or the document area selected by the cursor. For example, the cursor can be moved to a reserved chart, table, or text insertion area in a monitoring and analysis section of the document template, and the cursor position or the document area selected by the cursor can be determined as the target insertion position.

[0054] Specifically, the resource names of each target monitoring resource can be obtained separately, and the resource names can be normalized according to preset bookmark generation rules. After determining the bookmark name, the current position of the cursor in the document template or the document area selected by the cursor is obtained and used as the target insertion position. A bookmark named with the corresponding bookmark name is then inserted at the target insertion position. In this way, the insertion position of the resource content can be flexibly determined according to the actual layout needs of the document template, providing a positioning basis for subsequent resource matching and resource content insertion.

[0055] Step S130: In response to the report generation instruction, traverse each bookmark in the document template and obtain the bookmark name and corresponding position range of each bookmark.

[0056] The report generation instruction can represent an instruction used to trigger the report document generation process. For example, the report generation instruction can be generated by a trigger operation targeting the report generation function. The location range can represent the document area defined by the bookmark in the document template; for example, the location range can be a reserved paragraph or a reserved content area where the bookmark is located.

[0057] Specifically, upon receiving the report generation instruction, the system can sequentially access each bookmark in the document template according to a preset traversal order, and obtain the bookmark name and corresponding location range of each bookmark. Furthermore, the bookmark name and location range of each bookmark can be recorded for subsequent name matching and resource content insertion. This allows for the automatic identification of bookmarks in the document template and their locations, reducing manual searching and locating operations.

[0058] Step S140: Perform name purification processing on the bookmark names of each bookmark to obtain the names to be matched, and process each resource name in the monitoring resource list according to the preset matching name generation rules to obtain the comparison name corresponding to each monitoring resource.

[0059] Name cleansing can refer to cleaning the name format of a bookmark to obtain a name suitable for name matching. The name to be matched can refer to the name formed after name cleansing. For example, the name to be matched can be the name obtained after removing name differences caused by the bookmark naming format. Preset matching name generation rules can refer to the processing rules for converting resource names into names suitable for comparison with the name to be matched. The comparison name can refer to the name formed after processing the resource name according to the preset matching name generation rules.

[0060] Specifically, the bookmark names of each bookmark can be cleaned up separately, and each resource name in the monitored resource list can be processed according to preset matching name generation rules, so that the names to be matched and the comparison names have comparable name formats. This reduces the name differences between bookmark names and resource names caused by different naming requirements, providing a unified name comparison basis for automatic matching.

[0061] Step S150: Match the name to be matched for each bookmark with the comparison name for each monitoring resource, and determine the monitoring resource that is successfully matched as the monitoring resource associated with the bookmark.

[0062] The monitoring resources associated with a bookmark can refer to the monitoring resources within the range of positions where the resource content needs to be inserted into the corresponding bookmark, as determined by the name matching results. For example, when the comparison name generated from the resource name of a certain monitoring point matches the name to be matched corresponding to the bookmark, the monitoring resource corresponding to that monitoring point can be identified as the monitoring resource associated with that bookmark.

[0063] Specifically, for each bookmark, the corresponding name to be matched can be compared with the corresponding comparison name of each monitoring resource. When the name to be matched meets the preset matching conditions with one of the comparison names, the monitoring resource corresponding to that comparison name is determined as a successfully matched monitoring resource, and an association relationship is established between the bookmark and that monitoring resource. In this way, the monitoring resource corresponding to each bookmark can be automatically determined, reducing mismatches and omissions caused by manually maintaining the name comparison relationship.

[0064] Step S160: Based on the start and end times of the reporting period, obtain the resource content corresponding to the monitoring resources associated with each bookmark.

[0065] The reporting period can represent the time range of the monitoring data corresponding to the report document. For example, the reporting period can be the start and end time range corresponding to a monthly report, quarterly report, or annual report. The resource content can represent the content that needs to be written into the report document based on the monitoring resources and the reporting period. For example, the resource content can be content reflecting the changes, statistics, or analysis results of the monitoring data within the corresponding reporting period.

[0066] Specifically, the start and end times of the current reporting period can be obtained and used as the time range condition for the resource content. For each bookmark-linked monitoring resource, the resource content corresponding to this time range is obtained, ensuring that the resource content is adapted to the current reporting period. Therefore, the same document template can be used to generate report documents for different reporting periods, reducing the need for repeated querying and organizing of resource content when the reporting period changes.

[0067] Step S170: Based on the resource type of the monitored resources associated with each bookmark, determine the target insertion engine corresponding to each bookmark, and replace the original content in the corresponding location range with the resource content through the target insertion engine to obtain the report document.

[0068] The resource type can represent the monitored resource and the content category to which its content belongs. The target insertion engine can represent the processing engine that is adapted to the resource type and used to write the resource content into the document template. For example, for resource content with different data organization or display formats, a suitable target insertion engine can be determined for each. The report document can represent the document formed after the resource content corresponding to each bookmark has been replaced. For example, the report document can be a monthly, quarterly, or annual report on the safety monitoring of a hydropower station after the resource content has been filled in.

[0069] Specifically, the system can identify the resource type of the monitored resources associated with each bookmark and determine the appropriate target insertion engine based on the resource type. The target insertion engine locates the area to be replaced based on the position range corresponding to the bookmark and replaces the original content within that position range with the corresponding resource content. After the resource content replacement for each bookmark is completed, a report document is generated. Thus, resource content of different resource types can be written to the corresponding positions in an appropriate manner, thereby reducing errors, omissions, or positional deviations in resource content and improving the efficiency and accuracy of report document generation.

[0070] The following is a detailed explanation of the steps described above.

[0071] In some embodiments, step S120 involves normalizing the resource name of the target monitoring resource according to a preset bookmark generation rule to obtain a bookmark name that conforms to the preset bookmark naming convention. This may specifically include the following technical steps.

[0072] The first step is to remove the preset illegal characters from the resource name of the target monitored resource to obtain the cleaned name.

[0073] The preset illegal characters can represent characters that do not conform to the preset bookmark naming conventions. For example, preset illegal characters can include at least one of spaces, separators, periods, commas, and quotation marks. The cleaned-up name can represent the name obtained after removing the preset illegal characters from the resource name of the target monitored resource.

[0074] Specifically, a set of illegal characters can be pre-established, and each character can be sequentially determined to belong to the set according to the order of characters in the resource name of the target monitored resource. If the current character belongs to the set, it can be deleted; if it does not, it can be retained. After determining all characters in the resource name, the retained characters can be combined according to their original order to obtain the cleaned name.

[0075] For example, when the resource name of the target monitoring resource is "Dam Crest Horizontal Displacement-D1", the separator "-" can be deleted from the resource name to obtain the purified name "Dam Crest Horizontal Displacement D1"; when the resource name of the target monitoring resource is "Pyrometer-P2-2024", the two separators "-" can be deleted from the resource name to obtain the purified name "Pyrometer P22024". By deleting preset illegal characters from the resource name, characters that do not conform to the preset bookmark naming specifications can be eliminated, while retaining name information such as engineering location, monitoring object, and measuring point number.

[0076] The second step is to fill the end of the cleaned name with preset fill characters until the cleaned name reaches the preset length.

[0077] The preset padding character can represent the characters used to supplement the length of the cleaned-up name. For example, the preset padding character can be the numeric character 0. The preset length can represent the uniform character length adopted after name normalization. For example, the preset length can be 40 characters.

[0078] Specifically, the system can count the number of characters currently included in the cleaned name and compare the counted number with the preset length. When the length of the cleaned name is less than the preset length, a preset padding character can be added to the end of the cleaned name, and the system can then check again whether the cleaned name after padding reaches the preset length.

[0079] If the entered cleansing name still does not reach the preset length, you can continue to add preset padding characters to the end until the entered cleansing name reaches the preset length. During the filling process, you can keep the original characters in the cleansing name and their order unchanged, and only add the corresponding number of preset padding characters to the end of the cleansing name.

[0080] For example, when the preset length is 40 characters and the preset padding character is 0, the character 0 can be continuously filled into the end of the horizontal displacement D1 of the cleaned name until the cleaned name reaches 40 characters. By filling the preset padding character into the end of the cleaned name, resource names of different lengths can have a uniform name length and character structure after name normalization, which is convenient for subsequent bookmark name differentiation and name cleanup.

[0081] The third step is to replace the first character of the cleansed name with a number when the first character is a number, and then replace the first character with the corresponding Chinese numeral to obtain the bookmark name.

[0082] The first character can represent the first character listed in the purification name. Chinese numerals can represent Chinese characters with the same numerical meaning as the numeric characters. For example, the numeric characters 0 to 9 can correspond to the Chinese numerals zero to nine, respectively.

[0083] Specifically, the first character of the purified name after character filling can be read, and it is determined whether the first character is a numeric character. When the first character is a numeric character, the Chinese numeral corresponding to the first character can be determined according to the pre-established correspondence between numeric characters and Chinese numerals, and the first character is replaced with the corresponding Chinese numeral to obtain the bookmark name.

[0084] For example, when the purified name starts with "1 dam section displacement", the first character "1" can be replaced with the Chinese numeral "一", so that the obtained bookmark name starts with "一 dam section displacement"; when the purified name starts with "dam crest horizontal displacement", since the first character "dam" is not a numeric character, the first character can be kept unchanged, and the current purified name is determined as the bookmark name. By replacing the numeric character at the beginning of the name with the corresponding Chinese numeral, the bookmark name can be prevented from starting with a number, and the dam section number or measuring point number information represented by the numeric character can be retained, so that the obtained bookmark name complies with the preset bookmark naming specification.

[0085] In some embodiments, the preset bookmark generation rule may further include processing for duplicate bookmark names, which may specifically include the following technical steps.

[0086] In the first step, when there is a prior bookmark identical to the bookmark name in the document template, the filling character at the preset identification position in the bookmark name is updated to a duplicate name identifier generated according to a preset order, until the updated bookmark name is different from the bookmark names of all prior bookmarks in the document template.

[0087] Wherein, a prior bookmark may refer to a bookmark that already exists in the document template before the current bookmark is inserted. The preset identification position may refer to a pre-specified character position in the bookmark name for setting the duplicate name identifier. For example, when the preset length of the bookmark name is 40 characters, the preset identification position may be the 40th position of the bookmark name.

[0088] The duplicate name identifier may refer to a character used to distinguish multiple bookmarks with the same main name part. For example, the duplicate name identifiers may be numeric characters 1 to 9. The preset order may refer to the order in which multiple duplicate name identifiers are generated sequentially. For example, the preset order may be that the duplicate name identifiers 1, 2, 3, ..., 9 are generated sequentially in the order of increasing numerical values.

[0089] Specifically, after the bookmark name is obtained, each prior bookmark that already exists in the document template can be acquired, and the bookmark name of the bookmark to be inserted is compared with the bookmark name of each prior bookmark respectively. When the bookmark name of the bookmark to be inserted is different from the bookmark names of all prior bookmarks, a bookmark named with the bookmark name can be inserted at the target insertion position.

[0090] When a bookmark with the same name as the bookmark to be inserted exists in the document template, the first duplicate name identifier can be generated in a preset order, and the fill character of the preset identifier position in the bookmark name can be updated to the first duplicate name identifier.

[0091] After the update is complete, the updated bookmark name can be compared again with the bookmark names of each existing bookmark in the document template. If the updated bookmark name is still the same as one of the existing bookmark names, the next duplicate name identifier can be generated in a preset order, and the preset identifier bit can be updated using the next duplicate name identifier. Repeat the process of generating duplicate name identifiers, updating preset identifier bits, and comparing bookmark names until the updated bookmark name is different from the bookmark names of each existing bookmark in the document template.

[0092] For example, when the preset flag is the 40th position of the bookmark name, and the 40th position was originally a padding character 0, if a prior bookmark with the same name already exists in the document template, the padding character 0 in the 40th position can be updated to a duplicate name flag 1. If the updated bookmark name still duplicates a prior bookmark, the 40th position can be updated to a duplicate name flag 2, and so on.

[0093] By setting duplicate name identifiers generated in a preset order in the preset identifier position, multiple reference positions of the same target monitoring resource in the document template can be distinguished without changing the main name part of the bookmark name, thus avoiding duplicate bookmark names that prevent the current bookmark from being inserted.

[0094] The second step is to output a bookmark insertion error message when the number of duplicate name identifiers generated in the preset order reaches the preset limit, and there are still existing bookmarks in the document template with the same name as the updated bookmark.

[0095] The preset upper limit can represent the last duplicate name identifier allowed to be generated according to a preset order, or the maximum number of duplicate name identifiers that can be generated. For example, when the duplicate name identifier uses numeric characters 1 to 9, the preset upper limit can be the numeric character 9. The bookmark insertion error message can represent information used to indicate that the bookmark name is still duplicated after completing a preset number of duplicate name processing steps.

[0096] Specifically, after generating duplicate name identifiers in a preset order each time, it can be determined whether the number of duplicate name identifiers generated has reached a preset limit. If the number of duplicate name identifiers has not reached the preset limit, and the updated bookmark name is still the same as a bookmark name of a previous bookmark, the next duplicate name identifier can be generated.

[0097] When the number of duplicate name identifiers reaches the preset limit, the updated bookmark name using that identifier can be compared again with the bookmark names of all existing bookmarks in the document template. If there are still existing bookmarks in the document template with the same updated bookmark name, the insertion process for the current bookmark can be stopped, and a bookmark insertion error message can be output.

[0098] For example, when the preset identifier of the bookmark name has been updated to the duplicate name identifier 9, but the same prior bookmark still exists in the document template, a bookmark insertion error message can be output. The bookmark insertion error message may include the resource name of the target monitored resource, the current bookmark name, and the reason for the duplicate bookmark name.

[0099] By setting a preset upper limit for duplicate name flags, invalid duplicate name processing can be avoided when non-duplicate bookmark names cannot be generated, and bookmark insertion anomalies can be identified in a timely manner.

[0100] In some embodiments, step S140 involves name purification processing of the bookmark names of each bookmark to obtain the names to be matched, and processing of each resource name in the monitoring resource list according to a preset matching name generation rule to obtain the comparison name corresponding to each monitoring resource. Specifically, this may include the following technical steps.

[0101] The first step is to delete the duplicate name flags when there are duplicate name flags in the preset flag positions of each bookmark name, and then continuously delete the fill characters from the end of the bookmark name after deleting the duplicate name flags to obtain the name to be matched for each bookmark.

[0102] Specifically, it can read the characters in the preset identifier positions of the current bookmark name and determine whether the characters are duplicate identifiers generated in a preset order. If duplicate identifiers exist in the preset identifier positions, the duplicate identifiers can be deleted to eliminate name differences caused by the same monitoring resource being referenced multiple times in the document template.

[0103] After removing duplicate name identifiers, characters can be read sequentially from the end of the bookmark name in reverse order. When the currently read character is a padding character, it can be deleted, and the previous character can be read. When the currently read character is not a padding character, deletion can be stopped, and the remaining name can be identified as the name to be matched for the bookmark.

[0104] For example, the main name part of a bookmark is "Dam crest horizontal displacement D1", followed by multiple padding characters 0, and a default identifier 1 is set. The duplicate name identifier 1 can be deleted first, and then the padding characters 0 can be continuously deleted from the end of the bookmark after deleting the duplicate name identifier until a non-padding character is read, thereby obtaining the name to be matched, "Dam crest horizontal displacement D1".

[0105] By deleting duplicate name identifiers in the preset identifier position and padding characters at the end of the bookmark name, the characters added to the bookmark name due to the need for uniform name length and differentiation of duplicate bookmarks can be eliminated, so that different bookmarks corresponding to the same monitoring resource form a consistent name to be matched.

[0106] The second step involves standardizing the resource names of each monitored resource by deleting preset illegal characters, filling in preset filler characters, and replacing the first character, resulting in standardized names.

[0107] The standardized name can refer to the name obtained after the resource name of the monitored resource has been standardized according to the preset matching name generation rules.

[0108] Specifically, it is possible to iterate through each monitoring resource in the monitoring resource list and read the resource name of the current monitoring resource. For each resource name, the preset illegal characters in the resource name can be deleted sequentially according to the processing method in step S120. Preset padding characters are then added to the end of the name after deleting the preset illegal characters until the name length reaches the preset length. When the first character of the name is a number, it is replaced with the corresponding Chinese numeral, thereby obtaining the standard name corresponding to the current monitoring resource.

[0109] For example, when the resource name of the monitored resource is "Dam Crest Horizontal Displacement - D1", the separator can be deleted first to obtain "Dam Crest Horizontal Displacement D1". Then, 0 characters can be continuously added to the end of the name until the name length reaches the preset length. Since the first character of the name is not a number, there is no need to replace the first character, thus obtaining the corresponding standard name.

[0110] The third step is to continuously delete the padding characters starting from the end of the standard name to obtain the comparison name corresponding to each monitoring resource.

[0111] Specifically, characters can be read sequentially from the end of the current specification name in reverse order. When a padding character is encountered, it can be deleted, and the reading of the previous character can continue. When a non-padding character is encountered, deletion can be stopped, and the remaining name can be identified as the comparison name corresponding to the current monitoring resource.

[0112] For example, after name normalization, the resource name "Dam Crest Horizontal Displacement - D1" can include the main name "Dam Crest Horizontal Displacement D1" and multiple padding characters "0" at the end. After continuously deleting the padding characters from the end of the normalized name, the comparison name "Dam Crest Horizontal Displacement D1" can be obtained. Therefore, the name to be matched obtained after name cleansing of the signature name and the comparison name obtained after corresponding processing of the resource name can have the same name format.

[0113] In some embodiments, step S130 involves traversing each bookmark in the document template to obtain the bookmark name and corresponding position range of each bookmark, which may specifically include the following technical steps.

[0114] The first step is to obtain the bookmark collection for the document template.

[0115] The bookmark set can represent a collection of objects consisting of multiple bookmarks already existing in the document template. For example, when the document template is a Microsoft Word document, the bookmark set can be the Bookmarks collection corresponding to that document.

[0116] Specifically, you can access the document object corresponding to the currently opened document template and retrieve all bookmarks in the document template through the document object's bookmark collection property. When the document template includes multiple chapters, the bookmarks can be distributed across the reserved areas for charts, tables, or text in different chapters.

[0117] Furthermore, it can be determined whether the bookmark set includes bookmarks. If the bookmark set includes bookmarks, subsequent traversal processing can proceed; if the bookmark set does not include bookmarks, the current bookmark traversal processing can end. By uniformly obtaining the bookmark set of the document template, an entry point can be provided for subsequent processing of information from each bookmark in the same way.

[0118] The second step is to iterate through the bookmark collection and read the name attribute, start position attribute, and end position attribute of each bookmark.

[0119] The `name` property represents the attribute in the bookmark object used to record the bookmark name. For example, the `name` property could be `Bookmark.Name`. The `start position` property represents the starting character position of the bookmark's corresponding position range within the document template. For example, the `start position` property could be `Bookmark.Range.Start`. The `end position` property represents the ending character position of the bookmark's corresponding position range within the document template. For example, the `end position` property could be `Bookmark.Range.End`.

[0120] Specifically, you can start from the first bookmark in the bookmark set and visit each bookmark in the order they are listed in the set. For the currently visited bookmark, you can read the name attribute to get the bookmark name; read the start position attribute to get the start position of the document area corresponding to the bookmark; and read the end position attribute to get the end position of the document area corresponding to the bookmark.

[0121] Furthermore, the bookmark name, start position attribute, and end position attribute of the same bookmark can be recorded as a set of bookmark information in a memory list. After reading the information of the current bookmark, you can continue to access the next bookmark, until all bookmarks in the bookmark set have been traversed.

[0122] For example, the bookmark information obtained from the iteration can also be displayed in the bookmark list area, allowing for a unified view of the bookmark names and their distribution within the document template. A document bookmark list display interface can be found by referring to... Figure 2 As shown. See also Figure 2 The document bookmark list display interface can include a bookmark search area and a bookmark name display area. The bookmark search area can include a "Search Bookmarks" input box, used to receive the bookmark name or part of a bookmark name to be queried, and filter the corresponding bookmarks from multiple scanned bookmarks based on the input. The bookmark name display area can display the various bookmark names in the document template in the order they were scanned, and users can use a scroll bar to view other bookmark names not currently displayed.

[0123] Each book signature may include a main name portion derived from the resource name of the target monitoring resource through nomenclature processing, and several padding characters at the end of the main name portion. For example, Figure 2 The main names shown in Figure 311 (Upstream Water Level Measurement Change Process Line) and Figure 4123 (Dam Crest Joint Measurement Lateral) can have multiple consecutive 0 characters at the end to ensure the bookmark names reach a preset length. When bookmarks corresponding to the same main name are inserted multiple times into the document template, the fill character of the preset identifier can be updated to a duplicate name identifier, such as displaying the character 1 or 2 at the end of the bookmark name, to distinguish multiple bookmarks with the same main name.

[0124] The third step is to determine the position range corresponding to each bookmark based on its start and end position attributes.

[0125] Specifically, the character position indicated by the start position attribute of any bookmark can be determined as the starting point of the position range corresponding to that bookmark, and the character position indicated by the end position attribute of that bookmark can be determined as the ending point of that position range, thereby determining a continuous document area defined from the start point to the end point.

[0126] Furthermore, the determined location range can be associated with the corresponding bookmark name. Therefore, after identifying the monitoring resources associated with that bookmark, the document area requiring resource content replacement can be located based on the location range corresponding to the bookmark name.

[0127] For example, when the start position attribute of a bookmark points to the first character of a reserved paragraph in a certain monitoring and analysis chapter, and the end position attribute points to the last character of the reserved paragraph, the document area defined by the reserved paragraph can be determined as the position range corresponding to the bookmark.

[0128] By obtaining the bookmark set and reading the name, start position, and end position attributes of each bookmark, the bookmark name and corresponding position range of each bookmark in the document template can be obtained automatically, reducing the manual operation of searching for bookmarks one by one and determining the insertion position of resource content.

[0129] In some embodiments, step S160 involves obtaining the resource content corresponding to the monitoring resources associated with each bookmark based on the start and end times of the reporting period. This may specifically include the following technical steps.

[0130] The first step is to convert the start and end dates of the reporting period into timestamps.

[0131] The timestamp represents a time parameter formed by converting the date and time into numerical values ​​according to a unified time base. For example, the timestamp can be a millisecond-level timestamp. Specifically, the start and end dates of the reporting period can be obtained through a time selection control or a time input area, and then converted into corresponding timestamps according to a preset time conversion method.

[0132] For example, when generating a monthly report, the date corresponding to the first day of the target month can be converted to a timestamp corresponding to the start date, and the date corresponding to the last day of the target month can be converted to a timestamp corresponding to the end date. When generating a quarterly or annual report, the start and end dates corresponding to the target quarter or target year can be used for conversion, respectively. For the report period selection and report generation interface, please refer to [reference needed]. Figure 3 As shown. See also Figure 3 The report cycle selection and report generation interface may include a start date selection control, an end date selection control, and a report generation control. The start date selection control and the end date selection control are used to determine the start and end dates of the report cycle, respectively, while the report generation control is used to trigger the report generation command.

[0133] Furthermore, when the date information also includes specific times, the preset start time of the start date and the preset end time of the end date can be converted into timestamps to fully define the time range covered by the reporting period. By converting the start and end dates of the reporting period into timestamps respectively, the reporting period can be formed into a unified numerical form that facilitates time comparison and range filtering by the server.

[0134] The second step is to send a resource acquisition request to the server for each bookmark. The resource acquisition request carries the timestamp corresponding to the start date, the timestamp corresponding to the end date, and the resource identifier of the monitoring resource associated with the bookmark.

[0135] The resource retrieval request can represent a request to the server to return the corresponding resource content of a specified monitoring resource within the reporting period. The resource identifier can represent identification information used to uniquely identify the monitoring resource. Specifically, bookmarks can be processed sequentially according to their traversal order, and the resource identifier of the monitoring resource associated with the current bookmark can be obtained. Subsequently, the timestamp corresponding to the start date, the timestamp corresponding to the end date, and the resource identifier can be encapsulated in the resource retrieval request corresponding to the current bookmark, and this resource retrieval request can be sent to the server.

[0136] For example, a resource identifier can be set in the resource path of the resource acquisition request, the timestamp corresponding to the start date can be set to the beginTime parameter, and the timestamp corresponding to the end date can be set to the endTime parameter. A resource acquisition request can have the following form: GET / reportResource / {resourceId} / preview?beginTime={timestamp of start date}&endTime={timestamp of end date}.

[0137] For different bookmarks in the document template, resource retrieval requests can be constructed using the resource identifier of the monitoring resource associated with each bookmark. During the same report generation process, each resource retrieval request can carry the same timestamps for both the start and end dates, ensuring that the resource content for each monitoring resource uses a unified reporting period. By including two timestamps and a resource identifier in the resource retrieval request, the monitoring resource and data time range corresponding to the resource content can be simultaneously defined, reducing the retrieval of data irrelevant to the current bookmark or reporting period.

[0138] The third step is to receive the resource content retrieved and returned by the server based on the resource identifier and two timestamps.

[0139] Specifically, after receiving a resource acquisition request, the server can extract the resource identifier, the timestamp corresponding to the start date, and the timestamp corresponding to the end date from the resource acquisition request, and determine the corresponding monitoring resource based on the resource identifier.

[0140] Furthermore, the server can query the corresponding resource configuration information based on the resource identifier, and filter data within the corresponding reporting period from the monitoring data based on the timestamps corresponding to the start and end dates. The server then generates resource content based on the filtered data and returns the resource content.

[0141] After receiving the resource content returned by the server, the client can record the resource content along with the bookmark that initiated the resource retrieval request, so that the target corresponding to that bookmark can be inserted into the engine for subsequent processing. The server's process of querying resource configuration based on resource identifier, filtering monitoring data based on start and end time, and returning the corresponding content can be implemented according to the preset server data processing logic.

[0142] By retrieving resource content based on resource identifiers and two timestamps, the same document template can retrieve monitoring resource content for the corresponding time period according to different reporting cycles, thus adapting to different reporting cycles such as monthly reports, quarterly reports, and annual reports.

[0143] In some embodiments, the process of matching the name to be matched for each bookmark with the comparison name corresponding to each monitoring resource may also include the following technical steps.

[0144] The first step is to record the bookmark name and corresponding location range of the bookmark in the alarm list when no monitoring resource associated with any bookmark is identified from the monitoring resource list.

[0145] The alert list can represent a collection of information used to record anomalies that occur during the generation of report documents and their corresponding document locations. For example, a record in the alert list may include a bookmark name, the corresponding location range, and the anomaly type.

[0146] Specifically, for any given bookmark, the name to be matched corresponding to that bookmark can be sequentially matched with the comparison names corresponding to each monitoring resource. If, after completing the matching with all comparison names in the monitoring resource list, no successfully matched monitoring resource is found, it can be determined that no monitoring resource associated with that bookmark has been identified from the monitoring resource list.

[0147] Subsequently, the bookmark name and corresponding location range can be read, and the bookmark name and location range can be recorded in the alarm list. Furthermore, a resource matching failure flag can be set in the corresponding alarm record to indicate that the bookmark did not match the corresponding monitored resource.

[0148] For example, when the name to be matched for a certain bookmark is the horizontal displacement of the dam crest D3, and there is no matching name in the monitoring resource list that is the same as the name to be matched, the bookmark name and the corresponding location range can be recorded in the alarm list, and the resource content acquisition process for the bookmark can be skipped.

[0149] The second step is to output a list of alarms after obtaining the report document.

[0150] Specifically, after completing the acquisition and replacement of resource content for each bookmark that can be processed normally, a report document can be obtained. Subsequently, a list of alerts generated during the report document generation process can be output.

[0151] For example, an alarm list can be output in the alarm display area of ​​the client, or the alarm list can be output along with a corresponding report document. For any record in the alarm list, the bookmark where the mismatch occurred can be determined based on the bookmark name, and the location of the incomplete resource content in the report document can be located based on the location range therein.

[0152] Furthermore, the records in the alarm list can be sorted according to their location range in the report document, ensuring that the output order of the abnormal records matches the order of their corresponding locations in the report document. By outputting the alarm list after the report document is generated, unmatched bookmarks and their corresponding locations can be displayed centrally without interrupting the overall report generation process, facilitating the review of locations where resource content has not been entered.

[0153] In some embodiments, the process of obtaining resource content based on the start and end times of the reporting period may also include the following technical steps.

[0154] The first step is to resend the resource acquisition request when it times out.

[0155] Here, "timeout" indicates that no response or resource content has been received from the server within a preset waiting period after the resource acquisition request is sent. "Number of resends" represents the cumulative number of times the same resource acquisition request has been sent after the initial send. "Preset number of resends" represents the maximum number of times the same resource acquisition request is allowed to be resent. For example, the preset number of resends could be three.

[0156] Specifically, after sending a resource acquisition request to the server, a timer can be started corresponding to the resource acquisition request, and the server can be checked within a preset waiting time to see if the resource content returned by the server has been received.

[0157] When resource content is received within the preset waiting time, the timer can be stopped, and processing of the received resource content can continue. If the preset waiting time expires and no resource content is received, the resource acquisition request can be determined to have timed out, and a new resource acquisition request carrying the same resource identifier, a timestamp corresponding to the start date, and a timestamp corresponding to the end date can be resent. Each time the resource acquisition request is resent, the number of resentments can be updated, and the timer can be restarted after each resentment to continue waiting for the server to return the resource content. By resending the resource acquisition request when it times out, the impact of temporary network fluctuations or service response delays on resource content acquisition can be reduced.

[0158] The second step is to record the resource identifier and the location range of the corresponding bookmark carried in the resource acquisition request to the alarm list when the preset number of resends has been reached, and to continue to acquire the resource content corresponding to the next bookmark.

[0159] Specifically, after each resource acquisition request times out, the current number of resends can be compared with a preset number. If the preset number of resends has not been reached, the resource acquisition request can be resent.

[0160] When the preset number of resends is reached and no resource content is received from the server, the resource retrieval request for the current bookmark can be stopped. Subsequently, the resource identifier can be extracted from the current resource retrieval request, and the location range corresponding to the current bookmark can be obtained. The resource identifier and location range are then recorded in the alarm list.

[0161] Furthermore, a request timeout flag can be set in the corresponding alarm log to distinguish between different abnormal situations such as resource matching failure and resource acquisition request timeout. After completing the alarm log, the resource content acquisition process for the current bookmark can be terminated, and the resource content for the next bookmark can be acquired.

[0162] For example, if the preset number of attempts is three, and the resource content is still not received after resending the same resource acquisition request three times, the resource identifier carried in the resource acquisition request and the location range corresponding to the current bookmark can be recorded in the alarm list, and the next bookmark can be processed. By skipping the current bookmark after resending to the preset number of times, the overall generation process of the report document can be avoided from being blocked by the continuous failure of a single resource acquisition request.

[0163] The third step is to record the resource identifier of the corresponding monitoring resource and the location range of the corresponding bookmark in the alarm list when the received resource content does not conform to the content format corresponding to the resource type of the monitoring resource associated with the corresponding bookmark, and continue to obtain the resource content corresponding to the next bookmark.

[0164] The content format refers to the data organization or expression format that matches the resource type being monitored. If the resource content does not conform to the corresponding content format, it may indicate that the resource content lacks the expected data structure, is empty, or cannot be parsed according to the corresponding resource type.

[0165] Specifically, after receiving the resource content returned by the server, the expected content format can be determined according to the resource type of the monitored resource associated with the current bookmark, and the received resource content can be checked to see if it conforms to the expected content format.

[0166] When resource content conforms to the expected format, it can be retained for subsequent processing by the target insertion engine. When resource content does not conform to the expected format, further processing of the current resource content can be stopped, and the resource identifier and current bookmark location range of the corresponding monitored resource can be read. The resource identifier and location range are then recorded in the alarm list. Furthermore, a content format anomaly flag can be set in the corresponding alarm record. After alarm recording, the current bookmark can be skipped, and the resource content corresponding to the next bookmark can be retrieved. For example, when resource content lacks the data structure required for the corresponding resource type or an error occurs during parsing, the resource identifier and current bookmark location range of the corresponding monitored resource can be recorded in the alarm list, instead of writing the resource content into the document template.

[0167] In some embodiments, step S170 determines the target insertion engine corresponding to each bookmark based on the resource type of the monitoring resource associated with each bookmark, which may specifically include the following technical steps.

[0168] Firstly, when the resource type of the monitored resource associated with the bookmark is an image, the image insertion engine is determined to be the target insertion engine corresponding to the bookmark.

[0169] The "image type" can represent a resource category where the content is organized and displayed in image form. For example, image-type monitoring resources can be monitoring process line graphs, feature value graphs, or monitoring distribution maps. The "image insertion engine" can represent a processing engine used to process image-type resource content and write the processed images to the location range corresponding to the bookmarks.

[0170] Specifically, the resource type of the monitored resource associated with the current bookmark can be read, and the read resource type can be compared with a pre-set image type identifier. When the two match, the image insertion engine can be determined as the target insertion engine corresponding to the current bookmark, and the resource content corresponding to the current bookmark can be sent to the image insertion engine for processing.

[0171] For example, when using numbers to represent different resource types, the number 3 can be used to represent the image type. When the resource type of the monitored resource associated with the current bookmark is 3, the image insertion engine can be determined as the target insertion engine corresponding to the current bookmark.

[0172] By selecting the image insertion engine based on the image type, monitoring process line graphs, feature value graphs, or monitoring distribution maps can be processed in a way that adapts to the image data, providing a basis for subsequently writing the image data into the corresponding location range.

[0173] Secondly, when the resource type of the monitored resource associated with the bookmark is a table, the table insertion engine is determined to be the target insertion engine corresponding to the bookmark.

[0174] The table type can represent a resource category where resource content is organized and displayed according to a row and column structure. For example, a table-type monitoring resource could be a monitoring data statistics table, a feature value summary table, an installation information table, or a change table. The table insertion engine can represent a processing engine used to parse table-type resource content and create and populate the table within the corresponding bookmark location range.

[0175] Specifically, the resource type of the monitored resource associated with the current bookmark can be compared with a pre-set table type identifier. When they match, the table insertion engine can be determined as the target insertion engine corresponding to the current bookmark, and the resource content corresponding to the current bookmark can be sent to the table insertion engine for processing.

[0176] For example, the number 2 can be used to represent the table type. When the resource type of the monitored resource associated with the current bookmark is 2, the table insertion engine can be determined as the target insertion engine corresponding to the current bookmark.

[0177] By selecting the table insertion engine based on the table type, resource content with a row and column structure can be parsed and written according to the corresponding table structure, avoiding the need to process table resource content using the same processing methods as images or text.

[0178] Third, when the resource type of the monitored resource associated with the bookmark is text, the text insertion engine is determined to be the target insertion engine corresponding to the bookmark.

[0179] The text type can represent the resource category in which the resource content is organized and displayed in text form. For example, a text-type monitoring resource can be monitoring and analysis text, monitoring and analysis conclusions, or commentary text. The text insertion engine can represent the processing engine used to write text-type resource content into the location range corresponding to the bookmark and to perform formatting processing on the paragraph containing the resource content.

[0180] Specifically, the resource type of the monitored resource associated with the current bookmark can be compared with a pre-set text type identifier. When they match, the text insertion engine can be determined as the target insertion engine corresponding to the current bookmark, and the resource content corresponding to the current bookmark can be sent to the text insertion engine for processing.

[0181] For example, the number 1 can be used to represent the text type. When the resource type of the monitored resource associated with the current bookmark is 1, the text insertion engine can be determined as the target insertion engine corresponding to the current bookmark.

[0182] By selecting the text insertion engine based on the text type, monitoring and analysis text or conclusions can be written in text form to the corresponding location range, distinguishing them from the processing methods used for image and table type resources.

[0183] Therefore, based on the resource type of the monitored resources associated with each bookmark, the resource content corresponding to each bookmark can be allocated to the image insertion engine, table insertion engine, or text insertion engine respectively, realizing unified routing and classification processing for different resource types and reducing content insertion anomalies caused by mismatch between resource type and insertion method.

[0184] In some embodiments, the resource content includes markup language strings, and the original content within the corresponding location range is replaced with the resource content by a target insertion engine. Specifically, this may include the following technical steps.

[0185] When the target insertion engine is an image insertion engine, the specific technical steps may include the following.

[0186] The first step is to parse the markup language string to obtain the image tags.

[0187] The markup language string represents a data string that describes resource content using tags, tag attributes, and hierarchical relationships between tags. For example, the markup language string can be a HyperText Markup Language (HTML) string. The image tag represents a tag in the markup language string used to describe image resources and their data sources. For example, the image tag can be the `img` tag in an HTML string.

[0188] Specifically, the data fields used to carry the resource content can be extracted from the response data returned by the server, and the markup language string can be obtained from the data fields. Subsequently, a markup language parsing tool can be used to load the markup language string and parse it into a hierarchical node structure.

[0189] After forming the node structure, you can traverse or query the tag nodes in the node structure and identify the tags used to describe the image content as image tags.

[0190] For example, an HTML string can be extracted from the data field of the response data, parsed using HtmlAgilityPack (an HTML document parsing library), and the img tag can be located in the parsing result.

[0191] The second step is to extract the image encoding data from the source attribute values ​​of the image tag.

[0192] The source attribute value can represent the attribute value in the image tag used to record the source of the image data. For example, the source attribute value can be the src attribute value of the img tag. Image encoded data can represent the data formed by converting the binary data corresponding to the image into a string according to a preset encoding method. For example, image encoded data can be Base64 encoded data.

[0193] Specifically, it can read the source attributes from the image tag and obtain the corresponding source attribute value. The source attribute value can include image format description, image encoding method description, and image encoding data.

[0194] It can identify the format and encoding prefix in the source attribute value that precedes the image encoding data, remove the prefix from the source attribute value, and determine the string after the prefix as the image encoding data.

[0195] For example, when the source attribute value has the following form: data:image / png;base64,image-encoded data, the prefix "data:image / png;base64," can be removed, and the remaining Base64 string can be identified as image-encoded data.

[0196] The third step is to decode the image encoding data to obtain the image data.

[0197] Here, image data can represent binary data used to form an image, obtained by decoding image encoded data. For example, image data can be a byte array. Specifically, the encoding method used for the image encoded data can be determined, and the string-like image encoded data can be converted into byte array-like image data according to the corresponding decoding method.

[0198] In one exemplary implementation, the decoded byte array can be written to a temporary image file, allowing the document processing program to read the image data via a file path. For example, the temporary image file can be a PNG file. By decoding the image encoded data into image data, the image resource can be converted from string format to a document-insertable format.

[0199] The fourth step is to insert the image data into the corresponding bookmark location range.

[0200] Specifically, you can retrieve the position range corresponding to the current bookmark and delete or clear the existing content within that range. Then, you can call the image insertion interface provided by the document processing program to insert image data into the position range corresponding to the current bookmark.

[0201] For example, after writing image data to a temporary image file, you can call the Microsoft Word InlineShapes.AddPicture method to insert the image into the position range corresponding to the current bookmark, using the file path of the temporary image file. After inserting the image, you can delete the temporary image file to release temporary storage resources.

[0202] In one exemplary implementation, the location range corresponding to the bookmark can be recorded first, then the original content within that location range can be deleted, and the image data can be inserted into the recorded location range to reduce the impact of the original content on the image insertion position.

[0203] By parsing image tags, extracting and decoding image encoding data, the image resources returned by the server in string format can be converted into image data that can be inserted into document templates. Monitoring process line graphs, feature value graphs, or monitoring distribution graphs can then be written to the corresponding bookmark locations. The parsing, decoding, temporary file generation, and insertion processes of image resources can be executed sequentially.

[0204] When the target insertion engine is a table insertion engine, the specific technical steps may include the following.

[0205] The first step is to parse the markup language string to obtain the table labels.

[0206] The table tag can represent a tag in a markup language string used to define the overall structure of a table. For example, the table tag can be the `table` tag in an HTML string.

[0207] Specifically, markup language strings can be extracted from the resource content, and these strings can be parsed using a markup language parsing tool to obtain a node structure composed of multiple tag nodes. Subsequently, the `table` tag can be searched for within the node structure, and the found `table` tag is identified as the table tag.

[0208] For example, HtmlAgilityPack can be used to parse HTML strings and locate table tags from the parsing results by tag name to obtain table tags and their child nodes.

[0209] The second step is to create a table within the corresponding bookmark location range based on the number of row nodes and cell nodes in the table label.

[0210] Row nodes can represent nodes within table tags that describe a row of table content. For example, a row node can be a tr (Table Row) node. Cell nodes can represent nodes within row nodes that describe a table cell. For example, a cell node can be a td (Table Data) node or a th (Table Header) node.

[0211] Specifically, you can iterate through each row node under the table label, count the number of row nodes, and determine the number of rows in the table to be created.

[0212] Additionally, a preset row node can be selected from the table labels, and the number of cell nodes included in that preset row node can be counted. The counted number of cell nodes is then used to determine the number of columns in the table to be created. The preset row node can be a second row node or any other row node with a complete column structure.

[0213] After determining the number of rows and columns of the table to be created, you can obtain the position range corresponding to the current bookmark and delete the existing content within that range. Then, you can call the table creation interface provided by the document processing program to create a table with the determined number of rows and columns within that position range. For example, you can call the Microsoft Word's Tables.Add method to create a native Word table with the corresponding number of rows and columns within the position range corresponding to the current bookmark.

[0214] The third step is to fill the text content of each cell node into the corresponding cell in the created table.

[0215] Specifically, you can traverse each row of nodes in the order of the nodes in the table labels, and for the current row of nodes, traverse each cell node in the order of the cell nodes.

[0216] For the j-th cell node in the i-th row node, the text content of the cell node can be extracted and written into the i-th row and j-th column cell of the created table, thereby establishing the correspondence between each cell node and each cell in the created table.

[0217] When the cell node is a th node, the text content can be written to the corresponding header cell; when the cell node is a td node, the text content can be written to the corresponding data cell.

[0218] For example, when the first row node includes cell nodes such as measurement point name, maximum value, minimum value, and change, the above text can be written sequentially into the corresponding cells of the first row of the created table.

[0219] The fourth step is to apply the preset table format to the created table.

[0220] The preset table format can represent a pre-set set of format parameters used to control the display format of the table. For example, the preset table format may include at least one of the following: border format, alignment, font format, bold header format, adaptive column width format, and repeating header row format.

[0221] Specifically, after writing the text content into each cell, you can set the border style, cell text alignment, font, and font size of the created table. For the row containing the table header, you can apply bold formatting; for tables that need to span multiple pages, you can set the header row as a repeating header row; for cell content of different lengths, you can set the column width to adapt automatically. For example, you can center the text in the table, set the first row to bold format, and automatically adjust the column width according to the length of each column's content.

[0222] When the target insertion engine is a text insertion engine, the specific technical steps may include the following.

[0223] The first step is to write the resource content into the corresponding bookmark location range.

[0224] Specifically, text-type resource content can be extracted from the response data returned by the server, and the position range corresponding to the current bookmark can be obtained. For example, the Range object corresponding to the current bookmark can be obtained.

[0225] Subsequently, the existing content within that location range can be deleted, and the resource content can be written to the corresponding location range. For example, the monitoring and analysis text can be assigned to Range.Text to replace the original placeholder text or previously generated text content with the new monitoring and analysis text.

[0226] When the resource content includes multiple paragraphs, the corresponding text can be written into the position range according to the paragraph separation relationship in the resource content in order to preserve the paragraph structure of the text content.

[0227] The second step is to apply preset paragraph formatting to the paragraphs within the specified location range.

[0228] The preset paragraph format can represent a pre-set set of format parameters used to control the display format of paragraphs containing resource content. For example, the preset paragraph format may include at least one of font, font size, first-line indent, paragraph indent, and line spacing.

[0229] Specifically, after the resource content is written, one or more paragraphs containing the written resource content can be obtained, and the font, font size, indentation and line spacing of the corresponding paragraphs can be set according to the preset paragraph format.

[0230] For example, the monitoring and analysis text can be set to the same font and size as the main text of the report document, and a predetermined first-line indentation and line spacing can be set so that the text content in different bookmark positions has a uniform display format.

[0231] By writing text-based resource content into the corresponding bookmark location range and applying preset paragraph formats to the paragraph, the inserted text can be made compatible with the overall layout of the report document while maintaining the editability of the monitoring and analysis text. Text resource content can be replaced and paragraph formatted using the Range object.

[0232] By performing image decoding and insertion, table creation and filling, and text writing for image, table, and text types respectively, resource content with different data organization formats can replace the original content in the corresponding location range in an appropriate manner, reducing situations where resource content cannot be parsed correctly, insertion format is incorrect, or document format is inconsistent.

[0233] Furthermore, various abnormal situations may occur during the automatic generation of report documents. The handling methods for each type of abnormality and whether to interrupt the report document generation process are shown in Table 1 below.

[0234] Table 1 When the server returns an error code, fails to decode image encoded data, fails to write temporary image files, or fails to parse table tags, the corresponding resource identifier, bookmark position range, and exception type can be recorded in the alarm list. The insertion process of the current resource content can be skipped, and the next bookmark can continue to be processed.

[0235] In some embodiments, the acquisition of the monitoring resource list and the determination of at least one target monitoring resource in step S110 may specifically include the following technical steps.

[0236] The first step is to send a resource classification request carrying an authentication token and a project identifier to the server.

[0237] The server can represent a processing terminal used to manage monitoring resources and provide monitoring resource data to the client containing the document template. For example, the server can be a hydropower station safety monitoring data service platform deployed on a server. The authentication token can represent a credential generated by the server after identity authentication, used to indicate the identity of the requesting entity and resource access permissions. For example, the authentication token can be a JSON Web Token. The project identifier can represent identification information used to distinguish different hydropower station projects; for example, the project identifier can be a project-id. The resource classification request can represent a request for the server to return classified monitoring resources under a specified hydropower station project.

[0238] Specifically, the client can receive login information and send it to the server. The server can authenticate the requesting entity based on the login information, generate an authentication token upon successful authentication, and return the token to the client. The client can save the authentication token to carry it when accessing the server subsequently.

[0239] Furthermore, the server can determine the permitted hydropower station projects based on the identity information corresponding to the authentication token and return a list of permitted hydropower station projects to the client. In response to the selection operation of any hydropower station project in the list, the client can read the project identifier of the selected hydropower station project.

[0240] After obtaining the authentication token and project identifier, a resource classification request can be constructed, incorporating the authentication token and project identifier into the request, and then sent to the server. For example, the authentication token can be set in the Authorization request header, and the project identifier in the project-id request header, and the resource classification API can be invoked to send the resource classification request.

[0241] After receiving a resource classification request, the server can verify the format, validity period, and corresponding resource access permissions of the authentication token. Once the authentication token verification is successful, the server can limit the queried monitoring resource to the hydropower station project it belongs to based on the project identifier. This allows the server to return monitoring resources for the current hydropower station project within the authorized scope, reducing the confusion between monitoring resources from different projects. The generation and verification of authentication tokens, project selection, and project data isolation can be implemented in the manner described above.

[0242] For example, the client login and function operation interface can be referred to Figure 4 As shown. See also Figure 4The client login and function operation interface may include a username input box, a password input box, a login control, a project name selection box, a bookmark insertion control, a report generation control, and a resource replacement control. The username and password input boxes are used to receive login information; the login control triggers authentication; the project name selection box is used to select the current hydropower station project; the bookmark insertion control triggers a bookmark insertion operation; the report generation control triggers a report generation command; and the resource replacement control replaces the monitoring resource associated with the current bookmark with another monitoring resource.

[0243] For example, the monitoring resource list interface can be referenced. Figure 5 As shown. See also Figure 5 The monitoring resource list display interface can include a resource search box, a tree-shaped resource display area, and an add control. The resource search box receives resource names or partial characters from resource names and filters corresponding monitoring resources based on the input. The tree-shaped resource display area can display monitoring resources hierarchically according to their primary and secondary nodes. Primary nodes can include the headworks, main powerhouse, powerhouse rear slope, intake, environmental parameters, tailrace tunnel, main transformer room, rock wall crane beam, and pressure steel pipe, etc. Secondary nodes can include deformation measuring points, horizontal displacement measuring points, and environmental measuring points, etc. Specific monitoring resources are further displayed under secondary nodes, such as the TP2-TSK process line for deformation measuring points, the rainfall measurement change process line, the temperature measurement change process line in the hub area, and the upstream water level measurement change process line, etc. Responding to the expansion operation of a primary or secondary node, the corresponding lower-level nodes can be displayed. Responding to the selection operation of a specific monitoring resource and the triggering operation of the add control, the resource name, resource identifier, and resource type of the selected monitoring resource can be read, and the selected monitoring resource can be identified as the target monitoring resource.

[0244] The second step is to receive the monitoring resource list returned by the server. The monitoring resources in the monitoring resource list are classified into two levels according to the engineering location and the instrument type.

[0245] The term "engineering location" can refer to the location of the hydraulic structure or the monitoring area corresponding to the monitoring resource. For example, an engineering location may include at least one of the following: dam crest, dam foundation, left bank slope, and underground powerhouse. "Instrument type" can refer to the category of monitoring instrument or monitoring point corresponding to the monitoring resource. For example, an instrument type may include at least one of the following: horizontal displacement measuring point, vertical displacement measuring point, piezometer, strain gauge, and anchor stress gauge. The two-level classification can represent a primary classification of the monitoring resource based on engineering location, followed by a secondary classification of the monitoring resource based on instrument type within each engineering location.

[0246] Specifically, the server can filter monitoring resources belonging to the current hydropower station project from multiple monitoring resources corresponding to the resource classification request based on the project identifier. For each selected monitoring resource, the server can read the associated engineering part and instrument type.

[0247] The server can group monitoring resources with the same engineering location into the same primary category, and within each primary category, group monitoring resources with the same instrument type into the same secondary category. After completing the two-level classification, the server can encapsulate the classification information, along with the resource name, resource identifier, and resource type of each monitoring resource, into a monitoring resource list, and return the monitoring resource list to the client.

[0248] For example, under the primary category corresponding to the dam crest, secondary categories such as horizontal displacement measuring points and vertical displacement measuring points can be set, and under the secondary category corresponding to the horizontal displacement measuring points, monitoring resources such as dam crest horizontal displacement-D1 and dam crest horizontal displacement-D2 can be set; under the primary category corresponding to the dam foundation, secondary categories such as piezometers and strain gauges can be set, and under the secondary category corresponding to the piezometers, monitoring resources such as dam foundation piezometer-P1 and dam foundation piezometer-P2 can be set; and under the primary category corresponding to the underground powerhouse, a secondary category corresponding to the anchor stress gauge can be set.

[0249] By classifying monitoring resources into two levels according to engineering location and instrument type, monitoring resources with the same monitoring location and instrument type can be grouped into the same category, providing a classification basis for subsequent locating monitoring resources according to the location of hydraulic structures and instrument categories.

[0250] The third step is to display the list of monitoring resources in a tree structure according to the two-level classification.

[0251] A tree structure can represent a data structure that displays hierarchical classification relationships through nodes at different levels. For example, a tree structure may include engineering part nodes, instrument type nodes, and monitoring resource nodes, where the engineering part node is the parent node of the instrument type node, and the instrument type node is the parent node of the monitoring resource node.

[0252] Specifically, after receiving the monitoring resource list, the client can read the two-level classification relationship in the monitoring resource list, set each engineering part as the first-level node in the tree structure, set the instrument type corresponding to each engineering part as the second-level node under the corresponding first-level node, and set the monitoring resources belonging to the corresponding engineering part and instrument type as monitoring resource nodes under the second-level node.

[0253] Each engineering component node and instrument type node can have an expanded and collapsed state. When an engineering component node is collapsed, the instrument type nodes and monitoring resource nodes under that engineering component can be hidden; in response to an expanded operation on an engineering component node, the instrument type nodes under that engineering component can be displayed. In response to an expanded operation on any instrument type node, the monitoring resource nodes under that instrument type can be displayed.

[0254] For example, after expanding the engineering part nodes corresponding to the dam crest, instrument type nodes such as horizontal displacement measuring points and vertical displacement measuring points can be displayed; after further expanding the instrument type nodes corresponding to the horizontal displacement measuring points, monitoring resource nodes such as the dam crest horizontal displacement-D1 process line diagram and the dam crest horizontal displacement-D2 process line diagram can be displayed.

[0255] By displaying the monitoring resource list in a tree structure according to two-level classification, a large number of monitoring resources can be displayed hierarchically according to engineering location and instrument type, reducing the difficulty of finding resources caused by the concentrated arrangement of monitoring resources of different monitoring areas and different instrument types.

[0256] The fourth step is to determine the selected monitoring resource as the target monitoring resource in response to the selection operation of at least one monitoring resource in the tree structure.

[0257] Specifically, it can detect selection operations performed on monitoring resource nodes in a tree structure. Selection operations can be single-click, double-click, or checkbox operations. When at least one monitoring resource node is detected as selected, the resource name, resource identifier, and resource type corresponding to the selected monitoring resource node can be read, and the selected monitoring resource can be identified as the target monitoring resource.

[0258] For example, the engineering component nodes corresponding to the dam crest and the instrument type nodes corresponding to the horizontal displacement measuring points can be expanded sequentially, and a double-click operation can be performed on the monitoring resource node corresponding to the dam crest horizontal displacement-D1 process curve. In response to this double-click operation, the dam crest horizontal displacement-D1 process curve can be identified as the target monitoring resource.

[0259] When multiple monitoring resources are selected, the resource information corresponding to each selected monitoring resource can be read separately, and all selected monitoring resources can be identified as target monitoring resources, so that bookmarks can be generated and inserted separately in the future.

[0260] By expanding the tree structure hierarchically according to the engineering location and instrument type and selecting monitoring resources, the search range of target monitoring resources can be narrowed, and the identified target monitoring resources can inherit the standard resource name, resource identifier and resource type provided by the server, reducing errors caused by manual input of resource information.

[0261] In some embodiments, when inserting a bookmark named with the bookmark name into a document template, the resource identifier and resource type of the target monitoring resource can also be associated with the bookmark and stored, and the reference position of the monitoring resource in the document template can be traced according to the resource identifier. Specifically, the following technical steps can be included.

[0262] The first step is to insert a bookmark named after the bookmark name into the document template, and then associate the resource identifier and resource type of the target monitored resource with the bookmark and store them in the bookmark's metadata.

[0263] The resource identifier can represent identification information used to uniquely identify the monitored resource. For example, the resource identifier can be a resource ID assigned by the server to the monitored resource. Metadata can represent data stored in association with the bookmark and used to describe the monitored resource associated with the bookmark. For example, the metadata of a bookmark can include a resource identifier field and a resource type field, where the resource identifier field records the resource identifier of the target monitored resource, and the resource type field records the resource type of the target monitored resource.

[0264] Specifically, after determining the bookmark name and target insertion position corresponding to the target monitoring resource in step S120, the resource identifier and resource type of the target monitoring resource can be read. When inserting a bookmark named with the bookmark name at the target insertion position, the resource identifier and resource type can be written into the metadata of the bookmark according to a preset metadata structure.

[0265] The default metadata structure can include a resource identifier field and a resource type field, or it can use an encoded structure that can extract the resource identifier and resource type from bookmarks. After the associated storage is completed, the association relationship between bookmark name, the location range corresponding to the bookmark, resource identifier, and resource type can be established.

[0266] For example, when the target monitoring resource is a dam crest horizontal displacement-D1 process line diagram with resource identifier 1001 and resource type is image type, a bookmark named with the corresponding bookmark name can be inserted at the target insertion position, and the resource identifier 1001 and image type can be associated and stored in the metadata of the bookmark.

[0267] Therefore, the bookmark name can be used to perform name matching, the location range can be used to locate the insertion area of ​​the resource content, the resource identifier can be used to identify the monitored resource associated with the bookmark, and the resource type can be used to determine the target insertion engine corresponding to the bookmark.

[0268] By associating the resource identifier and resource type of the target monitored resource with bookmarks and storing them in the bookmark's metadata, bookmarks can retain not only the name and location information, but also the unique identification information and content category information of the corresponding monitored resource, providing a data foundation for subsequent resource tracing. The resource identifier and resource type can be stored in an encoded form associated with the bookmark.

[0269] The second step is to respond to the resource tracing instruction carrying the target resource identifier and traverse the metadata of each bookmark in the document template.

[0270] The resource tracing instruction can be a command used to query the location where a specified monitored resource is referenced in a document template. The target resource identifier can be the resource identifier of the monitored resource specified by the resource tracing instruction.

[0271] Specifically, in response to a resource tracing operation triggered for a specific monitored resource, a resource tracing instruction carrying the target resource identifier corresponding to that monitored resource can be generated. The resource tracing operation can be generated by selecting a monitored resource from the monitored resource list and triggering the tracing function, or by inputting the target resource identifier and triggering the tracing function.

[0272] Upon receiving a resource tracing instruction, the target resource identifier can be extracted from the instruction, and the bookmark set from the document template can be obtained. Subsequently, the metadata of each bookmark can be read sequentially according to the order in which the bookmarks are arranged in the bookmark set.

[0273] For the currently accessed bookmark, the value of the resource identifier field can be read from the bookmark's metadata. If the resource identifier is not stored in the metadata of the current bookmark, the current bookmark can be skipped and the metadata of the next bookmark can be read. If the resource identifier is stored in the metadata of the current bookmark, the read resource identifier can be compared with the target resource identifier.

[0274] The third step is to determine the location range corresponding to each bookmark whose resource identifier stored in the metadata matches the target resource identifier as the resource reference location corresponding to the target resource identifier, and output the resource reference location.

[0275] The resource reference location can refer to the document location in the document template where the monitored resource corresponding to the target resource identifier is referenced. For example, the resource reference location can be a paragraph area defined by a bookmark, an image area, a table area, or other continuous document area.

[0276] Specifically, when the resource identifier stored in the metadata of the current bookmark matches the target resource identifier, it can be determined that the current bookmark references the monitored resource corresponding to the target resource identifier. Subsequently, the start position attribute and end position attribute of the current bookmark can be read, and the position range corresponding to the current bookmark can be determined based on the start position attribute and end position attribute, and this position range can be determined as the resource reference position corresponding to the target resource identifier.

[0277] When the metadata of multiple bookmarks in a document template contains resource identifiers that are consistent with the target resource identifier, the location range corresponding to each bookmark can be obtained separately, and multiple location ranges can be determined as the resource reference location corresponding to the target resource identifier.

[0278] Furthermore, resource reference locations can be output according to their order of arrangement in the document template. For example, the location number, chapter, or paragraph corresponding to each resource reference location can be output in the resource tracing results area; and the document display position can be moved to the corresponding location range in response to the selection of any resource reference location.

[0279] For example, when the dam crest horizontal displacement-D1 process line diagram is referenced in the monitoring results section and the comprehensive analysis section of the report document, its resource identifier can be used as the target resource identifier. The metadata of each bookmark in the document template can be traversed, and the location range corresponding to the bookmarks with the same resource identifier in the two sections can be determined as the resource reference location.

[0280] By traversing the metadata of each bookmark and comparing the resource identifiers stored therein, the positions of all resource references of the same monitored resource in the document template can be determined based on the target resource identifier, reducing the operation of searching for monitored resources item by item in long documents with many references.

[0281] In some embodiments, after replacing the original content within the corresponding location range with resource content through the target insertion engine, the association between bookmarks and monitored resources can be maintained, and the report document can be refreshed according to the updated reporting cycle. Specifically, this may include the following technical steps.

[0282] The first step is to replace the original content in the corresponding location range with the resource content through the target insertion engine, and then retain or recreate the bookmarks in the location range corresponding to the replaced resource content, while retaining the bookmark metadata.

[0283] Specifically, before replacing existing content, the bookmark name, location range, and metadata of the bookmark can be recorded. After replacing the resource content, it can be determined whether the original bookmark still exists and whether its location range covers the replaced resource content. If the original bookmark still exists and can cover the replaced resource content, the original bookmark and its metadata are retained; if the original bookmark disappears or its location range cannot cover the replaced resource content, a new location range is determined based on the start and end positions of the replaced resource content, and a new bookmark named after the original bookmark is created in the new location range. Simultaneously, the metadata of the original bookmark is associated and stored with the newly created bookmark. For example, after inserting a monitoring process line diagram, monitoring data statistics table, or monitoring analysis text, the retained or newly created bookmarks can respectively cover the inserted image, table, or text content.

[0284] The second step is to respond to the refresh command for the report document and, based on the start and end times of the updated report period, re-acquire the resource content corresponding to the monitoring resources associated with each bookmark.

[0285] The refresh command can be used to trigger the re-acquisition and updating of existing resource content in the report document. The updated reporting period can be used to represent the time range of monitoring data that has been reset relative to the current reporting period.

[0286] Specifically, upon receiving a refresh command, the system can obtain the start and end dates of the updated reporting period and iterate through the bookmarks in the report document. For each bookmark, the resource identifier of the associated monitoring resource can be determined based on its metadata, and the corresponding resource content can be retrieved again according to the start and end times of the updated reporting period. For example, the reporting period can be adjusted from a certain month to the next month or a certain quarter, and the corresponding monitoring process line diagram, monitoring data statistics table, or monitoring analysis text can be retrieved again according to the adjusted start and end times.

[0287] The third step is to use the target insertion engine corresponding to each bookmark to replace the current content within the location range corresponding to each bookmark with the newly acquired resource content.

[0288] The current content refers to the existing resource content within the location range corresponding to the bookmark before the refresh. Specifically, the target insertion engine can be determined based on the resource type of the monitored resources associated with each bookmark, and the current content within the corresponding location range can be replaced with the newly acquired resource content using the target insertion engine. When the monitored resource is an image, the current image can be replaced using the image insertion engine; when it is a table, the current table can be replaced using the table insertion engine; and when it is text, the current text can be replaced using the text insertion engine. After the replacement is completed, the bookmark can be retained or recreated within the location range corresponding to the newly acquired resource content, and the bookmark's metadata can be retained. Therefore, while maintaining the association between bookmarks, location ranges, and monitored resources, the report document can be refreshed repeatedly according to different reporting periods, thereby reducing the operation of querying and replacing resource content item by item.

[0289] In some embodiments, the automatic report document generation method further includes: when a new measuring point is detected in the measuring point configuration table, automatically generating multiple resource configuration records associated with the new measuring point based on the engineering location and instrument type of the new measuring point. Each resource configuration record corresponds to one of the resource types: image type, table type, and text type, and includes a resource name obtained by concatenating the engineering location, the measuring point name of the new measuring point, and the resource suffix corresponding to the resource type, the measuring point identifier of the new measuring point, and a data query statement determined by the instrument type and the resource type; the monitoring resource list is determined based on the generated resource configuration records.

[0290] The measurement point configuration table stores information such as unique identifier, measurement point number, measurement point name, engineering location, instrument type, project identifier, installation date, and measurement point group. A pre-defined mapping between instrument type, resource type, resource suffix, and data query statement template can be established. When a new measurement point is added to the configuration table, the engineering location, measurement point name, measurement point identifier, and instrument type of the new measurement point can be read, and resource configuration records can be generated according to the configuration rules corresponding to image, table, and text types, respectively. For example, the resource suffix for image type can be a process line diagram, for table type it can be a feature value table, and for text type it can be analysis text. When the measurement point name does not include the engineering location, the resource name is obtained by concatenating the engineering location, measurement point name, and resource suffix. The data query statement can be generated from the corresponding data query statement template for the instrument type and resource type, and the measurement point identifier of the newly added measurement point can be written as a query condition. After generating resource configuration records, each resource configuration record can be added to the monitoring resource configuration table, and the monitoring resource list can be updated accordingly, so that the monitoring resources corresponding to newly added monitoring points can be automatically displayed and called.

[0291] Furthermore, the measuring points in the measuring point configuration table can be grouped according to their engineering location and instrument type to obtain a first group. A fusion resource configuration record associated with all measuring points in the first group is generated for each first group. The data query statement of the fusion resource configuration record is used to query the monitoring data of all measuring points in the first group. When multiple measuring points are detected to be set to the same measuring point group identifier, the measuring points are grouped according to the measuring point group identifier to obtain a second group. A fusion resource configuration record associated with all measuring points in the second group is generated for each second group. The measuring points in the second group are distributed in at least two engineering locations or belong to at least two instrument types. The monitoring resource list is determined based on the generated fusion resource configuration records.

[0292] The system can be categorized into two groups: the first group can include multiple measuring points with the same engineering location and instrument type; the second group can include multiple measuring points with the same measuring point group identifier but distributed across different engineering locations or belonging to different instrument types. The fusion resource configuration record can associate the measuring point identifiers of each measuring point within the corresponding group and includes a data query statement for querying the monitoring data of all measuring points within that group at once. For the first group, fusion resources reflecting monitoring data of similar measuring points can be generated based on engineering location and instrument type; for the second group, fusion resources reflecting monitoring data of multiple measuring points with preset business relationships can be generated based on the measuring point group identifier. When measuring points within a group are added, deleted, or the measuring point group identifier changes, the corresponding measuring point identifiers and data query statements associated with the fusion resource configuration record can be updated, and the monitoring resource list can be updated based on the updated fusion resource configuration record.

[0293] Furthermore, in the exemplary embodiments of this disclosure, an automatic report document generation system is also provided. (Refer to...) Figure 6 As shown, the automatic report generation system 600 may include a client 610 and a server 620, and the client 610 and the server 620 may communicate via the Hypertext Transfer Protocol. The Hypertext Transfer Protocol (HTTP) can be considered an application-layer communication protocol used between the client and the server to transmit request and response information.

[0294] The client 610 may include a name normalization module 611, a bookmark creation module 612, a bookmark scanning module 613, a resource matching module 614, a content acquisition module 615, and a report generation module 616.

[0295] The name normalization module 611 can be used to normalize the input name according to the preset bookmark generation rules, and obtain the output name that conforms to the preset bookmark naming specifications. In the bookmark creation process, the input name can be the resource name of the target monitored resource, and the output name can be the bookmark name; in the resource matching process, the input name can be the resource name in the monitored resource list, and the output name can be used to generate the comparison name of the corresponding monitored resource.

[0296] The bookmark creation module 612 can be used to obtain a document template and a list of monitoring resources. In response to the selection operation of at least one monitoring resource in the list, the selected monitoring resource is determined as the target monitoring resource. For each target monitoring resource, the bookmark creation module 612 can input the resource name of the target monitoring resource into the name normalization module 611, obtain the bookmark name output by the name normalization module 611, and insert a bookmark named with that bookmark name at the target insertion position in the document template.

[0297] The bookmark scanning module 613 can be used to respond to the report generation instruction, traverse each bookmark in the document template, read the bookmark name and corresponding position range of each bookmark, and record the read bookmark name and position range for use by the resource matching module 614 and the report generation module 616.

[0298] The resource matching module 614 can be used to perform name purification on the bookmark names of each bookmark to obtain the name to be matched corresponding to each bookmark; it can also input each resource name in the monitoring resource list into the name normalization module 611, and obtain the comparison name corresponding to each monitoring resource based on the name output by the name normalization module 611. The resource matching module 614 can match the name to be matched corresponding to each bookmark with the comparison name corresponding to each monitoring resource, and determine the monitoring resource that is successfully matched as the monitoring resource associated with the corresponding bookmark.

[0299] The content acquisition module 615 can be used to obtain the start date and end date of the reporting period, and convert the start date and end date into timestamps respectively. For each bookmark, the content acquisition module 615 can send a resource acquisition request to the server 620. The resource acquisition request carries the timestamp corresponding to the start date, the timestamp corresponding to the end date, and the resource identifier of the monitoring resource associated with the bookmark.

[0300] The report generation module 616 can determine the target insertion engine corresponding to each bookmark based on the resource type of the monitoring resources associated with each bookmark, and receive the resource content returned by the server 620. The report generation module 616 can replace the original content within the corresponding location range of each bookmark with the resource content using the target insertion engine. After completing the replacement of the resource content corresponding to each bookmark, a report document can be obtained.

[0301] The server 620 can respond to resource acquisition requests sent by the client 610, determine the corresponding data query conditions based on the resource identifier carried in the resource acquisition request, and retrieve the monitoring data corresponding to the resource identifier according to the two timestamps carried in the resource acquisition request. The server 620 can generate corresponding resource content from the retrieved monitoring data according to the resource type corresponding to the resource identifier, and return the resource content to the client 610.

[0302] In some embodiments, refer to Figure 6 As shown, the server 620 may include a monitoring resource management module 621, a monitoring resource configuration table 622, an authentication and authorization module 623, a project management module 624, and an interface service module 625.

[0303] The authentication and authorization module 623 can be used to verify the authentication tokens carried in resource classification requests and resource acquisition requests. When the authentication token verification passes, the corresponding request can continue to be processed; when the authentication token verification fails, the processing of the corresponding request can be stopped.

[0304] The project management module 624 can be used to obtain the project identifier carried in the resource classification request, and filter the monitoring resources belonging to the corresponding project from the monitoring resources corresponding to multiple projects according to the project identifier, so as to limit the project scope corresponding to the monitoring resource list.

[0305] The monitoring resource management module 621 can be used to configure and manage various monitoring resources, and to classify the monitoring resources selected by the project management module 624 into two levels according to the engineering location and instrument type. After completing the two-level classification, the monitoring resource management module 621 can return the two-level classified monitoring resource list to the client 610 for the client 610 to display and select target monitoring resources.

[0306] For example, the results of classifying monitoring resources into two levels according to engineering location and instrument type can be shown in Table 2 below.

[0307] Table 2 The monitoring resource configuration table 622 can be used to store the resource identifier, resource type and data query statement of each monitoring resource, so that the resource identifier is associated with the corresponding data query statement and resource type.

[0308] In one exemplary implementation, the server 620 can also set up a measurement point configuration table and a monitoring data table. The measurement point configuration table, the monitoring data table, and the monitoring resource configuration table 622 are interconnected to support monitoring resource configuration queries and monitoring data queries.

[0309] The monitoring data table stores monitoring data such as unique data identifiers, associated monitoring point identifiers, monitoring time, monitoring values, and data status. The monitoring resource configuration table 622 stores resource configuration information such as resource identifiers, resource names, resource types, associated monitoring point identifiers, data query statements, and resource content generation parameters for each monitoring resource. The monitoring point configuration table and the monitoring data table can be linked through unique monitoring point identifiers and associated monitoring point identifiers, and the monitoring resource configuration table 622 can also be linked through unique monitoring point identifiers and associated monitoring point identifiers. Therefore, the interface service module 625 can obtain the corresponding resource configuration information based on the resource identifier, determine the target monitoring point based on the associated monitoring point identifier, and use the data query statement to query the monitoring data within the reporting period to generate corresponding image, table, or text-type resource content.

[0310] The interface service module 625 can be used to respond to resource acquisition requests, extract the resource identifier, the timestamp corresponding to the start date and the timestamp corresponding to the end date from the resource acquisition request, and obtain the corresponding data query statement and resource type from the monitoring resource configuration table 622 according to the resource identifier.

[0311] The interface service module 625 can inject the timestamps corresponding to the start date and end date carried in the resource acquisition request into the acquired data query statement, and execute the injected data query statement to query the monitoring data within the corresponding reporting period.

[0312] After obtaining the monitoring data, the interface service module 625 can generate the monitoring data into corresponding resource content according to the resource type obtained from the monitoring resource configuration table 622, and return the resource content to the client 610 so that the client 610 can write the resource content into the document template through the corresponding target insertion engine.

[0313] The specific details of each module in the above automatic report document generation system have been described in detail in the corresponding automatic report document generation methods, so they will not be repeated here.

[0314] It should be noted that although several modules or units of the report document automatic generation system have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0315] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described automatic report document generation method is also provided.

[0316] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be embodied in the following forms: a completely hardware embodiment, a completely software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0317] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0318] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), and a display unit 740.

[0319] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of this disclosure. The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 721 and / or a cache memory 722, and may further include a read-only memory (ROM) 723.

[0320] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0321] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0322] Electronic device 700 can also communicate with one or more external devices 770 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0323] Through the description of the above embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal system, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0324] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0325] The program product for implementing the above-described automatic report document generation method according to embodiments of this disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, system, or device.

[0326] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0327] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, system, or device.

[0328] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0329] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0330] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0331] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0332] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0333] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for automatically generating report documents, characterized in that, The method includes: Obtain a document template and a list of monitoring resources, and in response to a selection operation on at least one monitoring resource in the list of monitoring resources, determine at least one target monitoring resource; For each of the target monitoring resources, the resource name of the target monitoring resource is normalized according to the preset bookmark generation rules to obtain a bookmark name that conforms to the preset bookmark naming specifications, and a bookmark named with the bookmark name is inserted at the target insertion position in the document template. In response to the report generation instruction, traverse each bookmark in the document template to obtain the bookmark name and corresponding position range of each bookmark; The bookmark names of each bookmark are cleaned to obtain the names to be matched, and each resource name in the monitoring resource list is processed according to the preset matching name generation rules to obtain the comparison name corresponding to each monitoring resource. The matching name corresponding to each bookmark is matched with the comparison name corresponding to each monitoring resource, and the monitoring resource that is successfully matched is determined as the monitoring resource associated with the bookmark. Based on the start and end times of the reporting period, obtain the resource content corresponding to the monitoring resources associated with each of the aforementioned bookmarks; Based on the resource type of the monitoring resource associated with each bookmark, the target insertion engine corresponding to each bookmark is determined, and the original content in the corresponding location range is replaced with the resource content through the target insertion engine to obtain the report document.

2. The method for automatically generating report documents according to claim 1, characterized in that, The preset bookmark generation rules include: Remove preset illegal characters from the resource name of the target monitoring resource to obtain a cleaned name; Enter preset padding characters at the end of the purification name until the length of the purification name reaches the preset length; When the first character of the purification name is a number, the first character is replaced with a Chinese numeral corresponding to the first character to obtain the bookmark name.

3. The method for automatically generating report documents according to claim 2, characterized in that, The preset bookmark generation rules also include: When a prior bookmark with the same name exists in the document template, the filler character of the preset identifier in the bookmark name is updated to a duplicate name identifier generated in a preset order, until the updated bookmark name is different from the bookmark names of all prior bookmarks in the document template. If the number of duplicate name identifiers generated according to the preset order reaches the preset limit, and there are still prior bookmarks with the same name as the updated bookmark in the document template, a bookmark insertion error message will be output.

4. The method for automatically generating report documents according to claim 3, characterized in that, The process of cleaning up the bookmark names of each bookmark to obtain the names to be matched includes: When there is a duplicate name identifier in the preset identifier position of each of the bookmark names, delete the duplicate name identifier, and continuously delete the filler characters from the end of the bookmark name after deleting the duplicate name identifier to obtain the name to be matched corresponding to each bookmark; The names of each resource in the monitoring resource list are processed according to a preset matching name generation rule to obtain the comparison name corresponding to each monitoring resource, including: Following the processing methods of deleting preset illegal characters, filling in preset filler characters, and replacing the first character, the resource names of each monitoring resource are standardized to obtain standardized names; The padding characters are continuously deleted from the end of the standardized name to obtain the comparison name corresponding to each monitoring resource.

5. The method for automatically generating report documents according to claim 1, characterized in that, The step of obtaining the resource content corresponding to the monitoring resources associated with each bookmark based on the start and end times of the reporting period includes: Convert the start and end dates of the reporting period into timestamps respectively; For each of the aforementioned bookmarks, a resource acquisition request is sent to the server. The resource acquisition request carries the timestamp corresponding to the start date, the timestamp corresponding to the end date, and the resource identifier of the monitoring resource associated with the bookmark. Receive the resource content that the server retrieves and returns based on the resource identifier and the two timestamps.

6. The method for automatically generating report documents according to claim 1, characterized in that, The resource types include image types, table types, and text types; The step of determining the target insertion engine corresponding to each bookmark based on the resource type of the monitored resource associated with each bookmark includes: When the resource type of the monitored resource associated with the bookmark is the image type, the image insertion engine is determined to be the target insertion engine corresponding to the bookmark; When the resource type of the monitoring resource associated with the bookmark is the table type, the table insertion engine is determined to be the target insertion engine corresponding to the bookmark; When the resource type of the monitored resource associated with the bookmark is the text type, the text insertion engine is determined to be the target insertion engine corresponding to the bookmark.

7. The method for automatically generating report documents according to claim 6, characterized in that, The resource content includes markup language strings; When the target insertion engine is the image insertion engine, the markup language string is parsed to obtain image tags, image encoding data is extracted from the source attribute values ​​of the image tags, the image encoding data is decoded to obtain image data, and the image data is inserted into the position range of the corresponding bookmark; When the target insertion engine is the table insertion engine, the markup language string is parsed to obtain table tags. Based on the number of row nodes and cell nodes in the table tags, a table is created within the position range of the corresponding bookmark. The text content in each cell node is filled into the corresponding cell in the created table, and a preset table format is applied to the created table. When the target insertion engine is the text insertion engine, the resource content is written to the position range of the corresponding bookmark, and a preset paragraph format is applied to the paragraph in the position range.

8. The method for automatically generating report documents according to claim 1, characterized in that, Also includes: When inserting a bookmark named with the bookmark name into the document template, the resource identifier and resource type of the target monitoring resource are associated with the bookmark and stored in the metadata of the bookmark; In response to a resource tracing instruction carrying a target resource identifier, the metadata of each bookmark in the document template is traversed. The location range corresponding to each bookmark whose resource identifier stored in the metadata matches the target resource identifier is determined as the resource reference location corresponding to the target resource identifier, and the resource reference location is output.

9. The method for automatically generating report documents according to claim 8, characterized in that, Also includes: After replacing the original content in the corresponding position range with the resource content through the target insertion engine, the bookmark is retained or recreated in the position range corresponding to the replaced resource content, and the metadata of the bookmark is retained. In response to the refresh instruction for the report document, the resource content corresponding to the monitoring resources associated with each bookmark is re-acquired according to the start and end time of the updated report period, and the current content within the position range corresponding to each bookmark is replaced with the re-acquired resource content through the target insertion engine corresponding to each bookmark.

10. A report document automatic generation system, used to implement the report document automatic generation method according to any one of claims 1 to 9, characterized in that, The system includes a client and a server, with the client communicating with the server via Hypertext Transfer Protocol. The client includes a name normalization module, a bookmark creation module, a bookmark scanning module, a resource matching module, a content acquisition module, and a report generation module. The name normalization module is used to normalize the input name according to the preset bookmark generation rules, so as to obtain the output name that conforms to the preset bookmark naming rules. The bookmark creation module is used to obtain a document template and a list of monitoring resources. In response to the selection operation of at least one monitoring resource in the list of monitoring resources, at least one target monitoring resource is determined. The name normalization module is called with the resource name of each target monitoring resource to obtain a bookmark name, and a bookmark named with the bookmark name is inserted at the target insertion position in the document template. The bookmark scanning module is used to respond to the report generation instruction, traverse each bookmark in the document template, and obtain the bookmark name and corresponding position range of each bookmark; The resource matching module is used to perform name purification processing on the bookmark names of each bookmark to obtain the name to be matched, call the name normalization module with each resource name in the monitoring resource list to obtain the comparison name corresponding to each monitoring resource, match each name to be matched with each comparison name, and determine the monitoring resource that is successfully matched as the monitoring resource associated with the bookmark. The content acquisition module is used to convert the start date and end date of the reporting period into timestamps respectively, and send a resource acquisition request to the server for each bookmark; the resource acquisition request carries the two timestamps and the resource identifier of the monitoring resource associated with the bookmark; The report generation module is used to determine the target insertion engine corresponding to each bookmark based on the resource type of the monitoring resource associated with each bookmark, and replace the original content in the corresponding location range with the resource content returned by the server through the target insertion engine to obtain the report document; The server is used to respond to the resource acquisition request, determine the corresponding data query conditions according to the resource identifier carried in the resource acquisition request, query the monitoring data corresponding to the resource identifier according to the two timestamps, generate the monitoring data into resource content according to the resource type corresponding to the resource identifier, and return the resource content to the client.