Lossy compression method and device for positioning data and wearable device
Through the methods of area division and segmentation compression, the positioning data of IoT wearable devices is compressed lossily, solving the problems of large storage space and inconvenient retrieval, and achieving the effect of saving and convenient retrieval of storage space.
Patent Information
- Application Number
- CN202510469797.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-25
AI Technical Summary
When the prior art compresses the positioning data of the wearable devices in the Internet of Things, the storage space is large and cannot be easily retrieved, which cannot meet the needs of data storage and retrieval.
The positioning track data is divided into multiple regions through the region division rule, the area stay point position of each region is calculated, and the segmented reference point is used as the origin for segmented compression to obtain the compressed positioning track data.
Lossive compression of positioning data is achieved, storage space is saved, and data retrieval is more convenient.
Smart Images

Figure CN120377930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data compression, and in particular to a lossy compression method, device and wearable device for positioning data. Background Art
[0002] With the rapid development of IoT technology, a large number of IoT wearable devices are widely used, such as locatable electronic watches and electronic student ID cards. These devices generate both mobile trajectory data and location-intensive area data of long-term stays at a certain location, and continuously generate and collect a large amount of location data. However, this also brings huge challenges, especially in data storage and retrieval. IoT wearable location data has the characteristics of high real-time and large volume. As time goes by, non-compressed storage methods will bring high server-side storage costs, but the frequency of use of these data is very low, so it is particularly important to effectively compress and store such data.
[0003] In the related art, when compressing and storing data, it is usually compressed by a general data compression method, such as compression algorithms: Huffman Coding, LZ77 and LZ78 algorithms, DEFLATE algorithm, etc. Alternatively, compression is performed by using some set IoT locations to summarize data compression methods, for example, storing valid types of positioning data and not storing invalid types of positioning data, thereby reducing the amount of positioning data and then reducing the storage space occupied by the positioning data. However, both methods compress the data in a fixed manner, and the compressed data is relatively large. The compression effect still has the problem of large data volume. In addition, the problem of fast retrieval when the positioning data is called is not considered, and convenient retrieval cannot be achieved.
[0004] Therefore, how to effectively compress and store positioning data, save storage space, and make retrieval convenient has become a technical problem that needs to be solved urgently in the prior art. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a lossy compression method, device and wearable device for positioning data, so as to overcome the current problems that the storage space is large after data compression and it cannot be easily retrieved.
[0006] To achieve the above objectives, the present invention adopts the following technical solutions:
[0007] In one aspect, a method for lossy compression of positioning data includes:
[0008] Get positioning trajectory data;
[0009] Determine the time period of staying in the same place in the positioning trajectory data based on a preset algorithm;
[0010] According to the area division rule, divide the in-situ stay time period into multiple areas, calculate the position of the area stay point for each area, and modify the positions of all positioning points within any area to the position of the area stay point corresponding to that area to obtain the corrected positioning trajectory data; wherein, calculating the position of the area stay point for each area includes: calculating the average longitude and latitude of the positioning points within each area to obtain the position of the area stay point for that area;
[0011] Segment the corrected positioning trajectory data based on the trajectory segmentation rule, and determine the segmentation reference point and the offset point in the segmented trajectory data segments;
[0012] Taking the segmentation reference point as the origin, perform segmentation compression on the segmentation reference point and the offset point to obtain the compressed positioning trajectory data.
[0013] Optionally, the preset algorithm is adding a time constraint condition to the DBSCAN algorithm;
[0014] The time constraint condition is: when searching for positioning points based on the positioning trajectory data, search for several positioning points after any positioning point time.
[0015] Optionally, the area division rule includes: dividing the positioning points of every first number in chronological order into one area; when the number of positioning points in the last area is less than the first number, take all the positioning points in the last area as the end area;
[0016] wherein, the first number is the minimum number of points in the preset algorithm.
[0017] Optionally, determining the segmentation reference point and the offset point in the segmented trajectory data segments includes:
[0018] Taking the first point in each trajectory data segment as the segmentation reference point, and taking the points other than the first point in each trajectory data segment as the offset points.
[0019] Optionally, the trajectory segmentation rule includes:
[0020] If the distance between two consecutive positioning points in time is greater than the product of the radius in the preset algorithm and the segmentation granularity coefficient; or, the time interval between two consecutive positioning points in time is greater than the preset duration, then it is determined that segmentation is required between these two positioning points.
[0021] Optionally, taking the segmentation reference point as the origin and performing segmentation compression on the segmentation reference point and the offset point includes:
[0022] Write the segmented reference point data according to the segmented reference point data format, and write the offset point data according to the offset point data format, the time difference between the offset point and the previous point, and the longitude and latitude difference.
[0023] Optionally, the segmented reference point data format includes: a time zone and a longitude and latitude zone; the writing of the segmented reference point data according to the segmented reference point data format includes:
[0024] Take the last 6 bits of the long integer time code of the segmented reference point and store them in the data stream; convert the longitude and latitude data of the segmented reference point into integers, and save the converted longitude and latitude into the data stream respectively; store the time code of the segmented reference point in the time zone with a length of 6 bytes, and store the longitude and latitude information of the segmented reference point in the longitude and latitude zone with a length of 8 bytes;
[0025] The offset point data format includes: a time offset zone and a longitude and latitude offset zone; the writing of the offset point data according to the offset point data format includes:
[0026] Subtract the time of the current offset point from the time of the previous offset point to obtain a time offset, and write the time offset into the time offset zone according to the time offset;
[0027] Subtract the longitude and latitude of the current offset point from the longitude and latitude of the previous offset point respectively to obtain a longitude and latitude offset amount, and save the longitude and latitude offset amount into the data stream; store the time offset of the segmented reference point in the time offset zone with a length of 3 bytes, and store the longitude and latitude offset information of the segmented reference point in the longitude and latitude offset zone with a preset byte length.
[0028] Optionally, it further includes:
[0029] Store the compressed positioning trajectory data into a preset space;
[0030] In response to a decompression instruction, call the compressed positioning trajectory data and decompress the compressed positioning trajectory data to obtain decompressed positioning trajectory data.
[0031] On the other hand, a lossy compression device for positioning data, characterized in that it includes a processor and a memory, and the processor is connected to the memory:
[0032] Wherein, the processor is used to call and execute the program stored in the memory;
[0033] The memory is used to store the program, and the program is at least used to execute the lossy compression method of the positioning data described in any one of the above.
[0034] In another aspect, a wearable device, characterized by comprising the lossy compression device for positioning data described above.
[0035] The technical solution provided by the embodiments of the present invention divides the far - away stay time period into multiple regions according to the region division rule, calculates the region stay points of each region, and thus modifies the positions of all positioning points within any region to the position of the region stay point of that region, obtaining the corrected positioning trajectory data, thereby realizing the lossy compression of the data; and taking the segmented reference point as the origin, performing segmented compression on the segmented reference point and the offset point to obtain the compressed positioning trajectory data, thereby realizing the lossy compression processing of the data, saving storage space, and, due to segmentation, the stored data is more convenient for retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0037] Figure 1 is a flowchart provided by an embodiment of the present invention;
[0038] Figure 2 is a schematic structural diagram provided by an embodiment of the present invention;
[0039] Figure 3 is a schematic structural diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be described in detail below. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope protected by the present invention.
[0041] As described in the background art, when compressing and storing data, it is usually compressed by a general data compression method, such as compression algorithms: Huffman Coding, LZ77 and LZ78 algorithms, DEFLATE algorithm, etc. Or, it is compressed by a data compression method that summarizes some set Internet of Things locations. For example, valid type location data is stored, and invalid type location data is not stored, so as to reduce the quantity of location data, and then reduce the storage space occupied by the location data. However, both of them fixedly compress the data and do not consider the problem of quick retrieval when the location data is called, and convenient retrieval cannot be achieved.
[0042] Therefore, how to compress and store location data and make retrieval convenient has become a technical problem to be solved urgently in the prior art.
[0043] Based on this, an embodiment of the present invention provides a lossy compression method for location data, Figure 1 which is a schematic flowchart of a lossy compression method for location data provided by an embodiment of the present invention. Refer to Figure 1 and this embodiment may include the following steps:
[0044] Step S101, obtain location trajectory data.
[0045] It should be noted that any wearable device can be defined as the target wearable device, and the location trajectory data of the target wearable device within a period of time can be obtained according to its movement trajectory; among them, a period of time can be one day, one week, one month, one year, etc., and the present application does not make specific limitations.
[0046] Step S102, determine the in-situ stay time period in the location trajectory data based on a preset algorithm.
[0047] The location trajectory data may include data of any one location point.
[0048] After obtaining the location trajectory data, the in-situ stay time period of the target wearable device can be judged according to the location trajectory data.
[0049] In some embodiments, the preset algorithm is to add a time constraint condition to the DBSCAN algorithm;
[0050] The time constraint condition is: when searching for location points according to the location trajectory data, search for several location points after any one location point time.
[0051] For example, on the basis of the DBSCAN algorithm, a time constraint condition is added. DBSCAN is a density-based clustering algorithm, and the algorithm after adding the time constraint is the Timebased-DBSCAN algorithm. The specific method included is:
[0052] Given a global radius Eps and a minimum number of points MinPts;
[0053] According to the positioning trajectory data, start searching from the first positioning point in chronological order; the constraint condition for the search action is "only search for M positioning points before and after the time of this point"; the value of M is: when MinPts is even, M takes MinPts / 2, and when MinPts is odd, M takes MinPts / 2 + 1; use the above method for searching until the first core point, also known as the core object, is found, and then expand this core point; the expansion method is to search for all density-connected positioning points starting from this core point. The density-connected positioning points include density-connected core points and boundary points until there are no more expandable positioning points, and cluster all density-connected positioning points into a cluster; repeat the method of clustering into a cluster to find core points that have not been clustered until all data has been processed;
[0054] The core object refers to: if the Eps neighborhood of an object contains at least the minimum number MinPts of objects, then this object is called a core object;
[0055] The Eps neighborhood refers to: the state space within a region with a radius of Eps for a given object is called the Eps neighborhood of this object. Use NEps(P) to represent the set of points within the Eps radius of point P, and use Sp and Sq to represent the sequence numbers of point p and point q in the trajectory, that is
[0056] N Eps (p) = {q|q is in the dataset D, distance(p,q) ≤ Eps, abs(Sq - Sp) ≤ M}
[0057] The boundary point refers to: a boundary point is not a core point but falls within the neighborhood of a certain core point.
[0058] The directly density-reachable refers to: given a set of objects D, if p is within the Eps neighborhood of q and q is a core object, then it is said that object p is directly density-reachable (Directly Density-Reachable) from object q.
[0059] The density-reachable refers to: if there exists an object chain p1, p2,...., pn, p1 = q, pn = p, for pi ∈ D (1 ≤ i ≤ n), pi+1 is directly density-reachable from pi with respect to Eps and MinPts, then object P is density-reachable (Density-Reachable) from object q with respect to Eps and MinPts.
[0060] The so-called density connection means that: if there exists an object O ∈ D such that both objects p and q are density-reachable from O with respect to Eps and MinPts, then object p is density-connected to q with respect to Eps and MinPts (Density-Connected).
[0061] By calculation, the in-situ stay time period can be obtained. It should be noted that by judging the positioning point coordinates, the positioning points within a certain distance can be defined as the positions of in-situ stay, and the information of these positions can be used as the in-situ stay time period.
[0062] Step S103: According to the region division rule, divide the in-situ stay time period into multiple regions, calculate the position of the region stay point for each region, and modify the positions of all positioning points within any region to the position of the corresponding region stay point of that region to obtain the corrected positioning trajectory data.
[0063] It can be understood that lossy compression is achieved by dividing the in-situ stay time period.
[0064] In some embodiments, the region division rule includes: dividing the positioning points of each first number into a region in chronological order; when the number of positioning points in the last region is less than the first number, all the positioning points in the last region are used as the end region;
[0065] wherein, the first number is the minimum number of points in the preset algorithm MinPts 。
[0066] For example, the positioning points within the stay time period can be calculated in chronological order, with every MinPts points as a region, and the last region with less than MinPts positioning points is still used as a separate region; the MinPts is the minimum number of points MinPts in the Timebased-DBSCAN algorithm.
[0067] It can be understood that by adopting such an implementation method, accurate division can be achieved.
[0068] In some embodiments, the calculation of the position of the region stay point for each region includes:
[0069] Calculating the average value of the longitude and latitude of the positioning points within each region to obtain the position of the region stay point for that region.
[0070] By calculating the longitude and latitude, an accurate position of the region stay point can be obtained.
[0071] Step S104: Segment the corrected positioning trajectory data based on the trajectory segmentation rule, and determine the segmentation reference point and the offset point in the segmented trajectory data segments.
[0072] Lossy compression is assisted by segmenting the corrected positioning trajectory data.
[0073] In some embodiments, the trajectory segmentation rule includes:
[0074] If the distance between two consecutive positioning points in time is greater than the product of the radius in the preset algorithm and the segmentation granularity coefficient; or, if the time interval between two consecutive positioning points in time is greater than the preset duration, it is determined that segmentation is required between these two positioning points.
[0075] For example, the distance between two consecutive positioning points in time can be given as X, the time interval between two consecutive positioning points in time can be given as T, and the segmentation granularity coefficient can be given as a;
[0076] According to the corrected positioning trajectory data, the segmentation condition is:
[0077] 1) f(X) = X > Eps * a | a > 1, X < 40761 meters; or,
[0078] 2) Or f(T) = T > 1 hour;
[0079] Where Eps is the radius Eps in the Timebased - DBSCAN algorithm.
[0080] It can be understood that such a setting can achieve the accuracy of segmentation.
[0081] In some embodiments, determining the segmentation reference point and the offset point in the segmented trajectory data includes:
[0082] Taking the first point in each segment of trajectory data as the segmentation reference point, and taking the points other than the first point in each segment of trajectory data as the offset points.
[0083] It can be understood that such a setting can accurately obtain the offset points.
[0084] Step S105: Using the segmentation reference point as the origin, perform segmented compression on the segmentation reference point and the offset points to obtain the compressed positioning trajectory data.
[0085] In some embodiments, using the segmentation reference point as the origin and performing segmented compression on the segmentation reference point and the offset points includes:
[0086] Writing the segmentation reference point data according to the segmentation reference point data format, and writing the offset point data according to the offset point data format and the time difference and longitude - latitude difference between the offset point and the previous point.
[0087] It can be understood that by adopting the technical solution provided in this embodiment, for each segment of data after segmentation, the origin can be set at the segmentation reference point, and the other points in this segment can be offset, and compressed in a preset format to obtain the compressed positioning trajectory data, realizing the lossy compression of the data.
[0088] The technical solution provided in this embodiment is a method of assigning the positioning points to the average value within the region when staying at a certain location for a long time. This method can not only play a role in lossy compression of the data, but also make the trajectory more in line with the actual situation.
[0089] In some embodiments, the data format of the segmentation reference point includes: a time zone and a longitude and latitude zone; writing the segmentation reference point data according to the data format of the segmentation reference point includes:
[0090] Take the last 6 bits of the long integer time code of the segmentation reference point and store them in the data stream; convert the longitude and latitude data of the segmentation reference point into integers, and save the converted longitude and latitude into the data stream respectively; store the time code of the segmentation reference point in the time zone with a length of 6 bytes, and store the longitude and latitude information of the segmentation reference point in the longitude and latitude zone with a length of 8 bytes;
[0091] The data format of the offset point includes: a time offset zone and a longitude and latitude offset zone; writing the offset point data according to the data format of the offset point includes:
[0092] Subtract the time of the current offset point from the time of the previous offset point to obtain the time offset, and write the time offset into the time offset zone according to the time offset;
[0093] Subtract the longitude and latitude of the current offset point from the longitude and latitude of the previous offset point respectively to obtain the longitude and latitude offset amount, and save the longitude and latitude offset amount into the data stream;
[0094] Store the time offset of the segmentation reference point in the time offset zone with a length of 3 bytes, and store the longitude and latitude offset information of the segmentation reference point in the longitude and latitude offset zone with a preset byte length.
[0095] Figure 2 It is a schematic diagram of the data writing format for segment compression provided by the embodiment of the present invention. Refer to Figure 2 , for example, the data of the segmentation reference point can be referred to Figure 2The segmented reference points therein include a time zone (time: 6 bytes) and a longitude and latitude zone (longitude and latitude: 8 bytes). When writing to the time zone, 6 bytes are used to write the time, which can be accurate to milliseconds, such as 0x0192B3544776; when writing to the longitude and latitude zone, the first four bits represent the longitude and the last four bits represent the latitude. When writing, the last 6 bits of the long integer time code of the segmented reference point can be saved into the data stream; the longitude and latitude data of the segmented reference point are converted into integers. Assuming the actual decimal digit number n of the longitude and latitude data, multiply by 10*n and convert from double-precision floating-point number to integer; then the converted longitude and latitude in integer form are respectively saved into the data stream of 4 bytes.
[0096] For example, the data of the offset point can be referred to Figure 2 The offset points in it include a time offset zone (time: 3 bytes) and a longitude and latitude offset zone (longitude and latitude offset: 1 - 4 bytes). When writing to the time offset zone, use the time difference from the previous point, accurate to milliseconds, such as 0x36EE80; when writing to the longitude and latitude offset zone, use the highest 4 bits to represent how many 4 bits are needed for the longitude and latitude offset. The number of bits of the longitude and latitude offset data needs to be a multiple of 4, and the multiple value range is: 0, 1, 2, 3, and the required data length is: (0~6)*4 bits = 0~24 bits, that is, 0~3 bytes. For example, when writing, subtract the time of the offset point from the previous point to get the time offset, and save the last 3 bits of the time offset code into the data stream; subtract the longitude and latitude of the offset point from the longitude and latitude of the previous point respectively to get the longitude and latitude offset amount; calculate the number of bits of the data payload of the longitude and latitude offset amount and round up to the nearest multiple of 4 bits (bytes). The results can be divided into: 0 bits, 4 bits, 8 bits, and 12 bits. Design the data headers to represent 0 bits, 4 bits, 8 bits, and 12 bits with 0b00, 0b01, 0b10, and 0b11 respectively, and use 1 byte to store the data header; the data payload length of the longitude and latitude offset amount is calculated according to the actual offset amount, and its range is: 0~24 bits, that is, 0~3 bytes; write the data header and payload of the offset amount into the data stream respectively; according to the writing format, it can be known that the data payload length of the longitude and latitude offset amount of the stay point is 0 bytes, and this part of the data is the lossy compression part.
[0097] It can be understood that the segmented reference points provided by the embodiments of the present invention can provide scalability for subsequent positioning data retrieval.
[0098] In some embodiments, it further includes:
[0099] Store the compressed positioning trajectory data into a preset space;
[0100] In response to the decompression instruction, the compressed positioning trajectory data is called and decompressed to obtain the decompressed positioning trajectory data.
[0101] For example, storing the compressed trajectory data: storing the compressed positioning trajectory data and the segmented reference point information into a specified file or a storage middleware.
[0102] Reading and decompressing the trajectory positioning data: loading the compressed trajectory data file from a specified file or a storage middleware, and performing reverse operations according to the method of the compression process to obtain the decompressed positioning trajectory data.
[0103] The technical solution provided by the embodiment of the present invention divides the far - away stay time period into multiple regions according to the region division rule, calculates the region stay points of each region, and thus modifies the positions of all positioning points within any region to the positions of the region stay points of that region, obtaining the corrected positioning trajectory data, thereby realizing the lossy compression of the data; and using the segmented reference point as the origin, performing segmented compression on the segmented reference point and the offset points to obtain the compressed positioning trajectory data, thereby realizing the lossy compression processing of the data, saving storage space, and, due to segmentation, the stored data is more convenient for retrieval.
[0104] The present invention also provides a lossy compression device for positioning data, which is used to implement the above - mentioned method embodiments. Figure 3 It is a schematic structural diagram of a lossy compression device for positioning data provided by an embodiment of the present invention. As Figure 3 shown, the lossy compression device for positioning data in this embodiment includes a processor 31 and a memory 32, and the processor 31 is connected to the memory 32. Among them, the processor 31 is used to call and execute the program stored in the memory 32; the memory 32 is used to store the program, and the program is at least used to execute the lossy compression method for positioning data in the above - mentioned embodiments.
[0105] The specific implementation scheme of the lossy compression of positioning data provided by the embodiments of the present application can refer to the implementation manners of the lossy compression method for positioning data in any of the above - mentioned embodiments, and will not be elaborated here.
[0106] Based on a general inventive concept, the embodiment of the present invention also provides a wearable device, including the above - mentioned lossy compression device for positioning data.
[0107] It can be understood that the same or similar parts in the above - mentioned embodiments can be referred to each other, and the content not detailed in some embodiments can be referred to the same or similar content in other embodiments.
[0108] It should be noted that in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be construed as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "a plurality of" refers to at least two.
[0109] Any process or method description shown in the flowchart or described in other ways herein can be understood to represent a module, segment, or part of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in the reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the technical field to which the embodiments of the present invention belong.
[0110] It should be understood that each part of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0111] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0112] In addition, each functional unit in various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into a module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0113] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, etc.
[0114] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0115] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A lossy compression method for positioning data, characterized in that, Including: Obtaining positioning trajectory data; Determining the staying-in-place time period in the positioning trajectory data based on a preset algorithm; According to the area division rule, dividing the staying-in-place time period into multiple areas, calculating the position of the area staying point for each area, and modifying the positions of all positioning points within any area to the position of the corresponding area staying point of that area to obtain the corrected positioning trajectory data; wherein, calculating the position of the area staying point for each area includes: calculating the average longitude and latitude of the positioning points within each area to obtain the position of the area staying point of that area; Segmenting the corrected positioning trajectory data based on the trajectory segmentation rule, and determining the segmentation reference point and the offset point in the segmented trajectory data; Using the segmentation reference point as the origin, performing segmentation compression on the segmentation reference point and the offset point to obtain the compressed positioning trajectory data.
2. The method according to claim 1, wherein The preset algorithm is adding a time constraint condition to the DBSCAN algorithm; The time constraint condition is: when searching for positioning points based on the positioning trajectory data, searching for several positioning points after any positioning point in time.
3. The method according to claim 2, characterized in that, The area division rule includes: dividing the positioning points of each first number in chronological order into one area; when the number of positioning points in the last area is less than the first number, taking all the positioning points in the last area as the end area; Wherein, the first number is the minimum number of points in the preset algorithm.
4. The method according to claim 1, wherein Determining the segmentation reference point and the offset point in the segmented trajectory data includes: Taking the first point in each segment of trajectory data as the segmentation reference point, and taking the points other than the first point in each segment of trajectory data as the offset points.
5. The method according to claim 1, wherein The trajectory segmentation rule includes: If the distance between two consecutive positioning points in time is greater than the product of the radius in the preset algorithm and the segmentation granularity coefficient; or, the time interval between two consecutive positioning points in time is greater than the preset duration, then it is determined that segmentation is required between these two positioning points.
6. The method according to claim 1, wherein Using the segmentation reference point as the origin, performing segmentation compression on the segmentation reference point and the offset point includes: Writing the segmentation reference point data according to the segmentation reference point data format, and writing the offset point data according to the offset point data format and the time difference and longitude and latitude difference between the offset point and the previous point.
7. The method according to claim 6, characterized in that, The segmentation reference point data format includes: a time zone and a longitude and latitude zone; writing the segmentation reference point data according to the segmentation reference point data format includes: Taking the last 6 bits of the long integer time code of the segmentation reference point and storing them in the data stream; converting the longitude and latitude data of the segmentation reference point to integers, and respectively saving the converted longitude and latitude as integers in the data stream; storing the time code of the segmentation reference point in the time zone with a length of 6 bytes, and storing the longitude and latitude information of the segmentation reference point in the longitude and latitude zone with a length of 8 bytes; The offset point data format includes: a time offset zone and a longitude and latitude offset zone; writing the offset point data according to the offset point data format includes: Subtracting the time of the current offset point from the time of the previous offset point to obtain the time offset, and writing the time offset into the time offset zone according to the time offset; Subtract the longitude and latitude of the current offset point from those of the previous offset point respectively to obtain the longitude and latitude offset, and save the longitude and latitude offset into the data stream; store the time offset of the segmented reference point with a length of 3 bytes in the time offset area, and store the longitude and latitude offset information of the segmented reference point with a preset byte length in the longitude and latitude offset area.
8. The method according to any one of claims 1-7, characterized in that, It further includes: Store the compressed positioning trajectory data into a preset space; In response to a decompression instruction, call the compressed positioning trajectory data, and decompress the compressed positioning trajectory data to obtain the decompressed positioning trajectory data.
9. A lossy compression device for positioning data, characterized in that, It includes a processor and a memory, and the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the lossy compression method of the positioning data according to any one of claims 1-8.
10. A wearable device, characterized in that, It includes the lossy compression device for positioning data according to claim 9.