Cluster type mass remote sensing image interpretation framework based on EBS and multi-node parallelism

By adopting parallel computing and distributed processing technology in the processing of massive remote sensing image data, allocating tasks to multiple computing nodes, and using technologies such as Redis, Celery and MySQL, the problem of low efficiency in remote sensing image data processing is solved and efficient Interpretation and system reliability, suitable for large-scale data processing and multi-user access.

CN118626243APending Publication Date: 2024-09-10NANJING GUOTU INFORMATION IND CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311841911.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The processing efficiency of massive remote sensing image data is low and GPU resources are not fully utilized. Especially during the interpretation process, it is difficult for a single computer to process efficiently due to the large data capacity, complex formats, and large differences in time and spatial resolution requirements.

Method used

A clustered massive remote sensing image interpretation framework based on EBS and multi-node parallelism is adopted. Through parallel computing and distributed processing, remote sensing data tasks are allocated to multiple computing nodes for parallel computing, and technologies such as Redis, Celery and MySQL are used to implement the tasks. Scheduling and storage improve interpretation efficiency and system reliability.

Benefits of technology

It improves the efficiency and system reliability of remote sensing image interpretation, realizes efficient processing and storage of large-scale data, reduces waiting time, enhances system fault tolerance and performance, and supports multi-user parallel access and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626243A
    Figure CN118626243A
Patent Text Reader

Abstract

According to the cluster type mass remote sensing image interpretation framework based on the EBS and the multi-node parallelism, the parallel computing capability is utilized, the processing task of the remote sensing data is distributed to a plurality of computing nodes to be carried out, and the interpretation efficiency is improved. The method mainly comprises the following steps: (1) configuring a basic environment; (2) judging whether a request is sent or not according to the number of remaining tasks in Redis; (3) task release: sending a request, writing an application program code, and adding subtasks into a message queue; (4) task execution: receiving tasks in Redis, and performing remote sensing image interpretation; (5) starting task progress monitoring; (6) task exception processing: capturing exceptions and re-issuing tasks to the Redis task queue; and (7) generating and browsing interpretation results: after all tasks are finished, merging the interpretation results of the images, converting into a vector layer, and optimizing and adjusting. According to the method, Redis, Celery, MySQL and other frameworks and technologies are utilized, the method is suitable for application scenes needing to process a large number of tasks and real-time data, and mass remote sensing image data are effectively managed and utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of remote sensing image interpretation, and specifically relates to a cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism. Background Art

[0002] In the development of distributed and clustered applications, there are problems involving large-scale data processing and task scheduling. To deal with these problems, developers use some common technologies and tools, such as Redis, Celery, and MySQL. Redis is an in-memory data storage system, which is often used as a cache and message broker. It has the characteristics of fast access and high scalability, and can effectively handle a large amount of short-term data access and storage. Celery is a distributed task queue system for processing large-scale asynchronous tasks. It can distribute task data to multiple working nodes, and schedule and monitor tasks to achieve efficient task processing. MySQL is a commonly used relational database management system, widely used for data persistence and storage. It provides powerful data management and query functions, and can be integrated with other components (such as Redis and Celery) to achieve data reading, writing and processing. Summary of the invention

[0003] Purpose of the invention: With the development and increasing application of remote sensing technology, the use of flying platforms such as satellites and drones has also increased, resulting in the accumulation of massive remote sensing image data. The scale and quantity of these data continue to increase, and the effective management and utilization of these data has become a serious problem. In particular, in the process of interpreting massive remote sensing images, due to the characteristics of remote sensing data, namely, large data capacity, complex data format, and great differences in the requirements for time and spatial resolution, simply using a single computer for processing faces challenges such as low interpretation efficiency and insufficient utilization of GPU resources. The present invention is based on solutions of parallel computing, distributed processing and other advanced technologies. Utilizing the power of parallel computing, the processing tasks of remote sensing data are distributed to multiple computing nodes for parallel computing, thereby improving the efficiency of interpretation.

[0004] Technical solution: A cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism of the present invention includes the following steps:

[0005] Step 1: Basic environment configuration: To build a reliable massive remote sensing image interpretation framework, you first need to perform multiple basic environment configuration and program deployment steps, including configuring EBS storage volumes, creating and starting multiple EC2 instances, and installing and configuring Redis, MySQL, and Celery.

