Grid map creation method and device, electronic equipment and storage medium

CN122780449APending Publication Date: 2026-09-18SUNPURE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610636665.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-09
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

该方案本质为固定策略驱动,无法适配复杂排布形式的光伏阵列,容易出现清扫覆盖不全、漏扫等问题

Benefits of technology

[0032]第四方面,本申请提供了一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的栅格地图创建方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122780449A_ABST
    Figure CN122780449A_ABST
Patent Text Reader

Abstract

This application discloses a grid map creation method, apparatus, electronic device, and storage medium, belonging to the field of robotics. The method includes: acquiring a target image containing photovoltaic (PV) modules, identifying the PV modules in the target image to obtain the position information of each PV module in the target image; dividing the PV modules according to their position information to obtain at least one PV array; determining a first direction and a second direction of the PV array; and gridding the PV array according to the position information of each PV module, the first direction, and the second direction to generate a grid map of the PV array. This application transforms the physical arrangement of the PV array into gridded data recognizable by robots, enabling PV cleaning robots to perform localization and path navigation based on the correspondence between the grids and the positions of the PV modules in the grid map. This allows for adaptation to PV array arrangements of varying complexity, improving the cleaning effect of the PV modules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of robotics technology, and in particular relates to a grid map creation method, apparatus, electronic device and storage medium. Background Technology

[0002] With the accelerated global energy structure transformation, photovoltaic power generation has been widely adopted. Since contaminants on the surface of photovoltaic modules can easily reduce photoelectric conversion efficiency, photovoltaic cleaning robots are typically used to clean these modules to ensure stable power generation efficiency. These robots usually employ a tracked mobile chassis equipped with cleaning rollers, moving along the surface of the photovoltaic modules and using the rotating rollers to complete the cleaning task.

[0003] In related technologies, photovoltaic cleaning robots generally adopt a line-following cleaning solution, assuming that the photovoltaic modules are arranged in a simple rectangular pattern. By obtaining the module specifications, a fixed row-changing distance is set, and sensors detect the boundaries to perform fixed-distance row-changing cleaning. This solution is essentially driven by a fixed strategy and cannot adapt to complex photovoltaic array arrangements, easily leading to problems such as incomplete cleaning coverage and missed areas. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a grid map creation method, apparatus, electronic device, and storage medium to improve the cleaning effect of photovoltaic modules.

[0005] Firstly, this application provides a method for creating a raster map, including: A target image containing photovoltaic modules is acquired, and the photovoltaic modules in the target image are identified to obtain the position information of each photovoltaic module in the target image; The photovoltaic modules are divided according to their location information to obtain at least one photovoltaic array; Determine the first and second orientations of the photovoltaic array; The photovoltaic array is rasterized based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction to generate a raster map of the photovoltaic array.

[0006] The grid map creation method provided in this application obtains target images containing photovoltaic modules and identifies the photovoltaic modules. This allows the spatial location information of each photovoltaic module in the actual scene to be obtained. The photovoltaic modules are divided into photovoltaic arrays, which can integrate scattered or complexly arranged photovoltaic modules into logically clear array units. A grid map is generated based on the first and second directions of the photovoltaic arrays. This can transform the physical arrangement of the photovoltaic arrays into gridded data that can be recognized by the robot. This enables the photovoltaic cleaning robot to locate and navigate according to the correspondence between each grid and the position of the photovoltaic module in the grid map. It no longer relies on a fixed row-changing distance and can adapt to photovoltaic array arrangements of different complexities, thus improving the cleaning effect of photovoltaic modules.

[0007] According to one embodiment of this application, the step of identifying photovoltaic modules in the target image to obtain the position information of each photovoltaic module in the target image includes: The target image is input into the target detection model to obtain the position information of each photovoltaic module in the target image; The target detection model is trained based on a sample image set labeled with the location information of photovoltaic modules.

[0008] In this embodiment, by inputting the target image into a target detection model trained on a sample image set labeled with the location information of photovoltaic modules, deep learning technology can be used to automatically identify and locate photovoltaic modules in the target image. This is applicable to complex scenarios and different photovoltaic module layouts, and improves the accuracy of photovoltaic module identification.

[0009] According to one embodiment of this application, the photovoltaic modules are divided according to their location information to obtain at least one photovoltaic array, including: An undirected graph is constructed using each photovoltaic module as a node; wherein, in the undirected graph, the weights of the edges connecting each node include the distance between photovoltaic modules and the angle difference between photovoltaic modules; Clustering is performed on each node based on the edge weights of each node in the undirected graph. Nodes whose edge weights correspond to a distance between photovoltaic modules that is less than or equal to a distance threshold and whose angle difference between photovoltaic modules is less than or equal to an angle difference threshold are identified as being located in the same connected component, thus obtaining at least one connected component. Photovoltaic modules corresponding to nodes within the same connected component are considered as a photovoltaic array.

[0010] In this embodiment, an undirected graph is constructed by treating each photovoltaic module as a node, and the distance and angle difference between photovoltaic modules are used as the edge weights. This comprehensively considers the spatial proximity and arrangement characteristics of the photovoltaic modules. By clustering each node according to the edge weights, photovoltaic modules that are spatially adjacent and have the same orientation can be assigned to the same connected component. This can adaptively identify irregularly arranged or tilted photovoltaic modules, thus improving the accuracy of photovoltaic array division.

[0011] According to one embodiment of this application, the photovoltaic module is rectangular; the distance between the photovoltaic modules is the minimum distance between the sides of the photovoltaic modules; the angle difference between the photovoltaic modules is calculated based on the direction of the long side or the direction of the short side of the rectangle.

[0012] In this embodiment, by determining the minimum distance between the sides of the photovoltaic modules as the minimum distance between the sides of the photovoltaic modules, and calculating the angle difference based on the long side or short side of the rectangle, the geometric characteristics and arrangement rules of the rectangular photovoltaic modules are taken into account, and the accuracy of photovoltaic array division is further improved.

[0013] According to one embodiment of this application, determining the first direction and the second direction of the photovoltaic array includes: The coordinates of the feature points of each photovoltaic module in the photovoltaic array are calculated based on the position information of each photovoltaic module in the photovoltaic array to obtain a set of feature point coordinates; The first and second directions of the photovoltaic array are determined based on the set of feature point coordinates.

[0014] In this embodiment, by calculating the coordinates of feature points based on the position information of each photovoltaic module in the photovoltaic array and obtaining the set of feature point coordinates, the discrete position information of photovoltaic modules can be transformed into a set of geometric feature points. This allows for the analysis of the arrangement trend and structural orientation of the photovoltaic array, thereby improving the accuracy of determining the direction of the photovoltaic array.

[0015] According to one embodiment of this application, the photovoltaic module is rectangular; determining the first and second directions of the photovoltaic array based on the set of feature point coordinates includes: The feature point coordinates in the set of feature point coordinates are sorted to determine the target feature point coordinates; The first direction and the second direction are determined based on the long side direction and short side direction of the target photovoltaic module corresponding to the coordinates of the target feature point.

[0016] In this embodiment, by sorting the coordinates of feature points, the coordinates of the target feature points of the photovoltaic array can be accurately located. Then, based on the long and short side directions of the rectangular photovoltaic module corresponding to the coordinates of the target feature points, the first and second directions are determined. This allows the true orientation of the photovoltaic array to be obtained, providing a directional reference that matches the arrangement of the photovoltaic modules for the rasterization process, thereby improving the accuracy of the raster map.

[0017] According to one embodiment of this application, determining the first direction and the second direction based on the long side direction and short side direction of the target photovoltaic module corresponding to the coordinates of the target feature point includes: A first direction vector representing the direction of the long side is determined through the midpoint of the short side of the target photovoltaic module, and a second direction vector representing the direction of the short side is determined through the midpoint of the long side of the target photovoltaic module. Calculate the angles between the first direction vector and the second direction vector and the first coordinate axis, respectively; The direction vector with the smallest included angle is determined as the first direction, and the direction vector with the largest included angle is determined as the second direction.

[0018] In this embodiment, the orientation features of the photovoltaic module can be accurately extracted based on the geometric center line of the photovoltaic module by using the first direction vector and the second direction vector. By calculating the angle between the direction vector and the first coordinate axis, a quantitative relationship between the direction vector and the coordinate system can be established, thereby accurately defining the orientation reference of the photovoltaic array, making the gridding process more consistent with the arrangement of the photovoltaic modules.

[0019] According to one embodiment of this application, the step of rasterizing the photovoltaic array based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction to generate a raster map of the photovoltaic array includes: Determine a first ray originating from the coordinates of the target feature point and extending along the first direction; Add the coordinates of feature points in the feature point coordinate set whose distance from the first ray is less than or equal to the target distance to the first reference set; The feature point coordinates in the first reference set are sorted according to the first coordinate axis, and the sorted feature point coordinates are traversed: for the current feature point coordinates, a second ray is determined along the second direction with the current feature point coordinates as the starting point, and the feature point coordinates in the feature point coordinate set whose distance from the second ray is less than or equal to the target distance are added to the second reference set corresponding to the current feature point coordinates. The second reference sets corresponding to different feature point coordinates are sorted according to the second coordinate axis. Based on the sorting results of the second reference sets corresponding to different feature point coordinates and the sorting results of the first reference set, the grid cells of the photovoltaic modules corresponding to each feature point coordinate in the grid map are determined.

