Underground municipal infrastructure data quality inspection method, device, medium and equipment
In the underground municipal infrastructure data quality inspection method, the number of threads is determined based on the time-consuming evaluation of quality inspection rules, and the thread queue scheduling strategy is used in combination with data partitioning and monitoring engines to solve the problem of poor quality inspection efficiency and reliability in the existing technology. problem, achieving efficient multi-thread parallel processing and large-scale data processing.
Patent Information
- Application Number
- CN202410722426.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-27
AI Technical Summary
The existing underground municipal infrastructure data quality inspection method is inefficient in single-threaded execution mode. In multi-threaded execution mode, it faces problems such as large scheduling overhead, resource contention, memory overflow, thread exceptions and infinite loops, resulting in poor program reliability. , seriously restricting the efficiency and quality of quality inspection.
Generate multiple quality inspection tasks by reading the premade quality inspection plan, determine the number of threads based on the time-consuming evaluation of quality inspection rules, create data copies and execute quality inspection tasks through the thread queue scheduling strategy, divide large areas into small areas, and generate space Information, using thread parallel processing combined with the monitoring engine and data partitioning mechanism to ensure the smooth execution of quality inspection tasks.
It significantly improves the efficiency of quality inspection, ensures the reliability of the system through reasonable resource allocation and monitoring mechanisms, enhances the scalability of the system, and adapts to large-scale data processing needs.
Smart Images