[0006] Step 2: Determine the number of tasks and whether to send a request: Send a remote sensing image interpretation request to the master node root_node in the form of a service request. Root_node determines the number of tasks remaining in Redis. It prompts how many tasks are left and whether it is necessary to continue the detection operation.

[0007] Step 3, task release: If you need to continue the detection operation in step 2, send a request, write the application code, and determine how many subtasks need to be added to the Redis message queue according to the size of the remote sensing image. The specific steps include: determining the size of the remote sensing image and cropping the image, sending the task to the Redis message queue, and storing the interpretation parameters in the MySQL database.

[0008] Step 4, Task Execution: Each EC2 node is a Worker, and they are all connected to the Redis service. When there are tasks to be processed in Redis, the Worker will take the tasks. By associating task_id with the current project_id, the Worker will obtain the relevant interpretation data parameters from MySQL to interpret the remote sensing image. After the interpretation is completed, the generated result file will be stored in the specified output path in TIF format.

[0009] Step 5, Task Monitoring: Enable task progress monitoring, access the node information request interface regularly, obtain the progress information of each EC2 node in real time and display it. Mainly includes sending and processing requests, and information display.

[0010] Step 6, task exception handling: When using Redis and Celery to build a task queue, if a task ends abnormally, the present invention can automatically re-execute the task. To this end, the Worker process will capture any unexpected exceptions and re-publish the task to the Redis task queue for subsequent re-execution.

[0011] Step 7, generate and browse interpretation results: After all tasks are completed on the display page, the cropped image interpretation results can be merged into a TIF file and converted into a vector layer. Then, according to the interpretation requirements, the vector layer is optimized and adjusted. The specific steps include: merge raster, convert raster to surface, and post-process the surface layer.

[0012] Based on the problem of effectively managing and utilizing the accumulated massive remote sensing image data, the present invention adopts parallel computing, distributed processing and other advanced technology solutions. By utilizing the power of parallel computing, the processing tasks of remote sensing data are distributed to multiple computing nodes for parallel computing, thereby improving the interpretation efficiency and effectively solving the problems of low interpretation efficiency and insufficient GPU resource utilization faced by processing using a single computer.

[0013] Furthermore, in the basic environment configuration of step 1, to build a reliable massive remote sensing image interpretation framework, you first need to complete multiple basic environment configuration and program deployment steps. The steps are as follows:

[0014] Step 1.1, configure EBS storage volume, create and launch multiple EC2 instances: First, log in to the AWS Management Console, enter the EC2 control panel, create a storage volume, and select parameters such as storage type, capacity size, and availability zone; second, create an EC2 instance. In the EC2 control panel, select "Instance", then click "Launch Instance". In the launch wizard, select the appropriate AMI as the operating system and software base image used by the instance, select the instance type and other configuration options, such as subnet, VPC, security group, etc. In the "Storage" section, attach the previously created storage volume to the instance and select the corresponding device name. After completing the configuration, click "Launch" to create the EC2 instance; third, on the "Storage Volume" page, perform the "Create Snapshot" operation for the EBS volume that needs to be shared, and record the ID of this snapshot; finally, repeat the previous steps to create multiple EC2 instances. It should be noted that when configuring storage, select "Use an existing EBS volume" and select a shared storage volume so that the instance can access shared data.

[0015] Step 1.2, installation and environment configuration of Redis, MySQL, and Celery: Redis is used as a message agent, Celery is used as a task queue, and MySQL is used as a request sending parameter storage library. The three work together to build a cluster system, which can realize the distributed interpretation and result storage of remote sensing image data. Specifically including Redis installation and deployment, Celery installation and deployment, and MySQL installation and deployment. First, install a Redis server on an EC2 instance. Assume that the instance is named root_node, edit the Redis configuration file, set the required configuration options, such as password, port number, maximum memory limit, etc., and start the Redis service; secondly, copy the project running virtual environment to the EC2 instance, use pip to install the Celery library, and in celery_config.py, configure the message agent (such as RabbitMQ, Redis), set the task queue, the number of Workers, the serialization method of the task, the execution task result serialization method, the content type accepted by the specified task, the host address of the Redis service, the service port, the message queue database name, and the result storage database name, etc. The present invention uses Redis as a message agent. Finally, install the MySQL server in the root_node, set the MySQL username and password, create the database and table, start the MySQL service, and write the code to connect to the MySQL database in the configuration file of the project running code.