[0020] In this embodiment, by determining a first ray along a first direction starting from the coordinates of the target feature point, and constructing a first reference set by filtering the coordinates of the feature points based on the target distance, photovoltaic modules can be classified along the main direction of the photovoltaic array. By sorting and traversing the first reference set according to the first coordinate axis, and constructing and sorting a second reference set in combination with the second directional ray, a two-dimensional spatial index between photovoltaic modules can be established progressively in the secondary direction of the photovoltaic array. The row and column structure of the photovoltaic array is automatically determined, and the physical arrangement of the photovoltaic modules is transformed into a regular grid coordinate mapping, so that each grid in the grid map and the position of the photovoltaic module form a one-to-one correspondence. This enables the accurate rasterization of arrays in any direction and improves the accuracy of grid map construction.

[0021] According to one embodiment of this application, before gridding the photovoltaic modules in the photovoltaic array, the method further includes: In the event of missing parts in the photovoltaic array, the photovoltaic modules in the missing areas are replenished.

[0022] In this embodiment, by supplementing the photovoltaic modules in the missing areas of the photovoltaic array, the completed photovoltaic array can logically form a complete arrangement, reducing the problem of holes in the grid map caused by missing photovoltaic modules and improving the consistency of the number of rows and columns and the topological continuity of the grid map.

[0023] According to one embodiment of this application, the method further includes: Identify whether the photovoltaic module corresponding to each grid unit in the grid map is a completed photovoltaic module; Once the photovoltaic module corresponding to the target grid cell is identified as a complete photovoltaic module, identification information representing the absence of a photovoltaic module is established for the target grid cell.

[0024] In this embodiment, by establishing identification information representing non-existent photovoltaic modules for the target grid cells corresponding to the completed photovoltaic modules, the cleaning robot can identify grid cells that do not require cleaning operations based on the identification information when performing path planning and navigation control according to the grid map, thereby further improving the operational reliability of the photovoltaic cleaning robot.

[0025] According to one embodiment of this application, the method further includes: When there are multiple photovoltaic arrays obtained from the division, construct the connection relationship between each photovoltaic array; A global grid map is obtained by stitching together the grid maps of each photovoltaic array according to the connection relationship.

[0026] In this embodiment, by establishing spatial topological associations between different arrays, the grid maps of each photovoltaic array are stitched together to obtain a global grid map. This can integrate scattered local grid data into a global grid map, which facilitates continuous path planning and navigation of the photovoltaic cleaning robot between multiple photovoltaic arrays, thereby improving the continuity of cleaning operations and global coverage.

[0027] According to one embodiment of this application, the construction of the connection relationship between the photovoltaic arrays includes: Based on the location information of photovoltaic modules in each photovoltaic array, the common edge between each photovoltaic array is identified. Based on the common edge, the photovoltaic modules in each photovoltaic array that are adjacent to each other are identified. Based on the photovoltaic modules that are adjacent to each other, the connection relationship between each photovoltaic array is constructed. And / or, obtain the connected photovoltaic modules in each photovoltaic array of the target object input, and construct the connection relationship between each photovoltaic array based on the connected photovoltaic modules in each photovoltaic array.

[0028] In this embodiment, by identifying common edges and determining adjacent relationships based on the location information of photovoltaic modules in each photovoltaic array, a connection relationship can be automatically established between photovoltaic arrays based on the spatial distribution of photovoltaic modules. It also supports manual assistance in setting connection relationships, and can provide manual assistance in automatic identification of failures or complex scenarios, and can adapt to actual application scenarios with different levels of complexity.

[0029] Secondly, this application provides a raster map creation apparatus, the apparatus comprising: The acquisition module is used to acquire a target image containing photovoltaic modules, identify the photovoltaic modules in the target image, and obtain the position information of each photovoltaic module in the target image; A partitioning module is used to partition the photovoltaic modules according to their location information to obtain at least one photovoltaic array; The determining module is used to determine the first direction and the second direction of the photovoltaic array; The generation module is used to rasterize the photovoltaic array based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction, and generate a raster map of the photovoltaic array.

[0030] The grid map creation device provided in this application can obtain the spatial location information of each photovoltaic module in the actual scene by acquiring a target image containing photovoltaic modules and identifying the photovoltaic modules. It can divide each photovoltaic module into a photovoltaic array, integrate scattered or complexly arranged photovoltaic modules into logically clear array units, and generate a grid map based on the first and second directions of the photovoltaic array. It can convert the physical arrangement of the photovoltaic array into gridded data that can be recognized by the robot, so that the photovoltaic cleaning robot can perform positioning and path navigation according to the correspondence between each grid and the position of the photovoltaic module in the grid map. It no longer relies on a fixed row replacement distance, can adapt to photovoltaic array arrangement forms of different complexity, and improve the cleaning effect of photovoltaic modules.

[0031] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the raster map creation method as described in the first aspect above.

[0032] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the raster map creation method as described in the first aspect above.

[0033] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the raster map creation method as described in the first aspect above.

[0034] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: The grid map creation method provided in this application obtains target images containing photovoltaic modules and identifies the photovoltaic modules. This allows the spatial location information of each photovoltaic module in the actual scene to be obtained. The photovoltaic modules are divided into photovoltaic arrays, which can integrate scattered or complexly arranged photovoltaic modules into logically clear array units. A grid map is generated based on the first and second directions of the photovoltaic arrays. This can transform the physical arrangement of the photovoltaic arrays into gridded data that can be recognized by the robot. This enables the photovoltaic cleaning robot to locate and navigate according to the correspondence between each grid and the position of the photovoltaic module in the grid map. It no longer relies on a fixed row-changing distance and can adapt to photovoltaic array arrangements of different complexities, thus improving the cleaning effect of photovoltaic modules.

[0035] In some embodiments, by inputting the target image into a target detection model trained on a sample image set labeled with the location information of photovoltaic modules, deep learning technology can be used to automatically identify and locate photovoltaic modules in the target image. This is applicable to complex scenarios and different photovoltaic module layouts, and improves the accuracy of photovoltaic module identification.

[0036] In some embodiments, by constructing an undirected graph with each photovoltaic module as a node and using the distance and angle difference between photovoltaic modules as the edge weights, the spatial proximity relationship and arrangement characteristics between photovoltaic modules are comprehensively considered. By clustering each node according to the edge weights, photovoltaic modules that are spatially adjacent and have the same orientation can be assigned to the same connected component. This enables adaptive identification of irregularly arranged or tilted photovoltaic modules, improving the accuracy of photovoltaic array division.

[0037] In some embodiments, by determining the minimum distance between the sides of the photovoltaic modules as the minimum distance between the sides of the photovoltaic modules, and calculating the angle difference based on the long side direction or the short side direction of the rectangle, the geometric characteristics and arrangement rules of the rectangular photovoltaic modules are taken into account, and the accuracy of photovoltaic array division is further improved.

[0038] In some embodiments, by calculating the coordinates of feature points based on the position information of each photovoltaic module in the photovoltaic array and obtaining a set of feature point coordinates, the discrete position information of photovoltaic modules can be transformed into a set of geometric feature points, thereby enabling the analysis of the arrangement trend and structural orientation of the photovoltaic array and improving the accuracy of determining the orientation of the photovoltaic array.

[0039] In some embodiments, by sorting the coordinates of feature points, the coordinates of the target feature points of the photovoltaic array can be accurately located. Then, based on the long side and short side directions of the rectangular photovoltaic module corresponding to the coordinates of the target feature points, the first direction and the second direction can be determined. This allows the true orientation of the photovoltaic array to be obtained, providing a directional reference that matches the arrangement of the photovoltaic modules for rasterization processing, thereby improving the accuracy of the raster map.

[0040] In some embodiments, the orientation features of the photovoltaic module can be accurately extracted based on the geometric center line of the photovoltaic module by using the first direction vector and the second direction vector. By calculating the angle between the direction vector and the first coordinate axis, a quantitative relationship between the direction vector and the coordinate system can be established, thereby accurately defining the orientation reference of the photovoltaic array and making the gridding process more consistent with the arrangement of the photovoltaic module.

[0041] In some embodiments, by determining a first ray along a first direction starting from the coordinates of the target feature point, and constructing a first reference set by filtering the coordinates of the feature points based on the target distance, photovoltaic modules along the main direction of the photovoltaic array can be classified. By sorting and traversing the first reference set according to the first coordinate axis, and constructing and sorting a second reference set in combination with the second directional ray, a two-dimensional spatial index between photovoltaic modules can be established layer by layer in the secondary direction of the photovoltaic array. The row and column structure of the photovoltaic array is automatically determined, and the physical arrangement of the photovoltaic modules is transformed into a regular grid coordinate mapping, so that each grid in the grid map and the position of the photovoltaic module form a one-to-one correspondence. This enables the accurate rasterization of arrays in any direction and improves the accuracy of grid map construction.

[0042] In some embodiments, by supplementing the photovoltaic modules in the missing areas of the photovoltaic array, the supplemented photovoltaic array can logically form a complete arrangement, reducing the problem of holes in the grid map caused by missing photovoltaic modules, and improving the consistency of the number of rows and columns and the topological continuity of the grid map.

