Land-based navigation signal ranging code optimization method

By optimizing the selection of ranging codes for land-based navigation signals using the Hunger Games search algorithm, the high complexity problem in existing technologies is solved, and fast and effective ranging code combination optimization is achieved, improving the system's resistance to near-far effects and multiple access interference.

CN120991826APending Publication Date: 2025-11-21NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511051354.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing land-based navigation signal ranging code optimization technology is highly complex, making it difficult to solve the ranging code combination optimization problem within a limited time, which affects the system's anti-multipath interference and anti-multiple access interference performance.

Method used

The Hunger Game Search (HGS) algorithm is used to optimize the selection of ranging codes for land-based navigation signals. By constructing a candidate code set and a fitness function, a swarm intelligence optimization algorithm is used to iteratively find the optimal combination of ranging codes in the solution space, thereby reducing complexity and improving cross-correlation performance.

Benefits of technology

It quickly provides an approximate optimal solution for the ranging code, improving the system's resistance to near-far effects and multiple access interference, while reducing the optimization complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120991826A_ABST
    Figure CN120991826A_ABST
Patent Text Reader

Abstract

The invention discloses a land-based navigation signal ranging code optimization method. The method comprises the following steps: constructing a candidate ranging code set; wherein the candidate ranging code set comprises a plurality of groups of ranging codes; a cross-correlation peak ratio is calculated between every two ranging codes corresponding to the indexes contained in the individual, and a cross-correlation peak ratio vector is formed; setting a minimum value of a cross-correlation peak ratio, calculating a vector of the cross-correlation peak ratio and a mean square error of the minimum value of the cross-correlation peak ratio, and taking the mean square error as a fitness function of the algorithm; when the algorithm is executed, firstly, a solution space is constructed; each individual corresponds to one position in the solution space; during each iteration, algorithm parameters and the position of each individual are updated by calculating the fitness of the current iteration population; and taking the individual corresponding to the position of the updated individual in the solution space as a population of next iteration, repeating iteration until a preset condition is met, outputting the individual corresponding to the global optimal fitness, and outputting the ranging code corresponding to the index contained in the individual as the optimal ranging code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ranging code optimization for navigation systems, and particularly to a method for optimizing ranging codes for land-based navigation signals. Background Technology

[0002] Ground-based navigation systems are based on direct sequence spread spectrum (DSSS) technology. Different base stations correspond to different ranging codes (i.e., spreading codes). The navigation message and the ranging code are multiplied and then carrier-modulated to form a navigation signal for transmission. The receiver distinguishes the received navigation signal based on the different ranging codes to achieve positioning. In practical applications, the correlation performance of the ranging codes is the most important performance metric. Better autocorrelation performance improves the system's resistance to multipath interference and facilitates signal acquisition, while better cross-correlation performance improves the system's resistance to multiple access interference. Unlike other performance metrics, cross-correlation performance is a common performance metric for evaluating multiple ranging codes. Changing any one of the ranging codes will affect the cross-correlation performance of the ranging code group. Therefore, when using cross-correlation performance as an evaluation index to select the optimal ranging code, the problem becomes more complex. Existing ranging code selection techniques include multiple local optimum operations based on greedy algorithms, problem partitioning based on divide-and-conquer algorithms, and parallel solution methods. Ranging code selection belongs to the combinatorial optimization problem of selecting N from M in mathematics. Existing traversal solution methods require traversal... There are several combinations, which are extremely complex and difficult to solve in a finite amount of time. Summary of the Invention

[0003] The purpose of this invention is to provide a method for optimizing the ranging code of land-based navigation signals, so as to overcome the problems of high complexity and inability to solve the ranging code optimization in the existing technology within a limited time.

[0004] To achieve the above objectives, the present invention employs the following technical solution:

[0005] A method for optimizing the ranging code of a land-based navigation signal includes:

[0006] Construct a candidate ranging code set; wherein the candidate ranging code set contains multiple sets of ranging codes;

[0007] Construct the fitness function and individuals for the Hunger Games search algorithm; the objective is to select N optimal ranging codes from M candidate ranging codes, then there exist N optimal ranging codes. There are several ways to combine them; each individual algorithm is composed of the indices corresponding to any N non-repeating ranging codes in the candidate code set;