[0016] Furthermore, the number of tasks determined in step 2 is determined, and whether a request is being sent. A remote sensing image interpretation request is sent to root_node. Root_node determines the number of tasks remaining in Redis and prompts "How many tasks are there currently? Do you need to continue the detection operation?" If you click "Yes", proceed to the next step; otherwise, end the request directly.

[0017] Furthermore, in the task release described in step 3, the number of subtasks that need to be added to the Redis message queue is determined according to the size of the remote sensing image in the task, and the steps are as follows:

[0018] Step 3.1, determine the size of remote sensing images and crop the images: Taking change detection as an example, there are several subfolders in the received folder, and the name of a single subfolder is name. When there are two early and late remote sensing images, it is assumed that the image names are pre.tif and post.tif, and the sizes of the two images are the same. Get the width width and height height of the pre.tif remote sensing image. If either width or height is greater than the specified size maxsize, crop the image with the crop size of clipsize. Calculate the number of cropped rows and columns cols according to width, height, and clipsize. The cropping calculation formula is:

[0019] rows = int(height / clipsize) (1)

[0020] cols = int(width / clipsize) (2)

[0021] According to the cropping formula, pre.tif and post.tif are cropped into several early and late images. The corresponding early and late images are stored in different folders. The folder name is the number of columns of the image_number of rows_folder name, for example, the 0th column and the 1st row is 0_1_name; if it is smaller than the specified size, no cropping is performed and the subfolder is placed in the task storage folder.

[0022] Step 3.2, send the task to the Redis message queue: traverse the folders trimmed in step 3.1, take the images in a folder as a subtask, serialize the subtask, configure a task_id for each subtask, and submit the task_id and the serialized task to the Redis message queue.

[0023] Step 3.3, store the interpreted parameters in the MySQL database: configure a project_id for this request (this parameter is shared by all subtasks in this request), store the common parameters, project_id, and task_id of this task in the ProjectBatchDetection table, and store different parameters and project_id in the TaskBatchDetection table. The two tables are associated through project_id as a foreign key;

[0024] Furthermore, during the execution of the task in step 4, the Worker will receive the tasks to be processed in Redis. By associating task_id with the current project_id, the Worker will obtain the relevant interpretation data parameters from MySQL to interpret the remote sensing image. After the interpretation is completed, the generated result file will be stored in the specified output path in TIF format. To ensure that the spatial reference of the result file is consistent with that of the processed image, the TIF file will be named using the name of the corresponding folder and set the corresponding spatial reference information.

[0025] Furthermore, in the task monitoring described in step 5, the task progress monitoring is enabled, the node information request interface is accessed regularly, the progress information of each EC2 node is obtained in real time and displayed, the steps are as follows:

[0026] Step 5.1 Send and process the request: Send a Post request with project_id as a parameter. After receiving the request, the master node first associates the task based on project_id to obtain the current number of completed tasks. Secondly, it accesses the log information file of each EC2 node. The log information file of each node is stored in the logs folder of the master node. It reads the log information of each node, obtains the image information currently being processed by the node, the processing progress, GPU and CPU utilization, and graphics card information, encapsulates the information, and returns it in JSON format.

[0027] Step 5.2 Information display: The client decodes the returned information data and displays it in the corresponding window of the front end so that the user can understand the completion status of the interpretation task and the operation status of the node at any time.

[0028] Furthermore, in the task exception handling of step 6, if the task ends abnormally, the Worker process will capture any unexpected exceptions and republish the task to the Redis task queue for subsequent re-execution. The present invention sets a specified waiting time wait_time and a maximum number of retries. During the execution of the task, if an exception occurs, the task will automatically retry until the maximum number of retries is reached, thereby improving the reliability and success rate of the task.

[0029] Furthermore, in the generation and browsing of the interpretation results described in step 7, when all the display tasks on the display page are completed, the interpretation results of the cropped images are merged into a TIF file and converted into a vector layer. The vector layer is optimized and adjusted according to the interpretation requirements. The steps are as follows:

[0030] Step 7.1 Merge rasters: First, based on the GDAL.Open function, obtain the image height, width, number of bands, geographic range and other information, including the existing TIF file in the merge output path. Secondly, according to the TIF file name, determine its row and column, find the corresponding coordinate range information, and create a TIF template file with the horizontal and vertical range sizes based on the driver.Create function to merge horizontally. Based on the same method, merge vertically. If there is a non-zero value in the overlapping range, and the other image has a 0 value in the corresponding area, then take the non-zero value to avoid missed detection due to the merge. Merge the horizontal and vertical merge results to obtain the final remote sensing image interpretation result TIF file named result.tif.

