Method, device and storage medium for generating patrol routes
By dividing the flat map into grids and calculating the centroid, patrol routes are generated, which solves the problems of subjectivity and staticity of patrol routes in the existing technology, and achieves dynamic adjustment and better patrol effects.
Patent Information
- Application Number
- CN202211631482.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-12-19
AI Technical Summary
The existing patrol route determination method is highly subjective, has limited considerations, and cannot dynamically change, resulting in poor patrol results.
By dividing the plane map into grids, determine the grid that intersects with the patrol area, fuse the grid area according to the weight of key points, calculate the centroid and generate a patrol route, and dynamically adjust the route to respond to changes in police information and illegal ship information.
It realizes the automatic generation and dynamic change of patrol routes, improves the pertinence and effect of patrols, and overcomes the subjectivity and static nature of manually determined routes.
Smart Images

Figure CN116092211B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of security supervision, and in particular to a method, device and storage medium for generating a patrol route. Background Art
[0002] The existing patrol route determination method mainly patrols a predetermined patrol area such as a water area by manually predetermining a fixed route; the patrol route thus determined is highly subjective, has limited factors to consider, and has no dynamic changes, so that the expected patrol effect cannot be achieved. Summary of the invention
[0003] The embodiments of the present invention provide a method, device and storage medium for generating a patrol route, so as to automatically generate a patrol route.
[0004] In order to achieve the above object, on the one hand, a method for generating a patrol route is provided, comprising:
[0005] S1, dividing the selected plane map into a plurality of grids, wherein the selected plane map includes a predetermined patrol area;
[0006] S2, determine the patrol-related grids in the grid that intersect with the patrol area;
[0007] S3, for a patrol-associated grid including a key point, determining a grid weight of the patrol-associated grid according to the weight of the key point included in the patrol-associated grid, wherein the key point is a point that meets a predetermined condition or is a pre-selected point, and the weight of the key point is pre-set;
[0008] S4, respectively merging patrol-related grids whose positions are adjacent and whose grid weights are greater than zero to obtain multiple fused grid areas;
[0009] S5, determining the centroid of each fused grid area;
[0010] S6, obtain the patrol route by connecting the centroids.
[0011] Preferably, in the method, wherein the predetermined patrol area is a water area, step S1 comprises:
[0012] Mark the water area on the selected flat map;
[0013] Determine the smallest rectangle that can contain the water area;
[0014] Divide the rectangle into grids at predetermined distances.
[0015] Preferably, in the method, in step S1, the boundary of the water area is represented by a polygon formed by a plurality of selected points.
[0016] Preferably, in the method, in step S1,
[0017] Determine the smallest rectangle that can contain the water area: Determine the smallest square that can contain the water area;
[0018] Dividing the rectangle into grids according to a predetermined distance is: dividing the square into grids according to a predetermined distance.
[0019] Preferably, in the method, step S2 comprises:
[0020] Determine the center point of the grid;
[0021] Use ray casting to determine whether the center point is inside the patrol area;
[0022] The grid whose center point is inside the patrol area is determined as the patrol-related grid that intersects with the patrol area.
[0023] Preferably, in the method, in step S3, determining the grid weight of the patrol-related grid according to the weights of the key points contained in the patrol-related grid comprises:
[0024] The weights of the included key points are summed to determine the grid weight of the patrol-associated grid.
[0025] Preferably, in the method, the patrol area includes a water area, and in step S3, a location point in the patrol area that satisfies one or more of the following conditions is selected as a key point:
[0026] The location where the alarm occurred;
[0027] The location point where the illegal vessel stays for more than a predetermined time threshold;
[0028] The location where the illegal ship incident occurred.
[0029] Preferably, in the method, the location point where the illegal vessel stays for a time exceeding a predetermined time threshold is obtained by the following steps:
[0030] Query the AIS track of the ship;
[0031] Aggregate each AIS track according to the location point to obtain the ship's stay time at the location point;
[0032] It is determined whether the stay time exceeds a predetermined time threshold.
[0033] Preferably, the method, after obtaining the plurality of fused grid areas and before determining the centroid of the fused area, further comprises:
[0034] The weights of the multiple logically associated grids contained in the fused grid area are summed to obtain the weight of each fused grid area, and the fused grid areas are sorted according to the size of the weights of the fused grid areas;
[0035] Determine the maximum value of the number of grids contained in the patrol area in the horizontal and vertical directions of the grid, and judge whether the number of fused grid areas is greater than the maximum value; if so, select all fused grid areas to determine the centroid of step S5; if not, select multiple fused grid areas with large fused grid area weights and a number equal to the maximum value to determine the centroid of step S5.
[0036] Preferably, in the method, step S5 comprises:
[0037] For a fused grid area, a patrol-associated grid is selected from the patrol-associated grids contained in the fused grid area, and a key point is selected from the patrol-associated grid as the initial centroid. The KMeans algorithm is used for all the key points contained in the fused grid area to determine the final centroid of the fused grid area.
[0038] Preferably, the method, wherein
[0039] Step S5 includes:
[0040] Determine the patrol associated grid to which the centroid belongs;
[0041] Step S6 includes:
[0042] Starting from any selected centroid, the centroid of the patrol-associated grid closest to the centroid is selected as the next centroid until all centroids are used, in this way determining the order of the centroids;
[0043] Connect the centroids in order of arrangement, and the connecting line is the patrol route.
[0044] On the other hand, a device for generating a patrol route is provided, comprising a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the processor to implement any of the methods described above.
[0045] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one program, and the at least one program is executed by a processor to implement any of the methods described above.
[0046] The above technical solution has the following technical effects:
[0047] By using the technical solution for generating patrol routes in the embodiment of the present invention, the patrol routes can be automatically generated, thereby overcoming the subjectivity of manual determination in the prior art.
[0048] In a further embodiment, the patrol route can be dynamically changed according to the change of the situation. Specifically, when factors related to the patrol, such as the police situation, the case, and the AIS information of the illegal ship, change, since these factors are taken into account in the generation process of the patrol route, the patrol route can be dynamically generated according to these changes.
[0049] In a further embodiment of the present invention, patrol routes for water areas such as rivers and lakes can be automatically generated based on police situations, cases, and AIS information of illegal ships, so that patrols are more targeted and better patrol effects can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a method flow for generating a patrol route according to an embodiment of the present invention;
[0051] Figure 2 A schematic diagram of dividing a map into grids in a method for generating a patrol route according to an embodiment of the present invention;
[0052] Figure 3 It is a schematic structural diagram of a device for generating a patrol route according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] To further illustrate the various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, a person of ordinary skill in the art should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0054] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0055] Embodiment 1:
[0056] Figure 1 FIG. 1 is a flow chart of a method for generating a patrol route according to an embodiment of the present invention. Figure 1 The method for generating a patrol route in this embodiment includes the following steps:
[0057] S1, dividing the selected plane map into a plurality of grids, wherein the selected plane map includes a predetermined patrol area;
[0058] S2, determine the patrol-related grids in the grid that intersect with the patrol area;
[0059] S3, for a patrol-associated grid including a key point, determining a grid weight of the patrol-associated grid according to the weight of the key point included in the patrol-associated grid, wherein the key point is a point that meets a predetermined condition or is a pre-selected point, and the weight of the key point is pre-set;
[0060] S4, respectively merging patrol-related grids whose positions are adjacent and whose grid weights are greater than zero to obtain multiple fused grid areas;
[0061] S5, determining the centroid of the fused grid area;
[0062] S6,generates patrol routes by connecting the centroids.
[0063] In one embodiment, the predetermined patrol area is a water area. When it is a water area, step S1 includes:
[0064] Marking the water area on the selected plane map; wherein the boundary of the water area can be represented by a polygon formed by a plurality of selected points;
[0065] Determine the smallest rectangle that can contain the water area; preferably, determine the smallest square that can contain the water area;
[0066] The rectangle is divided into grids according to a predetermined distance; preferably, the rectangle is equally divided into grids according to the predetermined distance.
[0067] Preferably, step S2 includes: determining the center point of the grid; using a ray casting method to determine whether the center point is inside the patrol area; and determining the grid with the center point inside the patrol area as a patrol-associated grid that intersects with the patrol area.
[0068] Preferably, when the patrol area includes a water area, in step S3, a location point in the patrol area that meets one or more of the following conditions may be selected as a key point:
[0069] The location where the alarm occurred;
[0070] The location point where the illegal vessel stays for more than a predetermined time threshold;
[0071] The location where the illegal ship incident occurred.
[0072] In other embodiments of the present invention, the key points to be considered can be determined or selected according to the patrol target, other events that have occurred in the patrol area, and other factors that need to be considered. For example, the key points are key locations or positions that have an impact on the determination of the patrol route; according to the impact of the key points on the patrol route determination, the weights of the key points can be pre-set, and the weights are set larger if the impact is large, and smaller if the impact is small.
[0073] Implementation 2:
[0074] In this embodiment, the patrol area is a river or lake area. The steps of generating a patrol route of a river or lake area are described below.
[0075] 1. Get the polygon that marks the scope of the river or lake area. The polygon is represented by an array of passing points RP: RP[p1{lon,lat},p2{lon,lat},p3{lon,lat},...pn{lon,lat}], where p1, p2...pn are the selected points on the polygon, and {lon,lat} are the longitude and latitude values of the corresponding points.
[0076] like Figure 2 , the polygons corresponding to the rivers or lakes are segmented on the two-dimensional plane map. For example, the segmentation is performed according to the latitude and longitude area of the smallest square covering the polygon, and the square can be determined according to the maximum and minimum values of the latitude and longitude of the polygon. Specifically, for example, the upper left corner point rl{lon,lat} and the rightmost corner point rr{lon,lat} of the corresponding square are calculated according to a selected distance, that is, a grid range such as 50 meters. The above selected distance can be determined as needed, such as a visible range.
[0077] 2. Divide the grid into equal parts according to the distance d, that is, the width of one grid represents the distance d. Preferably, d>=50 meters. Figure 2 The network is represented by Gmn, indicating that the grid is formed by the intersection of the horizontal m-th grid width and the vertical n-th grid width.
[0078] G11[id1,rl{lon,lat},rr{lon,lat},d]
[0079] G12[id2,rl{lon,lat},rr{lon,lat},d]
[0080] G13[id3,rl{lon,lat},rr{lon,lat},d] ...
[0082] Gmn[idn,rl{lon,lat},rr{lon,lat},d];
[0083] Among them, idn represents the grid identifier of the corresponding grid, rl{lon,lat} is the longitude and latitude of the upper left corner of the grid; rr{lon,lat} is the longitude and latitude of the lower right corner of the grid; d represents the grid width, that is, the distance represented by one grid width. Among them, longitude and latitude can be converted into meters by the formula 0.00001 degree = 1 meter distance.
[0084] 3. Determine the patrol-related grid that intersects with the water area. In this example, the patrol-related grid is also called the river grid and is denoted by RG. Specifically, determine the possible river grids related to the patrol area by judging whether the equally divided grid is inside or intersects with the polygon range corresponding to the river or lake area. First, calculate the center point GCmn{lon, lat} of the Gmn grid, and then:
[0085] 3.1 Use the ray casting method to judge whether GCmn is inside the polygon RP, including: starting from GCmn, calculate the number of intersection nodes with RP in the way of keeping the longitude lon unchanged and the latitude lat increasing from small to large; if the number of nodes is odd, it is determined that the grid Gmn intersects with the water area, keep this grid, and end this step, otherwise, go to the next step;
[0086] 3.2 Calculate the shortest distance DISTn from GCmn to the polygon RP. When DISTn < d / 2, keep the grid Gmn, that is, determine that this grid intersects with the water area and is a patrol-related grid, otherwise, discard this grid;
[0087] 3.3 Use the above steps to judge each grid, and finally obtain the grids related to the water area such as river and lake areas, that is, the patrol-related grids, which are called river grids here, such as RG11 to RGmn marked by the following array;
[0088] RG11[id1, rl{lon, lat}, rr{lon, lat}, d],
[0089] RG13[id3, rl{lon, lat}, rr{lon, lat}, d], ...
[0091] RGmn[idn, rl{lon, lat}, rr{lon, lat}, d];
[0092] The data indicating the river grids includes grid identification, the upper left position of the grid, the lower right position of the grid, and the grid width d.
[0093] 4. Obtain key points related to patrol, i.e. key location points or address points; factors to be considered in selecting key points can be determined based on specific needs such as the purpose and focus of patrol; in this example, for example but not limitation, key points are selected based on police situations, cases, and AIS information of illegal ships, and relevant information of the key points is obtained, such as the location, type of key points, and weight of key points; the weight of key points can be pre-set based on the importance of the key points to the patrol, the greater the weight, the greater the impact; for example, in this example, the weight of the case is greater than the police situation, and the weight of the police situation is greater than the ship whose stay time exceeds the predetermined time threshold.
[0094] 4.1 Obtain police information from the police data of the last month;
[0095] KP1[p{lon,lat},t=alarm situation,w=5]
[0096] KP2[p{lon,lat},t=alarm situation,w=5]
[0097] KP3[p{lon,lat},t=alarm situation,w=5] ...
[0099] KPn[p{lon,lat},t=alarm situation,w=5];
[0100] KPn represents the nth key point, where n represents any natural number; the data of the key point includes: the position p{lon, lat} of the key point, the type t of the key point and the weight w; t = police situation, indicating that the key point is a key point related to the police situation;
[0101] 4.2 Extract the maritime mobile service identification mmsi of the illegal ship from the ship violation case database, and obtain the following information: MMSIS[sp1{mmsi},sp2{mmsi},sp3{mmsi}...spn{mmsi}]; where spn{mmsi} represents the mmsi of the ship spn;
[0102] 4.3 Use mmsi to query the information of the ship AIS track library in MMSIS, aggregate each ship track according to the location point, and obtain the start time, departure time, end time and stay time of each ship arriving at the corresponding location point, specifically:
[0103] SPP1[mmsi,p{lon,lat},st(start time),et(end time),time(stay time)],SPP2[mmsi,p{lon,lat},st(start time),et(end time),time(stay time)],SPP3[mmsi,p{lon,lat},st(start time),et(end time),time(stay time)],...
[0104] SPPn[mmsi,p{lon,lat},st(start time),et(end time),time(stay time)];
[0105] 4.4 When the stay time exceeds the predetermined time threshold, for example, when time>10 minutes, the above position point is classified as a key point KPm and the above data of the key point is retained. Otherwise, the data of the point is discarded, thereby obtaining the following data related to the illegal ship:
[0106] KP1[p{lon,lat},t=ship,w=1],
[0107] KP2[p{lon,lat},t=ship,w=1],
[0108] KP3[p{lon,lat},t=ship,w=1], ...
[0110] KPm[p{lon,lat},t=ship,w=1];
[0111] Similarly, the data of the key point includes the position p{lon, lat} of the point, the type t of the key point and the weight w of the corresponding key point. In this example, the weight of the key point of the illegal ship type is preset to w=1.
[0112] 4.5 Extract the location information of illegal ship cases from the illegal ship case database, and obtain the key points related to the case, which are expressed as follows:
[0113] KP1[p{lon,lat},t=case,w=10]
[0114] KP2[p{lon,lat},t=case,w=10]
[0115] KP3[p{lon,lat},t=case,w=10] ...
[0117] KPt[p{lon,lat},t=case,w=10]
[0118] Similarly, the data of the key point includes the position p{lon, lat} of the point, the type t of the key point and the weight w of the corresponding key point. In this example, the weight of the key point of the illegal ship type is preset to w=10.
[0119] 5. Determine the key points associated with the patrol association grid, i.e., the river grid RG in this example, including:
[0120] 5.1 Traverse the key points and determine whether the position p{lon,lat} of the key point KPn1 is in [rl{lon,lat},rr{lon,lat}] of the river grid RGn2; if so, the data of RGn2 is [idn,rl{lon,lat},rr{lon,lat},d,KP[KPn1]]; here, n1 and n2 represent arbitrary natural numbers; if the key point does not belong to any river grid RG, then discard the key point, and obtain the following river grid data. The following data shows the number of key points contained in a river grid:
[0121] RG11[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr]]
[0122] RG12[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr]]
[0123] RG13[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr]] ...
[0125] RGmn[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1, KP2,...KPr]];
[0126] In the above data, the number of key points contained in each river area is represented by r. The r in KPr in each river area can take different values. Here r only represents any natural number.
[0127] 5.2 Calculate the river grid area weight. The river grid area weight can be obtained by summing the weights w of each key point KP in a river grid area, thereby obtaining the following data representing each river grid, in which the weight of the river grid is added:
[0128] RG11[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr],KW=sum(w)]RG12[idn,rl{lon,lat},rr{lon,lat}, d,KP[KP1,KP2,...KPr],KW=sum(w)]RG13[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr],KW=sum(w)]...
[0129] RGmn[idn,rl{lon,lat},rr{lon,lat},d,KP[KP1,KP2,...KPr],KW=sum(w)].
[0130] 5.3 Fuse the patrol-related grids that are adjacent in position and whose grid weights are greater than zero respectively to obtain multiple fused grid areas; specifically, obtain the unanalyzed RG grid from the list of river grids RG obtained above, and use RGxy to represent the unanalyzed RG grid; determine whether the weight KW of RGxy is greater than 0, if so, create the data of the fused grid area: FuseGxy[idx,RG[RGxy]]; at the same time, remove RGxy from the list of river grids to avoid repeated fusion of the grid, and then go to step 5.4; idx represents the identifier of the fused grid area;
[0131] 5.4 Determine whether the weights of the river grids RG(x-1)y (grid on the left of the river grid), RG(x+1)y (grid on the right of the river grid), RGx(y-1) (grid below the river grid), and RGx(y+1) (grid above the river grid) adjacent to the river grid RGxy in the fused grid area FuseGxy[idxy,RG[RGxy]] in the vertical, horizontal, and vertical directions are greater than 0. If so, add the adjacent river grid to the fused grid area; after adding, remove the river grid from the list of river grids to be processed; continue to fuse the adjacent river grids in the same way until the grid weights KW of the river grids at the edge of the fused grid area are all less than 0, so that a fused grid area is obtained; next, continue to determine whether there are still unanalyzed river grids RG; if so, return to step 5.3 and continue to determine the next fused grid area; otherwise, proceed to the next step 5.5.
[0132] 5.5 The weight of the fused grid area is calculated by adding the weights of the river grids contained in the fused grid area, and the weight is added to the data of the fused grid area, as shown below; further, the fused grid area can be sorted according to the size of the weight RW, for example, the one with the larger weight is placed in the front, and the content of the fused grid area data is obtained as follows:
[0133] FuseG11[id11,RG[RG11,RG12,...RGxy],RW=sum(KW)]
[0134] FuseG22[id22,RG[RG22,RG23,...RGxy],RW=sum(KW)]
[0135] FuseG43[id43,RG[RG43,RG44,...RGxy],RW=sum(KW)] ...
[0137] FuseGxy[idxy,RG[...RGxy],RW=sum(KW)].
[0138] 5.6 Obtain the maximum value num of the subscript of the grid list obtained when the grid is initially divided, where num = max(m t ,n t ), where m t Indicates the number of grids contained in the patrol area horizontally in the map, n t Indicates the number of grids contained in the patrol area vertically in the map; if num is greater than the number of fused grid areas FuseG obtained above, all fused grid areas FuseG are added to KMeans for particle analysis; otherwise, the first num fused grid areas with higher weight rankings are added to KMeans for particle analysis.
[0139] 6. Calculate the mass points of each fused grid area FuseG;
[0140] Here, we take the example that num is less than or equal to the number of fused grid areas FuseG obtained above:
[0141] 6.1 Get any river grid associated with the first num fused grids FuseG, such as the first associated grid RGxy, and then take the first key point KPx{lon,lat} associated with RGxy as the initial centroid to obtain the initial centroid data: the first key point associated with RGxy can be any key point in RGxy;
[0142] CKP1{lon,lat}
[0143] CKP2{lon,lat} ...
[0145] CKPnum{lon,lat}
[0146] The above data represent the position of the first key point of each fusion area.
[0147] 6.2 Obtain all the final associated key points of each fused grid region FuseG, that is, all the key points contained in the fused grid region FuseG. For example, a FuseG includes the following key points KP1 to KPr, where r represents any natural number:
[0148] KP1[p{lon,lat},t=ship,w=1]
[0149] KP2[p{lon,lat},t=case,w=10]
[0150] KP3[p{lon,lat},t=alarm situation,w=5] ...
[0152] KPr[p{lon,lat},t,w=1];
[0153] 6.3 For each fused grid area, use KMeans to calculate the centroid and obtain the final centroid FuseP of the fused area grid;
[0154] FuseP1{lon,lat}
[0155] FuseP2{lon,lat} ...
[0157] FusePnum{lon,lat}
[0158] Wherein FusePnum represents the final centroid of the num-th fused grid area, where the final centroid is represented by its position information, exemplarily, by the longitude and latitude of its position.
[0159] 7. Calculate which river grid RG the centroid FuseP belongs to, and get the following data:
[0160] FuseRG1[FuseP1{lon,lat},RG1]
[0161] FuseRG2[FuseP2{lon,lat},RG2] ...
[0163] FuseRGnum[FusePnum{lon,lat},RGnum]
[0164] Among them, the above FuseP1, FuseP2 to FusePnum represent different centroids, which belong to different river grids RG1, RG2 to RGnum respectively; the centroid data represented by the above FuseRG1 to FuseRGnum include the location information of the centroid and the information of the river area to which it belongs. Exemplarily, the river grid RG to which the centroid FuseP belongs can be calculated based on the location of the centroid and the location of the river grid; for example, it can be determined by comparing the longitude and latitude of the centroid into which grid the longitude and latitude fall.
[0165] 8. Determine the order of connecting the centroids; for example, you can start from FuseRG1 and calculate the centroid FuseRGn of the river grid closest to its position, where n is a variable representing any natural number. After finding FuseRGn, calculate the centroid FuseRGn+1 of the other closest river grids, until all the centroids FuseRG are used, and get the order of centroids: FusePx, FusePy, FusePz, ... FusePnum. Connect these centroids in the above order, and the connecting line is the patrol route; thus, the patrol route is obtained. FusePx, FusePy, and FusePz only represent the centroids in the front.
[0166] The above method of determining the order of centroid arrangement is only exemplary. In other implementations, other sorting methods may be used to connect the centroids to obtain the patrol route.
[0167] Embodiment three:
[0168] The present invention also provides a device for generating a patrol route, such as Figure 3 As shown, the device includes a processor 301, a memory 302, a bus 303, and a computer program stored in the memory 302 and executable on the processor 301. The processor 301 includes one or more processing cores. The memory 302 is connected to the processor 301 via the bus 303. The memory 302 is used to store program instructions. When the processor executes the computer program, the steps in the above method embodiment of the first embodiment of the present invention are implemented.
[0169] Further, as an executable solution, the device for generating patrol routes may be a computer unit, which may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer unit may include, but is not limited to, a processor and a memory. Those skilled in the art may understand that the composition structure of the above-mentioned computer unit is only an example of a computer unit and does not constitute a limitation on the computer unit, and may include more or less components than the above-mentioned, or a combination of certain components, or different components. For example, the computer unit may also include input and output devices, network access devices, buses, etc., which are not limited in the embodiments of the present invention.
[0170] Further, as an executable solution, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer unit, and various interfaces and lines are used to connect the various parts of the entire computer unit.
[0171] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer unit by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0172] Embodiment 4:
[0173] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in the embodiment of the present invention are implemented.
[0174] If the module / unit integrated in the computer unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0175] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A method for generating a patrol route, characterized in that: include: S1, dividing a selected plane map into a plurality of grids, wherein the selected plane map includes a predetermined patrol area; S2, determining patrol-related grids in the grids that intersect with the patrol area; S3, for a patrol-related grid containing a key point, determining a grid weight of the patrol-related grid according to the weight of the key point contained in the patrol-related grid, wherein the key point is a point determined according to the purpose or focus of the patrol and meets a predetermined condition, and the weight of the key point is preset; S4, respectively merging patrol-related grids whose positions are adjacent and whose grid weights are greater than zero to obtain multiple fused grid areas; S5, determining the centroid of each fused grid area; S6,generates patrol routes by connecting the centroids.
2. The method according to claim 1, characterized in that The predetermined patrol area is a water area, and step S1 comprises: Mark the water area on the selected plan map; Determine the smallest rectangle that can contain the water area; The rectangle is divided into grids according to a predetermined distance.
3. The method according to claim 2, characterized in that In the step S1, Determine the smallest rectangle that can contain the water area: Determine the smallest square that can contain the water area; Dividing the rectangle into grids according to a predetermined distance comprises: dividing the square into grids according to a predetermined distance.
4. The method according to claim 1, characterized in that: In the step S1, the boundary of the patrol area is represented by a polygon formed by a plurality of selected points; The step S2 comprises: Determine the center point of the grid; Using a ray casting method to determine whether the center point is inside the patrol area; Determine the grid with the center point inside the patrol area as a patrol-related grid intersecting with the patrol area; In step S3, determining the grid weight of the patrol-related grid according to the weights of the key points contained in the patrol-related grid includes: The weights of the included key points are summed to determine the grid weight of the patrol-associated grid.
5. The method according to claim 1, characterized in that The patrol area includes a water area. In step S3, a location point in the patrol area that meets one or more of the following conditions is selected as a key point: The location where the alarm occurred; The location point where the illegal vessel stays for more than a predetermined time threshold; The location point where the illegal ship incident occurred; wherein the location point where the illegal ship stays for a time exceeding the predetermined time threshold is obtained by the following steps: Query the AIS track of the ship; Aggregate each AIS track according to the location point to obtain the ship's stay time at the location point; It is determined whether the stay time exceeds the predetermined time threshold.
6. The method according to claim 1, characterized in that After obtaining a plurality of fused mesh regions and before determining the centroid of the fused regions, the following steps are also included: The weights of the multiple logically associated grids contained in the fused grid area are summed to obtain the weight of each fused grid area, and the fused grid areas are sorted according to the size of the weights of the fused grid areas; Determine the maximum value of the number of grids contained in the patrol area in the horizontal and vertical directions of the grid, and judge whether the number of fused grid areas is greater than the maximum value; if so, select all the fused grid areas to determine the centroid of step S5; if not, select multiple fused grid areas with large fused grid area weights and a number equal to the maximum value to determine the centroid of step S5.
7. The method according to claim 1, characterized in that The step S5 comprises: For a fused grid area, a patrol-associated grid is selected from the patrol-associated grids contained in the fused grid area, and a key point is selected from the patrol-associated grid as the initial centroid. The KMeans algorithm is used for all the key points contained in the fused grid area to determine the final centroid of the fused grid area.
8. The method according to claim 1, characterized in that The step S5 comprises: Determine the patrol associated grid to which the centroid belongs; The step S6 comprises: Starting from any selected centroid, the centroid of the patrol-associated grid closest to the centroid is selected as the next centroid until all centroids are used, in this way determining the order of the centroids; According to the arrangement order, the centroids are connected, and the connecting line is the patrol route.
9. A device for generating a patrol route, characterized in that: The method comprises a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the processor to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is executed by a processor to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Grid partitioning method and device, electronic equipment and storage medium
CN114511249A
Command scheduling method and system, vehicle-mounted equipment and computer readable storage medium
CN115146878A
Patrol route determination method and device, computer equipment and storage medium
CN115292432A
Dynamic security patrol guidance system
US10325461B1
Method, Related System, and Readable Storage Medium Related to Robot Service
US20210208593A1