[0043] In some embodiments, by establishing identification information representing non-existent photovoltaic modules for the target grid cells corresponding to the completed photovoltaic modules, the cleaning robot can identify grid cells that do not require cleaning operations based on the identification information when performing path planning and navigation control according to the grid map, thereby further improving the operational reliability of the photovoltaic cleaning robot.

[0044] In some embodiments, by establishing spatial topological associations between different arrays, the grid maps of each photovoltaic array are stitched together to obtain a global grid map, which can integrate scattered local grid data into a global grid map, making it easier for the photovoltaic cleaning robot to perform continuous path planning and navigation between multiple photovoltaic arrays, thereby improving the continuity of cleaning operations and global coverage.

[0045] In some embodiments, by identifying common edges and determining adjacency relationships based on the location information of photovoltaic modules in each photovoltaic array, connection relationships can be constructed, and topological associations between photovoltaic arrays can be automatically established based on the spatial distribution of photovoltaic modules. It also supports manual assistance in setting connection relationships, and can provide manual assistance in automatic identification of failures or complex scenarios, and can adapt to actual application scenarios with different levels of complexity.

[0046] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is one of the schematic diagrams of the photovoltaic array arrangement provided in the embodiments of this application; Figure 2 This is the second schematic diagram of the photovoltaic array arrangement provided in the embodiments of this application; Figure 3 This is the third schematic diagram of the photovoltaic array arrangement provided in the embodiments of this application; Figure 4 This is a flowchart illustrating the grid map creation method provided in an embodiment of this application; Figure 5 This is a schematic diagram of target image acquisition provided in an embodiment of this application; Figure 6 This is one of the schematic diagrams showing the partitioning results of the photovoltaic array provided in the embodiments of this application; Figure 7 This is the second schematic diagram of the photovoltaic array partitioning results provided in the embodiments of this application; Figure 8 This is a schematic diagram of the photovoltaic array orientation determination process provided in the embodiments of this application; Figure 9 This is a schematic diagram of the rasterization process provided in an embodiment of this application; Figure 10 This is one of the schematic diagrams showing the connection relationship between the various photovoltaic arrays provided in the embodiments of this application; Figure 11 This is the second schematic diagram of the connection relationship between the photovoltaic arrays provided in the embodiments of this application; Figure 12 This is a schematic diagram of a global grid map provided in an embodiment of this application; Figure 13 This is a schematic diagram of the structure of the grid map creation device provided in the embodiments of this application; Figure 14 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0049] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0050] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0051] In related technologies, photovoltaic cleaning robots generally adopt a line-following cleaning solution, assuming that the photovoltaic modules are arranged in a simple rectangular pattern. By obtaining the module specifications, a fixed row-changing distance is set, and sensors detect the boundaries to perform fixed-distance row-changing cleaning. This solution is essentially driven by a fixed strategy and cannot adapt to complex photovoltaic array arrangements, easily leading to problems such as incomplete cleaning coverage and missed areas.

[0052] like Figures 1-3 As shown in the figure, the gray rectangles represent photovoltaic modules. Since photovoltaic modules are standard rectangles, after being installed and spliced ​​into a photovoltaic array, the array is usually designed as a rectangular arrangement. However, due to limitations imposed by the site environment, photovoltaic modules cannot be installed in some locations, resulting in missing modules inside the array, missing modules at the outer edge, and inconsistent installation directions of photovoltaic modules within the same array. An arrangement exhibiting at least one of these conditions can be considered a complex photovoltaic array. Of course, complex photovoltaic arrays can also be irregularly shaped, with uneven spacing, etc., which are not limited in this embodiment.

[0053] The method of relying on sensors to detect boundaries and perform fixed-distance row-changing cleaning is highly dependent on the geometric regularity of the photovoltaic array. For photovoltaic arrays with complex arrangements, photovoltaic cleaning robots lack the ability to dynamically plan the global cleaning path, making it difficult to adapt to actual spatial changes. This can easily lead to problems such as incomplete cleaning coverage and missed cleaning, causing the cleaning strategy to fail and seriously affecting the cleaning effect.

[0054] To address at least one of the aforementioned technical problems, this application provides a raster map creation method, apparatus, electronic device, and storage medium. The raster map creation method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments and application scenarios.

[0055] The grid map creation method can be applied to a terminal, specifically executed by the hardware or software within the terminal.

[0056] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).

[0057] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.

[0058] The raster map creation method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the method. The electronic devices mentioned in this application embodiment include, but are not limited to, computers, servers, etc. The following uses an electronic device as the execution subject to describe the raster map creation method provided in this application embodiment.

[0059] like Figure 4 As shown, the raster map creation method includes steps 410 and 420.

[0060] Step 410: Obtain a target image containing photovoltaic modules, identify the photovoltaic modules in the target image, and obtain the location information of each photovoltaic module in the target image.

[0061] In the embodiments of this application, a photovoltaic module refers to a component in a solar photovoltaic power generation system, which is usually encapsulated from multiple photovoltaic cells and has a regular geometric shape (such as a rectangle).

[0062] The target image is image data containing photovoltaic modules. The target image can be obtained by photographing the photovoltaic field using methods such as drone aerial photography, ground camera photography, and satellite remote sensing. The target image can be a single image, a panoramic image stitched together from multiple images, or a keyframe image from a video stream; this application does not limit the specific type of image.

[0063] In one example, such as Figure 5 As shown, drones can be used to photograph the photovoltaic field. When the drone collects images, it should be located as close as possible to the center of the photovoltaic array, and the image viewing angle should be as consistent as possible with the direction of the photovoltaic modules. The collected target images should contain the complete photovoltaic modules to be cleaned as much as possible.

[0064] In some embodiments, image recognition algorithms, such as deep learning-based target detection algorithms (e.g., YOLO (You Only Look Once) algorithm, Faster R-CNN (Region-based Convolutional Neural Network) algorithm) and traditional recognition algorithms based on feature extraction (e.g., SIFT (Scale-Invariant Feature Transform) algorithm, HOG (Histogram of Oriented Gradients) algorithm), can be used to identify photovoltaic modules in the target image and obtain the position information of each photovoltaic module in the target image.

[0065] The location information of each photovoltaic (PV) module is used to characterize its spatial distribution in the target image. This location information can be represented by pixel coordinates, geographic coordinates, or other identifiable spatial identifiers, such as the coordinates (x, y) of the PV module's center point in the image coordinate system, the set of pixel coordinates of the PV module's boundaries, and the vertex coordinates of the PV module. For example, the location information of each PV module can be determined by its four vertices, and the set of location information for each identified PV module is denoted as [the set of information for each PV module]. Each identified location information includes four vertices, and the vertex pixel coordinates are known. The vertex pixel coordinates of the i-th photovoltaic module are: .

[0066] Step 420: Divide the photovoltaic modules according to their location information to obtain at least one photovoltaic array.

[0067] In this embodiment, a photovoltaic array is a collection of multiple photovoltaic modules arranged according to a preset rule. Photovoltaic modules within the same array typically have the same installation angle and orientation, used for centralized power generation and management. The photovoltaic modules identified in the target image may come from different photovoltaic arrays. Therefore, it is necessary to classify and group them according to their location information, grouping photovoltaic modules belonging to the same array together to obtain at least one photovoltaic array.

[0068] After obtaining the location information of each photovoltaic module, it can be divided based on parameters such as the spacing, arrangement direction, and relative positional relationship between the photovoltaic modules. For example, a spacing threshold can be set. When the straight-line distance between two photovoltaic modules is less than the spacing threshold and their arrangement directions are consistent, it is determined that the two photovoltaic modules belong to the same photovoltaic array.

[0069] In some embodiments, considering that the components in the same photovoltaic array usually have the same installation tilt angle and azimuth angle, the orientation characteristics of each photovoltaic component can be extracted, and components with similar orientation characteristics and spatial proximity can be divided into the same photovoltaic array.

[0070] The number of photovoltaic arrays obtained from the division changes dynamically based on the actual distribution of photovoltaic modules in the target image. For example, if the target image contains only one set of photovoltaic modules arranged in a regular pattern, then only one photovoltaic array is obtained. Figure 6 As shown; if the target image contains multiple independently arranged and unrelated photovoltaic modules, then it can be divided into multiple photovoltaic arrays, such as... Figure 7 As shown.

[0071] Step 430: Determine the first and second directions of the photovoltaic array.

[0072] In this embodiment, the first direction and the second direction of the photovoltaic array are two mutually perpendicular directions used to characterize the overall arrangement trend of the photovoltaic array. The first direction and the second direction can correspond to the arrangement direction of the photovoltaic array. For example, the first direction is the row arrangement direction of the photovoltaic modules, i.e., the main direction of the photovoltaic array, and the second direction is the column arrangement direction of the photovoltaic modules, i.e., the secondary direction of the photovoltaic array. The first direction and the second direction are perpendicular to each other and together constitute the two-dimensional arrangement coordinate system of the photovoltaic array. Determining the first direction and the second direction can provide a reference direction for subsequent gridding of the photovoltaic array.