[0008] For each pair of indexes contained in an individual, a cross-correlation peak ratio (CPR) is calculated between the ranging codes to form a CPR vector. A minimum CPR value is set, and the mean square error of the CPR vector and the minimum CPR value is calculated as the fitness function of the algorithm.

[0009] When the algorithm is executed, the solution space is first constructed; the solution space is composed of... The population consists of individuals, each corresponding to a position in the solution space. In each iteration, the fitness of the current iteration population is calculated to determine whether to update the global optimal fitness and the global worst fitness, and the current global optimal position is determined, and the position of each individual is updated. The individual corresponding to the updated position in the solution space is used as the population for the next iteration. The iteration is repeated until a preset condition is met. Then, the individual corresponding to the global optimal fitness is output, and the ranging code corresponding to the index contained in that individual is output as the best ranging code.

[0010] Furthermore, if the index of the ranging code contained in the selected individual is repeated, it is called an illegal solution; it is necessary to arbitrarily select one of the repeated ranging code indices and then replace it with the index of a ranging code that has not yet been selected.

[0011] Furthermore, the peak cross-correlation ratio between two ranging codes is defined as:

[0012]

[0013] Among them, E corr The peak value represents the cross-correlation, and L represents the sequence length of the ranging code.

[0014] Furthermore, the fitness function is expressed as follows:

[0015]

[0016] Among them, the cross-correlation peak ratio E between each pair of the ranging codes corresponding to the N indices of an individual can be calculated, forming a length of Cross-correlation peak ratio vector E b The minimum cross-correlation peak ratio is E. bmin .

[0017] Furthermore, the process of the Hunger Games search algorithm is as follows:

[0018] Based on the number of ranging codes M in the candidate code set P and the number of ranging codes N in the subset of ranging codes to be selected, a solution space is constructed; the solution space is formed by... It consists of individual units, and each individual unit contains indexes corresponding to N ranging codes;

[0019] From the solution space From the given population, randomly select m individuals to construct the initial population; initialize the algorithm parameters;

[0020] Begin iteration;

[0021] In each iteration, the fitness of each individual in the population is calculated and sorted using the fitness function, and the global best fitness and global worst fitness are updated based on the current best fitness and the current worst fitness; the current global best position is determined.

[0022] Calculate location parameters to control changes in individual search locations; update search parameters and calculate the hunger level of each individual; calculate the hunger weight of the population and update the location of each individual in the population.

[0023] The updated positions of all individuals in the current population correspond to the individuals in the solution space that form the population for the next iteration. The above iterative process is repeated for the next iteration until the preset maximum number of iterations is reached or the algorithm converges and stops iterating, and the individual corresponding to the global optimal fitness is output.

[0024] Furthermore, the ranging code type in the candidate ranging code set adopts Weil code, and each ranging code is generated by truncating the Weil code of code length L0;

[0025] First, generate a legendre sequence with code length L0:

[0026] And there exists an integer x such that k = x 2 modL0

[0027] Where L(k) is the k-th element of the sequence, and mod represents the modulo division operation;

[0028] Next, calculate and generate a Weil code sequence of length L0:

[0029]

[0030] Where w represents the phase difference between the Legendre sequences,

[0031] Finally, by cyclically truncating the above Weil code sequence, a Weil code of length L can be obtained as a ranging code.

[0032] A terminal device includes a processor, a memory, and a computer program stored in the memory; when the processor executes the computer program, it implements the method for optimizing the ranging code of the land-based navigation signal.

[0033] A computer-readable storage medium storing a computer program; when executed by a processor, the computer program implements the method for optimizing the ranging code of a land-based navigation signal.

[0034] Compared with the prior art, the present invention has the following technical features:

[0035] The present invention combines swarm intelligence optimization algorithms. By applying the Hungry Game Search algorithm to the problem of optimizing the ranging code of land-based navigation signals, a subset of ranging codes with better cross-correlation performance is selected from the candidate ranging code set, realizing the optimal selection of the cross-correlation performance of the ranging code. Compared with the traversal search of the conventional method, it can reduce the optimization complexity and can quickly provide an approximate solution to the optimal solution. Brief Description of the Drawings

[0036] Figure 1 is the flowchart of the method of the present invention;