[0031] Step 7.2 Raster to Polygon: Based on the RasterToPolygon_conversion tool in ArcPy, perform the raster to polygon operation on result.tif to obtain the detection result vector layer SHP file.

[0032] Step 7.3 Post-processing of surface layer: Based on the SHP file obtained in step 7.2, obtain its spatial reference, whether it is a projected coordinate system or a geographic coordinate system. If it is a geographic coordinate system, use the projection conversion tool Project_management to convert it to a projected coordinate system; use CalculateField_management to add the area field Area, calculate the area value of each surface patch, and use the selection tool SelectLayerByAttribute_management to filter out patches larger than the fragment threshold fragment according to the calculated area value. Use the MakeFeatureLayer_management tool to create a temporary layer, use EliminatePolygonPart_management to eliminate holes on the temporary layer, use CA.SmoothPolygon to smooth the boundaries, and use CA.SimplifyBuilding to perform regularization operations to obtain the final post-processed SHP file, which is the final remote sensing interpretation result.

[0033] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0034] In order to deal with the problems of large-scale data processing and task scheduling in distributed and clustered application development, the developers use some common technologies and tools, such as Redis, Celery and MySQL, etc., and solutions based on parallel computing, distributed processing and other advanced technologies have emerged. By utilizing the ability of parallel computing, the processing tasks of remote sensing data are distributed to multiple computing nodes for parallel computing, thereby improving the efficiency of interpretation. It has the following advantages: ① Using EBS as a storage medium, the storage capacity can be easily expanded, and large-scale data sets can be efficiently processed and interpreted, thereby improving the efficiency of interpretation; ② The framework adopts multi-node parallel computing, which can divide the task into multiple subtasks and process them simultaneously, thereby improving the processing speed and processing capacity and reducing the waiting time; ③ Using a cluster architecture, the nodes can back up and redundancy each other, thereby improving the fault tolerance of the system, and the faulty nodes can be automatically restored, thereby improving the reliability of the system; ④ EBS is used as a storage medium, and the storage capacity can be dynamically adjusted as needed to ensure the flexible use of storage space, and the performance and processing capacity of the interpretation system can be improved by increasing the number of nodes. ⑤ Different users can access and process remote sensing image data at the same time, thereby promoting teamwork and information sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Technology Roadmap

[0036] Figure 2 Redis+MySQL+Celery architecture diagram

[0037] Figure 3 Cutting Flowchart

[0038] Figure 4 Schematic diagram of foreground remote sensing image cropping results

[0039] Figure 5 Request a Roadmap

[0040] Figure 6 Task progress monitoring chart

[0041] Figure 7 Schematic diagram of remote sensing interpretation results for change detection

[0042] Figure 8 Interpreting the parameter storage diagram DETAILED DESCRIPTION

[0043] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.

[0044] The present invention provides a cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism. The technical roadmap is as follows: Figure 1 As shown, the experimental steps are as follows:

[0045] Step 1: To build a reliable massive remote sensing image interpretation framework, you first need to complete multiple basic environment configuration and program deployment steps. The steps are as follows:

[0046] Step 1.1, configure EBS storage volume, create and start multiple EC2 instances: first, log in to the AWS management console, enter the EC2 control panel, create a storage volume, select storage type, capacity size and available zone and other parameters; second, create an EC2 instance, in the EC2 control panel, select "Instance", then click "Launch Instance", in the startup wizard, select Windows system as the operating system and software base image used by the instance, select the instance type and other configuration options, such as subnet, VPC, security group, etc. In the "Storage" section, attach the previously created storage volume to the instance and select the corresponding device name. The storage volume memory of the present invention is 1T. After completing the configuration, click "Start" to create an EC2 instance; third, on the "Storage Volume" page, perform the "Create Snapshot" operation for the EBS volume to be shared, and record the ID of this snapshot; finally, repeat the previous steps to create multiple EC2 instances. There are 4 EC2 instances in the present invention. It should be noted that when configuring storage, select "Use an existing EBS volume" and select a shared storage volume so that the instance can access shared data.