[0073] In some embodiments, any group of adjacent photovoltaic modules within the photovoltaic array can be selected, and the connection direction of this group of photovoltaic modules can be calculated based on the position information. This connection direction is used as the initial direction, and the connection direction of each group of adjacent photovoltaic modules is calculated by traversing all adjacent photovoltaic modules within the photovoltaic array. Statistical analysis is performed on all connection directions to determine the connection direction with the highest frequency, which is then used as the first direction of the photovoltaic array, and the direction perpendicular to the first direction is determined as the second direction. Alternatively, any photovoltaic module within the photovoltaic array can be selected, and the extension direction of the short side of the photovoltaic module can be determined as the first direction of the photovoltaic array, and the extension direction of the long side can be determined as the second direction of the photovoltaic array. The direction can also be determined by combining the geometric outer contour of the photovoltaic array. By calculating the direction of the overall circumscribed rectangle of the photovoltaic array, the direction of the long side of the circumscribed rectangle is used as the first direction, and the direction perpendicular to the first direction is used as the second direction. This embodiment of the application does not limit this approach.

[0074] Step 440: Grid the photovoltaic array according to the position information of each photovoltaic module in the photovoltaic array, the first direction and the second direction, and generate a grid map of the photovoltaic array.

[0075] In the embodiments of this application, rasterization refers to the process of converting the location information of continuously distributed photovoltaic modules into discrete raster cells. The generated raster map describes the spatial occupancy status of each photovoltaic module in the photovoltaic array in the form of regular grids. Each raster cell corresponds to a specific area in the physical space. The presence of photovoltaic modules in the area can be identified by the attribute values ​​of the raster cells.

[0076] The size of the grid cells can be determined based on the actual size of the photovoltaic modules, ensuring that each grid cell can cover one photovoltaic module. A grid coordinate system can be established based on a vertex of the photovoltaic array (such as the top left corner) and a first and second direction, dividing the photovoltaic array into multiple evenly distributed grid cells. The position information of each photovoltaic module is mapped to its corresponding grid cell, and the photovoltaic module identifier and position information for each grid cell are recorded, generating a grid map of the photovoltaic array.

[0077] In some embodiments, the generated grid map may include various information, such as the coordinates of grid cells and the corresponding photovoltaic module identifiers. The generated grid map can be applied to the path planning and operation control of photovoltaic cleaning robots. The photovoltaic cleaning robot can read the location information and arrangement pattern of the photovoltaic modules corresponding to each grid cell in the grid map, and combine it with its own navigation system to plan a cleaning path, reducing the occurrence of repeated cleaning or missed cleaning during the cleaning process.

[0078] The grid map creation method provided in this application obtains target images containing photovoltaic modules and identifies the photovoltaic modules. This allows the spatial location information of each photovoltaic module in the actual scene to be obtained. The photovoltaic modules are divided into photovoltaic arrays, which can integrate scattered or complexly arranged photovoltaic modules into logically clear array units. A grid map is generated based on the first and second directions of the photovoltaic arrays. This can transform the physical arrangement of the photovoltaic arrays into gridded data that can be recognized by the robot. This enables the photovoltaic cleaning robot to locate and navigate according to the correspondence between each grid and the position of the photovoltaic module in the grid map. It no longer relies on a fixed row-changing distance and can adapt to photovoltaic array arrangements of different complexities, thus improving the cleaning effect of photovoltaic modules.

[0079] In some embodiments, photovoltaic modules in a target image are identified to obtain the location information of each photovoltaic module in the target image, including: The target image is input into the target detection model to obtain the location information of each photovoltaic module in the target image; The target detection model was trained based on a set of sample images labeled with the location information of photovoltaic modules.

[0080] In this embodiment, the target detection model is a pre-built and trained deep learning neural network model used to detect and locate photovoltaic modules in the input image, and output the position information of each photovoltaic module in the image. The construction and training process of the target detection model can be completed offline before system deployment. After training, the target detection model has the ability to accurately identify photovoltaic modules under multiple viewing angles and multiple lighting conditions, and can be deployed in an online inference environment for real-time detection.

[0081] The sample image set required for model training can be multi-view photovoltaic scene images, including scenes with different types of photovoltaic power plants, different shooting angles, different lighting conditions, and different component arrangements, thereby improving the diversity of training data. After acquiring the sample images, the photovoltaic components in the sample images can be labeled manually. The labeling content can include the coordinates of the rectangular bounding box (such as the pixel coordinates of the upper left and lower right corners), the segmentation contour point set, or the component category label, forming a sample image set with location information labels.

[0082] Depending on the different requirements for recognition accuracy and inference speed, a suitable network structure can be selected as the basic architecture of the object detection model. For example, for scenarios that require high inference speed, lightweight network structures such as YOLOv8 and YOLOv5 can be used; for scenarios that require high-precision localization, instance segmentation models such as Mask R-CNN and Detectron2 can be used. Of course, other network structures can also be selected, and this application does not limit them.

[0083] The model training strategy can employ transfer learning to improve training efficiency and model generalization ability. Specifically, weights pre-trained on large-scale public datasets such as COCO (Common Objects in Context) and ImageNet can be used as the initial parameters of the object detection model, and then fine-tuned using the sample image set constructed above.

[0084] During training, the model parameters are iteratively updated by optimizing a multi-task loss function. This loss function can include classification loss (to distinguish photovoltaic modules from the background or other categories), bounding box regression loss (to locate the position of photovoltaic modules), and segmentation loss (to optimize the outline of photovoltaic modules). Each loss term can be balanced using weight coefficients. After sufficient iterative training, when the performance metrics (such as recall and precision) of the object detection model on the validation set reach a preset threshold, the model parameters can be solidified, resulting in an object detection model that can be deployed.

[0085] During the online inference phase, the target image containing photovoltaic modules can be transmitted as input data to the target detection model. The target detection model extracts and calculates features from the input target image through a forward propagation process, outputting the location information of the photovoltaic modules in the target image. For example, the location information of each photovoltaic module can be determined by the four vertices of the photovoltaic module, and the set of location information of all identified photovoltaic modules is denoted as […]. Each identified location information includes four vertices, and the vertex pixel coordinates are known. The vertex pixel coordinates of the i-th photovoltaic module are: .

[0086] In this embodiment, by inputting the target image into a target detection model trained on a sample image set labeled with the location information of photovoltaic modules, deep learning technology can be used to automatically identify and locate photovoltaic modules in the target image. This is applicable to complex scenarios and different photovoltaic module layouts, and improves the accuracy of photovoltaic module identification.

[0087] In some embodiments, the photovoltaic modules are divided according to their location information to obtain at least one photovoltaic array, including: An undirected graph is constructed by treating each photovoltaic module as a node; in the undirected graph, the weight of the edge connecting each node includes the distance between photovoltaic modules and the angle difference between photovoltaic modules. Clustering nodes in an undirected graph based on the edge weights of each node yields at least one connected component. Photovoltaic modules corresponding to nodes within the same connected component are considered as a photovoltaic array.

[0088] In this embodiment, to identify the clustering characteristics of photovoltaic modules in spatial distribution, the problem of partitioning photovoltaic modules is transformed into a clustering problem on a graph structure. Specifically, each photovoltaic module is treated as a node in an undirected graph. By constructing connections between nodes and assigning corresponding edge weights, a graph structure capable of characterizing the spatial correlation between photovoltaic modules is formed. ,in, Represents a node. Represents an edge.

[0089] In the process of constructing the graph structure, nodes correspond to photovoltaic modules. Each node carries the location information of the photovoltaic module. For any two nodes, if the corresponding photovoltaic modules meet certain proximity conditions, an undirected edge is established between the two nodes. The weight of the edge includes the distance between the photovoltaic modules and the angle difference between the photovoltaic modules, which comprehensively considers the spatial distance difference and directional consistency between the photovoltaic modules.

[0090] In some embodiments, the photovoltaic module is rectangular; the distance between photovoltaic modules is the minimum distance between the sides of the photovoltaic modules; the angle difference between photovoltaic modules is calculated based on the direction of the long side or the direction of the short side of the rectangle.

[0091] Considering that photovoltaic modules are rectangular and adjacent modules are typically arranged with their sides close together, the minimum distance between the sides of photovoltaic modules can be used as the distance between them. For example, the four sides can be determined based on the coordinates of the four vertices of photovoltaic module i, which is... The distance between photovoltaic module i and photovoltaic module j .

[0092] The angle difference can be calculated along either the long or short side of the rectangular structure of the photovoltaic module. For example, the lengths of the four sides can be sorted to determine the two short sides. The direction connecting the center points of the two short sides (i.e., the direction of the long side of the rectangle) is taken as the principal direction of photovoltaic module i, denoted as... The angle difference between photovoltaic module i and photovoltaic module j can be calculated using the following formula:

[0093] in, This represents the angle difference between photovoltaic module i and photovoltaic module j. Indicate the main direction of photovoltaic module j.

[0094] Angle difference is used to measure the consistency of the orientation of two photovoltaic modules. Photovoltaic modules with similar orientations are more likely to belong to the same photovoltaic array.

[0095] In this embodiment, by determining the minimum distance between the sides of the photovoltaic modules as the minimum distance between the sides of the photovoltaic modules, and calculating the angle difference based on the long side or short side of the rectangle, the geometric characteristics and arrangement rules of the rectangular photovoltaic modules are taken into account, and the accuracy of photovoltaic array division is further improved.

