A distributed parallel method and system for simplification of polylines with massive vertices
By cutting polylines into sub-polylines and simplifying them according to the angle distribution rules, the problem of simplification of massive vertex data is solved, efficient calculation and storage compression are achieved, and it is suitable for a variety of data scenarios.
Patent Information
- Application Number
- CN202410059746.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-01-16
AI Technical Summary
The existing polyline simplification algorithm cannot effectively process the trajectory data of massive vertices, resulting in a large amount of calculation and increased storage pressure, and cannot meet actual needs.
By cutting the polyline into sub-polylines according to the changing rules of the angles between the vertices, and simplifying according to the distribution of angles between the vertices on the sub-polylines and the dotted line segments connecting the first and last vertices, the simplification results are finally merged to reduce the amount of calculations. and improve compression ratio.
It significantly reduces the amount of calculation when processing high-dimensional data, improves the simplification rate and compression rate, is suitable for polylines with a large number of vertices and high dimensions, and reduces storage and computing pressure.
Smart Images

Figure CN118093747B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of signal processing technology, and in particular to a distributed parallel method and system for simplifying polylines with massive vertices. Background Art
[0002] With the rapid development of technologies such as mobile smart sensors and the Internet of Things, high-precision, fine-grained, and large-scale spatial trajectory data has exploded, covering a wide range of fields such as transportation, geography, and urban management. Spatial trajectories can essentially be viewed as polylines composed of multiple vertices, and the spatial position information obtained by IoT sensing devices can be expressed by each vertex on the polyline. Therefore, how to find key vertices from the trajectory through a polyline simplification algorithm, delete redundant vertices that have little impact on the trajectory change trend to effectively reduce the amount of data, and further reduce storage and computing pressure has become a key technical issue.
[0003] In order to solve this technical problem, the prior art proposes a method called Douglas-Peucker algorithm, which is a polyline simplification method. The main process is as follows:
[0004] Step 1: Draw a straight line between the first and last vertices of the polyline, calculate the distance between all vertices on the polyline and the straight line, and find the maximum distance value.
[0005] Step 2: Compare the maximum distance value with a predetermined threshold value D. If the maximum distance is less than the threshold value D, discard all vertices except the first and last vertices of the polyline, and use the straight line connecting the first and last vertices of the polyline in step 1 as an approximation of the polyline. The polyline is processed. If the maximum distance is greater than or equal to the threshold value D, retain all vertices in the polyline whose distance is greater than or equal to the threshold value D, and use the vertex with the smallest distance among these coordinates as the boundary to divide the polyline into two parts to form two sub-polylines.
[0006] Step 3: Repeat steps 1 and 2 of the method for the two sub-polylines obtained in step 2 until all maximum distances are smaller than the threshold D, thus completing the simplification of the polyline.
[0007] However, the polyline simplification algorithm in the prior art is mainly aimed at simplifying polylines with a small number of vertices. As data acquisition capabilities become increasingly powerful, the vertices on trajectory polylines are massive, resulting in the inability of such algorithms to meet actual response requirements. Summary of the invention
[0008] The purpose of the present invention is to overcome the defects of the prior art and provide a distributed parallel method and system for simplifying polylines with massive vertices.
[0009] The present invention provides a distributed parallel method for simplifying a multi-segment line with a large number of vertices, and its technical solution is as follows:
[0010] A distributed parallel method for simplifying a polyline with a large number of vertices, the distributed parallel method comprising the following steps:
[0011] S1, cutting the polyline obtained by the signal acquisition device into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and performing feature identification on each sub-polyline and storing them;
[0012] S2, simplifying each of the sub-polylines according to the distribution law of the angles formed by the vertices on the sub-polylines and the virtual connecting line segments of the first and last vertices, to obtain corresponding simplified results;
[0013] S3, connecting the simplified results corresponding to each sub-polyline obtained in step S2 end to end according to their original positions to obtain the simplified result of the polyline.
[0014] The distributed parallel method provided in the present invention is based on a new concept. In step S1, the polyline is cut into a plurality of sub-polylines according to the change law of the angles of all vertices on the polyline. Then, in step S2, each sub-polyline is simplified according to the distribution law of the angles formed by the vertices on it and the virtual connecting line segments of the first and last vertices to obtain the corresponding simplified results. Finally, they are merged in step S3 to obtain the simplified result of the entire polyline.
[0015] Compared with the Douglas-Peucker algorithm in the prior art, the distributed parallel method in the present invention has at least the following outstanding beneficial effects:
[0016] First, the distributed parallel method of the present invention is based on the changing law of the angles of all vertices on the polyline when dividing the polyline into several sub-polylines, thereby reducing the amount of calculation. For a polyline, except for the first and last vertices, the remaining vertices are the intersection points of the two adjacent sides of the polyline. The angle between the two adjacent sides of the polyline is usually called the vertex angle of the polyline. As can be seen from the background technology, the existing algorithms, whether for the initial division or simplification, need to be combined with the distance distribution of the virtual connecting line segments from all vertices on the polyline to the first and last vertices. For high-dimensional data, the amount of calculation of the algorithm is significantly large. Compared with the method of the present invention, the amount of calculation is significantly reduced when processing high-dimensional data.
[0017] Secondly, when the distributed parallel method in the present invention simplifies sub-polylines, it is based on the distribution law of the angles formed by the vertices on each sub-polyline and the virtual connecting line segments of the first and last vertices. Since the method of calculating the angle is simple, both low-dimensional and high-dimensional data have a unified calculation formula, which not only conforms to the characteristics of polylines and ensures no distortion, but also accelerates the simplification rate and improves the compression rate.
[0018] Finally, the distributed parallel method in the present invention has wide applicability, and is not only applicable to the simplification of polylines with a small number of vertices, but also applicable to the simplification of polylines with a large number of vertices and polylines with a high data dimension.
[0019] Preferably, the step S1 comprises the following steps:
[0020] S11, collecting specific object data through a signal collection device to form a multi-segment line corresponding to the specific object data;
[0021] S12, setting a first threshold value according to the data characteristics of the specific object data in step S11;
[0022] S13, taking the polyline as the current polyline, and calculating the supplementary angles of the angles of each vertex on the current polyline by a computing device;
[0023] S14, starting from the first vertex of the current polyline, the supplementary angles of the vertex angles of the current polyline are accumulated in sequence along the path of the current polyline, and the accumulation result is compared with the first threshold after each accumulation, if the accumulation result is less than the first threshold, it is determined whether the accumulation reaches the last vertex angle along the path of the current polyline, if it has reached it, the current polyline is used as a sub-polyline, and the segmentation is terminated; if it has not reached it, the next accumulation is performed; if the accumulation result is not less than the first threshold, the next step is performed;
[0024] S15, using the vertex or the point on the edge of the vertex angle reached by this accumulation as a split point, dividing the current polyline into two sub-polylines;
[0025] S16, taking the two sub-polylines obtained in step S15 as current polylines respectively, and executing step S13 again, and finally obtaining a plurality of sub-polylines;
[0026] By calculating the angle of each vertex on the polyline separately and calculating the supplementary angle of each vertex angle, and comparing the accumulated result of the supplementary angle of the vertex angle with the first threshold each time, the change law of all vertex angles on the polyline is grasped, and the polyline is divided successively, and finally the polyline is divided into several sub-polylines. The whole process has clear logic and is simple and reasonable.
[0027] Preferably, step S2 comprises the following steps:
[0028] S21, using a computing device to obtain the angles formed by each vertex on each of the sub-polysegment lines and the virtual line segment connecting the first and last vertices of the sub-polysegment line, and obtain all corresponding angles;
[0029] S22, generating respective corresponding second thresholds according to the characteristics of each of the sub-polylines;
[0030] S23, sorting all the angles corresponding to each of the sub-polylines obtained in step S1 respectively, and obtaining the corresponding minimum angle information;
[0031] S24, respectively comparing the minimum angle value corresponding to each of the sub-polylines obtained in step S23 with the second threshold value corresponding to the sub-polyline; if the minimum angle value corresponding to a certain sub-polyline is less than the second threshold value corresponding to the sub-polyline, then the sub-polyline is cut into two sub-polylines, and the two sub-polylines are rotated as a new sub-polyline to execute step S21; if the minimum angle value corresponding to a certain sub-polyline is not less than the second threshold value corresponding to the sub-polyline, then the line segment connecting the first and last vertices of the sub-polyline is used as the simplified result of the sub-polyline;
[0032] By obtaining the angles formed by each vertex on each sub-polyline and the virtual line segments connecting the first and last vertices of the sub-polyline, all the angles corresponding to each sub-polyline are obtained, and then they are sorted to obtain the minimum angle information corresponding to each sub-polyline. By grasping the distribution law of the angles formed by each vertex on each sub-polyline and the virtual line segments connecting the first and last vertices, each sub-polyline is simplified to obtain the corresponding simplified results. The algorithm has low complexity and high compression rate.
[0033] Preferably, the distributed parallel method further comprises:
[0034] S4, determining whether the simplification result of the polyline obtained in step S3 meets the simplification standard, and if so, ending the simplification; if not, returning to step S1;
[0035] If the simplified results are not concise enough, they can be simplified again to ensure that the simplified results are reasonable and provide guarantee for further use of the simplified results.
[0036] The present invention provides a distributed parallel system for simplifying multi-segment lines with massive vertices, and its technical solution is as follows:
[0037] A distributed parallel system for simplifying polylines with massive vertices, based on the distributed parallel method for simplifying polylines with massive vertices described in the present invention, the distributed parallel system includes:
[0038] A signal acquisition device, used for acquiring specific object data to form a multi-segment line corresponding to the specific object data;
[0039] A main node module, used for cutting the polyline obtained by the signal acquisition device into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and outputting them respectively;
[0040] A marking storage module, used for marking the plurality of sub-polylines outputted by the main node module respectively to form respective corresponding feature identifiers, and storing respective feature information according to the respective corresponding feature identifiers for use or processing;
[0041] At least one slave node module, each of which is configured to obtain one of the sub-polylines from the tag storage module each time, and simplify the sub-polyline obtained this time according to the distribution law of the angles formed by each vertex on the sub-polyline and the virtual connecting line segments of the first and last vertices, to obtain a simplified result corresponding to the sub-polyline this time;
[0042] The merging module is used to connect the simplified results corresponding to each sub-polyline obtained from the node module end to end according to their original positions to obtain the simplified result of the polyline.
[0043] The distributed parallel system in the present invention is provided with a signal acquisition device, a master node module, a tag storage module, at least one slave node module and a merging module. After the signal acquisition device acquires the polyline, the master node module can sequentially segment it, the tag storage module can mark and store it, the slave node module can simplify it, and finally the merging module can merge it to complete the simplification. The operation of the distributed parallel system in the present invention is based on the distributed parallel method for simplifying the polyline of massive vertices described in the present invention, which can solve the problem of slow compression efficiency of massive trajectory data and lay a foundation for further storage and calculation of trajectory data.
[0044] Preferably, the master node module includes:
[0045] A marking unit, used to mark the polyline obtained by the signal acquisition device according to the feature, and obtain a feature identifier corresponding to the polyline;
[0046] A segmentation unit, used for segmenting the polyline marked by the marking unit to obtain the plurality of sub-polylines and output them respectively;
[0047] in,
[0048] The marking unit communicates with the signal acquisition device, and the segmentation unit communicates with the marking storage module;
[0049] By setting marker units to mark polylines, errors or confusion can be avoided when merging simplified sub-polylines later.
[0050] Preferably, the tag storage module includes:
[0051] A shared queue unit, used for marking the plurality of sub-polylines output by the main node module respectively to form respective corresponding feature identifiers;
[0052] A shared disk unit, used for storing feature information of each sub-polyline according to a feature identifier corresponding to the sub-polyline for use or processing;
[0053] in,
[0054] The shared queue unit communicates with the segmentation unit, and the shared disk unit communicates with each of the slave node modules;
[0055] Furthermore, the sub-polylines formed by the segmentation can be marked and stored one by one for use or processing, and the rationality and orderliness of the subsequent simplification and merging can be guaranteed.
[0056] Preferably, the distributed parallel system also includes a patrol module for patrolling the working status of each of the slave node modules and distributing tasks to specific slave node modules based on the patrol results. The patrol module communicates with each of the slave node modules to ensure that the operation of the slave node modules is controllable.
[0057] Preferably, the patrol module comprises:
[0058] An inquiry unit, used for sending a work inquiry signal to each slave node module, and after knowing that some of the slave node modules are in an idle state, forming a call instruction for these slave node modules;
[0059] At least one response unit, communicating with the slave node modules in a one-to-one correspondence, each of the response units being used to obtain the corresponding slave node module working status information and respond to the signal sent by the inquiry unit to send the corresponding slave node module working status signal to the inquiry unit;
[0060] an execution unit, configured to receive the respective calling instructions for some of the slave node modules formed by the inquiry unit, and to retrieve the feature information of the sub-polylines to be simplified from the shared disk unit in a one-to-one manner according to the respective calling instructions for the slave node modules, and to distribute the feature information of the sub-polylines to be simplified to the slave node modules one by one for processing, and to delete the feature information of the sub-polylines that have been distributed from the shared disk unit after distribution;
[0061] in,
[0062] The inquiry unit communicates with each of the response units, and the execution unit communicates with the inquiry unit and the shared disk unit;
[0063] Furthermore, on the basis of ensuring that the operation of the slave node module is controllable, the slave node module can be reasonably called to ensure that the simplification of the sub-polylines is efficient and orderly.
[0064] Preferably, the distributed parallel system further comprises a judgment module, the judgment module is used to receive the simplified result of the polyline obtained by the merging module, and judge whether the simplified result of the polyline meets the simplification standard, if it meets the standard, the simplification is terminated and output; if it does not meet the standard, the simplified result of the polyline is sent to the main node module, and the main node module processes it again;
[0065] The judging module communicates with the merging module;
[0066] This can ensure that the simplification results are reasonable and concise, and at least provide scope and accuracy guarantees for the use of polyline simplification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 A flow chart of a distributed parallel method for simplifying a multi-segment line with a large number of vertices according to a first embodiment of the present invention;
[0068] Figure 2 This is a flow chart of a distributed parallel method for simplifying polylines with massive vertices according to the second embodiment of the present invention;
[0069] Figure 3 This is a flow chart of step S1 of embodiments 1 and 2 of the present invention;
[0070] Figure 4 This is a flow chart of step S2 of embodiments 1 and 2 of the present invention;
[0071] Figure 5 A portion of the image of the polyline in the first and second embodiments of the present invention;
[0072] Figure 6 This is a schematic diagram of a distributed parallel system structure for simplifying multi-segment lines with massive vertices according to a third embodiment of the present invention;
[0073] Figure 7 This is a schematic diagram of a distributed parallel system structure for simplifying multi-segment lines with massive vertices according to a fourth embodiment of the present invention;
[0074] Figure 8 This is a schematic diagram of a distributed parallel system structure for simplifying multi-segment lines with massive vertices according to a fifth embodiment of the present invention;
[0075] Fig. 9This is another structural schematic diagram of a distributed parallel system for simplification of polylines with massive vertices according to the fifth embodiment of the present invention;
[0076] Fig.10 This is a schematic diagram of the structure of the master node module of Embodiment 3, Embodiment 4 and Embodiment 5 of the present invention;
[0077] Fig.11 It is a schematic diagram of the structure of the tag storage module of the third embodiment, the fourth embodiment and the fifth embodiment of the present invention;
[0078] Fig.12 This is a schematic diagram of the patrol module structure of the fourth embodiment of the present invention.
[0079] Among them, the numbers marked in the figure represent: 1. Signal acquisition device; 2. Main node module: 21. Marking unit; 22. Segmentation unit; 3. Marking storage module: 31. Shared queue unit; 32. Shared disk unit; 4. Slave node module: 5. Merge module: 6. Patrol module; 61. Inquiry unit; 62. Answer unit; 63. Execution unit; 7. Judgment module. DETAILED DESCRIPTION
[0080] Five embodiments will be used below, and the technical solution of the present invention will be clearly and completely described in conjunction with the drawings in each embodiment.
[0081] Embodiment 1
[0082] This embodiment provides a distributed parallel method for simplifying a polyline with a large number of vertices, and the distributed parallel method includes the following steps:
[0083] S1, cutting the polyline obtained by the signal acquisition device into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and performing feature identification on each sub-polyline and storing them;
[0084] For a polyline, except for the first and last vertices, the remaining vertices are the intersection points of the two adjacent sides of the polyline. The angle between the two adjacent sides of the polyline is usually called the vertex angle of the polyline. The figure is a schematic diagram of a part of a polyline. Assume that the polyline has n vertices, which are denoted as p1, p2, ..., p n It is not difficult to find that except for the first vertex p1 and the last vertex p n Except for this, the other vertices are the intersection points of the two adjacent sides of the polyline. Thus, vertices p2, p3, ..., p n-1 The respective angles are the vertex angles of the polyline, and the first vertex angle is the angle where vertex p2 is located.
[0085] However, as an implementation method, sometimes the first vertex p1 and the last vertex p nThe respective included angles are regarded as π, and then the angle where the first vertex p1 is located is taken as the first vertex angle.
[0086] In this embodiment, step S1 includes the following steps:
[0087] S11, collecting specific object data through a signal collection device to form a multi-segment line corresponding to the specific object data;
[0088] S12, setting a first threshold σ1 according to the data characteristics of the specific object data in step S11;
[0089] S13, taking the polyline formed in step S1 as the current polyline, and calculating the supplementary angles of the angles of each vertex on the current polyline by a computing device;
[0090] like Figure 5 As shown in the figure, it is a part of a polyline. Let's assume that the vertices of the current polyline are p, p2, ..., p7, and the vertex p i The coordinates are denoted as (x i,1 , x i,2 , ..., x i,m ) T , i = 1,, 2, ..., 7, the angle where the vertex p2 is located is regarded as the first vertex angle α1, and then for the vertex p j , the corresponding vertex angle is α j-1 , j = 2, 3, ..., 7, the calculation formula can be:
[0091]
[0092] Furthermore, the corresponding calculation formula for the supplementary angle is as follows:
[0093] β j-1 =π-α j-1 ;
[0094] In addition, the vertex angle α j-1 The complementary angle β j-1 It can also be calculated directly using the following formula:
[0095]
[0096] S14, starting from the first vertex of the current polyline, the supplementary angles of the vertex angles of the current polyline are accumulated in sequence along the path of the current polyline, and the accumulation result is compared with the first threshold after each accumulation. If the accumulation result is less than the first threshold, it is determined whether the accumulation reaches the last vertex angle along the path of the current polyline. If it has reached the last vertex angle, the current polyline is used as a sub-polyline, and the segmentation is terminated; if it has not reached the last vertex angle, the next accumulation is performed; if the accumulation result is not less than the first threshold, the next step is performed;
[0097] S15, using the vertex or the point on the edge of the vertex angle reached by the current accumulation as the splitting point, splitting the current polyline into two sub-polylines;
[0098] S16. Use the two sub-polylines obtained in step S15 as current polylines respectively, and execute step S13 again to finally obtain several sub-polylines.
[0099] like Figure 5 As shown, if the supplementary angle β1 corresponding to vertex p2 is greater than the first threshold σ1, vertex p2 is split into polyline 1 and polyline 2. Then, if β2+β3>σ1, the polyline is further split into polyline 2 and polyline 3 until all polylines are divided into multiple groups of polylines.
[0100] S2, simplify each sub-polyline according to the distribution law of the angles formed by the vertices on it and the virtual connecting line segments of the first and last vertices, and obtain the corresponding simplified results;
[0101] In this embodiment, step S2 includes the following steps:
[0102] S21, using a computing device to obtain the angles formed by each vertex on each sub-polyline and the virtual line segment connecting the first and last vertices of the sub-polyline, and obtain all corresponding angles, the calculation formula is similar to that listed in step S1;
[0103] S22, generating respective corresponding second thresholds according to the characteristics of each sub-polyline;
[0104] S23, sorting all the angles corresponding to each sub-polyline obtained in step S1 respectively, and obtaining the corresponding minimum angle information;
[0105] S24, respectively compare the minimum angle value corresponding to each sub-polyline obtained in step S23 with the second threshold value corresponding to the sub-polyline; if the minimum angle value corresponding to a sub-polyline is smaller than the second threshold value corresponding to the sub-polyline, cut the sub-polyline into two sub-polylines and rotate them as a new sub-polyline to execute step S21; if the minimum angle value corresponding to a sub-polyline is not smaller than the second threshold value corresponding to the sub-polyline, take the line segment connecting the first and last vertices of the sub-polyline as the simplified result of the sub-polyline.
[0106] It should be noted that the second threshold corresponding to each sub-polyline is determined according to the requirements, which is a compromise between simplification and data volume. The second threshold can better maintain the original state but the data volume is large, and vice versa;
[0107] S3, connecting the simplified results corresponding to each sub-polyline obtained in step S2 end to end according to their original positions to obtain the simplified result of the polyline.
[0108] Embodiment 2
[0109] In the first embodiment, a method for simplifying polylines has been described. However, the method may not be sufficiently simplified. Therefore, the present embodiment further provides a distributed parallel method for simplifying polylines with a large number of vertices. The distributed parallel method further includes the following steps based on the first embodiment:
[0110] S4, determining whether the simplification result of the polyline obtained in step S3 meets the simplification standard, if it has met the standard, then ending the simplification; if it has not met the standard, then returning to executing step S1;
[0111] In this embodiment, the simplification standard is determined according to actual needs and can be determined by the number of simplified polyline vertices. When it is less than a certain number, it means that the accuracy standard has been reached and no further simplification is required.
[0112] Embodiment 3
[0113] Based on the distributed parallel method for simplifying polylines with a large number of vertices described in the first embodiment of the present invention, this embodiment further proposes a distributed parallel system for simplifying polylines with a large number of vertices, the distributed parallel system including:
[0114] The signal acquisition device 1 is used to acquire specific object data and form a polyline corresponding to the specific object data;
[0115] The main node module 2 is used to cut the polyline obtained by the signal acquisition device 1 into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and output them respectively;
[0116] The marking storage module 3 is used to mark the plurality of sub-polylines output by the main node module 2 respectively to form their corresponding feature identifiers, and store their respective feature information according to their corresponding feature identifiers for use or processing;
[0117] At least one slave node module 4, each slave node module 4 is configured to obtain a sub-polyline from the tag storage module 3 each time, and simplify the sub-polyline obtained this time according to the distribution law of the angles formed by the vertices on the sub-polyline and the virtual connecting line segments of the first and last vertices, to obtain the simplified result corresponding to the sub-polyline this time;
[0118] The merging module 5 is used to connect the simplified results corresponding to each sub-polyline obtained from the node module 4 end to end according to their original positions to obtain the simplified result of the polyline.
[0119] In this embodiment, the master node module 2 includes:
[0120] The marking unit 21 is used to mark the polyline obtained by the signal acquisition device 1 according to the feature, and obtain the feature identifier corresponding to the polyline;
[0121] The segmentation unit 22 is used to segment the polyline marked by the marking unit 21 to obtain a plurality of sub-polylines and output them respectively;
[0122] in,
[0123] The marking unit 21 communicates with the signal acquisition device 1 , and the segmentation unit 22 communicates with the marking storage module 3 .
[0124] In this embodiment, the tag storage module 3 includes:
[0125] The shared queue unit 31 is used to mark the plurality of sub-polylines output by the main node module 2 respectively to form their corresponding feature identifiers;
[0126] The shared disk unit 32 is used to store feature information of each sub-polyline according to the feature identifier corresponding to the sub-polyline for use or processing. In this embodiment, the feature information includes the position information of each vertex;
[0127] in,
[0128] The shared queue unit 31 communicates with the split unit 22 , and the shared disk unit 32 communicates with each slave node module 4 .
[0129] The polyline obtained by the signal acquisition device 1 is first marked by the marking unit 21 to obtain the identifier of the polyline, and the position of each node of the polyline can be recorded at the same time. Then it enters the segmentation unit 22 and is segmented into a number of sub-polylines by the segmentation unit 22. The shared queue unit 31 marks the sub-polylines output by the main node module 2 separately to form their corresponding feature identifiers. The shared disk unit 32 stores the feature information of each sub-polyline according to the feature identifier corresponding to the sub-polyline.
[0130] In the sub-polyline simplification stage, each slave node module 4 obtains a sub-polyline from the shared disk unit 32 each time, and simplifies the sub-polyline obtained this time according to the distribution law of the angles formed by the vertices on the sub-polyline and the virtual connecting line segments of the first and last vertices, to obtain the simplified result corresponding to this sub-polyline, and finally the merging module merges the sub-polyline to complete the simplification.
[0131] Embodiment 4
[0132] On the basis of try three, in order to achieve efficient division of labor and simplification of multiple word polylines, this embodiment further proposes a distributed parallel system for simplifying polylines with massive vertices, the distributed parallel system also includes a patrol module 6 for patrolling the working status of each slave node module 4 and distributing tasks to specific slave node modules 4 according to the patrol results, and the patrol module 6 communicates with each slave node module 4.
[0133] In this embodiment, the patrol module 6 includes:
[0134] The inquiry unit 61 is used to send a work inquiry signal to each slave node module 4, and after knowing that some slave node modules 4 are in an idle state, form a call instruction for these slave node modules 4;
[0135] At least one response unit 62, communicating with the slave node module 4 in one-to-one correspondence, each response unit 62 is used to obtain the corresponding working state information of the slave node module 4, and respond to the signal sent by the inquiry unit 61, so as to send the corresponding working state signal of the slave node module 4 to the inquiry unit 61;
[0136] The execution unit 63 is used to receive the respective calling instructions for some slave node modules 4 formed by the inquiry unit 61, and according to the respective calling instructions for these slave node modules 4, extract the feature information of the sub-polylines to be simplified from the shared disk unit 32 in a one-to-one manner and distribute them to these slave node modules 4 for processing, and delete the feature information of the sub-polylines that have been distributed from the shared disk unit 32 after distribution;
[0137] in,
[0138] The inquiry unit 61 communicates with each of the response units 62 , and the execution unit 63 communicates with the inquiry unit 61 and the shared disk unit 32 .
[0139] Embodiment 5
[0140] Based on the second embodiment, the third embodiment or the fourth embodiment, this embodiment further proposes a distributed parallel system for simplifying polylines with massive vertices. The distributed parallel system further includes a judgment module 7 based on the third embodiment or the fourth embodiment.
[0141] The judging module 7 is used to receive the simplified result of the polyline obtained by the merging module 5, and judge whether the simplified result of the polyline meets the simplification standard. If it meets the standard, the simplification is terminated and output; if it does not meet the standard, the simplified result of the polyline is sent to the main node module 2, and the main node module 2 processes it again;
[0142] The judging module 7 communicates with the merging module 5 .
[0143] like Figure 8 , Fig. 9 There are two forms in this embodiment, which may include the patrol module 6 or not. However, the implementation method without the patrol module 6 has the beneficial effects of high efficiency and precise simplification.
[0144] At this point, after the merging module 5 forms a simplified result, it can be processed by the judging module 7 to achieve simplification as much as possible for later use.
[0145] Although embodiments of the present invention have been shown and described, it will be apparent to those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A distributed parallel method for simplification of polylines with massive vertices, characterized by: The distributed parallel method comprises the following steps: S1, cutting the polyline obtained by the signal acquisition device into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and performing feature identification on each sub-polyline and storing them; S2, simplifying each of the sub-polylines according to the distribution law of the angles formed by the vertices on the sub-polylines and the virtual connecting line segments of the first and last vertices, to obtain corresponding simplified results; S3, connecting the simplified results corresponding to each sub-polyline obtained in step S2 end to end according to their original positions to obtain the simplified result of the polyline; The step S1 comprises the following steps: S11, collecting specific object data through a signal collection device to form a multi-segment line corresponding to the specific object data; S12, setting a first threshold value according to the data characteristics of the specific object data in step S11; S13, taking the polyline as the current polyline, and calculating the supplementary angles of the angles of each vertex on the current polyline by a computing device; S14, starting from the first vertex of the current polyline, the supplementary angles of the vertex angles of the current polyline are accumulated in sequence along the path of the current polyline, and the accumulation result is compared with the first threshold after each accumulation, if the accumulation result is less than the first threshold, it is determined whether the accumulation reaches the last vertex angle along the path of the current polyline, if it has reached the last vertex angle, the current polyline is used as a sub-polyline, and the segmentation is terminated; If it has not been reached, the next accumulation is performed; If the accumulated result is not less than the first threshold, execute the next step; S15, using the vertex or the point on the edge of the vertex angle reached by this accumulation as a split point, dividing the current polyline into two sub-polylines; S16, taking the two sub-polylines obtained in step S15 as current polylines respectively, and executing step S13 again, and finally obtaining a plurality of sub-polylines; The step S2 comprises the following steps: S21, using a computing device to obtain the angles formed by each vertex on each of the sub-polysegment lines and the virtual line segment connecting the first and last vertices of the sub-polysegment line, and obtain all corresponding angles; S22, generating respective corresponding second thresholds according to the characteristics of each of the sub-polylines; S23, sorting all the angles corresponding to each of the sub-polylines obtained in step S1 respectively, and obtaining the corresponding minimum angle information; S24, respectively compare the minimum angle value corresponding to each of the sub-polylines obtained in the step S23 with the second threshold value corresponding to the sub-polyline; if the minimum angle value corresponding to a certain sub-polyline is smaller than the second threshold value corresponding to the sub-polyline, cut the sub-polyline into two sub-polylines and rotate them as a new sub-polyline to execute the step S21; if the minimum angle value corresponding to a certain sub-polyline is not smaller than the second threshold value corresponding to the sub-polyline, take the line segment connecting the first and last vertices of the sub-polyline as the simplified result of the sub-polyline.
2. The distributed parallel method for simplification of polylines with massive vertices according to claim 1, characterized in that: The distributed parallel method also includes: S4, judging whether the simplification result of the polyline obtained in step S3 meets the simplification standard, if it has met the standard, ending the simplification; if it has not met the standard, returning to execute step S1.
3. A distributed parallel system for simplification of polylines with massive vertices, characterized by: Based on the distributed parallel method for simplification of polylines with massive vertices according to claim 1 or 2, the distributed parallel system includes: A signal acquisition device (1) is used to acquire specific object data and form a multi-segment line corresponding to the specific object data; A main node module (2) is used to cut the polyline obtained by the signal acquisition device (1) into a plurality of sub-polylines according to the change rule of the angles of all vertices on the polyline, and output them separately; A marking storage module (3) is used to mark the plurality of sub-polylines output by the main node module (2) respectively to form respective corresponding feature identifiers, and store respective feature information according to the respective corresponding feature identifiers for use or processing; At least one slave node module (4), each of the slave node modules (4) being configured to obtain one of the sub-polylines from the tag storage module (3) each time, and simplify the sub-polyline obtained this time according to the distribution law of the angles formed between each vertex on the sub-polyline and the virtual connecting line segments of the first and last vertices, to obtain a simplified result corresponding to the sub-polyline this time; The merging module (5) is used to connect the simplified results corresponding to each sub-polyline obtained by the node module (4) end to end according to their original positions to obtain the simplified result of the polyline.
4. The distributed parallel system for simplification of polylines with massive vertices according to claim 3, characterized in that: The master node module (2) includes: A marking unit (21) is used to mark the polyline obtained by the signal acquisition device (1) according to the feature, so as to obtain a feature identifier corresponding to the polyline; A segmentation unit (22) is used to segment the polyline marked by the marking unit (21) to obtain the plurality of sub-polylines and output them separately; in, The marking unit (21) communicates with the signal acquisition device (1), and the segmentation unit (22) communicates with the marking storage module (3).
5. The distributed parallel system for simplification of polylines with massive vertices according to claim 4, characterized in that: The tag storage module (3) includes: A shared queue unit (31) is used to mark the plurality of sub-polylines output by the main node module (2) respectively to form corresponding feature identifiers; A shared disk unit (32) is used to store feature information of each sub-polyline according to a feature identifier corresponding to the sub-polyline for use or processing; in, The shared queue unit (31) communicates with the segmentation unit (22), and the shared disk unit (32) communicates with each of the slave node modules (4).
6. The distributed parallel system for simplification of polylines with massive vertices according to claim 5, characterized in that: The distributed parallel system also includes a patrol module (6) for patrolling the working status of each slave node module (4) and distributing tasks to a specific slave node module (4) according to the patrol result. The patrol module (6) communicates with each slave node module (4).
7. The distributed parallel system for simplification of polylines with massive vertices according to claim 6, characterized in that: The patrol module (6) comprises: An inquiry unit (61) is used to send a work inquiry signal to each slave node module (4) and, after knowing that some of the slave node modules (4) are in an idle state, form a call instruction for each of the slave node modules (4); at least one response unit (62) communicating with the slave node modules (4) in a one-to-one correspondence, each response unit (62) being used to obtain the corresponding working status information of the slave node module (4), and respond to the signal sent by the inquiry unit (61), so as to send the corresponding working status signal of the slave node module (4) to the inquiry unit (61); an execution unit (63) for receiving respective call instructions for certain slave node modules (4) formed by the inquiry unit (61), and for taking out the feature information of the sub-polylines to be simplified from the shared disk unit (32) in a one-to-one manner according to the respective call instructions for these slave node modules (4) and distributing them one by one to these slave node modules (4) for processing, and deleting the feature information of the sub-polylines that have been distributed from the shared disk unit (32) after the distribution; in, The inquiry unit (61) communicates with each of the response units (62), and the execution unit (63) communicates with the inquiry unit (61) and the shared disk unit (32).
8. The distributed parallel system for simplification of polylines with massive vertices according to any one of claims 5 to 7, characterized in that: The distributed parallel system further comprises a judgment module (7), wherein the judgment module (7) is used to receive the simplification result of the polyline obtained by the merging module (5), and judge whether the simplification result of the polyline meets the simplification standard, and if the simplification result of the polyline meets the simplification standard, the simplification is terminated and outputted; if the simplification result of the polyline does not meet the simplification standard, the simplification result of the polyline is sent to the main node module (2) for further processing by the main node module (2); The judging module (7) communicates with the merging module (5).