[0037] Figure 2 is the relationship between the number of iterations and the fitness function value in the example of the present invention. Detailed Embodiments

[0038] The cross-correlation isolation degree of the ranging code determines the anti-near-far effect ability of the system. Selecting a ranging code group with better cross-correlation performance can effectively improve the anti-near-far effect ability of the system. Both land-based area navigation and GNSS distinguish signals from different transmitters through different ranging codes, but the number of base stations in GRNS is much smaller than the number of ranging codes in the GNSS ranging code group. This solution uses the GNSS ranging code group as the candidate code group, selects the best subset of ranging codes from it, and uses it as the ranging code of the base station.

[0039] A method for optimizing the ranging code of land-based navigation signals. The number of ranging codes in the candidate ranging code set is M, and the number of ranging codes in the optimized ranging code subset is N, where N < M, and the sequence length of the ranging code is L bits. The method includes the following steps:

[0040] Step 1, define the number M of ranging codes in the candidate ranging code set; the candidate ranging code set P is expressed as follows:

[0041] P = {P i | i = 1, 2,..., M}

[0042] where P i represents the i-th ranging code in the candidate ranging code set, and the sequence length of the ranging code is L; in an embodiment of the present invention, the B1C Weil code (code length is 10230) is used to optimize the candidate code in the candidate ranging code set, and N best ranging codes are selected from the M ranging codes in the candidate ranging code set and applied to N base stations. Therefore, there are a total of combinations in the solution space.

[0043] Step 2, define the individual dimension D and fitness function F of the Hungry Game Search (HGS) algorithm.

[0044] Individual dimension refers to the number N of ranging codes in the desired ranging code subset, i.e., D = N; the fitness function F is the measure of cross-correlation performance, specifically defined as follows:

[0045] The individual j in the HGS algorithm is composed of the indices (i.e., the sequence numbers of the ranging codes in set P) corresponding to any N unique ranging codes in set P, expressed as X. j =[x1,x2,...,x D ], where x k (k = 1, 2, ..., D) represents the k-th index that constitutes an individual; x k The value is a decimal and ranges from (0, N-1). That is, each individual first randomly selects N unique ranging codes from the set P, and the indices of these ranging codes constitute the individual.

[0046] Since each individual contains N unique ranging code indices, each individual corresponds to a subset of ranging codes; the solution space coexists. The optimal combination (individual) needs to be found through an optimization algorithm, which serves as the preferred subset of ranging codes. The N ranging codes corresponding to the N indices in this subset are the preferred ranging codes for the N base stations. Direct traversal... Due to the excessive computational load, this scheme adopts the HSG algorithm. First, a subset of individuals is selected to construct a population. Based on the position update of the individuals, the next position of each individual is determined. Thus, in each iteration, different individuals are selected for computation under the influence of fitness, so as to quickly achieve optimization.

[0047] During the algorithm's execution, if the selected individual X j If the index of the ranging code is repeated, it is called an illegal solution. We need to randomly select one of the repeated indexes of the ranging code and replace it with the index of the ranging code that has not yet been selected. This not only coordinates the illegal solutions, but also expands the search range during the adjustment process, which is beneficial to the convergence of the algorithm.

[0048] The peak cross-correlation ratio between two ranging codes is defined as:

[0049]

[0050] Among them, E corr The cross-correlation peak value is represented by , and L represents the sequence length of the ranging code. A higher cross-correlation peak value indicates a higher cross-correlation peak ratio and poorer correlation performance of the ranging code; conversely, a lower cross-correlation peak value indicates better correlation performance. The cross-correlation isolation of the ranging code determines the system's resistance to near-far effects. Selecting a ranging code group with better cross-correlation performance can effectively improve the system's resistance to near-far effects.

[0051] In a subset of ranging codes (i.e., individuals), a cross-correlation peak ratio E can be calculated between each pair of N ranging codes, forming a set of codes of length . Cross-correlation peak ratio vector E b Set the minimum cross-correlation peak ratio E. bmin Calculate E b With E bmin The mean square error (MSE) is used to measure the cross-correlation peak ratio vector of a certain ranging code subset relative to E. bmin The average difference between them, i.e.:

[0052]