[0096] In some embodiments, the straight-line distance between geometric points of photovoltaic modules can be used as the distance between photovoltaic modules. For example, geometric points such as the centroid, geometric center, or the point where two photovoltaic modules are closest to each other can be determined. The coordinates of the geometric points of each photovoltaic module can be determined based on the position information of the photovoltaic modules, and the spatial straight-line distance between any two geometric points of photovoltaic modules can be calculated as the distance between the photovoltaic modules.

[0097] In some embodiments, principal component analysis can be used to determine the principal axis direction of each photovoltaic module, and the angle between the principal axis directions of two photovoltaic modules can be calculated as the angle difference between the photovoltaic modules; alternatively, a straight line can be fitted to the edge contour of the photovoltaic module, the direction vector of the fitted straight line can be extracted, and then the angle between the fitted straight line directions of the two photovoltaic modules can be calculated to obtain the angle difference between the photovoltaic modules.

[0098] Of course, the distance between photovoltaic modules and the angle difference between photovoltaic modules can also be determined by other methods, and this application embodiment does not limit this.

[0099] After the graph structure is constructed, cluster analysis is performed on the nodes based on the topology of the undirected graph. The clustering process can employ graph clustering algorithms, decomposing the graph structure into several connected components by progressively merging similar nodes or cutting weakly connected edges. Nodes within each connected component have smaller edge weights, meaning they are closer and have higher directional consistency. Nodes between different connected components have larger edge weights or no direct connections. After clustering, at least one connected component is obtained, and the photovoltaic modules corresponding to the nodes within the same connected component can be considered as a photovoltaic array.

[0100] In this embodiment, an undirected graph is constructed by treating each photovoltaic module as a node, and the distance and angle difference between photovoltaic modules are used as the edge weights. This comprehensively considers the spatial proximity and arrangement characteristics of the photovoltaic modules. By clustering each node according to the edge weights, photovoltaic modules that are spatially adjacent and have the same orientation can be assigned to the same connected component. This can adaptively identify irregularly arranged or tilted photovoltaic modules, thus improving the accuracy of photovoltaic array division.

[0101] In some embodiments, clustering nodes based on the edge weights of each node in the undirected graph to obtain at least one connected component includes: In the edge weights, nodes whose distance between photovoltaic modules is less than or equal to a distance threshold and whose angle difference between photovoltaic modules is less than or equal to an angle difference threshold are determined to be located in the same connected component.

[0102] In this embodiment, the distance threshold and the angle difference threshold can be preset values. By determining the nodes whose distance between photovoltaic modules is less than or equal to the distance threshold and whose angle difference is less than or equal to the angle difference threshold in the edge weights as being located in the same connected component, the photovoltaic modules in the same connected component satisfy both the spatial proximity requirement and the arrangement direction consistency requirement, thereby further improving the accuracy of photovoltaic array division.

[0103] In some embodiments, determining a first orientation and a second orientation of the photovoltaic array includes: The coordinates of the feature points of each photovoltaic module in the photovoltaic array are calculated based on the position information of each photovoltaic module in the photovoltaic array, and the set of feature point coordinates is obtained. The first and second directions of the photovoltaic array are determined based on the set of feature point coordinates.

[0104] In this embodiment, feature point coordinates are parameters used to characterize the geometric position of the photovoltaic module. Feature point coordinates can be selected from coordinates with clear geometric meaning, such as the centroid, geometric center, or vertices (e.g., the top-left and bottom-right vertices) of the photovoltaic module. The feature point coordinates corresponding to the photovoltaic module can be calculated based on the module's position information. For example, if the centroid is selected as the feature point, its coordinates can be obtained through a centroid calculation algorithm, combined with the pixel distribution of the photovoltaic module. The feature point coordinates of photovoltaic modules within the same photovoltaic array are then aggregated to form a set of feature point coordinates corresponding to that photovoltaic array.

[0105] In some embodiments, the feature point coordinate set can be analyzed using Principal Component Analysis (PCA) to determine the first and second directions. For example, the feature point coordinate set can be fitted with an Oriented Bounding Box (OBB) to obtain the minimum area OBB that can enclose all feature points, and the vertex coordinates of the OBB can be extracted to form the OBB vertex coordinate set.

[0106] The OBB vertex coordinate set represents the overall distribution contour of feature points in a photovoltaic array. Principal component analysis can be performed on the OBB vertex coordinate set to calculate its covariance matrix, and then the eigenvalues ​​and corresponding eigenvectors of this covariance matrix can be solved. The first eigenvector corresponding to the largest eigenvalue can be determined as the first direction of the photovoltaic array, representing the primary extension trend of the photovoltaic module arrangement in the array. The second eigenvector corresponding to the second largest eigenvalue can be determined as the second direction of the photovoltaic array, which is orthogonal to the first direction and represents the secondary extension trend of the photovoltaic module arrangement in the array.

[0107] In some embodiments, the set of feature point coordinates can be fitted with a straight line. For example, fitting algorithms such as least squares method and random sampling consensus algorithm can be used to fit a fitted straight line that can reflect the main extension trend of the feature point set. The direction of the fitted straight line is the first direction of the photovoltaic array. The direction orthogonal to the direction of the fitted straight line is solved, and the orthogonal direction is determined as the second direction of the photovoltaic array.

[0108] In some embodiments, other methods may be used to determine the first and second directions of the photovoltaic array. For example, the minimum bounding rectangle of the feature point coordinate set may be fitted, and the first and second directions of the photovoltaic array may be determined based on the long side direction and short side direction of the fitted minimum bounding rectangle, respectively. This application does not limit this method.

[0109] In this embodiment, by calculating the coordinates of feature points based on the position information of each photovoltaic module in the photovoltaic array and obtaining the set of feature point coordinates, the discrete position information of photovoltaic modules can be transformed into a set of geometric feature points. This allows for the analysis of the arrangement trend and structural orientation of the photovoltaic array, thereby improving the accuracy of determining the direction of the photovoltaic array.

[0110] In some embodiments, the photovoltaic module is rectangular; determining the first and second directions of the photovoltaic array based on a set of feature point coordinates includes: Sort the feature point coordinates in the feature point coordinate set to determine the target feature point coordinates; The first and second directions are determined based on the long and short sides of the target photovoltaic module corresponding to the coordinates of the target feature points.

[0111] In this embodiment, the feature point coordinates in the feature point coordinate set can be sorted according to the combination of x-coordinates and y-coordinates. This sorting operation can distinguish feature points located at the edge of the photovoltaic array from internal feature points, thereby allowing for the selection of target feature points.

[0112] The target feature point can be a feature point located at the boundary of the photovoltaic array, reflecting the overall arrangement direction of the photovoltaic array. Corner components are usually less constrained by adjacent components, making the direction expression clearer. For example, the target feature point can be a feature point at any corner of the photovoltaic array, including the upper left, upper right, lower left, and lower right corners. The target feature point can also be any single feature point; this application does not limit this.

[0113] The feature point in the lower left corner Taking the target feature point as an example, determine the edges of the photovoltaic module corresponding to the target feature point. Since photovoltaic modules are rectangular with mutually perpendicular long and short sides, the direction of the long side of the target photovoltaic module can be used as the first direction and the direction of the short side as the second direction, or the direction of the short side can be used as the first direction and the direction of the long side as the second direction, or the direction information of multiple corner photovoltaic modules can be combined for consistency verification or average calculation to determine the first and second directions.

[0114] In this embodiment, by sorting the coordinates of feature points, the coordinates of the target feature points of the photovoltaic array can be accurately located. Then, based on the long and short side directions of the rectangular photovoltaic module corresponding to the coordinates of the target feature points, the first and second directions are determined. This allows the true orientation of the photovoltaic array to be obtained, providing a directional reference that matches the arrangement of the photovoltaic modules for the rasterization process, thereby improving the accuracy of the raster map.

[0115] In some embodiments, determining a first direction and a second direction based on the long side direction and short side direction of the target photovoltaic module corresponding to the coordinates of the target feature point includes: A first direction vector representing the direction of the long side is determined through the midpoint of the short side of the target photovoltaic module, and a second direction vector representing the direction of the short side is determined through the midpoint of the long side of the target photovoltaic module. Calculate the angles between the first direction vector and the second direction vector and the first coordinate axis, respectively; The direction vector with the smallest included angle is determined as the first direction, and the direction vector with the largest included angle is determined as the second direction.

[0116] like Figure 8 As shown, in this embodiment, based on the rectangular structure of the target photovoltaic module, the position information of the target photovoltaic module can be represented by the coordinates of its four vertices. According to the formula for the midpoint of two coordinates, the midpoints of the two short sides of the target photovoltaic module are calculated respectively. A first direction vector can be formed by taking the midpoint of one short side as the starting point and the midpoint of the other short side as the ending point. The first direction vector is parallel to the long side of the target photovoltaic module and can be used to characterize the direction of the long side. The midpoints of the two long sides of the target photovoltaic module are calculated separately. The second direction vector can be formed by taking the midpoint of one long side as the starting point and the midpoint of the other long side as the ending point. The second direction vector is parallel to the short side of the target photovoltaic module and can be used to characterize the direction of the short side.