[0047] Step 1.2, installation and environment configuration of Redis, MySQL, and Celery: Redis is used as a message agent, Celery is used as a task queue, and MySQL is used as a request sending parameter storage library. The three work together to build a cluster system, which can realize the distributed interpretation and result storage of remote sensing image data. Specifically including Redis installation and deployment, Celery installation and deployment, and MySQL installation and deployment. First, install a Redis server on an EC2 instance. Assume that the instance is named root_node, edit the Redis configuration file, set the required configuration options, such as password, port number, maximum memory limit, etc., and start the Redis service. The present invention assumes that the password is 1234 and the port number is 6666; secondly, copy the project running virtual environment to the EC2 instance, use pip to install the Celery library, and in celery_config.py, use Redis as a message agent, assume that the maximum number of executed tasks of the Worker is set to 1, the serialization method of the task, the serialization method of the execution result, and the content type accepted by the specified task are all in json format, the Redis service port is 6379, the message queue database name is 5, and the result storage database name is 7. Finally, install the MySQL server in root_node, set the MySQL user name to root, the password to 3306, the database name to db, the project table name to ProjectBatchDetection, the task table name to TaskBatchDetection, connect the two tables with project_id as the foreign key, start the MySQL service, and write the code to connect to the MySQL database in the configuration file of the project running code. Figure 2 shown.

[0048] Step 2, determine the number of tasks, whether to send a request: send a remote sensing image interpretation request to root_node in the form of a service request, root_node determines the number of tasks left in Redis, and prompts "how many tasks are there currently, do you need to continue the detection operation?" If you click "yes", proceed to the next step; otherwise, end this request directly. Click "yes" in the present invention.

[0049] Step 3, Task Release: If you click "Yes" in step 2, send a request, write application code, and determine the number of subtasks that need to be added to the Redis message queue based on the size of the remote sensing image in the task. The steps are as follows:

[0050] Step 3.1, determine the size of remote sensing images and crop the images: Taking change detection as an example, assuming that there are several subfolders in the received folder, and there are 2 early and late remote sensing images in a single subfolder, the image names are pre.tif and post.tif, the two images are the same size, and the folder name is test. Based on the GDAL.Open function, the width of the pre.tif remote sensing image is 10764, and the height is 8181. If either of the width and height is greater than the specified size maxsize is 10000, the image is cropped, and the cropping size is clipsize 4000. The number of cropping rows and columns is calculated based on width, height, and clipsize. The cropping calculation formula is:

[0051] rows = int(height / clipsize) (1)

[0052] cols = int(width / clipsize) (2)

[0053] The present invention calculates that rows is 2, cols is 2, and pre.tif and post.tif are cropped into several early and late images according to the cropping formula. The corresponding early and late images are stored in different folders. The folder name is a combination of the image column number, row number, and folder name. For example, row 0 and column 1 are 0_1_test. The cropping flow chart is as follows: Figure 3 As shown in the figure, the schematic diagram of the cropping result of pre.tif remote sensing image is as follows Figure 4 If no cropping is required, the image is stored in the storage folder as a task.

[0054] Step 3.2, send the task to the Redis message queue: traverse the folders trimmed in step 3.1, take the images in a folder as a subtask, serialize the subtask, configure a task_id for each subtask, and submit the task_id and the serialized task to the Redis message queue.

[0055] Step 3.3 Store the interpreted parameters in the MySQL database: This request configures a project_id (this parameter is shared by all subtasks in this request), and the interpreted parameters are stored as shown in the figure Figure 8 As shown in the figure, the black font is the field name, and the non-black font is the record data. The parameters, project_id, and task_id shared by this task are stored in the ProjectBatchDetection table. The ProjectBatchDetection table of the present invention is as follows Figure 8(a); different parameters and project_id are stored in the TaskBatchDetection table. The TaskBatchDetection table of the present invention is as follows: Figure 8 As shown in (b), the two tables are related by using project_id as a foreign key;

[0056] Step 4, task execution: Each EC2 node is a Worker, and is connected to the Redis service. If there are tasks in Redis, it will be collected and associated with the current project_id through task_id. Relevant interpretation data parameters are obtained from MySQL to interpret the remote sensing image, and the result file corresponding to the image is generated and stored in the output path. The result is in TIF format, and the spatial reference is set for the TIF file, which is consistent with the spatial reference of the processed image and named as the corresponding folder.

[0057] Step 5, Task Monitoring: Enable task progress monitoring, access the node information request interface regularly, obtain the progress information of each EC2 node in real time and display it. The steps are as follows:

[0058] Step 5.1, Send and process the request: Send a Post request with project_id as a parameter. After receiving the request, the master node first associates the task according to project_id and obtains the current number of completed tasks. Then, it accesses the log information file of each EC2 node. The log information file of each node is stored in the master node logs folder. It reads the log information of each node, obtains the image information, processing progress, GPU and CPU utilization, and graphics card information that the node is currently processing, and encapsulates the information and returns it in JSON format. The request roadmap is as follows: Figure 5 shown.