[0053] MSE(E) corresponding to the ranging code subset b The smaller the value, the smaller the average cross-correlation peak ratio, and the better the cross-correlation performance; the objective of the optimization algorithm in selecting the optimal parameter combination is to minimize the fitness function:

[0054] min F=min MSE(E b )

[0055] Step 3: Set the population size and maximum number of iterations for the HGS algorithm, and iteratively solve the problem based on the HGS algorithm to obtain the individual X corresponding to the minimum fitness function. best The ranging code corresponding to the index contained in this individual is used as the optimal ranging code.

[0056] The core of the HGS algorithm lies in achieving collaborative problem-solving and competitive search among individuals, thereby driving the entire group to evolve towards the optimal solution. It features strong optimization capabilities and fast convergence speed, and performs exceptionally well in handling both continuous and discrete problems. In this scheme, the HGS algorithm is as follows:

[0057] (1) Based on the number of ranging codes M in the candidate code set P and the number of ranging codes N in the subset of ranging codes to be optimized, construct a solution space; select N non-repeating ranging codes from the number of ranging codes M as a solution each time, so there exist N solutions. There are several solutions; the index of the ranging code contained in each solution is treated as an individual, that is, the solution space exists. There are 10 individuals, and each individual corresponds to a position in the solution space.

[0058] (2) Initialize the population; from the solution space From a population of individuals, randomly select m individuals to construct the initial population; initialize the maximum number of iterations T, the upper and lower boundaries UB and LB, and the initial positions of the individuals. The sum of hunger levels of all individuals (SHungry), the global optimal fitness (BF),

[0059] (3) Begin iteration:

[0060] The fitness of each individual in the population is calculated using the fitness function F and then sorted. The minimum fitness is bF (the current best fitness), and the maximum fitness is wF (the current worst fitness). If bF is less than the current global best fitness BF, then BF is updated to bF, and the position of the individual corresponding to bF is taken as the current global best position. If wF is greater than the current worst global fitness WF, then update WF to wF.

[0061] (4) Calculate the location parameter E, which controls the change in the individual's search position. The calculation formula is as follows:

[0062] E = sech(|F(j) - BF|)

[0063] Where F(j) represents the fitness of individual j, and sech() is a hyperbolic function with the expression: Where e is a natural constant and x is a function variable.

[0064] (5) Update search parameters And calculate the hunger level (hungry(j)) of individual j.

[0065] Search parameters The search range for controlling an individual's food-finding activities is calculated using the following formula:

[0066]

[0067] Among them, parameters rand represents a random number in the range [0,1], T represents the maximum number of iterations, and t represents the current number of iterations.

[0068] The formula for calculating hunger(j) is as follows:

[0069]

[0070] Where F(j) represents the fitness of individual j in the current iteration; the individual corresponding to the optimal fitness is the best individual, and the hunger of the best individual is set to 0; for other individuals, a parameter H is added to the original hunger, and the parameter H is different for each individual; the formula for calculating the parameter H is as follows:

[0071]

[0072] Where LH is the lower bound of hunger, BF and WF represent the best fitness and worst fitness in the current iteration process, respectively, and r6 and r7 are both random numbers in the range [0,1].

[0073] (6) Calculate the population hunger weight and

[0074] The individual's hunger level (hungry(j)) is quantified, and the hunger weight is calculated. and The quantization vector corresponding to each individual j constitute, The quantization vector corresponding to each individual j The composition and calculation formula are as follows:

[0075]

[0076] Where M represents the number of individuals, SHungry represents the sum of hunger(j) of all individuals, r3, r4 and r5 are all random numbers in the range [0,1], l is a preset constant threshold, and exp is the natural exponential function.

[0077] (7) Update the position of each individual in the population.

[0078] In the process of individuals searching for food sources, they usually cooperate with each other, but a very small number of individuals search independently; the process of individuals searching for food sources in the HGS algorithm can be represented as:

[0079]

[0080] in, Let represent the position of individual j in the current t-th iteration, and randn(1) represent a random value that follows a standard normal distribution. and This represents the two introduced hunger weights. This represents the globally optimal position in the current iteration. The search parameters calculated in step (4) are represented by E, the position parameters calculated in step (3), r1 and r2 are random numbers in the range [0,1], and l is a constant set. The range of activity of the current individual is used to simulate the current activity range, multiplied by a hunger weight. To test the effect of different levels of hunger on the search range.

