Road detection dynamic report generation method and device, equipment and storage medium
Reading detection data in parallel through FutureTask and rendering it to the report template using the POI-tl engine, solving the complexity and performance bottleneck problems in generating road detection reports in the prior art, and achieving efficient report generation and storage.
Patent Information
- Application Number
- CN202510093547.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
AI Technical Summary
In the generation of road inspection reports, the prior art has problems such as complex code logic, performance bottlenecks and high learning difficulty, especially when it involves document format replacement and table cell merging.
Through FutureTask, data is read from the detection data and the POI-tl engine is used to render the data into a preset report template to achieve the generation and storage of reports.
It significantly improves the efficiency of road inspection report generation, reduces workload, improves data usage compatibility, and effectively improves performance bottleneck problems.
Smart Images

Figure CN120012746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of road detection, and in particular to a method, device, equipment and storage medium for generating a road detection dynamic report. Background Art
[0002] During daily operation, roads are inevitably damaged and even collapse due to the adverse effects of external traffic loads, temperature changes, and internal material aging. In order to ensure the safety of roads during operation, regular physical inspections should be carried out on roads to check for potential hidden dangers and safeguard the safety of roads. After conducting field inspections, inspectors generate road inspection reports based on industry standards and engineering experience for easy reference, but the number of inspection reports is large and the content is complicated, which takes a lot of time.
[0003] At present, the common method for automatically generating report documents for road inspection reports is to preset the required paragraph, table and other formats in the Word (a word processing program) template to reduce the difficulty of program implementation. Furthermore, the document is processed through the Apache POI (a free, open source, cross-platform Java API written in Java) class library. This solution can meet most application scenarios of string replacement, but because the modification of Word documents in this solution is based on a simple encapsulation of modifying the underlying XML (Extensible Markup Language) operation, a large number of XML modification operations are still involved when complex requirements such as document format replacement and table cell merging are involved, which can easily lead to complex code logic. In addition, the use of Apache POI requires a full understanding of XML structure and parsing technology, which will increase the difficulty of learning. In addition, Apache POI mainly focuses on XML functions that are compatible with standards, lacks sufficient support for some newer XML features, and has performance bottlenecks. Summary of the invention
[0004] The present application provides a method, device, equipment and storage medium for generating a road detection dynamic report, which can significantly improve the efficiency of generating a road detection report, thereby improving work efficiency and effectively improving the performance bottleneck problem when generating a road detection report.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a road detection dynamic report, the method comprising:
[0006] Based on FutureTask, the data used to generate road inspection reports are read from various inspection data in a parallel reading mode;
[0007] The POI-tl engine renders the read data into a preset road detection report template according to a predetermined style and format, thereby generating a road detection report;
[0008] The generated road inspection report is stored based on the object storage service.
[0009] In combination with the first aspect, in one implementation,
[0010] The road inspection report includes a special ground road condition inspection report;
[0011] The types of test data involved in the above-ground special road condition test report include road surface appearance disease, road surface deflection test, drilling core test, road surface flatness test, and road surface anti-skid performance test;
[0012] The detection data is stored in the form of an Excel table, and each Excel table stores a corresponding type of detection data.
[0013] In combination with the first aspect, in one implementation, the data used to generate the road inspection report is read from various types of inspection data in a parallel reading manner based on FutureTask, specifically including:
[0014] Determine the Excel table format and storage location of various test data;
[0015] According to the available computing resources and the expected amount of detection data, set the corresponding thread pool size to create the thread pool;
[0016] According to the detected data type, different Excel tables are assigned to different threads for processing, and each thread is responsible for reading and parsing the data in the corresponding Excel table;
[0017] Schedule and manage threads based on FutureTask, obtain thread execution results, and integrate the data read by each thread to form a data set after all threads are processed.
[0018] In combination with the first aspect, in one implementation, the road detection report template is used to define the overall layout of the road detection report, and the road detection report template includes tags for binding and rendering the read data.
[0019] In combination with the first aspect, in one implementation,
[0020] The label includes multiple formats to render different types of data. The label formats include text labels, digital labels, and formatting labels. The data types include text, pictures, and tables.
[0021] The tag exists in the form of a placeholder to specify the insertion position and format of data in the road detection report template.
[0022] In combination with the first aspect, in one implementation, the POI-tl engine renders the read data into a preset road detection report template according to a predetermined style and format to generate a road detection report, specifically including:
[0023] The POI-tl engine matches the tag with the corresponding data read. According to the format of the tag and the type of data, the POI-tl engine automatically renders the data so that the read data is rendered into the road detection report template according to the predetermined style and format, thereby realizing the generation of the road detection report.
[0024] In combination with the first aspect, in one implementation, the object storage service is further provided with access rights and control policies to manage the road inspection reports stored in the object storage service.
[0025] In a second aspect, an embodiment of the present application provides a road detection dynamic report generation device, the road detection dynamic report generation device comprising:
[0026] A reading module, which is used to read data used to generate a road inspection report from various inspection data in a parallel reading manner based on FutureTask;
[0027] A rendering module, which is used to render the read data into a preset road detection report template according to a predetermined style and format through the POI-tl engine to realize the generation of a road detection report;
[0028] A storage module is used to store the generated road detection report based on the object storage service.
[0029] In the third aspect, an embodiment of the present application provides a road detection dynamic report generation device, which includes a processor, a memory, and a road detection dynamic report generation program stored in the memory and executable by the processor, wherein when the road detection dynamic report generation program is executed by the processor, the steps of the above-mentioned road detection dynamic report generation method are implemented.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a road detection dynamic report generation program is stored, wherein when the road detection dynamic report generation program is executed by a processor, the steps of the above-mentioned road detection dynamic report generation method are implemented.
[0031] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0032] By adopting a parallel reading method based on FutureTask, data used to generate road detection reports are read from various types of detection data, and then the read data is rendered into a pre-set road detection report template according to a predetermined style and format through the POI-tl engine to realize the generation of road detection reports. The generated road detection reports are stored based on the object storage service, realizing the automatic and convenient generation of road detection reports, greatly reducing the workload, and improving the compatibility of data used when generating road detection reports. By utilizing multi-threading technology, multiple threads can parse, read and process all data in parallel at the same time, significantly improving the efficiency of road detection report generation, thereby improving work efficiency and effectively improving the performance bottleneck problem when generating road detection reports. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of a method for generating a dynamic road detection report according to the present application;
[0034] Figure 2 This is a schematic diagram of the functional modules of the device for generating dynamic reports for road detection in this application;
[0035] Figure 3 This is a schematic diagram of the hardware structure of the road detection dynamic report generation device of this application. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0038] In a first aspect, an embodiment of the present application provides a method for generating a road detection dynamic report.
[0039] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the method for generating a dynamic report of road detection in this application. Figure 1 As shown, the road detection dynamic report generation method includes:
[0040] S1: Based on FutureTask, a parallel reading method is used to read data used to generate road inspection reports from various inspection data;
[0041] Specifically, data reading is the first step in the process of generating dynamic documents (i.e., road inspection reports), which involves obtaining the required data from various data sources (i.e., various types of inspection data). The data source can be a database or a specific file. Taking the ground special road condition inspection report generated by the ground special road condition inspection as an example, the ground special road condition inspection involves a variety of inspection data. Specifically, the types of inspection data involved in the ground special road condition inspection report include road surface appearance diseases, road surface deflection detection, drilling core sampling detection, road surface flatness detection, road surface anti-skid performance detection, etc. The inspection data is stored in the form of an Excel (a spreadsheet software) table, and each Excel table stores one type of inspection data.
[0042] The detection data of road detection, such as the data of special ground road detection, has the characteristics of multi-dimensionality and huge data volume, which means that the traditional sequential reading and integration method may face performance bottlenecks, especially when the Excel spreadsheets of each type of detection data are quite large. The sequential reading method may lead to slow data reading speed, which in turn affects the efficiency of road detection report generation. In order to solve this problem, this application adopts a strategy of parallel data reading. By utilizing multi-threading technology, different detection data can be allocated to different threads for processing, thereby realizing parallel processing. Specifically, with the help of FutureTask (an asynchronous computing task) of Java (an object-oriented programming language) concurrent tool class, it is possible to conveniently manage threads and task scheduling, coordinate the work of multiple threads, and ensure that various types of detection data can be processed at the same time.
[0043] Furthermore, in one embodiment, based on FutureTask, a parallel reading method is adopted to read data used to generate a road detection report from various detection data, specifically including:
[0044] S101: Determine the Excel table format and storage location of various test data;
[0045] S102: according to the available computing resources and the expected amount of detection data, the corresponding thread pool size is set to implement thread pool creation;
[0046] S103: assigning different Excel tables to different threads for processing according to the detected data type, and each thread is responsible for reading and parsing the data in the corresponding Excel table;
[0047] S104: Schedule and manage threads based on FutureTask, obtain thread execution results, and integrate the data read by each thread after all threads are processed to form a data set.
[0048] Specifically, first determine the data source and data format, clarify the Excel table format and storage location of each detection data, prepare for subsequent data reading, and then create a thread pool. Set the appropriate thread pool size based on the available computing resources (such as the number of CPU cores) and the expected amount of data. The thread pool can reuse threads to avoid the overhead caused by frequent thread creation and destruction. Then assign tasks to threads. According to the business type, different Excel tables are assigned to different threads for processing. Each thread is responsible for reading and parsing the data in the corresponding table. Then manage threads and tasks, use FutureTask to schedule and manage thread tasks, obtain the results of thread execution, and integrate them after all threads are completed. Finally, integrate the results. After all threads are processed, integrate the results of each thread to form a complete data set for subsequent template rendering.
[0049] Through the above steps, the speed of data reading can be significantly improved and the generation of performance bottlenecks can be effectively reduced. At the same time, this parallel processing method can also better utilize the computing resources of multi-core CPUs and further improve the overall efficiency of data processing.
[0050] S2: The read data is rendered into a preset road inspection report template according to a predetermined style and format through the POI-tl engine to realize the generation of a road inspection report; poi-tl, namely poi template language, is a Word template engine used to create Word documents using templates and data.
[0051] After the data is read, the next step is to render the road inspection report template to generate a complete road inspection report. The process of rendering the road inspection report template is to bind the data with the tags in the template to generate a document that meets the requirements. This application uses POI-tl as the engine for rendering Word templates.
[0052] The road detection report template is used to define the overall layout of the road detection report, and the road detection report template includes tags for binding and rendering the read data. That is, the road detection report template not only defines the overall layout of the road detection report, but also includes specific tags for binding and rendering the previously read data.
[0053] Labels include multiple formats to render different types of data. The format of labels is designed according to actual needs, such as text labels, numeric labels, formatted labels, etc.; the types of data include text, pictures, tables, etc. Labels exist in the form of placeholders to specify the insertion position and format of data in the road inspection report template. By using labels in different formats, different types of data and various layout requirements can be flexibly adapted.
[0054] Furthermore, in one embodiment, the POI-tl engine renders the read data into a preset road detection report template according to a predetermined style and format, thereby realizing the generation of a road detection report, which specifically includes: the POI-tl engine matches the tag with the corresponding read data, and according to the format of the tag and the type of data, the POI-tl engine automatically renders the data, so that the read data is rendered into the road detection report template according to the predetermined style and format, thereby realizing the generation of a road detection report.
[0055] Specifically, during the data binding phase, the POI-tl engine will match and replace the tags with the corresponding data in the data set. According to the format and data type of the tag, the POI-tl engine will automatically handle the rendering process of the data. For example, for text tags, the POI-tl engine will insert the text value of the text into the tag position; for table tags, the POI-tl engine will format the table according to specific format requirements before rendering. In this way, it can ensure that the data is accurately rendered into the template according to the predetermined style and format, generating a dynamic document with rich content and unified format. At the same time, the POI-tl template engine can also achieve a high degree of flexibility and customizability, and can quickly adjust the template and data set according to actual needs to adapt to different dynamic document generation scenarios.
[0056] It should be noted that the POI-tl engine is developed based on Apache POI. Based on the API (Application Programming Interface) interface provided by the POI-tl engine, it is very convenient to dynamically fill various types of content into the Word template, such as text, pictures, tables, lists, and sub-documents. The filling of content can be supported. Moreover, the POI-tl engine has a very powerful plug-in mechanism. By using plug-ins, its functions can be expanded to meet more personalized and customized needs. Further, this application is aimed at the performance bottleneck problem of the POI-tl engine when parsing the data source document by sequentially reading data. The strategy of reading data in parallel is used. By utilizing multi-threading technology, different detection data is allocated to different threads for processing, so that multiple threads can parse and read all data in parallel at the same time. After all threads have completed the processing tasks, the obtained data are integrated and processed. In this way, the processing speed of document parsing and reading is significantly improved, thereby effectively improving the performance bottleneck problem that POI-tl appears in the document parsing stage.
[0057] S3: Stores the generated road detection report based on the object storage service.
[0058] After completing the rendering of the road inspection report template and generating the road inspection report, in order to ensure the persistence and accessibility of these report documents, they need to be securely stored. This application uses an object storage service (OSS) to store the generated road inspection reports. If the imported data has not changed, you can read these report document files directly from the object storage service the next time you need to obtain them, without having to go through a complete set of report document generation processes again. This method can significantly reduce additional performance overhead and waiting time, and improve response speed and user experience. Through integration with the object storage service, it is also more convenient to manage and access document files stored in the cloud.
[0059] Furthermore, appropriate access rights and control policies can be set as needed to ensure data security and privacy. The object storage service also has access rights and control policies to manage road inspection reports stored in the object storage service. In addition, the object storage service also provides a wealth of tools to facilitate operations such as backup, recovery, and migration of the data stored therein, further improving the flexibility and reliability of data management.
[0060] The method for generating a dynamic road detection report in an embodiment of the present application adopts a parallel reading method based on FutureTask to read data for generating a road detection report from various detection data, and then renders the read data into a pre-set road detection report template according to a predetermined style and format through the POI-tl engine to realize the generation of a road detection report, and stores the generated road detection report based on an object storage service, thereby realizing the automatic and convenient generation of road detection reports, greatly reducing the workload, and improving the compatibility of data used when generating road detection reports. By utilizing multi-threading technology, multiple threads can parse, read and process all data simultaneously and in parallel, significantly improving the efficiency of generating road detection reports, thereby improving work efficiency and effectively improving the performance bottleneck problem when generating road detection reports.
[0061] In a second aspect, an embodiment of the present application also provides a device for generating a road detection dynamic report.
[0062] In one embodiment, referring to Figure 2 , Figure 2 This is a functional module diagram of the road detection dynamic report generation device of this application. Figure 2 As shown, the road detection dynamic report generating device includes: a reading module, a rendering module, and a storage module.
[0063] The reading module is used to read data used to generate road detection reports from various detection data in a parallel reading manner based on FutureTask; the rendering module is used to render the read data into a pre-set road detection report template according to a predetermined style and format through the POI-tl engine to realize the generation of road detection reports; the storage module is used to store the generated road detection reports based on the object storage service.
[0064] In a third aspect, an embodiment of the present application provides a road detection dynamic report generation device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0065] Reference Figure 3 , Figure 3 Schematic diagram of the hardware structure of the road detection dynamic report generation device involved in the embodiment of the present application. In the embodiment of the present application, the road detection dynamic report generation device may include a processor, a memory, a communication interface and a communication bus.
[0066] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0067] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to realize the interconnection of devices inside the road detection dynamic report generation device, and an interface for realizing the interconnection of the road detection dynamic report generation device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0068] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0069] The processor may be a general-purpose processor, and the general-purpose processor may call the road detection dynamic report generation program stored in the memory, and execute the road detection dynamic report generation method provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). Among them, the method executed when the road detection dynamic report generation program is called can refer to the various embodiments of the road detection dynamic report generation method of the present application, which will not be repeated here.
[0070] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0071] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0072] The computer-readable storage medium of the present application stores a road detection dynamic report generation program, wherein when the road detection dynamic report generation program is executed by a processor, the steps of the road detection dynamic report generation method as described above are implemented.
[0073] Among them, the method implemented when the road detection dynamic report generation program is executed can refer to the various embodiments of the road detection dynamic report generation method of the present application, and will not be repeated here.
[0074] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0075] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0076] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0077] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0079] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating a road detection dynamic report, characterized in that: The road detection dynamic report generation method comprises: Based on FutureTask, the data used to generate road inspection reports are read from various inspection data in a parallel reading mode; The POI-tl engine renders the read data into a preset road detection report template according to a predetermined style and format, thereby generating a road detection report; The generated road inspection report is stored based on the object storage service.
2. A method for generating a road detection dynamic report as claimed in claim 1, characterized in that: The road inspection report includes a special ground road condition inspection report; The types of test data involved in the above-ground special road condition test report include road surface appearance disease, road surface deflection test, drilling core test, road surface flatness test, and road surface anti-skid performance test; The detection data is stored in the form of an Excel table, and each Excel table stores a corresponding type of detection data.
3. A method for generating a road detection dynamic report as claimed in claim 2, characterized in that: The method based on FutureTask adopts a parallel reading method to read data used to generate a road inspection report from various inspection data, specifically including: Determine the Excel table format and storage location of various test data; According to the available computing resources and the expected amount of detection data, set the corresponding thread pool size to create the thread pool; According to the detected data type, different Excel tables are assigned to different threads for processing, and each thread is responsible for reading and parsing the data in the corresponding Excel table; Schedule and manage threads based on FutureTask, obtain thread execution results, and integrate the data read by each thread to form a data set after all threads are processed.
4. A method for generating a road detection dynamic report as claimed in claim 1, characterized in that: The road detection report template is used to define the overall layout of the road detection report, and the road detection report template includes tags for binding and rendering the read data.
5. A method for generating a road detection dynamic report as claimed in claim 4, characterized in that: The label includes multiple formats to render different types of data. The label formats include text labels, digital labels, and formatting labels. The data types include text, pictures, and tables. The tag exists in the form of a placeholder to specify the insertion position and format of data in the road detection report template.
6. A method for generating a road detection dynamic report as claimed in claim 5, characterized in that: The POI-tl engine renders the read data into a preset road detection report template according to a predetermined style and format to generate a road detection report, specifically including: The POI-tl engine matches the tag with the corresponding data read. According to the format of the tag and the type of data, the POI-tl engine automatically renders the data so that the read data is rendered into the road detection report template according to the predetermined style and format, thereby realizing the generation of the road detection report.
7. A method for generating a road detection dynamic report as claimed in claim 1, characterized in that: The object storage service is also provided with access rights and control policies to manage the road inspection reports stored in the object storage service.
8. A road detection dynamic report generation device, characterized in that: The road detection dynamic report generating device comprises: A reading module, which is used to read data used to generate a road inspection report from various inspection data in a parallel reading manner based on FutureTask; A rendering module, which is used to render the read data into a preset road detection report template according to a predetermined style and format through the POI-tl engine to realize the generation of a road detection report; A storage module is used to store the generated road detection report based on the object storage service.
9. A road detection dynamic report generation device, characterized in that: The road detection dynamic report generation device includes a processor, a memory, and a road detection dynamic report generation program stored in the memory and executable by the processor, wherein when the road detection dynamic report generation program is executed by the processor, the steps of the road detection dynamic report generation method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a road detection dynamic report generation program, wherein when the road detection dynamic report generation program is executed by a processor, the steps of the road detection dynamic report generation method according to any one of claims 1 to 7 are implemented.