[0059] Step 5.2, information display: The client decodes the returned information data and displays it in the corresponding window of the front end so that the user can understand the completion status of the interpretation task and the operation status of the node at any time. The task monitoring process is as follows: Figure 6 shown.

[0060] Step 6, task exception handling: When using Redis and Celery, when a task ends abnormally, the present invention starts the operation of automatically re-executing the task, and the Worker process can capture unexpected exceptions and re-publish the task to the Redis task queue. The present invention sets the specified waiting time wait_time to 30s and the maximum number of retries to 3 times. During the execution of the task, if an exception occurs, the task will automatically retry until the maximum number of retries is reached, thereby improving the reliability and success rate of the task.

[0061] Step 7, generate and browse the interpretation results: When the display page shows that all tasks are completed, merge the interpretation results of the cropped images into a TIF file and convert them into a vector layer, and optimize and adjust the vector layer according to the interpretation requirements. The steps are as follows:

[0062] Step 7.1, merge raster: First, based on the GDAL.Open function, obtain the image height, width, number of bands, geographic range and other information. The module package merges the existing TIF files in the output path. Secondly, according to the TIF file name, determine its row and column, find the corresponding coordinate range information, calculate the horizontal range, and create a TIF template file with the horizontal and vertical range sizes based on the driver.Create function. First, merge horizontally, and then merge vertically based on the same method. If there is a non-zero value in the overlapping range, and the other image has a zero value in the corresponding area, then take the non-zero value to avoid missed detection due to the merge. Merge the horizontal and vertical merge results to obtain the final remote sensing image interpretation result TIF file named result.tif.

[0063] Step 7.2, raster to polygon: Based on ArcPy, perform raster to polygon conversion on result.tif to obtain the detection result vector layer SHP file. The raster to polygon conversion operation uses the RasterToPolygon_conversion tool in ArcGIS.

[0064] Step 7.3, surface layer post-processing: Based on the SHP file obtained in step 7.2, obtain its spatial reference, whether it is a projected coordinate system or a geographic coordinate system. If it is a geographic coordinate system, use the Project_management projection conversion tool to convert it to a projected coordinate system; use CalculateField_management to add the area field Area, calculate the area value of each surface patch, and use the selection tool SelectLayerByAttribute_management to filter out patches larger than the fragment threshold fragment, set to 150, according to the calculated area value. Use the MakeFeatureLayer_management tool to create a temporary layer, and use the EliminatePolygonPart_management, smooth the boundaries (CA.SmoothPolygon), and regularize (CA.SimplifyBuilding) operations on the temporary layer to obtain the final post-processed SHP file, that is, this file is the final remote sensing interpretation result. The schematic diagram of the change detection remote sensing interpretation result is shown in the figure. Figure 7 shown.

Claims

1. A cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism, characterized by: The EBS storage volume used in this invention can achieve persistent data storage, high reliability, scalability, high performance, backup and recovery. Secondly, when multiple nodes are in parallel, Redis+celery+MYSQL technology is used. Redis provides high-speed caching, Celery performs asynchronous task processing on multiple remote sensing image interpretation tasks, and MySQL provides reliable data persistence and consistency, which improves the efficiency of remote sensing image interpretation and is particularly suitable for application scenarios that need to process a large number of tasks and real-time data. It includes the following steps: Step 1: Basic environment configuration: In order to build a reliable massive remote sensing image interpretation framework, you first need to complete multiple basic environment configuration and program deployment steps, including configuring EBS storage volumes, creating and starting multiple EC2 instances, and installing and configuring Redis, MySQL, and Celery. Step 2: Determine the number of tasks and whether to send a request: Send a remote sensing image interpretation request to root_node in the form of a service request. Root_node determines the number of tasks left in Redis and prompts "How many tasks are there currently? Do you need to continue the detection operation?" If you click "Yes", proceed to the next step; otherwise, terminate the request directly. Through this step, you can autonomously control whether to continue the operation to prevent the accumulation of tasks in Redis. Step 3, task release: If you click "Yes" in step 2, send a request, write application code, and determine the number of subtasks that need to be added to the Redis message queue based on the size of the remote sensing image in the task. The specific steps include: determining the size of the remote sensing image and cropping the image, sending the task to the Redis message queue, and storing the interpretation parameters in the MySQL database. Step 4, task execution: Each EC2 node is a Worker, and is connected to the Redis service. If there are tasks in Redis, they are collected and associated with the current project_id through task_id. Relevant interpretation data parameters are obtained from MySQL to interpret the remote sensing image, and the result file corresponding to the image is generated and stored in the output path. The result is in TIF format, and the spatial reference is set for the TIF file, which is consistent with the spatial reference of the processed image and named as the name of the corresponding folder. Step 5, Task Monitoring: Enable task progress monitoring, access the node information request interface regularly, obtain the progress information of each EC2 node in real time and display it. Mainly includes sending and processing requests, and information display. Step 6, task exception handling: When using Redis and Celery, when a task ends abnormally, the present invention starts the operation of automatically re-executing the task, and the Worker process can capture unexpected exceptions and re-publish the task to the Redis task queue. The present invention sets a specified waiting time wait_time and a maximum number of retries. During the execution of the task, if an exception occurs, the task will automatically retry until the maximum number of retries is reached, thereby improving the reliability and success rate of the task. Step 7, generate and browse the interpretation results: When the display page shows that all tasks are completed, merge the interpretation results of the cropped image into a TIF file and convert it into a vector layer, and optimize and adjust the vector layer according to the interpretation requirements. The specific steps include: merge raster, convert raster to surface, and post-process the surface layer.