[0117] In this embodiment, the first coordinate axis can be either the horizontal axis (x-axis) or the y-axis of the image coordinate system. The angle calculation formula can be used to calculate the angle between the first direction vector and the first coordinate axis, and the angle between the second direction vector and the first coordinate axis, respectively. It should be noted that during the angle calculation, it is necessary to ensure that the coordinates of the direction vector are consistent with the direction of the first coordinate axis. If the coordinates of the direction vector are negative, the angle is corrected based on the vector direction to ensure that the calculated angle accurately reflects the actual angle between the direction vector and the first coordinate axis, avoiding deviations in angle calculation caused by vector direction.

[0118] In this embodiment, the direction vector with the smallest angle to the first coordinate axis can be determined as the first direction of the photovoltaic array, that is, the main direction of the photovoltaic array, and the other direction vector can be determined as the second direction of the photovoltaic array, that is, the secondary direction of the photovoltaic array.

[0119] In this embodiment, the orientation features of the photovoltaic module can be accurately extracted based on the geometric center line of the photovoltaic module by using the first direction vector and the second direction vector. By calculating the angle between the direction vector and the first coordinate axis, a quantitative relationship between the direction vector and the coordinate system can be established, thereby accurately defining the orientation reference of the photovoltaic array, making the gridding process more consistent with the arrangement of the photovoltaic modules.

[0120] In some embodiments, the photovoltaic array is rasterized according to the position information of each photovoltaic module in the photovoltaic array, a first direction, and a second direction to generate a raster map of the photovoltaic array, including: Determine the first ray originating from the coordinates of the target feature point and following the first direction; Add the coordinates of feature points in the feature point coordinate set whose distance from the first ray is less than or equal to the target distance to the feature point coordinate set; The feature point coordinates in the first reference set are sorted according to the first coordinate axis, and the sorted feature point coordinates are traversed: for the current feature point coordinates, the second ray along the second direction with the current feature point coordinates as the starting point is determined, and the feature point coordinates in the feature point coordinate set whose distance from the second ray is less than or equal to the target distance are added to the second reference set corresponding to the current feature point coordinates. The second reference sets corresponding to different feature point coordinates are sorted according to the second coordinate axis. Based on the sorting results of the second reference sets corresponding to different feature point coordinates and the sorting results of the first reference set, the grid cells of the photovoltaic modules corresponding to each feature point coordinate in the grid map are determined.

[0121] In this embodiment, to establish the mapping relationship between the physical location of photovoltaic modules and the coordinates of the grid map, a gridding method based on ray projection and hierarchical sorting is adopted. Taking the first direction and the second direction as the reference, the irregularly distributed photovoltaic modules in the two-dimensional space are transformed into a regular row and column structure by constructing rays and clustering photovoltaic modules along the ray directions, thereby realizing the generation of the grid map.

[0122] like Figure 9 As shown, Figure 9 The left dot represents the coordinates of the feature point, and the right dot represents the rasterized grid cell. A first ray can be constructed along the first direction, using the target feature point coordinates as the starting point. The feature point coordinates in the set are traversed, and the perpendicular distance from each feature point to the first ray is calculated. Feature point coordinates with distances less than or equal to a preset target distance are selected and added to the first reference set, denoted as [reference value]. The set size is m, indicating that the array has m columns. The feature point coordinates in the first reference set correspond to the photovoltaic modules distributed along the first direction. The photovoltaic modules corresponding to the target feature point coordinates form the 0th row in the grid map. The target distance can be determined based on the actual size of the photovoltaic module and the detection accuracy.

[0123] After obtaining the first reference set, the feature point coordinates in the first reference set are sorted according to the first coordinate axis (e.g., the horizontal x-axis of an image coordinate system) to establish the order relationship of the photovoltaic modules corresponding to each feature point coordinate in the first reference set in the first direction. The sorted feature point coordinates are traversed one by one. For each currently encountered feature point coordinate, the following operations are performed: For the current feature point coordinates, take the point as the starting point of the ray and construct a second ray along the second direction. Traverse the feature point coordinates in the feature point coordinate set, calculate the perpendicular distance from each feature point coordinate to the second ray, and filter out the feature point coordinates whose distance is less than or equal to the target distance and add them to the second reference set corresponding to the current feature point coordinates.

[0124] Each current feature point coordinate corresponds to an independent second reference set. The feature point coordinates in the second reference set, together with the current feature point, constitute a photovoltaic module sequence distributed along the second direction.

[0125] In this embodiment, taking the target feature point coordinates as the coordinates of the feature point at the lower left corner of the photovoltaic array as an example, the coordinates of the first currently visited feature point are the coordinates of the target feature point, and the corresponding second reference set can be denoted as... The set size is n, indicating that the array has n rows. The feature point coordinates in the second reference set correspond to the photovoltaic modules distributed along the second direction. The photovoltaic modules corresponding to the target feature point coordinates constitute the 0th column in the grid map.

[0126] After obtaining the second reference set corresponding to the coordinates of each feature point, each second reference set is sorted according to the second coordinate axis (e.g., the vertical y-axis of the image coordinate system), thereby establishing the order relationship of feature points within each second reference set in the second direction. Since the sorting result of the first reference set provides the row index information of each photovoltaic module in the first direction, and the sorting result of each second reference set provides the column index information of each photovoltaic module in the second direction, combining the sorting results of these two dimensions, the grid cell coordinates (row number, column number) of the photovoltaic module corresponding to each feature point coordinate in the grid map can be determined. For example, the sorting number of the feature point coordinate in the first reference set can be used as the row coordinate of the corresponding grid cell, and the sorting number of the feature point coordinate in the second reference set to which the feature point coordinate belongs can be used as the column coordinate of the corresponding grid cell.

[0127] In this embodiment, by determining a first ray along a first direction starting from the coordinates of the target feature point, and constructing a first reference set by filtering the coordinates of the feature points based on the target distance, photovoltaic modules can be classified along the main direction of the photovoltaic array. By sorting and traversing the first reference set according to the first coordinate axis, and constructing and sorting a second reference set in combination with the second directional ray, a two-dimensional spatial index between photovoltaic modules can be established progressively in the secondary direction of the photovoltaic array. The row and column structure of the photovoltaic array is automatically determined, and the physical arrangement of the photovoltaic modules is transformed into a regular grid coordinate mapping, so that each grid in the grid map and the position of the photovoltaic module form a one-to-one correspondence. This enables the accurate rasterization of arrays in any direction and improves the accuracy of grid map construction.

[0128] In some embodiments, prior to gridding the photovoltaic modules in the photovoltaic array, the method further includes: In cases where there are missing photovoltaic modules in the photovoltaic array, the missing modules are replaced.

[0129] In this embodiment, considering the complex arrangement of photovoltaic modules in actual application scenarios, there may be situations such as missing photovoltaic modules in edge areas or missing photovoltaic modules in the interior, which will affect the regularity and directional consistency of the subsequent grid map arrangement. Therefore, it is necessary to fill in the missing areas before performing the gridding operation.

[0130] For example, the distribution characteristics of the spacing between photovoltaic modules can be statistically analyzed to identify abnormally large spacing values. When the spacing between adjacent photovoltaic modules is significantly greater than the normal row or column spacing of the photovoltaic array, it can be determined that there are missing photovoltaic modules in that area. Alternatively, the topological adjacency relationship of photovoltaic modules can be constructed to detect whether there are isolated modules or abnormal connection breaks.

[0131] After identifying missing areas in the photovoltaic array, the positions of the missing photovoltaic modules can be filled in based on prior knowledge of the array's regular arrangement. For example, for missing modules inside the array, their positions can be estimated using linear interpolation or equal-interval extrapolation based on the known positions of surrounding modules. For missing modules at the array's edges, their positions can be filled in based on the array's boundary extension trend and the module sizes.

[0132] In some embodiments, the edge contour lines of the photovoltaic modules in the photovoltaic array can be extended so that each edge line forms several intersection points in the area of ​​the photovoltaic array without photovoltaic modules. These intersection points are used as the corner points of the missing photovoltaic modules. Then, combined with the outer contour information of the photovoltaic array, the standard size and arrangement spacing of the photovoltaic modules, etc., the photovoltaic modules in the missing areas of the photovoltaic array can be completed.

[0133] In this embodiment, by supplementing the photovoltaic modules in the missing areas of the photovoltaic array, the completed photovoltaic array can logically form a complete arrangement, reducing the problem of holes in the grid map caused by missing photovoltaic modules and improving the consistency of the number of rows and columns and the topological continuity of the grid map.

[0134] In some embodiments, the method further includes: Identify whether the photovoltaic module corresponding to each grid cell in the grid map is a complete photovoltaic module; Once the photovoltaic module corresponding to the target grid cell is identified as a complete photovoltaic module, identification information representing the absence of photovoltaic modules is established for the target grid cell.

[0135] In some embodiments, the photovoltaic module corresponding to each grid cell can be identified as a complete photovoltaic module based on the correlation between the feature point coordinates of the photovoltaic module and the position of the vertex of the photovoltaic module.

