Distributed processing method, system and device for images and storage medium
The distributed processing method uses real-time rendering of crop map images, solving the problem of long time in traditional slicing methods and real-time monitoring of crop growth.
Patent Information
- Application Number
- CN202510008322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-02
AI Technical Summary
The traditional slicing method requires pre-slicing processing when processing crop map images, resulting in a long time that cannot meet the needs of real-time monitoring.
Using a distributed processing method, by obtaining the client's map request instructions, the target area image is extracted from the pre-stored distributed image, split it into multiple rendering areas for real-time rendering, and generate the corresponding map tile image, and transmit it to the client.
Without pre-slicing, map tiles can be generated in real time after receiving map request instructions, which improves the processing efficiency of map images and meets the real-time monitoring needs of crop growth.
Smart Images

Figure CN119919520A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of map image processing, and in particular to a distributed processing method, system, device and storage medium for images. Background Art
[0002] With the continuous popularization and development of remote sensing technology, the use of remote sensing technology to monitor crop production in real time is becoming more and more common in the agricultural field.
[0003] Since there are high requirements for the resolution and real-time performance of map images when monitoring the growth of crops, the data volume of crop map images is often very large. The traditional slicing method requires pre-slicing of crop map images. Map tile images can only be released after all crop map images are sliced. Therefore, it takes a very long time, usually several days to several months, which cannot meet the needs of real-time monitoring of crops. Summary of the invention
[0004] The embodiments of the present invention provide a distributed processing method, system, device and storage medium for images to solve the above problems.
[0005] In a first aspect, an embodiment of the present invention provides a distributed processing method for an image, comprising: obtaining a map request instruction from a client; extracting a target area image from a pre-stored distributed image in response to the map request instruction; splitting the target area image into multiple rendering areas, performing real-time rendering on each rendering area, and generating a corresponding map tile image; and transmitting the map tile image to the client.
[0006] The distributed image processing method provided by the embodiment of the present invention extracts the target area image from the pre-stored distributed image after receiving the map request instruction from the client, splits the target area image into multiple rendering areas for real-time rendering without pre-slicing, and can generate the corresponding map tile image in real time after receiving the map request instruction, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0007] Optionally, the distributed image includes multiple levels, and each level includes multiple spatial grid images. Before the step of obtaining the map request instruction from the client, the distributed processing method for the image also includes: obtaining the longitude and latitude information of each spatial grid image of the distributed image; converting the longitude and latitude information into coded information.
[0008] Optionally, before the step of obtaining the map request instruction from the client, the distributed processing method for the image also includes: obtaining initial image data; preprocessing the initial image data to obtain a distributed image including multiple levels; performing projection conversion processing on the initial image data to generate an overview of the initial image data and the spatial coordinate information of the overview.
[0009] Optionally, in response to a map request instruction, the step of extracting a target area image from a pre-stored distributed image includes: in response to the map request instruction, obtaining target coordinate range information; based on the target coordinate range information, calculating the map range required for the target area image; matching the map range with the spatial coordinate information, and searching for an overview corresponding to the target area image; based on the overview, obtaining coding information corresponding to the overview; and based on the coding information, extracting the corresponding target area image from the distributed image.
[0010] Optionally, the target area image is split into multiple rendering areas, and each rendering area is rendered in real time to generate a corresponding map tile image, the steps including: obtaining coding information of the target area image; based on the coding information of the target area image, obtaining at least one target space grid image corresponding to the target area image; based on the geotools component and the geohash grid algorithm, splitting the target space grid image into multiple rendering areas, and rendering each rendering area in real time to generate map tile images of each level corresponding to the target space grid image.
[0011] Optionally, based on the geotools component, the target space grid image is split into multiple rendering areas, and each rendering area is rendered in real time, and the steps of generating map tile images of each level corresponding to the target space grid image include: based on the geohash grid algorithm, calculating the rendering range of the target space grid image; based on the rendering range, splitting the target space grid image into multiple rendering areas; based on the geotools component, obtaining the capability set document corresponding to each rendering area; based on the capability set document, obtaining map tile information, the map tile information including tile image specifications, tile image levels, and tile image formats of the map tile image to be generated; based on the map tile information, obtaining a tile matrix set and corresponding tile coordinate information of each rendering area; based on the tile matrix set and the tile coordinate information, performing real-time rendering on each rendering area, and generating map tile images of each level corresponding to the target space grid image.
[0012] Optionally, before the step of transmitting the map tile image to the client, the distributed processing method for the image also includes: storing the generated map tile image to the map tile cache server; screening whether all map tile images have been stored in the map tile cache server, and if there are map tile images that are not stored in the map tile cache server, generating the missing map tile images in the map tile cache server in real time.
[0013] In a second aspect, an embodiment of the present invention provides an image distributed processing system, comprising: a distributed storage server, in which at least one distributed image is stored; a distributed computing server, electrically connected to the distributed storage server, the distributed computing server is used to obtain a map request instruction from a client, and in response to the map request instruction, extract a target area image from the distributed image pre-stored in the distributed storage server, and split the target area image into multiple rendering areas, perform real-time rendering on each rendering area, and generate a corresponding map tile image; a map slice cache server, electrically connected to the distributed computing server, the map slice cache server is used to store the map tile image generated by the distributed computing server, and transmit the map tile image to the client.
[0014] The image distributed processing system provided by the embodiment of the present invention extracts the target area image from the pre-stored distributed image after receiving the map request instruction from the client, splits the target area image into multiple rendering areas for real-time rendering without pre-slicing, and can generate the corresponding map tile image in real time after receiving the map request instruction, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0015] Optionally, the distributed image includes multiple levels, and each level includes multiple spatial grid images; the distributed computing server is also used to obtain the longitude and latitude information of each spatial grid image of the distributed image, and convert the longitude and latitude information into coding information, as well as obtain initial image data, and pre-process the initial image data, obtain distributed images including multiple levels and store the distributed images in a distributed storage server, and perform projection conversion processing on the initial image data to generate an overview of the initial image data and the spatial coordinate information of the overview. The image distributed processing system also includes: a gateway device, the gateway device connects the client to the map tile cache server in communication, the gateway device is used to receive a map request instruction from the client and transmit the map request instruction to the map tile cache server, and receive a map tile image corresponding to the map request instruction and transmit the map tile image to the client; a database, the database is connected to the distributed computing server in communication, and the database is used to store coding information, overviews and spatial coordinate information.
[0016] In a third aspect, an embodiment of the present invention provides a distributed image processing device, comprising: a processor and a memory, wherein instructions are stored in the memory; the processor calls the instructions in the memory so that the processor executes the distributed image processing method of any of the aforementioned embodiments of the first aspect of the present invention.
[0017] The processor of the image distributed processing device provided by the embodiment of the present invention executes the distributed image processing method of any of the aforementioned embodiments of the first aspect of the present invention by calling the instructions in the memory. After receiving the map request instruction from the client, the target area image can be extracted from the pre-stored distributed image, and the target area image can be split into multiple rendering areas for real-time rendering without pre-slicing. This enables the corresponding map tile image to be generated in real time after receiving the map request instruction, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed by a processor, the distributed image processing method of any of the aforementioned embodiments of the first aspect of the present invention is implemented.
[0019] The instructions stored in the computer-readable storage medium provided in the embodiment of the present invention can be called by the processor and execute the distributed image processing method of any of the aforementioned embodiments of the first aspect of the present invention, so that after receiving the map request instruction from the client, the target area image can be extracted from the pre-stored distributed image, and the target area image can be split into multiple rendering areas for real-time rendering without pre-slicing. After receiving the map request instruction, the corresponding map tile image can be generated in real time, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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 the structures shown in these drawings without paying creative work.
[0021] Figure 1 A flowchart of an embodiment of a distributed image processing method of the present invention;
[0022] Figure 2 It is a flowchart before step S110 in one embodiment of the distributed processing method of images of the present invention;
[0023] Figure 3 It is a flowchart before step S110 in one embodiment of the distributed processing method of images of the present invention;
[0024] Figure 4 A flowchart of step S120 in one embodiment of the distributed image processing method of the present invention;
[0025] Figure 5 is a flow chart of step S130 in one embodiment of the distributed image processing method of the present invention;
[0026] Figure 6 is a flow chart of step S133 in one embodiment of the distributed image processing method of the present invention;
[0027] Figure 7 A schematic diagram of a rendering area based on a Geohash network algorithm in an embodiment of a distributed image processing method of the present invention;
[0028] Figure 8 A hierarchical schematic diagram of a Geohash network algorithm in one embodiment of a distributed image processing method of the present invention;
[0029] Fig. 9 A schematic diagram of a map tile image based on a Geohash network algorithm in an embodiment of a distributed image processing method of the present invention;
[0030] Fig.10 A structural block diagram of an embodiment of the image distributed processing system of the present invention;
[0031] Fig.11 It is a flowchart of a method for implementing distributed processing of images in one embodiment of the distributed image processing system of the present invention;
[0032] Fig.12 A schematic diagram of the structure of an embodiment of the distributed image processing system of the present invention;
[0033] Fig.13 It is a structural block diagram of an embodiment of the distributed image processing device of the present invention.
[0034] Description of Figure Numbers:
[0035] 100- Image distributed processing system;
[0036] 110-distributed storage server; 120-distributed computing server; 130-map slice cache server; 140-gateway device; 150-database; 160-client;
[0037] 201 - processor; 202 - memory; 203 - communication interface; 204 - bus. DETAILED DESCRIPTION
[0038] 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.
[0039] It should be noted that all directional indications such as up, down, left, right, front, back, etc. in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture as shown in the accompanying drawings. If the specific posture changes, the directional indication will also change accordingly.
[0040] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0041] For ease of understanding, the distributed image processing method according to an embodiment of the present invention is described below.
[0042] The distributed processing method for images in the embodiment of the present invention is based on the following Fig.11 The distributed image processing system shown in the figure is implemented, the distributed storage server 110 stores distributed images divided by the geohash grid algorithm in multiple image storage areas, and the distributed computing server 120 can extract the corresponding target area image from the distributed storage server 110 according to the map request instruction of the client (i.e., the web browser), and render the divided target area image in parallel through multiple nodes, and finally cache the generated map tile image to the map tile cache server 130, and then output the target map tile image to the client 160 (i.e., the web browser) in the area and level requested in the map request instruction to achieve real-time rendering and fast output of map tile images. Among them, WMTS is a Web Map Tile Service.
[0043] like Figure 1 As shown, the distributed processing method for images in the embodiment of the present invention includes steps S110 to S140.
[0044] In step S110, a map request instruction from the client is obtained.
[0045] In this embodiment, the map request instruction of the client is the coordinates of the area where the client requests to display the map and the map zoom level of the area.
[0046] Among them, the client can be a communication device such as a computer, a mobile phone, or a tablet computer. The map request instruction sent from the front end (such as the web page or APP end of the communication device) can be received by the back end (such as the server end) to implement the distributed processing method of the image in the embodiment of the present invention.
[0047] In some optional embodiments, the distributed image includes multiple levels, and each level includes multiple spatial grid images. Before step S110, the distributed image is acquired and pre-stored, and the distributed processing method of the image includes steps S101A to S102A.
[0048] like Figure 2 As shown, in step S101A, the longitude and latitude information of each spatial grid image of the distributed image is obtained.
[0049] In step S102A, the longitude and latitude information is converted into coded information.
[0050] In this embodiment, the longitude and latitude information of each spatial grid image of the distributed image is converted into coding information, namely, geohash coding, through the geohash grid algorithm. Since the geohash coding is hierarchical and regional, the geohash coding can be used for rapid positioning in the process of searching for the corresponding spatial grid image according to the map request instruction. For example, start searching from the higher-level geohash coding and gradually narrow the scope to the lower-level geohash coding. If multiple matching geohash codes are found in the higher-level coding matching, further screening is performed according to the more detailed lower-level coding until the most accurate geohash coding corresponding to the map request instruction is found, thereby obtaining the spatial grid image corresponding to the coding.
[0051] Specifically, taking the longitude and latitude coordinates (lng, lat) of a certain area as an example, firstly, the level of the geohash code to be converted is determined, which is assumed to be level z in this embodiment.
[0052] For longitude lng, calculation is based on the following formula:
[0053] tileX=int((lng+180) / 360*2^z);
[0054] Among them, int represents the rounding operation. Through this formula, the longitude and latitude coordinate values of the area can be mapped to the tile x coordinate value range at a specific level according to the conversion relationship between longitude and latitude and tile coordinates, and then the corresponding longitude tileX value is rounded, that is, the X coordinate position of the longitude in the tile coordinate system at the current tile level.
[0055] For latitude lat, the calculation is based on the following formula:
[0056] tileY=(1-arsinh(tan(lat*π / 180)) / π)*2^(z-1);
[0057] Among them, arsinh(x) is equivalent to ln(x+(x^2+1)^0.5). This formula can be used to convert the latitude value into the tile y coordinate value at a specific level. Similarly, the latitude is rounded to get the tileY value, that is, the Y coordinate position of the latitude in the tile coordinate system at the current tile level.
[0058] Finally, according to the calculated tileX and tileY values and the geohash encoding rules, they are converted into the corresponding geohash encoding string.
[0059] like Figure 3 As shown, in some optional embodiments, before step S110, the step of acquiring distributed images in the distributed image processing method includes steps S101B to S103B.
[0060] In step S101B, initial image data is acquired.
[0061] In step S102B, the initial image data is preprocessed to obtain a distributed image including multiple levels.
[0062] In step S103B, projection conversion processing is performed on the initial image data to generate an overview of the initial image data and spatial coordinate information of the overview.
[0063] In this embodiment, the images in the acquired initial image data are segmented into distributed images including multiple levels according to different levels through the geohash algorithm, and the initial image data are projected and transformed. For example, the images in the initial image data can be transformed into a unified projection coordinate system through projection transformation methods such as Mercator projection and Gauss-Krüger projection, and an overview of the initial image data is generated by extracting the boundary information of the image in the initial image data, such as the boundary coordinates of the minimum circumscribed rectangle of the geographic range covered by the image or other boundary information of geometric shapes that can represent the approximate range of the image, and finally the overview of the initial image data and the spatial coordinate information of the overview are obtained for subsequent rapid retrieval of distributed images, while saving the computing task amount and storage burden and accelerating the response speed.
[0064] In step S120 , in response to the map request instruction, the target area image is extracted from the pre-stored distributed images.
[0065] like Figure 4 As shown, in some optional embodiments, step S120 includes steps S121 to S125.
[0066] In step S121, in response to the map request instruction, target coordinate range information is acquired.
[0067] In step S122, based on the target coordinate range information, the map range required for the target area image is calculated.
[0068] In step S123, the map range is matched with the spatial coordinate information to find an overview corresponding to the target area image.
[0069] In step S124, based on the overview, encoding information corresponding to the overview is obtained.
[0070] In step S125 , based on the coding information, the corresponding target area image is extracted from the distributed images.
[0071] In this embodiment, after the initial image data is projected and transformed to generate an overview of the initial image data and the spatial coordinate information of the overview, the target coordinate range information can be used to determine the target area requested to be displayed by the client, and then the map range size that needs to be displayed in the target area image can be calculated.
[0072] Then, the map range corresponding to the target coordinate range information is matched with the spatial coordinate information to determine the corresponding overview view, and then the corresponding coding information is obtained, so as to realize the rapid retrieval of the corresponding target area image from the distributed image and extract the target area image.
[0073] In step S130, the target area image is split into a plurality of rendering areas, and each rendering area is rendered in real time to generate a corresponding map tile image.
[0074] like Figure 5 As shown, in some optional embodiments, step S130 includes steps S131 to S133.
[0075] In step S131, the encoding information of the target area image is obtained.
[0076] In step S132, at least one target space grid image corresponding to the target area image is acquired based on the encoding information of the target area image.
[0077] In step S133, based on the geotools component and the geohash grid algorithm, the target space grid image is split into multiple rendering areas, and each rendering area is rendered in real time to generate map tile images of each level corresponding to the target space grid image.
[0078] Since the volume of high-precision image data often reaches GB or even TB level, it is very slow to process a single large volume of image data.
[0079] In this embodiment, after obtaining the target area image and the coding information of the target area image, the corresponding target space grid image is obtained from the distributed image according to the coding information of the target area image, and then based on the geohash grid algorithm, the corresponding target space grid image is retrieved from the distributed image to determine the area range to be rendered. Then, the target space grid image within the area range to be rendered is divided into multiple rendering areas through the geotools component, and each rendering area is rendered synchronously to finally obtain map tile images of each level corresponding to the target space grid image.
[0080] The specific process of generating map tile images of each level corresponding to the target space grid image based on the geotools component and the geohash grid algorithm is as follows.
[0081] like Figure 6 As shown, further, step S133 includes steps S1331 to S1335.
[0082] In step S1331, based on the geohash grid algorithm, the rendering range of the target space grid image is calculated.
[0083] In step S1332, based on the rendering range, the target space grid image is divided into a plurality of rendering areas.
[0084] In step S1333, based on the geotools component, a capability set document corresponding to each rendering area is obtained.
[0085] In step S1334, map tile information is obtained based on the capability set document, where the map tile information includes tile image specifications, tile image levels, and tile image formats of the map tile image to be generated.
[0086] In step S1335, based on the map tile information, a tile matrix set and corresponding tile coordinate information of each rendering area are obtained.
[0087] In step S1336, based on the tile matrix set and the tile coordinate information, each rendering area is rendered in real time to generate map tile images of each level corresponding to the target space grid image.
[0088] like Figures 7 to 9 As shown in the figure, the geohash grid algorithm is divided into levels 1 to 12 according to the length of the string in the encoding information, so as to realize the division of the distributed image into grids of different levels. For example, the width and length of the spatial grid image of the distributed image of level 1 are 5000km. From level 1 to level 12, the width and length of the spatial grid image decrease successively, and the width and length of the spatial grid image of level 12 are 37.2mm and 18.6mm, which are used for subsequent rendering of map tile images of different levels.
[0089] In this embodiment, after calculating the rendering range of the target space grid image through the geohash grid algorithm, it can be determined that one, two or more target space grid images are within the rendering range, and the target space grid images within the rendering range are divided into multiple rendering areas, and then each rendering area is rendered through multiple rendering nodes to achieve distributed rendering and synchronous output, which greatly improves the rendering speed, and finally obtains map tile images of each level corresponding to the target space grid image, thereby greatly improving the speed of outputting map tile images.
[0090] Specifically, in the geotools component, the capability set document (Capabilities document) obtained is WMTS100Capabilities (Web Map Tile Service, WMTS), which includes the tile image specifications, tile image levels, and tile image formats of the map tile images to be generated, as well as the tile matrix set and reference coordinate system.
[0091] After obtaining the map tile information, the tile matrix set and the corresponding tile coordinate information of each rendering area are obtained to calculate the level and coordinates of the map tile image, and finally generate map tile images of each level corresponding to the target space grid image.
[0092] In some optional embodiments, before step S140, the distributed processing method for images further includes steps S134 to S135.
[0093] In step S134, the generated map tile image is stored in the map tile cache server.
[0094] In step S135, it is screened whether all map tile images have been stored in the map tile cache server. If there are map tile images that have not been stored in the map tile cache server, the missing map tile images in the map tile cache server are generated in real time.
[0095] In this embodiment, after a map tile image is generated and stored in a map tile cache server, a screening is performed to determine whether the map tile image in the map tile cache server is missing, for example, by comparing it with the rendering range of the target space grid image to determine whether there is an area in the map tile image that lacks rendering.
[0096] If there are map tile images that are not stored in the map tile cache server, the missing map tile images in the map tile cache server are regenerated in real time according to the embodiments of the above method for the images in the area where rendering is missing to fill the missing map tile images.
[0097] In step S140 , the map tile image is transmitted to the client.
[0098] In this embodiment, the client can generate a map request instruction, extract the target area image from the pre-stored distributed image, and then generate a map tile image by splitting the target area image and rendering it in real time, and finally transmit the map tile image to the client to achieve real-time rendering. Compared with the traditional slicing method using pre-slicing in the prior art, this application uses the geotools component to achieve real-time rendering and generate map tile images in real time. Depending on the amount of image data, the map tile image can be output to the client within tens of seconds to tens of minutes. Compared with the traditional slicing method of several days of slicing rendering output time, the rendering output speed of the map tile image is greatly accelerated to meet the needs of real-time monitoring.
[0099] In this embodiment, the coordinates of the map tile image are calculated as follows:
[0100] For example, the origin of the preset tile map projection coordinate system is 180° east longitude and 85.05° south latitude, the x-axis is rightward, the y-axis is upward, and the tile level (zoom level) is 0 at the minimum and 24 at the maximum.
[0101] The coordinate range corresponding to the tile coordinates z=0, x=0, y=0 is longitude [-180,180], latitude [-85.05,85.05], and the corresponding tile size is 256 pixels * 246 pixels.
[0102] The formula for converting longitude and latitude coordinates (lng, lat) to tile coordinates (tileX, tileY) is as follows:
[0103] tileX=int((lng+180) / 360*2^z);
[0104] tileY=(1-arsinh(tan(lat*π / 180)) / π)*2^(z-1);
[0105] Where z is the tile level, and the calculation result is an integer. The inverse hyperbolic sine function arsinh(x) is equivalent to ln(x+(x^2+1)^0.5).
[0106] The formula for converting tile coordinates (tileX, tileY) to longitude and latitude coordinates (lng, lat) is as follows:
[0107] lng = tileX / 2^z*360-180;
[0108] lat=arctan(sinh(π*(1-2*tileY / 2^z)))*180 / π;
[0109] Among them, z is the tile level, the hyperbolic function sinh(x)=(e^xe^(-x))*0.5, and the calculation result (lng,lat) is the minimum longitude and maximum latitude corresponding to the tile image.
[0110] The formula for converting longitude and latitude coordinates (lng, lat) to pixel coordinates (pixelX, pixelY) is as follows:
[0111] pixelX=(lng+180) / 360*2^z*256%256;
[0112] pixelY=(1-ln(tan(lat*π / 180)+sec(lat*π / 180)) / (2*π))*2^z*256%256;
[0113] The pixel coordinates are the coordinates of the pixel points in the corresponding tile image. The tile image size is set to 256*256 pixels, that is, the pixel resolution, and z is the tile level. The coordinates of the pixel point are obtained by dividing the web Mercator plane coordinates by the pixel resolution and then dividing by 256 to obtain the modulo.
[0114] The formula for converting the pixel coordinates (pixelX, pixelY) of the tile coordinates (tileX, tileY) to the longitude and latitude coordinates (lng, lat) is as follows:
[0115] lng=(tileX+pixelX / 256) / 2^z*360-180;
[0116] lat=arctan(sinh(π-2*π*(tileY+pixelY / 256) / 2^z))*180 / π;
[0117] Among them, z is the tile level.
[0118] By using the above-mentioned method of calculating the coordinates of the map tile image in the present application, the coordinates of each pixel point of the output map tile image can be calculated to achieve the calculation and accurate positioning of the coordinate system of the map tile image.
[0119] The distributed processing method for images provided by an embodiment of the present invention includes: obtaining a map request instruction from a client; extracting a target area image from a pre-stored distributed image in response to the map request instruction; splitting the target area image into multiple rendering areas, rendering each rendering area in real time, and generating a corresponding map tile image; and transmitting the map tile image to the client.
[0120] The distributed image processing method provided by the embodiment of the present invention extracts the target area image from the pre-stored distributed image after receiving the map request instruction from the client, splits the target area image into multiple rendering areas for real-time rendering without pre-slicing, and can generate the corresponding map tile image in real time after receiving the map request instruction, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0121] For the above method embodiment, the embodiment of the present invention also provides Fig.10 The image distributed processing system 100 shown includes a distributed storage server 110 , a distributed computing server 120 , and a map tile cache server 130 .
[0122] At least one distributed image is stored in the distributed storage server 110, and the distributed computing server 120 is electrically connected to the distributed storage server 110. The distributed computing server 120 is used to obtain a map request instruction from the client 160, and in response to the map request instruction, extract a target area image from the distributed images pre-stored in the distributed storage server 110, and split the target area image into multiple rendering areas, perform real-time rendering on each rendering area, and generate a corresponding map tile image.
[0123] The map tile cache server 130 is electrically connected to the distributed computing server 120 . The map tile cache server 130 is used to store the map tile images generated by the distributed computing server 120 and transmit the map tile images to the client 160 .
[0124] like Fig.11 and Fig.12 As shown, in this embodiment, the distributed computing server 120 includes multiple nodes, and the distributed storage server 110 includes multiple image storage areas. The distributed computing server 120 can split the target area image into multiple rendering areas based on the geohash grid algorithm, and simultaneously render on multiple nodes and output the rendered map tile images to speed up the rendering speed.
[0125] The multiple image storage areas of the distributed storage server 110 are used to store distributed images segmented into grid images by the geohash grid algorithm, so that the distributed computing server 120 can quickly extract the corresponding target area image from the distributed storage server 110 according to the map request instruction.
[0126] After preprocessing the initial image data, the distributed image is divided and stored in multiple image storage areas of the distributed storage server 110 through the geohash grid algorithm. The client 160 (i.e., the web browser) sends a map request instruction (i.e., a wmts map request) to the map tile cache server 130 (i.e., the map tile cache server), so that the distributed computing server 120 can receive the map request instruction, and calculate the current range of the map to be rendered and perform spatial indexing according to the map request instruction, extract the corresponding target area image from the distributed storage server 110, and render the divided target area image in parallel through multiple nodes, and finally cache the generated map tile image in the map tile cache server 130, and output the target map tile image to the client 160 (i.e., the web browser) according to the area and level to be displayed requested in the map request instruction, so as to realize real-time rendering and fast output of map tile images. Among them, WMTS is a Web Map Tile Service.
[0127] In some optional embodiments, the distributed image includes multiple levels, and each level includes multiple spatial grid images.
[0128] The distributed computing server 120 is also used to obtain the longitude and latitude information of each spatial grid image of the distributed image, and convert the longitude and latitude information into coded information, as well as to obtain initial image data and pre-process the initial image data, obtain distributed images including multiple levels and store the distributed images to the distributed storage server 110, and perform projection conversion processing on the initial image data to generate an overview of the initial image data and the spatial coordinate information of the overview.
[0129] The image distributed processing system 100 further includes a gateway device 140 and a database 150. The gateway device 140 connects the client 160 to the map tile cache server 130 in communication. The gateway device 140 is used to receive a map request instruction from the client 160 and transmit the map request instruction to the map tile cache server 130, and receive a map tile image corresponding to the map request instruction and transmit the map tile image to the client 160. The database 150 is connected to the distributed computing server 120 in communication, and is used to store coding information, overviews, and spatial coordinate information.
[0130] In this embodiment, the client 160 communicates with the map tile cache server 130 through the gateway device 140 to send a map request instruction to the distributed computing server 120 and receive the generated map tile image. The client 160 can also obtain the map service directory preset in the map tile cache server 130 through the gateway device 140. The preset map service directory caches the latest map tile image, so that the latest map tile image can be viewed.
[0131] The image distributed processing system 100 provided in the embodiment of the present invention extracts the target area image from the pre-stored distributed image after receiving the map request instruction from the client 160, splits the target area image into multiple rendering areas for real-time rendering without pre-slicing, and can generate the corresponding map tile image in real time after receiving the map request instruction, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0132] For the above method embodiment, the embodiment of the present invention also provides Fig.13 The distributed image processing device shown includes: a processor 201 and a memory 202, and the memory 202 stores instructions.
[0133] The processor 201 calls the instructions in the memory 202 so that the processor 201 executes the distributed image processing method of any of the aforementioned embodiments of the present invention.
[0134] The distributed processing method for images provided by an embodiment of the present invention includes: obtaining a map request instruction from the client 160; extracting a target area image from a pre-stored distributed image in response to the map request instruction; splitting the target area image into multiple rendering areas, rendering each rendering area in real time, and generating a corresponding map tile image; and transmitting the map tile image to the client 160.
[0135] The distributed image processing device provided by the embodiment of the present invention can extract the target area image from the pre-stored distributed image after receiving the map request instruction from the client 160 by implementing the above method, and split the target area image into multiple rendering areas for real-time rendering without pre-slicing, thereby achieving the real-time generation of the corresponding map tile image after receiving the map request instruction, improving the processing efficiency of the map image, so as to meet the real-time monitoring needs of the growth of crops.
[0136] Furthermore, the distributed image processing device provided by the embodiment of the present invention may further include a communication interface 203 and a bus 204 , and the processor 201 , the memory 202 and the communication interface 203 are electrically connected via the bus 204 .
[0137] The memory 202 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 203 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 204 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0138] The processor 201 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 201. The above processor 201 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 202, and the processor 201 reads the information in the memory 202 and completes the steps of the method of the above embodiment in combination with its hardware.
[0139] An embodiment of the present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the above-mentioned distributed image processing method.
[0140] The computer-readable storage medium provided by the embodiment of the present invention stores data and computer-executable instructions of the above-mentioned distributed processing method for images, and the above-mentioned distributed processing method for images includes: obtaining a map request instruction from the client; extracting a target area image from a pre-stored distributed image in response to the map request instruction; splitting the target area image into multiple rendering areas, rendering each rendering area in real time, and generating a corresponding map tile image; transmitting the map tile image to the client.
[0141] The computer-readable storage medium provided by the embodiment of the present invention can extract the target area image from the pre-stored distributed images after receiving the map request instruction from the client by implementing the above method, and split the target area image into multiple rendering areas for real-time rendering without pre-slicing. After receiving the map request instruction, the corresponding map tile image can be generated in real time, thereby improving the processing efficiency of the map image to meet the real-time monitoring needs of the growth of crops.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0144] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A distributed processing method for images, characterized in that: The method comprises: Get the client's map request instruction; In response to the map request instruction, extracting a target area image from pre-stored distributed images; Splitting the target area image into multiple rendering areas, performing real-time rendering on each rendering area, and generating a corresponding map tile image; The map tile image is transmitted to the client.
2. The distributed image processing method according to claim 1, characterized in that: The distributed image includes multiple levels, and each level includes multiple spatial grid images. Before the step of obtaining the map request instruction of the client, the method further includes: Acquire the longitude and latitude information of each of the spatial grid images of the distributed image; The latitude and longitude information is converted into coded information.
3. The distributed image processing method according to claim 2, characterized in that: Before the step of obtaining the map request instruction from the client, the method further includes: Acquiring initial image data; Preprocessing the initial image data to obtain the distributed image including multiple levels; The initial image data is subjected to projection conversion processing to generate an overview of the initial image data and spatial coordinate information of the overview.
4. The distributed image processing method according to claim 3, characterized in that: The step of extracting the target area image from the pre-stored distributed images in response to the map request instruction includes: In response to the map request instruction, obtaining target coordinate range information; Based on the target coordinate range information, calculate the map range required for the target area image; Matching the map range with the spatial coordinate information to find an overview corresponding to the target area image; Based on the overview, acquiring the encoding information corresponding to the overview; Based on the coding information, the corresponding target area image is extracted from the distributed image.
5. The distributed image processing method according to claim 2, characterized in that: The step of splitting the target area image into a plurality of rendering areas, performing real-time rendering on each rendering area, and generating a corresponding map tile image comprises: Acquire the encoding information of the target area image; Based on the encoding information of the target area image, acquiring at least one target space grid image corresponding to the target area image; Based on the geotools component and the geohash grid algorithm, the target space grid image is split into a plurality of rendering areas, and each of the rendering areas is rendered in real time to generate the map tile images of each level corresponding to the target space grid image.
6. The distributed image processing method according to claim 5, characterized in that: The step of splitting the target space grid image into a plurality of rendering areas based on the geotools component, and performing real-time rendering on each of the rendering areas to generate the map tile images of each level corresponding to the target space grid image comprises: Based on the geohash grid algorithm, calculating the rendering range of the target space grid image; Based on the rendering range, dividing the target space grid image into a plurality of rendering areas; Based on the geotools component, obtaining a capability set document corresponding to each of the rendering areas; Based on the capability set document, map tile information is acquired, wherein the map tile information includes tile image specifications, tile image levels, and tile image formats of the map tile image to be generated; Based on the map tile information, obtaining a tile matrix set and corresponding tile coordinate information of each rendering area; Based on the tile matrix set and the tile coordinate information, each rendering area is rendered in real time to generate the map tile images of each level corresponding to the target space grid image.
7. The distributed image processing method according to claim 1, characterized in that: Before the step of transmitting the map tile image to the client, the method further includes: Storing the generated map tile image in a map tile cache server; Screening whether all the map tile images have been stored in the map tile cache server, if there are map tile images that have not been stored in the map tile cache server, generating the map tile images missing in the map tile cache server in real time.
8. An image distributed processing system, characterized in that: The system comprises: A distributed storage server, wherein at least one distributed image is stored in the distributed storage server; A distributed computing server is electrically connected to the distributed storage server, and the distributed computing server is used to obtain a map request instruction from a client, and in response to the map request instruction, extract a target area image from the distributed images pre-stored in the distributed storage server, and split the target area image into a plurality of rendering areas, and perform real-time rendering on each rendering area to generate a corresponding map tile image; A map tile cache server is electrically connected to the distributed computing server, and is used to store the map tile image generated by the distributed computing server and transmit the map tile image to the client.
9. The distributed image processing system according to claim 8, characterized in that: The distributed image includes a plurality of levels, and each of the levels includes a plurality of spatial grid images; The distributed computing server is further used to obtain the longitude and latitude information of each of the spatial grid images of the distributed image, and convert the longitude and latitude information into coded information, and obtain initial image data, and pre-process the initial image data, obtain the distributed image including multiple levels and store the distributed image to the distributed storage server, and perform projection conversion processing on the initial image data to generate an overview of the initial image data and spatial coordinate information of the overview. The system also includes: A gateway device, wherein the gateway device connects the client to the map tile cache server for communication, and the gateway device is used to receive the map request instruction of the client and transmit the map request instruction to the map tile cache server, and receive the map tile image corresponding to the map request instruction and transmit the map tile image to the client; A database is communicatively connected to the distributed computing server, and is used to store the coding information, the overview map and the spatial coordinate information.
10. An image distributed processing device, characterized in that: The distributed image processing device comprises: a processor and a memory, wherein instructions are stored in the memory; The processor calls the instruction in the memory so that the distributed image processing device implements the distributed image processing method as described in any one of claims 1 to 7.
11. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the distributed image processing method as described in any one of claims 1 to 7 is implemented.