[0081] (8) After the position of each individual j is updated, the updated positions of the m individuals in the current population are determined. Select individuals at corresponding positions in the solution space. These individuals constitute the population for the next iteration. Repeat steps (3) to (7) for the next iteration until the preset maximum number of iterations is reached or the algorithm converges (the global optimal fitness BF does not change or the change is less than a certain threshold). Stop the iteration, output the individuals corresponding to the global optimal fitness BF, and output the subset of ranging codes formed by the ranging codes corresponding to the indices contained in the individuals as the preferred subset of ranging codes.

[0082] Example:

[0083] In this implementation example, the ranging code type uses Weil codes, with a length L = 10230 bits, and the number of ranging codes in the candidate ranging code set is M = 63. The ranging code is generated by truncating the 10234-bit Weil code, and its generation method is described as follows: First, a legendary sequence L(k) with a code length of L0 = 10234 is generated:

[0084]

[0085] Here, mod represents the modulo division operation.

[0086] Next, calculate and generate a Weil code sequence with a code length of L0 = 10234:

[0087]

[0088] Where w represents the phase difference between two Legendre sequences.

[0089] Finally, by cyclically truncating the above Weil code sequence, we can obtain a Weil code with a code length of L = 10230, i.e., the truncated sequence is:

[0090] c(n;w;p)=W((n+p-1)modN;w),n=0,1,2,...,L-1

[0091] Where p is the truncation point, indicating that the truncation starts from the p-th bit of the Weil code, p∈[1,L], and n represents the n-th bit of the sequence; the phase difference w and truncation point p parameter settings of the 63 Weil code sequences are shown in Table 1.

[0092] If the number of code sequences in the preferred ranging code subset is required to be N=6, then the individual dimension D=6 and the fitness function F are:

[0093]

[0094] Set E bmin = -33dB, population size is 100, maximum number of iterations is 200, the relationship between the number of iterations and the fitness function value is as follows: Figure 2 As shown. The algorithm converges in the 140th generation, and the final optimal ranging code set is numbered [12,34,37,42,50,60], meaning the selected ranging code is P. 12 ,P 34 ,P 37 ,P 42 ,P 50 ,P 60The cross-correlation peak ratio range, mean, and standard deviation statistics of the optimal ranging code set are shown in Table 2.

[0095] Table 1. Parameters of 63 Weil codes

[0096]

[0097]

[0098]

[0099] Table 2. Statistics on the range of cross-correlation peak ratio of the preferred ranging code subset.

[0100] Ranging code Maximum value Minimum value mean Standard deviation Candidate code group -29.2667 -32.9253 -31.6105 0.52266 Preferred subset -31.7984 -32.7393 -32.2295 0.29381

[0101] Figure 2 This graph shows the relationship between the number of iterations and the fitness function value when using the HGS algorithm to iteratively solve the ranging code optimization problem. Figure 2 It can be seen that the fitness value converges at the 140th iteration. The solution time of the proposed method is quantified and compared with that of the traversal search method. The number of combinations required to be traversed using the traversal search method is... The simulation showed that traversing 10,000 groups would take 401.5107 seconds, and it is inferred that traversing all groups would take 2.7281 × 10⁻⁶ seconds. 6 However, with a population size of 100 and a maximum number of iterations of 200, the simulation experiment of completing the ranging code optimization based on the HGS algorithm only takes 797.3742 seconds. This demonstrates the high efficiency of the method proposed in this invention.

[0102] According to an embodiment of the present invention, Table 2 shows the statistical results of the cross-correlation peak ratio range of the preferred ranging code subset. The maximum value, mean, and standard deviation of the cross-correlation peak ratio of the preferred subset are smaller than those of the candidate code groups. The upper limit of the cross-correlation peak ratio of the preferred ranging code set is reduced by 2.5317 dB compared to the upper limit of the cross-correlation peak ratio of the candidate code sequence (63 Weil codes) of -29.2667. Since the cross-correlation isolation of the system is determined by the upper limit of the cross-correlation peak ratio, the method proposed in this invention can effectively improve the cross-correlation isolation of the system.