[0136] Taking a photovoltaic module as a rectangle and feature point coordinates as centroid coordinates as an example, a real photovoltaic module has four vertices and its centroid coordinates are located within the rectangular area enclosed by the vertices. However, the completed photovoltaic module is calculated based on the arrangement rules and has theoretical centroid coordinates, but no real rectangular vertices. Therefore, we can traverse the centroid coordinates of the photovoltaic module corresponding to each grid unit and determine whether the centroid coordinates are surrounded by vertices. If they are surrounded by vertices, it is determined to be a real photovoltaic module. If they are not surrounded by vertices, it is determined to be a completed photovoltaic module.

[0137] In some embodiments, to distinguish between actual photovoltaic modules in the grid map and virtual photovoltaic modules generated through completion operations, the source of each grid cell can also be identified after the grid map is constructed.

[0138] Photovoltaic modules identified in the target image and virtual photovoltaic modules generated through completion operations can be marked. Based on the mapping relationship between photovoltaic modules and grid cells established during the rasterization process, the marking of the photovoltaic module corresponding to each grid cell is traced to identify whether the photovoltaic module corresponding to the grid cell is a completed photovoltaic module. When it is detected that the photovoltaic module corresponding to the target grid cell is a virtual photovoltaic module generated through completion, an identification information representing that there is no actual photovoltaic module is established for that grid cell. The identification information can be in the form of binary labels (e.g., 0 indicates no actual module, 1 indicates actual module), status codes (e.g., NULL, VIRTUAL, etc.), or attribute fields, and embedded in the cell attribute data of the raster map.

[0139] In this embodiment, by establishing identification information representing non-existent photovoltaic modules for the target grid cells corresponding to the completed photovoltaic modules, the cleaning robot can identify grid cells that do not require cleaning operations based on the identification information when performing path planning and navigation control according to the grid map, thereby further improving the operational reliability of the photovoltaic cleaning robot.

[0140] In some embodiments, the method further includes: When there are multiple photovoltaic arrays obtained from the division, construct the connection relationship between each photovoltaic array; A global grid map is obtained by stitching together the grid maps of each photovoltaic array based on their connectivity.

[0141] In this embodiment, if there are multiple photovoltaic arrays, after creating the grid map for each photovoltaic array, the topological connection relationship between the photovoltaic arrays can be further constructed, and the grid maps can be spliced ​​and merged based on the connection relationship to generate a global grid map.

[0142] In some embodiments, establishing the connection relationships between the photovoltaic arrays includes: Based on the location information of photovoltaic modules in each photovoltaic array, identify the common edges between photovoltaic arrays, identify photovoltaic modules with adjacent relationships in each photovoltaic array based on the common edges, and construct the connection relationship between photovoltaic arrays based on the photovoltaic modules with adjacent relationships. And / or, obtain the connected photovoltaic modules in each photovoltaic array of the target object input, and construct the connection relationship between each photovoltaic array based on the connected photovoltaic modules in each photovoltaic array.

[0143] In this embodiment, such as Figure 10 As shown, it is possible to identify whether there is a common edge between two photovoltaic arrays based on the position information of each component in the photovoltaic array, and then traverse the photovoltaic components on the common edge to determine whether there is an adjacent relationship between the edges of the photovoltaic components of the two photovoltaic arrays.

[0144] Since the installation orientation of photovoltaic modules in each photovoltaic array may be inconsistent, adjacent photovoltaic modules in two photovoltaic arrays may have three possible scenarios: adjacent along their long sides, adjacent along their long and short sides, and adjacent along their short sides. For the cases of adjacent along their long and short sides, it is sufficient to determine if the two photovoltaic modules share a common edge to establish their adjacency. For the case of adjacent along their long and short sides, it can be determined by checking if there is an inclusion relationship between the adjacent edges of the two photovoltaic modules. For example, suppose the edges of two photovoltaic modules in two photovoltaic arrays are... and ,if or This indicates that the two photovoltaic modules are adjacent to each other.

[0145] When there are no common edges between photovoltaic arrays, the connected photovoltaic modules in each photovoltaic array can be obtained from the input of the target object, and the connection relationship between each photovoltaic array can be constructed based on the connected photovoltaic modules in each photovoltaic array.

[0146] The target object can be maintenance personnel, external systems, etc. The target object can input information about the connected photovoltaic modules in each photovoltaic array. Based on the input from the target object, the connection relationships between the photovoltaic arrays can be constructed, such as... Figure 11 As shown, the connection relationship is represented by connecting edges.

[0147] In this embodiment, by identifying common edges and determining adjacent relationships based on the location information of photovoltaic modules in each photovoltaic array, a connection relationship can be automatically established between photovoltaic arrays based on the spatial distribution of photovoltaic modules. It also supports manual assistance in setting connection relationships, and can provide manual assistance in automatic identification of failures or complex scenarios, and can adapt to actual application scenarios with different levels of complexity.

[0148] After establishing the connection relationships between the photovoltaic arrays, the grid maps of the photovoltaic arrays can be stitched together based on these relationships to generate a global grid map. For example... Figure 12 As shown, the global grid map includes multiple grid maps, each corresponding to a photovoltaic array. The grid cells are represented using a 3-dimensional depth: the first dimension records the row number of the grid cell, indicating the arrangement position of the photovoltaic modules in the first direction; the second dimension records the column number of the grid cell, indicating the arrangement position of the photovoltaic modules in the second direction of the array; the third dimension records the presence / absence status of photovoltaic modules, used to distinguish between actually detected photovoltaic modules and completed virtual photovoltaic modules, such as... Figure 12 The grid cells containing (0,7) and (0,8) in the lower right corner are shown. For grid maps with adjacent relationships, the specific information of adjacent photovoltaic module pairs is identified in the data structure of the global grid map, that is, recording which two grid maps are adjacent and the corresponding grid cell relationships of the adjacent boundaries.

[0149] The generated global grid map can directly provide basic data support for functions such as cleaning robot path planning, area task division, obstacle detour and operation and maintenance scheduling, and provide key technical support for the intelligent management and maintenance of photovoltaic power plants.

[0150] In this embodiment, by establishing spatial topological associations between different arrays, the grid maps of each photovoltaic array are stitched together to obtain a global grid map. This can integrate scattered local grid data into a global grid map, which facilitates continuous path planning and navigation of the photovoltaic cleaning robot between multiple photovoltaic arrays, thereby improving the continuity of cleaning operations and global coverage.

[0151] The raster map creation method provided in this application can be executed by a raster map creation device. This application uses the example of a raster map creation device executing the raster map creation method to illustrate the raster map creation device provided in this application.

[0152] This application also provides a grid map creation apparatus.

[0153] like Figure 13 As shown, the raster map creation device includes: The acquisition module 1310 is used to acquire a target image containing photovoltaic modules, identify the photovoltaic modules in the target image, and obtain the position information of each photovoltaic module in the target image; The partitioning module 1320 is used to partition each photovoltaic module according to the location information of each photovoltaic module to obtain at least one photovoltaic array; The module 1330 is used to determine the first and second directions of the photovoltaic array; The generation module 1340 is used to rasterize the photovoltaic array based on the position information of each photovoltaic module in the photovoltaic array, the first direction and the second direction, and generate a raster map of the photovoltaic array.

[0154] The grid map creation device provided in this application can obtain the spatial location information of each photovoltaic module in the actual scene by acquiring a target image containing photovoltaic modules and identifying the photovoltaic modules. It can divide each photovoltaic module into a photovoltaic array, integrate scattered or complexly arranged photovoltaic modules into logically clear array units, and generate a grid map based on the first and second directions of the photovoltaic array. It can convert the physical arrangement of the photovoltaic array into gridded data that can be recognized by the robot, so that the photovoltaic cleaning robot can perform positioning and path navigation according to the correspondence between each grid and the position of the photovoltaic module in the grid map. It no longer relies on a fixed row replacement distance, can adapt to photovoltaic array arrangement forms of different complexity, and improve the cleaning effect of photovoltaic modules.

[0155] In some embodiments, the acquisition module 1310 is further configured to: The target image is input into the target detection model to obtain the location information of each photovoltaic module in the target image; The target detection model was trained based on a set of sample images labeled with the location information of photovoltaic modules.

[0156] In some embodiments, the partitioning module 1320 is further configured to: An undirected graph is constructed by treating each photovoltaic module as a node; in the undirected graph, the weight of the edge connecting each node includes the distance between photovoltaic modules and the angle difference between photovoltaic modules. Clustering is performed on each node based on the edge weights of each node in the undirected graph. Nodes whose edge weights show that the distance between photovoltaic modules is less than or equal to a distance threshold and the angle difference between photovoltaic modules is less than or equal to an angle difference threshold are identified as being in the same connected component, thus obtaining at least one connected component. Photovoltaic modules corresponding to nodes within the same connected component are considered as a photovoltaic array.

[0157] In some embodiments, the determining module 1330 is further configured to: The coordinates of the feature points of each photovoltaic module in the photovoltaic array are calculated based on the position information of each photovoltaic module in the photovoltaic array, and the set of feature point coordinates is obtained. The first and second directions of the photovoltaic array are determined based on the set of feature point coordinates.