2. According to claim 1, a cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism, characterized in that: In the basic environment configuration described in step 1, in order to build a reliable massive remote sensing image interpretation framework, multiple basic environment configuration and program deployment steps need to be completed. The steps are as follows: Step 2.1, configure EBS storage volume, create and start multiple EC2 instances: first log in to the AWS Management Console, enter the EC2 control panel, create a storage volume, and select parameters such as storage type, capacity size, and availability zone; Second, create an EC2 instance. In the EC2 control panel, select "Instances" and then click "Launch Instance". In the launch wizard, select the appropriate AMI as the operating system and software base image used by the instance, select the instance type and other configuration options, such as subnet, VPC, security group, etc. In the "Storage" section, attach the previously created storage volume to the instance and select the corresponding device name. After completing the configuration, click "Launch" to create the EC2 instance; third, on the "Storage Volume" page, perform the "Create Snapshot" operation for the EBS volume that needs to be shared, and record the ID of this snapshot; finally, repeat the previous steps to create multiple EC2 instances. It should be noted that when configuring storage, select "Use an existing EBS volume" and select a shared storage volume so that the instance can access shared data. Step 2.2, installation and environment configuration of Redis, MySQL, and Celery: Redis is used as a message agent, Celery is used as a task queue, and MySQL is used as a request sending parameter storage library. The three work together to build a cluster system, which can realize the distributed interpretation and result storage of remote sensing image data. Specifically including Redis installation and deployment, Celery installation and deployment, and MySQL installation and deployment. First, install a Redis server on an EC2 instance. Assume that the instance is named root_node, edit the Redis configuration file, set the required configuration options, such as password, port number, maximum memory limit, etc., and start the Redis service; secondly, copy the project running virtual environment to the EC2 instance, use pip to install the Celery library, and in celery_config.py, configure the message agent (such as RabbitMQ, Redis), set the task queue, the number of Workers, the serialization method of the task, the execution task result serialization method, the content type accepted by the specified task, the host address of the Redis service, the service port, the message queue database name, and the result storage database name, etc. The present invention uses Redis as a message agent. Finally, install the MySQL server in the root_node, set the MySQL username and password, create the database and table, start the MySQL service, and write the code to connect to the MySQL database in the configuration file of the project running code.

3. The cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism according to claim 1, characterized in that: Determine the number of tasks as described in step 2, whether to send a request, send a remote sensing image interpretation request to root_node in the form of a service request, root_node determines the number of tasks remaining in Redis, and prompts "How many tasks are there currently, do you need to continue the detection operation?" If you click "Yes", proceed to the next step; otherwise, end this request directly.