[0103] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for optimizing the ranging code of a land-based navigation signal, characterized in that, include: Construct a candidate ranging code set; wherein the candidate ranging code set contains multiple sets of ranging codes; Construct the fitness function and individuals for the Hunger Games search algorithm; the objective is to select N optimal ranging codes from M candidate ranging codes, then there exist N optimal ranging codes. There are several ways to combine them; each individual algorithm is composed of the indices corresponding to any N non-repeating ranging codes in the candidate code set; For each pair of indexes contained in an individual, a cross-correlation peak ratio (CPR) is calculated between the ranging codes to form a CPR vector. A minimum CPR value is set, and the mean square error of the CPR vector and the minimum CPR value is calculated as the fitness function of the algorithm. When the algorithm is executed, the solution space is first constructed; the solution space is composed of... The population consists of individuals, each corresponding to a position in the solution space. In each iteration, the fitness of the current iteration population is calculated to determine whether to update the global optimal fitness and the global worst fitness, and the current global optimal position is determined, and the position of each individual is updated. The individual corresponding to the updated position in the solution space is used as the population for the next iteration. The iteration is repeated until a preset condition is met. Then, the individual corresponding to the global optimal fitness is output, and the ranging code corresponding to the index contained in that individual is output as the best ranging code.

2. The method for selecting the ranging code for land-based navigation signals according to claim 1, characterized in that, If the selected individual contains duplicate indexes of the ranging code, it is called an illegal solution; it is necessary to randomly select one of the duplicate ranging code indices and replace it with the index of a ranging code that has not yet been selected.

3. The method for selecting the optimal ranging code for land-based navigation signals according to claim 1, characterized in that, The peak cross-correlation ratio between two ranging codes is defined as: Among them, E corr The peak value represents the cross-correlation, and L represents the sequence length of the ranging code.

4. The method for selecting the ranging code for land-based navigation signals according to claim 1, characterized in that, The fitness function is expressed as follows: Among them, the cross-correlation peak ratio E between each pair of the ranging codes corresponding to the N indices of an individual can be calculated, forming a length of Cross-correlation peak ratio vector E b The minimum cross-correlation peak ratio is E. bmin .

5. The method for selecting the optimal ranging code for land-based navigation signals according to claim 1, characterized in that, The Hunger Games search algorithm process is as follows: Based on the number of ranging codes M in the candidate code set P and the number of ranging codes N in the subset of ranging codes to be selected, a solution space is constructed; the solution space is formed by... It consists of individual units, and each individual unit contains indexes corresponding to N ranging codes; From the solution space From a population of individuals, m individuals are randomly selected to construct the initial population. Initialize the algorithm parameters; Begin iteration; In each iteration, the fitness of each individual in the population is calculated and sorted using the fitness function, and the global best fitness and global worst fitness are updated based on the current best fitness and the current worst fitness; the current global best position is determined. Calculate location parameters to control changes in individual search locations; update search parameters and calculate the hunger level of each individual; calculate the hunger weight of the population and update the location of each individual in the population. The updated positions of all individuals in the current population correspond to the individuals in the solution space that form the population for the next iteration. The above iterative process is repeated for the next iteration until the preset maximum number of iterations is reached or the algorithm converges and stops iterating, and the individual corresponding to the global optimal fitness is output.

6. The method for selecting the ranging code for land-based navigation signals according to claim 1, characterized in that, The ranging code type in the candidate ranging code set adopts Weil code, and each ranging code is generated by truncating a Weil code of code length L0; First, generate a legendre sequence with code length L0: Where L(k) is the k-th element of the sequence, and mod represents the modulo division operation; Next, calculate and generate a Weil code sequence of length L0: W(k;w)=L(k)⊕L((k+w)modL0),k=0,1,2,...,L0-1 Where w represents the phase difference between the Legendre sequences, Finally, by cyclically truncating the above Weil code sequence, a Weil code of length L can be obtained as a ranging code.

7. A terminal device, comprising a processor, a memory, and a computer program stored in the memory; characterized in that, When the processor executes the computer program, it implements the preferred method for the ranging code of the land-based navigation signal according to any one of claims 1-6.

8. A computer-readable storage medium storing a computer program; characterized in that, When the computer program is executed by the processor, it implements the preferred method for the ranging code of the land-based navigation signal according to any one of claims 1-6.