Satellite navigation positioning auxiliary ephemeris data compression and transmission method
Technical Field
The invention belongs to the technical field of satellite positioning, and relates to a satellite navigation positioning auxiliary ephemeris data compression and transmission method.
Background
The navigation positioning technology based on the navigation satellite has higher positioning precision and convenient use, and the related application thereof has penetrated into various industries, so the benefits brought by the technology are more remarkable. Generally, the first positioning time of the device is about 30 seconds, and for a low-power-consumption device, the 30 seconds can cause great energy consumption, which is not favorable for long-term operation of the device. In order to reduce the first positioning time of the equipment, the server transmits the current ephemeris data to assist the equipment in positioning, so that the first positioning time of the equipment is shortened, and the energy consumption of the equipment is reduced.
When the device performs positioning, the device first obtains current ephemeris data from the server, for example, about 32 satellites of a GPS system, about 30 satellites of a beidou system, about 60 bytes of ephemeris data of a single satellite, and about 3720 bytes of ephemeris data of each server. If the positioning is performed by using systems such as GLONASS, Galileo and the like, the transmitted data volume will exceed 6000 bytes. For devices using narrowband communications, such as NB-IoT devices, transmitting more data also increases energy consumption and time to first fix.
Disclosure of Invention
In order to reduce the energy consumption of equipment as much as possible, the invention discloses a satellite navigation positioning auxiliary ephemeris data compression and transmission method, which can compress ephemeris data and reduce the data volume of transmission.
In order to achieve the purpose, the invention provides the following technical scheme:
the satellite navigation positioning auxiliary ephemeris data compression method comprises the following steps:
step 1, when the device carries out positioning, firstly judging whether local storage ephemeris data is expired, if so, requesting current ephemeris data from a server, wherein a request message comprises timestamp information of the local storage ephemeris;
step 2, after receiving the equipment request, the server searches for the current ephemeris data and finds out the outdated ephemeris data corresponding to the timestamp according to the uploaded timestamp information;
step 3, subtracting all parameters of the current ephemeris and the outdated ephemeris to obtain the variation of each parameter;
step 4, representing the change states of the satellite numbers and the 26 parameters by using 4 bytes, wherein 0-5 bits represent the satellite numbers, and 6-31 bits represent whether the corresponding satellite parameters change or not by using a bitmap method;
and 5, respectively carrying out numerical compression on the 4 bytes and each parameter variable quantity which is not 0 in the step 4, wherein the numerical compression process is as follows:
a) shifting the data to the left by one bit and shifting the sign bit at the most significant bit to the least significant bit;
b) splitting the data into a 7-bit representation;
c) using the highest bit value of each byte to represent whether higher bit data exists, and removing other bytes in front of the byte in which the highest bit value represents that the higher bit data does not exist;
and 6, performing numerical compression on all the variable quantities and then packaging to form a data stream, wherein the data arrangement sequence is as follows: the satellite number and the parameter change state compression value are not 0 parameter change amount compression value.
Further, the expiration time in the step 1 is set to be 1-4 hours.
Furthermore, in the step 4, 6 to 31 bits of 4 bytes, 0 indicates that the parameter is changed, and 1 indicates that the parameter is not changed.
Further, in the step c), a most significant digit value of 1 in each byte indicates that higher-order data exists, and 0 indicates that no higher-order data exists.
The satellite navigation positioning auxiliary ephemeris data transmission method comprises a satellite navigation positioning auxiliary ephemeris data compression method, and comprises a process of sending data to equipment by a server and decompressing the data after the equipment receives the data returned by the server, wherein the data decompression process specifically comprises the following steps:
step 1, the device receives the data stream, splits the data stream into a plurality of groups of parameters according to the most significant bit of each byte, and performs the following processing:
a) reading a byte of the data stream, judging whether a higher-order byte exists according to the highest-order numerical value of the byte, and continuing the step b);
b) if the higher order byte exists, continuing to read the next byte data;
c) repeating the steps a) to b) until no higher byte exists in the read byte;
d) removing the most significant bit of each byte, and taking out the low 7 bits of each byte for recombination;
repeatedly executing the steps a) to d) until all data in the data stream are read, thereby obtaining the satellite number, the parameter change state byte and the subsequent parameter change quantity;
and 2, carrying out numerical decompression on the recombined data to obtain the variable quantities of all the parameters, and comprising the following steps of:
a) acquiring the sign bit of the highest bit of the variation, and taking the negative bit;
b) the reorganized data is shifted to the right by one bit and is expressed in the form of 8-bit bytes;
c) carrying out XOR operation on the results of the a and the b to obtain a variable quantity;
and 3, reducing the variable quantity into a parameter value, wherein the process is as follows:
a) judging whether each satellite parameter changes from 6-31 bits of the data stream;
b) and after the variable quantity of each changed ephemeris parameter is obtained according to the ephemeris parameter bitmap, adding the variable quantity and the local ephemeris parameters corresponding to the satellite numbers to obtain the current ephemeris parameters.
Further, in step a) of step 1, a most significant digit value of the byte is 1, which indicates that higher-order data exists, and 0 indicates that no higher-order data exists.
Furthermore, in the step a) of the step 3, a value of 0 in 6 to 31 bits indicates that the parameter is changed, and a value of 1 indicates that the parameter is not changed.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the server compares the current ephemeris data with the ephemeris data stored locally in the equipment to obtain the variable quantity of the parameter and compress the value, the variable quantity is indexed by adopting the parameter change flag bit in the data, only the compressed variable quantity and a small amount of data are transmitted to the equipment, the total transmission data can be compressed to about 70 percent of the original transmission data, the data transmission quantity and the transmission time can be effectively reduced in narrow-band communication, and the communication energy consumption of the equipment is reduced.
Detailed Description
The technical solutions provided by the present invention will be described in detail below with reference to specific examples, and it should be understood that the following specific embodiments are only illustrative of the present invention and are not intended to limit the scope of the present invention.
Through a plurality of tests, the device finds that part of parameters in the ephemeris data downloaded from the server every time do not change, and part of the ephemeris data changes less. For data which does not change, the data can not be sent to the equipment, and only the equipment is told that the data does not change; for changing data, reference ephemeris is used for calculation and the calculation results are compressed. Whether the parameters are changed is indicated by adopting a bitmap mode, and the satellite parameters corresponding to the bitmap are shown in the following table 1:
ephemeris parameters
|
Corresponding bitmap index
|
Satellite health status
|
6
|
Count the whole week
|
7
|
User distance accuracy index
|
8
|
Time delay difference of satellite equipment
|
9
|
Rate of change of track inclination
|
10
|
Ephemeris data age
|
11
|
Reference time of clock error parameter
|
12
|
Clock error parameter 0
|
13
|
Clock error parameter 1
|
14
|
Clock error parameter 2
|
15
|
Clock data age
|
16
|
Amplitude of cosine harmonic correction term of track radius
|
17
|
Difference between average movement rate of satellite and calculated value
|
18
|
Mean angle of approach of reference time
|
19
|
Amplitude of cosine harmonic correction term of latitude argument
|
20
|
Eccentricity ratio
|
21
|
Amplitude of sinusoidal harmonic correction term of latitude amplitude angle
|
22
|
Square root of major semi-axis
|
23
|
Ephemeris reference time
|
24
|
Amplitude of sinusoidal harmonic correction of track inclination
|
25
|
Right ascension at the intersection calculated from the reference time
|
26
|
Amplitude of cosine harmonic correction of track inclination
|
27
|
Orbital inclination with reference to time
|
28
|
Amplitude of sinusoidal harmonic correction term of track radius
|
29
|
Argument of near place
|
30
|
Rate of change of ascension crossing point
|
31 |
TABLE 1
Specifically, the method for compressing ephemeris data for satellite navigation and positioning assistance provided by the invention comprises the following steps:
step 1, when the device performs positioning, whether the local storage ephemeris data is expired is judged firstly, the expiration time can be set to be 1-4 hours, if the data is expired, the current ephemeris data is requested from a server, and the request message contains the timestamp information of the local storage ephemeris.
And 2, after receiving the equipment request, the server searches for the current ephemeris data and finds out the expired ephemeris data corresponding to the timestamp according to the uploaded timestamp information, namely the ephemeris data is the same as the ephemeris data stored locally in the equipment.
And 3, subtracting all parameters of the current ephemeris and the outdated ephemeris to obtain the variation of each parameter.
And 4, the ephemeris data content comprises 26 parameters, and the length of each parameter is 1-32 bits. The satellite number and the state of change of 26 parameters are represented by 4 bytes. The first 4 bytes of 0-5 bits represent the satellite number, 6-31 bits represent the corresponding satellite parameters by using a bitmap method (shown in table 1), each bit of the fixed position represents whether one parameter changes, wherein 0 represents the parameter change, and 1 represents the parameter does not change.
And 5, respectively carrying out numerical compression on the first 4 bytes and each parameter variable quantity which is not 0, wherein the numerical compression process is as follows:
assume that the variance of one of the parameters is 32-bit value: 00000000000000000000000100000001
a) The amount of change is shifted to the left by one bit and the sign bit (most significant bit) is shifted to the least significant bit, with the following results:
00000000 00000000 00000010 00000010
b) the data was split into a 7-bit representation, with the following results:
0000 0000000 0000000 0000100 0000010
c) whether higher order data exists is represented by the highest order bit per byte, 1 represents the existence, 0 represents the nonexistence, and other bytes preceding the byte with the highest order bit of 0 are removed, with the following results:
00000100 10000010
and 6, performing numerical compression on all the variable quantities and then packaging to form a data stream, wherein the data arrangement sequence is as follows: the satellite number and the parameter change state compression value are not 0 parameter change amount compression value.
Through the steps, the ephemeris data is compressed and sent to the device by the server, and each byte is sent from low to high when the data stream is sent.
After receiving the data returned by the server, the equipment decompresses the data to obtain the current latest satellite ephemeris data, and the ephemeris data decompression method comprises the following steps:
step 1, the device receives the data stream, and splits the data stream into a plurality of groups of parameters according to the most significant bit of each byte, and the process is as follows:
taking the first 4 bytes of the data stream received by the device as an example, assume that the first 4 bytes are: 10000010000001001000011110000001
a) Reading a byte of the data stream, judging whether the most significant bit of the byte is 1, continuing the step b)
In this example, the read data: 10000010 with high 1
b) If the most significant bit of the byte is 1, indicating that the next byte is the most significant bit of the parameter, the next byte data is continuously read.
The result after reading the next byte of data in this example is: 0000010010000010
c) Repeating the steps a-b until the highest bit of the read byte is 0
The most significant bit of the read byte in the step b) is 0, so the finally read data is: 0000010010000010
d) The most significant bit of each byte is removed, and the lower 7 bits of each byte are taken out for recombination, and the results are as follows:
and (3) recombining data: 00001000000010
And repeatedly executing the steps a) to d) until all data in the data stream are read, thereby obtaining the satellite number, the parameter change state byte and the subsequent parameter change quantity.
And 2, carrying out numerical decompression on the recombined data to obtain the variable quantities of all the parameters, and comprising the following steps of:
a) the sign bit (most significant bit) of the variation is taken and taken to be negative, with the following results:
00000000 00000000
b) the reorganized data is shifted to the right by one bit and represented in 8-bit byte form, with the following results:
00000001 00000001
c) and performing exclusive or operation on the results of the a and the b to obtain a variation, wherein the result is as follows:
00000001 00000001
and 3, reducing the variable quantity into a parameter value, wherein the process is as follows:
a) since 0 to 5 of the first parameter of the data stream indicates the satellite number and 6 to 31 of the bitmap of the ephemeris parameter, it is determined whether or not the number is 1 from the 6 th bit. The bit of 1 indicates that the parameter exists, and the variable quantity is the result obtained after numerical decompression; a bit of 0 indicates that this parameter is absent and that the variation is 0.
b) And after the variable quantity of each ephemeris parameter is obtained according to the ephemeris parameter bitmap, adding the variable quantity and the local ephemeris parameters corresponding to the satellite numbers to obtain the current ephemeris parameters.
And decompression of the ephemeris data is completed.
The above mentioned compressing and decompressing process of the ephemeris data is a complete transmission method of the satellite navigation positioning assistance ephemeris data.
The technical means disclosed in the invention scheme are not limited to the technical means disclosed in the above embodiments, but also include the technical scheme formed by any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and such improvements and modifications are also considered to be within the scope of the present invention.