[0158] In some embodiments, the determining module 1330 is further configured to: Sort the feature point coordinates in the feature point coordinate set to determine the target feature point coordinates; The first and second directions are determined based on the long and short sides of the target photovoltaic module corresponding to the coordinates of the target feature points.

[0159] In some embodiments, the determining module 1330 is further configured to: A first direction vector representing the direction of the long side is determined through the midpoint of the short side of the target photovoltaic module, and a second direction vector representing the direction of the short side is determined through the midpoint of the long side of the target photovoltaic module. Calculate the angles between the first direction vector and the second direction vector and the first coordinate axis, respectively; The direction vector with the smallest included angle is determined as the first direction, and the direction vector with the largest included angle is determined as the second direction.

[0160] In some embodiments, the generation module 1340 is further configured to: Determine the first ray originating from the coordinates of the target feature point and following the first direction; Add the coordinates of feature points in the feature point coordinate set whose distance from the first ray is less than or equal to the target distance to the feature point coordinate set; The feature point coordinates in the first reference set are sorted according to the first coordinate axis, and the sorted feature point coordinates are traversed: for the current feature point coordinates, the second ray along the second direction with the current feature point coordinates as the starting point is determined, and the feature point coordinates in the feature point coordinate set whose distance from the second ray is less than or equal to the target distance are added to the second reference set corresponding to the current feature point coordinates. The second reference sets corresponding to different feature point coordinates are sorted according to the second coordinate axis. Based on the sorting results of the second reference sets corresponding to different feature point coordinates and the sorting results of the first reference set, the grid cells of the photovoltaic modules corresponding to each feature point coordinate in the grid map are determined.

[0161] In some embodiments, the partitioning module 1320 is further configured to: In cases where there are missing photovoltaic modules in the photovoltaic array, the missing modules are replaced.

[0162] In some embodiments, the generation module 1340 is further configured to: Identify whether the photovoltaic module corresponding to each grid cell in the grid map is a complete photovoltaic module; Once the photovoltaic module corresponding to the target grid cell is identified as a complete photovoltaic module, identification information representing the absence of photovoltaic modules is established for the target grid cell.

[0163] In some embodiments, the generation module 1340 is further configured to: When there are multiple photovoltaic arrays obtained from the division, construct the connection relationship between each photovoltaic array; A global grid map is obtained by stitching together the grid maps of each photovoltaic array based on their connectivity.

[0164] In some embodiments, the generation module 1340 is further configured to: Based on the location information of photovoltaic modules in each photovoltaic array, identify the common edges between photovoltaic arrays, identify photovoltaic modules with adjacent relationships in each photovoltaic array based on the common edges, and construct the connection relationship between photovoltaic arrays based on the photovoltaic modules with adjacent relationships. And / or, obtain the connected photovoltaic modules in each photovoltaic array of the target object input, and construct the connection relationship between each photovoltaic array based on the connected photovoltaic modules in each photovoltaic array.

[0165] The grid map creation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.

[0166] The raster map creation device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0167] In some embodiments, such as Figure 14 As shown, this application embodiment also provides an electronic device 1400, including a processor 1401, a memory 1402, and a computer program stored in the memory 1402 and executable on the processor 1401. When the program is executed by the processor 1401, it implements the various processes of the above-described raster map creation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0168] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.

[0169] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described raster map creation method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0170] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0171] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described raster map creation method.

[0172] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0173] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described raster map creation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0174] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0175] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0177] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0178] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0179] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for creating a raster map, characterized in that, include: A target image containing photovoltaic modules is acquired, and the photovoltaic modules in the target image are identified to obtain the position information of each photovoltaic module in the target image; The photovoltaic modules are divided according to their location information to obtain at least one photovoltaic array; Determine the first and second orientations of the photovoltaic array; The photovoltaic array is rasterized based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction to generate a raster map of the photovoltaic array.

2. The method according to claim 1, characterized in that, The step of identifying photovoltaic modules in the target image to obtain the location information of each photovoltaic module in the target image includes: The target image is input into the target detection model to obtain the position information of each photovoltaic module in the target image; The target detection model is trained based on a sample image set labeled with the location information of photovoltaic modules.

3. The method according to claim 1, characterized in that, Based on the location information of each photovoltaic module, the photovoltaic modules are divided to obtain at least one photovoltaic array, including: An undirected graph is constructed using each photovoltaic module as a node; wherein, in the undirected graph, the weights of the edges connecting each node include the distance between photovoltaic modules and the angle difference between photovoltaic modules; Clustering is performed on each node based on the edge weights of each node in the undirected graph. Nodes whose edge weights correspond to a distance between photovoltaic modules that is less than or equal to a distance threshold and whose angle difference between photovoltaic modules is less than or equal to an angle difference threshold are identified as being located in the same connected component, thus obtaining at least one connected component. Photovoltaic modules corresponding to nodes within the same connected component are considered as a photovoltaic array.

4. The method according to claim 3, characterized in that, The photovoltaic modules are rectangular; the distance between the photovoltaic modules is the minimum distance between the sides of the photovoltaic modules; the angle difference between the photovoltaic modules is calculated based on the direction of the long side or the direction of the short side of the rectangle.

5. The method according to claim 1, characterized in that, Determining the first and second directions of the photovoltaic array includes: The coordinates of the feature points of each photovoltaic module in the photovoltaic array are calculated based on the position information of each photovoltaic module in the photovoltaic array to obtain a set of feature point coordinates; The first and second directions of the photovoltaic array are determined based on the set of feature point coordinates.

6. The method according to claim 5, characterized in that, The photovoltaic module is rectangular; determining the first and second directions of the photovoltaic array based on the set of feature point coordinates includes: The feature point coordinates in the set of feature point coordinates are sorted to determine the target feature point coordinates; The first direction and the second direction are determined based on the long side direction and short side direction of the target photovoltaic module corresponding to the coordinates of the target feature point.

7. The method according to claim 6, characterized in that, Determining the first direction and the second direction based on the long side direction and short side direction of the target photovoltaic module corresponding to the coordinates of the target feature point includes: A first direction vector representing the direction of the long side is determined through the midpoint of the short side of the target photovoltaic module, and a second direction vector representing the direction of the short side is determined through the midpoint of the long side of the target photovoltaic module. Calculate the angles between the first direction vector and the second direction vector and the first coordinate axis, respectively; The direction vector with the smallest included angle is determined as the first direction, and the direction vector with the largest included angle is determined as the second direction.

8. The method according to claim 6, characterized in that, The step of rasterizing the photovoltaic array based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction to generate a raster map of the photovoltaic array includes: Determine a first ray originating from the coordinates of the target feature point and extending along the first direction; Add the coordinates of feature points in the feature point coordinate set whose distance from the first ray is less than or equal to the target distance to the first reference set; The feature point coordinates in the first reference set are sorted according to the first coordinate axis, and the sorted feature point coordinates are traversed: for the current feature point coordinates, a second ray is determined along the second direction with the current feature point coordinates as the starting point, and the feature point coordinates in the feature point coordinate set whose distance from the second ray is less than or equal to the target distance are added to the second reference set corresponding to the current feature point coordinates. The second reference sets corresponding to different feature point coordinates are sorted according to the second coordinate axis. Based on the sorting results of the second reference sets corresponding to different feature point coordinates and the sorting results of the first reference set, the grid cells of the photovoltaic modules corresponding to each feature point coordinate in the grid map are determined.

9. The method according to claim 1, characterized in that, Before gridding the photovoltaic modules in the photovoltaic array, the method further includes: In the event of missing parts in the photovoltaic array, the photovoltaic modules in the missing areas are replenished.

10. The method according to claim 9, characterized in that, The method further includes: Identify whether the photovoltaic module corresponding to each grid unit in the grid map is a completed photovoltaic module; Once the photovoltaic module corresponding to the target grid cell is identified as a complete photovoltaic module, identification information representing the absence of a photovoltaic module is established for the target grid cell.

11. The method according to claim 1, characterized in that, The method further includes: When there are multiple photovoltaic arrays obtained from the division, construct the connection relationship between each photovoltaic array; A global grid map is obtained by stitching together the grid maps of each photovoltaic array according to the connection relationship.

12. The method according to claim 11, characterized in that, The construction of the connection relationship between each photovoltaic array includes: Based on the location information of photovoltaic modules in each photovoltaic array, the common edge between each photovoltaic array is identified. Based on the common edge, the photovoltaic modules in each photovoltaic array that are adjacent to each other are identified. Based on the photovoltaic modules that are adjacent to each other, the connection relationship between each photovoltaic array is constructed. And / or, obtain the connected photovoltaic modules in each photovoltaic array of the target object input, and construct the connection relationship between each photovoltaic array based on the connected photovoltaic modules in each photovoltaic array.

13. A raster map creation device, characterized in that, include: The acquisition module is used to acquire a target image containing photovoltaic modules, identify the photovoltaic modules in the target image, and obtain the position information of each photovoltaic module in the target image; A partitioning module is used to partition the photovoltaic modules according to their location information to obtain at least one photovoltaic array; The determining module is used to determine the first direction and the second direction of the photovoltaic array; The generation module is used to rasterize the photovoltaic array based on the position information of each photovoltaic module in the photovoltaic array, the first direction, and the second direction, and generate a raster map of the photovoltaic array.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-12.

15. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-12.