Figure CN118708335A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method, device, medium and equipment for quality inspection of underground municipal infrastructure data. Background Art
[0002] The existing underground municipal infrastructure data quality inspection method is inefficient in single-threaded execution mode, and faces problems such as high scheduling overhead, resource contention, memory overflow, thread exceptions and dead loops in multi-threaded execution mode, which ultimately lead to program crashes and poor reliability. These problems seriously restrict the efficiency and quality of quality inspection, and a new solution is urgently needed to improve the efficiency and reliability of quality inspection methods. Summary of the invention
[0003] Based on this, it is necessary to provide underground municipal infrastructure data quality inspection methods, devices, media and equipment to solve the problems of poor quality inspection efficiency and quality of existing technologies.
[0004] A method for quality inspection of underground municipal infrastructure data, the method comprising:
[0005] Read the pre-made quality inspection plan and generate multiple quality inspection tasks according to the quality inspection plan;
[0006] The time consumption of the quality inspection rules in each quality inspection task is evaluated, and the number of threads for each quality inspection task is determined based on the time consumption evaluation result to obtain the total number of threads; among which, the task time consumption is positively correlated with the number of threads;
[0007] Read the underground municipal infrastructure data, and create a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set;
[0008] Generate thread instances with a total number of threads based on the data set, and schedule the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy;
[0009] The data set of a large area is divided into data sets of multiple small areas, and the data sets are converted to generate spatial information. The thread instances are started in sequence to perform quality inspection and output a quality inspection report.
[0010] In one embodiment, the calculation formula for time consumption evaluation includes:
[0011]
[0012] In the above formula, M represents the total time consumption level of quality inspection rules, R represents the time consumption level of a single quality inspection rule, D represents the data volume level, math.ceil() represents rounding up, T represents the average time consumption of quality inspection rules, Ti represents the time consumption of quality inspection rules during the i-th spot check, N represents the number of times the quality inspection rules are checked, P represents the preset interval value, S represents the total amount of data, and Q represents the preset interval value.
[0013] In one embodiment, the order of scheduling thread instances to execute quality inspection tasks through a thread queue scheduling strategy includes:
[0014] Creating a thread pool; wherein the number of threads in the thread pool corresponds to the subclass of the data set;
[0015] Submit the quality inspection tasks to be executed to the thread queue of the thread pool in turn to wait for execution, and set the thread pool to obtain tasks from the thread queue according to the first-in-first-out strategy and assign them to idle threads for execution.
[0016] In one embodiment, dividing the data set of a large area into a plurality of data sets of small areas includes:
[0017] Determining a partition range of the data set as an initial current partition area;
[0018] Divide the current divided area into a number of small blocks according to the grid;
[0019] Calculate the density of each small block, expressed as:
[0020] ρ=N / S
[0021] Among them, N represents the number of feature records, and S represents the area of the small block;
[0022] Based on the density, high-density blocks in the small blocks are identified. If the high-density blocks are greater than the preset density, the range of high-density blocks greater than the preset density is used as the updated current division area, and the step of dividing the current division area into several small blocks according to the grid is returned to execute until there are no high-density blocks greater than the preset density, and the numbers of all small blocks are output.
[0023] In one embodiment, converting the data set to generate spatial information includes:
[0024] Parse the data set in terms of precision, format and coordinate system, and convert the parsed results into discrete spatial objects;
[0025] Use linear interpolation and spline interpolation methods to convert discrete spatial objects into continuous spatial objects;
[0026] The spatial index is established based on continuous spatial objects using the grid index method.
[0027] In one embodiment, after starting the thread instances in sequence to perform quality inspection, the method further includes:
[0028] The running status of the thread is periodically detected by the monitoring engine; wherein the running status includes waiting for execution, executing, execution failure and execution success;
[0029] If it is found that the thread is in a waiting or executing state for longer than a preset time, or if it is found that the thread is in an execution failure state, a retry mechanism or a fault tolerance mechanism is triggered.
[0030] In one of the embodiments, after starting the thread instances in order to perform quality checks, the method further includes: using a least recently used strategy to remove the quality checked partition data blocks from the memory.
[0031] An underground municipal infrastructure data quality inspection device, the underground municipal infrastructure data quality inspection device comprising:
[0032] A quality inspection task determination module is used to read a pre-made quality inspection plan and generate multiple quality inspection tasks according to the quality inspection plan;
[0033] The thread quantity determination module is used to evaluate the time consumption of the quality inspection rules in each quality inspection task, and determine the number of threads for each quality inspection task according to the time consumption evaluation result to obtain the total number of threads; wherein the task time consumption is positively correlated with the number of threads;
[0034] A data set creation module, used for reading underground municipal infrastructure data, and creating a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads, so as to form a data set;
[0035] A thread creation and scheduling module, used to generate thread instances of the total number of threads based on the data set, and schedule the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy;
[0036] The quality inspection module is used to divide the data set of a large area into multiple data sets of small areas, convert the data sets to generate spatial information, start thread instances in sequence to perform quality inspection, and output quality inspection reports.
[0037] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to execute the steps of the above-mentioned underground municipal infrastructure data quality inspection method.
[0038] An underground municipal infrastructure data quality inspection device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the underground municipal infrastructure data quality inspection method.
[0039] The present invention provides a method, device, medium and equipment for quality inspection of underground municipal infrastructure data. A plurality of quality inspection tasks are generated by reading a prefabricated quality inspection scheme, and the time consumption of the quality inspection rules in each task is evaluated. The number of threads required for the task is determined according to the evaluation result, and the corresponding data copies and thread instances are created. The data set of a large area is divided into a plurality of small areas by using the thread queue scheduling strategy and data partitioning, and spatial information is generated. The thread instances are started in sequence to perform quality inspection, and finally a quality inspection report is output. The beneficial effect of this method is that the quality inspection efficiency is significantly improved through multi-threaded parallel processing, and the reliability of the system is guaranteed through reasonable resource allocation and monitoring mechanisms. In addition, the use of data partitioning and indexing enhances the scalability of the system and adapts to the needs of large-scale data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] in:
[0042] Figure 1 It is a flowchart of the underground municipal infrastructure data quality inspection method;
[0043] Figure 2 It is a structural schematic diagram of the underground municipal infrastructure data quality inspection device;
[0044] Figure 3 This is a structural block diagram of the underground municipal infrastructure data quality inspection equipment. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof 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.
[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0048] like Figure 1 As shown, Figure 1 : is a flow chart of a method for quality inspection of underground municipal infrastructure data in one embodiment. The method for quality inspection of underground municipal infrastructure data in this embodiment includes the following steps:
[0049] S101, read the pre-made quality inspection plan, and generate multiple quality inspection tasks according to the quality inspection plan.
[0050] Among them, the quality inspection plan is a detailed plan document that contains all the quality inspection rules, standards and steps that need to be executed. These rules and standards are usually pre-established based on industry specifications and specific project requirements. The plan is stored in a file system or database in a standard format (such as XML, JSON, etc.). The quality inspection task is the specific inspection work performed based on the quality inspection plan. Each task contains specific quality inspection rules and data to be inspected.
[0051] Optional, the content of the quality inspection plan: Quality inspection rules: specific inspection items and standards, such as the format, integrity, spatial topological relationship of the inspection data, etc. Inspection standards: define the specific requirements of each quality inspection rule, such as value range, spatial relationship, etc. Data type: specific data type to be inspected, such as points, lines, surfaces, etc. Other parameters: such as data processing methods, task priorities, etc.
[0052] We can divide the entire quality inspection work into multiple tasks according to the requirements of the quality inspection plan. Each task may correspond to a specific data set and one or more quality inspection rules.
[0053] For example, Task 1: Check the integrity and format of point data. Rule 1: Check the coordinate range to ensure that the coordinates of all point data are within the specified range. Rule 2: Check the integrity of attribute data to ensure that the attribute fields (such as ID, name, etc.) of each point data are filled in completely. Rule 3: Check the consistency of coordinate system to ensure that all point data use the same geographic coordinate system.
[0054] Task 2: Check the spatial topological relationship of the line data. Rule 4: Check the breakpoints of the line data to ensure that there are no breakpoints in the line data and that the start and end points of each line segment are connected properly. Rule 5: Check the overlap and intersection of the line data to ensure that there is no overlap or unreasonable intersection between line segments. Rule 6: Check the connectivity of the line data to ensure that all pipeline data are connected and there are no isolated pipeline segments.
[0055] Task 3: Check the consistency of the attributes of the surface data. Rule 7: Check the area specifications of the surface data to ensure that the area of the surface data meets the specifications. Rule 8: Check the closure of the surface data to ensure that all polygons are closed. Rule 9: Check the integrity of the attribute data to ensure that the attribute fields of each surface data (such as area, type, etc.) are complete and consistent.
[0056] S102, performing a time consumption evaluation on the quality inspection rules in each quality inspection task, and determining the number of threads for each quality inspection task according to the time consumption evaluation result to obtain the total number of threads.
[0057] Among them, time consumption assessment is to estimate the execution time of each quality inspection task to determine how long it takes to complete the task.
[0058] In a specific embodiment, the calculation formula for time consumption evaluation includes:
[0059]
[0060] In the above formula, M represents the total time consumption level of quality inspection rules, R represents the time consumption level of a single quality inspection rule, D represents the data volume level, math.ceil() represents rounding up, T represents the average time consumption of quality inspection rules, Ti represents the time consumption of quality inspection rules during the i-th spot check, N represents the number of times the quality inspection rules are checked, P represents the preset interval value, S represents the total amount of data, and Q represents the preset interval value.
[0061] Then, the number of threads for each quality inspection task is determined based on the total quality inspection rule time level (M). The task time is positively correlated with the number of threads, that is, the more time it takes, the more threads need to be allocated to improve efficiency through parallel processing. In this way, through time evaluation, thread allocation can be optimized to avoid resource contention, memory overflow and other problems, and improve the execution efficiency and reliability of quality inspection tasks.
[0062] S103, reading the underground municipal infrastructure data, and creating a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set.
[0063] Specifically, the underground municipal infrastructure data is first read. This data includes information on various infrastructure such as the city’s underground pipelines, pipes, communication cables, etc., which are stored in different databases or file systems. This data needs to be loaded into the memory according to a predetermined reading plan.
[0064] Then, a corresponding number of data copies are created for each thread. Optionally, we copy the underground municipal infrastructure data into multiple data copies, and each thread processes one data copy. All data copies are organized into a data set, which contains all the data blocks to be processed. Each data block is associated with a specific thread, ensuring that each thread only processes the data blocks assigned to it when performing quality inspection tasks. The data set can be stored and managed using linked lists, arrays, or other suitable data structures for efficient subsequent processing.
[0065] In this way, each thread processes its own assigned copy of the data, avoiding resource contention and memory overflow problems.
[0066] S104, generating thread instances of the total number of threads based on the data set, and scheduling the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy.
[0067] Specifically, we will first define a thread class based on the quality inspection requirements of the data set. The thread class can be implemented by inheriting the Thread class or implementing the Runnable interface. The thread class needs to override the run() method, which contains the main code for executing the quality inspection task. Then, based on the total number of threads determined earlier, create an instance of the thread class.
[0068] Then, the thread pool is used to manage the thread instances, avoiding the overhead of thread creation and destruction and improving efficiency. In a specific embodiment, the specific steps of scheduling the order of thread instances to execute quality inspection tasks through the thread queue scheduling strategy include:
[0069] (1) Create a thread pool.
[0070] The thread pool can be understood as a container that contains a set of pre-created threads that can be reused. The number of threads in the thread pool corresponds to the subclass of the data set.
[0071] (2) Submit the quality inspection tasks to be executed to the thread queue of the thread pool in turn to wait for execution, and set the thread pool to obtain tasks from the thread queue according to the first-in-first-out strategy and assign them to idle threads for execution.
[0072] That is, according to the scheduling strategy, the thread pool will obtain tasks from the thread queue and assign the tasks to an idle thread. After the thread executes the quality inspection task, it returns the result to the thread pool manager. Here, our scheduling strategy is the first-in-first-out strategy, which schedules tasks in the order in which they arrive, and the tasks that arrive first are executed first. In addition, we can also choose other strategies, such as the shortest job first strategy, which schedules tasks according to their execution time, and executes tasks with shorter execution time first. Or the time slice strategy, that is, in preemptive scheduling, according to the priority level of the thread, threads of the same priority level form a first-in-first-out queue, and use the time slice strategy.
[0073] S105, dividing the data set of the large area into multiple data sets of small areas, converting the data sets to generate spatial information, starting thread instances in sequence to perform quality inspection, and outputting a quality inspection report.
[0074] The data set of a large area refers to the data set of the entire underground municipal infrastructure. In order to improve processing efficiency, the entire data set is divided into multiple data sets of small areas. In a specific embodiment, the specific steps of dividing the data set of a large area into multiple data sets of small areas include:
[0075] (1) Determine the partition range of the data set as the initial current partition area.
[0076] (2) Divide the current partition area into several small blocks according to the grid.
[0077] For example, the city is divided into several small blocks according to a square grid, each of which is 1 km x 1 km. Of course, other shapes or specifications are also possible.
[0078] (3) Calculate the density of each small block, expressed as:
[0079] ρ=N / S
[0080] Among them, N represents the number of feature records, and S represents the area of the small block;
[0081] (4) Based on the density, high-density blocks are identified in the small blocks. If the high-density blocks are larger than the preset density, the range of high-density blocks larger than the preset density is used as the updated current partition area, and the above step (2) is returned to execute until there are no high-density blocks larger than the preset density, and the numbers of all the small blocks are output.
[0082] The raw data is then converted into a spatial object that can be recognized and operated by a computer. In a specific embodiment, the data set is converted to generate spatial information, including:
[0083] (1) Analyze the data set based on accuracy, format and coordinate system, and convert the analysis results into discrete spatial objects.
[0084] Specifically, when parsing, it is necessary to ensure that the accuracy of all data is unified, such as the number of decimal places of location coordinates, to avoid errors caused by inconsistent accuracy. In addition, the original data may be stored in different formats (such as Shapefile, GeoJSON, CSV, etc.). At the same time, the data may use different coordinate systems (such as WGS84, UTM, etc.). Finally, the parsed data is converted into discrete spatial objects, such as points, lines, and surfaces. For example, the start and end points of underground pipelines are extracted from the data to generate line objects, and surface objects are generated from the boundary points of the plot.
[0085] (2) Use linear interpolation and spline interpolation methods to convert discrete spatial objects into continuous spatial objects.
[0086] Among them, linear interpolation is suitable for simple cases, that is, generating new points between two known points so that these points are connected into a straight line. Spline interpolation is suitable for complex cases, that is, generating smooth curves between multiple known points. Commonly used methods of spline interpolation include cubic spline interpolation, etc.
[0087] (3) Based on continuous spatial objects, a spatial index is established using the grid index method.
[0088] Among them, the grid index method refers to distributing spatial objects in a two-dimensional grid, and each grid cell contains spatial objects within a certain range. When querying, only the relevant grid cells need to be checked, which greatly improves the query efficiency.
[0089] Through these steps, the discrete underground pipeline data can be converted into continuous and operable spatial objects, and an efficient spatial index can be established to improve query and operation efficiency. Finally, the thread instances are started in a predetermined order, and each thread processes a data set of one or more small areas. When the thread instance performs the quality inspection task, it will perform quality inspection on the assigned data block, including attribute inspection and spatial topology inspection. Each thread instance summarizes the quality inspection results and generates a quality inspection report. The quality inspection report includes the data inspection results of each small block, the problems found, and the recommended solutions.
[0090] In a specific embodiment, after starting the thread instances in sequence to perform quality inspection, the following steps are also performed: the running status of the threads is periodically detected by the monitoring engine; wherein the running status includes waiting for execution, executing, execution failure and successful execution; if it is found that the thread is in the waiting for execution or executing state for longer than a preset time, or the thread is found to be in the execution failure state, a retry mechanism or a fault tolerance mechanism is triggered.
[0091] In this process, we can use modular redundancy algorithm for monitoring. The modular redundancy algorithm consists of m identical modules and a voter; after voting by the voter, the output of the majority of the m modules with the same results is used as the output of the system. If only n or n+1 modules out of the m modules can work properly, the system can work normally and output the correct results. Assume that the voter is completely reliable; the reliability of each module is R, then the reliability of the m modular redundancy algorithm is:
[0092]
[0093] In this way, the monitoring engine can effectively manage and optimize the execution of quality inspection tasks, ensuring that problems can be handled in a timely manner when encountered, thereby improving the overall reliability and efficiency of quality inspection tasks.
[0094] In a specific embodiment, after the thread instances are started in sequence to perform quality checks, the following steps are further performed: the quality-checked partition data blocks are removed from the memory using the least recently used strategy.
[0095] Specifically, during the quality inspection process, the system will continuously load data blocks from the disk or other storage media into the memory for quality inspection. These data blocks occupy a certain amount of space in the memory. The system needs to maintain a record to track the most recent use time of each data block. This is usually achieved through a linked list or similar data structure, with the head of the linked list being the most recently used data block and the tail being the least recently used data block. When a data block completes the quality inspection, the system will check the memory usage according to the least recently used strategy. If the memory space is insufficient or the preset memory usage limit is reached, the system will choose to remove the least recently used data block. The removed data blocks will be saved to the disk or other external storage. The space released in the memory can be used to load new data blocks and continue the subsequent quality inspection tasks.
[0096] This approach ensures that quality inspection tasks can be carried out smoothly without causing memory overflow or performance degradation. This not only improves memory utilization, but also enhances system stability and reliability.
[0097] The above-mentioned underground municipal infrastructure data quality inspection method generates multiple quality inspection tasks by reading the pre-made quality inspection plan, and evaluates the time consumption of the quality inspection rules in each task. According to the evaluation results, the number of threads required for the task is determined, and the corresponding data copies and thread instances are created. The data set of a large area is divided into multiple small areas by using the thread queue scheduling strategy and data partitioning, and spatial information is generated. The thread instances are started in sequence to perform quality inspection, and finally the quality inspection report is output. The beneficial effect of this method is that the quality inspection efficiency is significantly improved through multi-threaded parallel processing, and the reliability of the system is guaranteed through reasonable resource allocation and monitoring mechanisms. In addition, the use of data partitioning and indexing enhances the scalability of the system and adapts to the needs of large-scale data processing.
[0098] In one embodiment, Figure 2 As shown, a data quality inspection device for underground municipal infrastructure is proposed, which includes:
[0099] The quality inspection task determination module 201 is used to read the pre-made quality inspection plan and generate multiple quality inspection tasks according to the quality inspection plan;
[0100] The thread number determination module 202 is used to evaluate the time consumption of the quality inspection rules in each quality inspection task, and determine the number of threads for each quality inspection task according to the time consumption evaluation result to obtain the total number of threads; wherein the task time consumption is positively correlated with the number of threads;
[0101] The data set creation module 203 is used to read the underground municipal infrastructure data and create a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set;
[0102] The thread creation and scheduling module 204 is used to generate thread instances of the total number of threads based on the data set, and schedule the order in which the thread instances execute quality inspection tasks through the thread queue scheduling strategy;
[0103] The quality inspection module 205 is used to divide the data set of a large area into multiple data sets of small areas, convert the data sets to generate spatial information, start thread instances in sequence to perform quality inspection, and output a quality inspection report.
[0104] Figure 3 FIG. 1 shows an internal structure diagram of an underground municipal infrastructure data quality inspection device in one embodiment. Figure 3As shown, the underground municipal infrastructure data quality inspection device includes a processor, a memory and a network interface connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the underground municipal infrastructure data quality inspection device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the underground municipal infrastructure data quality inspection method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the underground municipal infrastructure data quality inspection method. Those skilled in the art can understand that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the present application scheme, and does not constitute a limitation on the underground municipal infrastructure data quality inspection equipment to which the present application scheme is applied. The specific underground municipal infrastructure data quality inspection equipment may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0105] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: reading a pre-made quality inspection plan and generating multiple quality inspection tasks according to the quality inspection plan; performing a time consumption evaluation on the quality inspection rules in each quality inspection task, and determining the number of threads for each quality inspection task according to the time consumption evaluation result to obtain the total number of threads; wherein the task time consumption is positively correlated with the number of threads; reading underground municipal infrastructure data, and creating a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set; generating thread instances of the total number of threads based on the data set, and scheduling the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy; dividing a large area data set into multiple small area data sets, and converting the data set to generate spatial information, starting thread instances in sequence to perform quality inspection, and outputting a quality inspection report.
[0106] A device for quality inspection of underground municipal infrastructure data comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: reading a prefabricated quality inspection plan and generating a plurality of quality inspection tasks according to the quality inspection plan; performing a time consumption evaluation on the quality inspection rules in each quality inspection task and determining the number of threads of each quality inspection task according to the time consumption evaluation result to obtain the total number of threads; wherein the task time consumption is positively correlated with the number of threads; reading underground municipal infrastructure data and creating a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set; generating thread instances of the total number of threads based on the data set and scheduling the order in which the thread instances execute the quality inspection tasks through a thread queue scheduling strategy; dividing a large area data set into a plurality of small area data sets, converting the data sets to generate spatial information, starting thread instances in sequence to perform quality inspection, and outputting a quality inspection report.
[0107] It should be noted that the above-mentioned underground municipal infrastructure data quality inspection method, device, equipment and computer-readable storage medium belong to a general inventive concept, and the contents in the embodiments of the underground municipal infrastructure data quality inspection method, device, equipment and computer-readable storage medium are applicable to each other.
[0108] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0110] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for quality inspection of underground municipal infrastructure data, characterized in that: The method comprises: Read the pre-made quality inspection plan and generate multiple quality inspection tasks according to the quality inspection plan; The time consumption of the quality inspection rules in each quality inspection task is evaluated, and the number of threads for each quality inspection task is determined based on the time consumption evaluation result to obtain the total number of threads; among which, the task time consumption is positively correlated with the number of threads; Read the underground municipal infrastructure data, and create a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads to form a data set; Generate thread instances with a total number of threads based on the data set, and schedule the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy; The data set of a large area is divided into data sets of multiple small areas, and the data sets are converted to generate spatial information. The thread instances are started in sequence to perform quality inspection and output a quality inspection report.
2. The method according to claim 1, characterized in that: The calculation formula for time consumption evaluation includes: In the above formula, M represents the total time consumption level of quality inspection rules, R represents the time consumption level of a single quality inspection rule, D represents the data volume level, math.ceil() represents rounding up, T represents the average time consumption of quality inspection rules, Ti represents the time consumption of quality inspection rules during the i-th spot check, N represents the number of times the quality inspection rules are checked, P represents the preset interval value, S represents the total amount of data, and Q represents the preset interval value.
3. The method according to claim 1, characterized in that The order of scheduling thread instances to execute quality inspection tasks through the thread queue scheduling strategy includes: Creating a thread pool; wherein the number of threads in the thread pool corresponds to the subclass of the data set; Submit the quality inspection tasks to be executed to the thread queue of the thread pool in turn to wait for execution, and set the thread pool to obtain tasks from the thread queue according to the first-in-first-out strategy and assign them to idle threads for execution.
4. The method according to claim 1, characterized in that: The step of dividing a large area data set into a plurality of small area data sets includes: Determining a partition range of the data set as an initial current partition area; Divide the current divided area into a number of small blocks according to the grid; Calculate the density of each small block, expressed as: ρ=N / S Among them, N represents the number of feature records, and S represents the area of the small block; Based on the density, high-density blocks in the small blocks are identified. If the high-density blocks are greater than the preset density, the range of high-density blocks greater than the preset density is used as the updated current division area, and the step of dividing the current division area into several small blocks according to the grid is returned to execute until there are no high-density blocks greater than the preset density, and the numbers of all small blocks are output.
5. The method according to claim 1, characterized in that The step of converting the data set to generate spatial information includes: Parse the data set in terms of precision, format and coordinate system, and convert the parsed results into discrete spatial objects; Use linear interpolation and spline interpolation methods to convert discrete spatial objects into continuous spatial objects; The spatial index is established based on continuous spatial objects using the grid index method.
6. The method according to claim 1, characterized in that After the thread instances are started in sequence to perform quality inspection, the method further includes: The running status of the thread is periodically detected by the monitoring engine; wherein the running status includes waiting for execution, executing, execution failure and execution success; If it is found that the thread is in a waiting or executing state for longer than a preset time, or if it is found that the thread is in an execution failure state, a retry mechanism or a fault tolerance mechanism is triggered.
7. The method according to claim 1, characterized in that After the thread instances are started in order to perform quality checks, the method further includes: using a least recently used strategy to remove the quality checked partition data blocks from the memory.
8. An underground municipal infrastructure data quality inspection device, characterized in that: The underground municipal infrastructure data quality inspection device comprises: A quality inspection task determination module is used to read a pre-made quality inspection plan and generate multiple quality inspection tasks according to the quality inspection plan; The thread quantity determination module is used to evaluate the time consumption of the quality inspection rules in each quality inspection task, and determine the number of threads for each quality inspection task according to the time consumption evaluation result to obtain the total number of threads; wherein the task time consumption is positively correlated with the number of threads; A data set creation module, used for reading underground municipal infrastructure data, and creating a corresponding number of data copies of the underground municipal infrastructure data according to the determined total number of threads, so as to form a data set; A thread creation and scheduling module, used to generate thread instances of the total number of threads based on the data set, and schedule the order in which the thread instances execute quality inspection tasks through a thread queue scheduling strategy; The quality inspection module is used to divide the data set of a large area into multiple data sets of small areas, convert the data sets to generate spatial information, start thread instances in sequence to perform quality inspection, and output quality inspection reports.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
10. An underground municipal infrastructure data quality inspection device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
E-commerce platform data quality inspection method and system
CN119105856A