4. The cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism according to claim 1, characterized in that: In the task release described in step 3, the number of subtasks that need to be added to the Redis message queue is determined according to the size of the remote sensing image in the task. The steps are as follows: Step 4.1, determine the size of remote sensing images and crop the images: Taking change detection as an example, there are several subfolders in the received folder, and the name of a single subfolder is name. When there are two early and late remote sensing images, the image names are pre.tif and post.tif, and the sizes of the two images are the same. Get the width width and height height of the pre.tif remote sensing image. If either width or height is greater than the specified size maxsize, crop the image, and the crop size is clipsize. Calculate the number of cropped rows and columns cols according to width, height, and clipsize. The cropping calculation formula is: rows = int(height / clipsize) (1) cols = int(width / clipsize) (2) According to the cropping formula, pre.tif and post.tif are cropped into several early and late images. The corresponding early and late images are stored in different folders. The folder name is the number of columns of the image_number of rows_folder name, for example, the 0th column and the 1st row is 0_1_name; if it is smaller than the specified size, no cropping is performed and the subfolder is placed in the task storage folder. Step 4.2, send the task to the Redis message queue: traverse the folders trimmed in step 4.1, take the images in a folder as a subtask, serialize the subtask, configure a task_id for each subtask, and submit the task_id and the serialized task to the Redis message queue. Step 4.3, store the interpreted parameters in the MySQL database: This request configures a project_id, stores the common parameters, project_id, and task_id of this task in the ProjectBatchDetection table, and stores different parameters and project_id in the TaskBatchDetection table. The two tables are related by project_id as a foreign key.

5. The cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism according to claim 1, characterized in that: During the execution of the task described in step 4, the EC2 node is associated with the Redis service. If there are tasks in Redis, they are collected and associated with the current project_id through the task task_id. The relevant interpretation data parameters are obtained from MySQL for remote sensing image interpretation, and the result file corresponding to the image is generated and stored in the output path. The result is in TIF format, and the spatial reference is set for the TIF file, which is consistent with the spatial reference of the processed image and named as the name of the corresponding folder.

6. The EBS-based and multi-node parallel cluster massive remote sensing image interpretation framework according to claim 1, characterized in that: In the task monitoring described in step 5, enable task progress monitoring, access the node information request interface regularly, obtain the progress information of each EC2 node in real time and display it. The steps are as follows: Step 6.1 Send and process the request: Send a Post request with project_id as a parameter. After receiving the request, the master node first associates the task based on project_id to obtain the current number of completed tasks. Secondly, it accesses the log information file of each EC2 node. The log information file of each node is stored in the logs folder of the master node. It reads the log information of each node, obtains the image information currently being processed by the node, the processing progress, GPU and CPU utilization, and graphics card information, encapsulates the information, and returns it in JSON format. Step 6.2 Information display: The client decodes the returned information data and displays it in the corresponding window of the front end so that the user can understand the completion status of the interpretation task and the operation status of the node at any time.

7. The EBS-based and multi-node parallel clustered massive remote sensing image interpretation framework according to claim 1, characterized in that: In the task exception processing described in step 6, if there is a task exception, the task is automatically retried according to the set waiting time wait_time and the maximum number of retries until the maximum number of retries is reached. If the retry is successful, interpretation is performed to improve the reliability and success rate of the task.

8. The cluster-based massive remote sensing image interpretation framework based on EBS and multi-node parallelism according to claim 1, characterized in that:In the generation and browsing of the interpretation results described in step 7, when the display page shows that all tasks are completed, the interpretation results of the cropped images are merged into a TIF file and converted into a vector layer. The vector layer is optimized and adjusted according to the interpretation requirements. The steps are as follows: Step 8.1 Merge rasters: Based on the GDAL module package, merge the existing TIF files in the output path, determine the row and column of the TIF file according to the TIF file name, first merge horizontally, then merge vertically. If there is a non-zero value in one image and the other image has a zero value in the corresponding area within the overlapping range, then take the non-zero value to avoid missed detection due to merging, and get the final remote sensing image interpretation result TIF file named result.tif. Step 8.2 Raster to Surface: Based on ArcPy, perform raster to surface operation on result.tif to obtain the detection result vector layer SHP file Step 8.3 Post-processing of surface layer: Based on the SHP file obtained in step 8.2, obtain its spatial reference, which is a projected coordinate system or a geographic coordinate system. If it is a geographic coordinate system, use the projection conversion tool to convert it to a projected coordinate system; add the area field Area, calculate the area value of each surface patch, and use the selection tool to filter out patches larger than the fragment threshold fragment according to the calculated area value, create a temporary layer, eliminate holes, smooth boundaries, and regularize the temporary layer to obtain the final post-processed SHP file, which is the final remote sensing interpretation result.

Citation Information

Cited By

  • Provincial domain level remote sensing AI big data natural resource intelligent monitoring system

    CN121074674A