Method of calculating fitting parameters, positioning method, device and program product

By improving the simulated annealing algorithm and introducing multiple molecular variables and probability mechanisms, the problem that the simulated annealing algorithm is prone to falling into local extreme values ​​is solved, and more efficient and accurate fitting parameter calculation is achieved, thereby improving the data fitting effect.

CN117312758BActive Publication Date: 2025-10-10欧摩威软件系统开发(重庆)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311484726.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-08
Publication Date
2025-10-10
Estimated Expiration
2043-11-08

AI Technical Summary

Technical Problem

The existing simulated annealing algorithm is prone to fall into local extreme points when calculating fitting parameters, resulting in inaccurate fitting parameters and affecting the data fitting effect.

Method used

An improved simulated annealing algorithm is used to increase the probability of molecules finding the global optimal solution and reduce time overhead by introducing multiple molecular variables and escape probability and acceptance probability mechanisms.

Benefits of technology

The accuracy of fitting parameters is improved, time overhead is reduced, and more accurate fitting parameters are calculated in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312758B_ABST
    Figure CN117312758B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a kind of method for calculating fitting parameter and positioning method, and is used to calculate fitting parameter by improving simulated annealing algorithm, to improve the accuracy of calculated fitting parameter.The method comprises the following steps: the step of initializing parameter, including: initializing multiple molecules (or variables), each molecule is at least composed of fitting parameter and energy value;The step of simulated annealing, including: using simulated annealing, according to test data and objective function model, the multiple molecules are iterated to calculate the final fitting parameter;Wherein, the test data is collected from the first environment, the objective function model is the algorithm model used by the second environment, and the final fitting parameter is used to fit the first data obtained from the first environment into the second data in the second environment, so that the algorithm model can realize predetermined function based on the second data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data processing technology, and in particular to a method for calculating fitting parameters, a positioning method, a device and a program product. Background Art

[0002] Data fitting is very common in engineering practice. For example, suppose an algorithm model is designed for environment A. The project requires deploying the algorithm model in environment B, but the data distribution in environment B differs from that in environment A. This requires using a set of fitting parameters to map the data in environment B to the data space of environment A, ensuring that the data distribution in environment B remains consistent with that in environment A and adapting the algorithm model. This mapping process is called data fitting.

[0003] In the prior art, simulated annealing algorithms are often used to calculate the aforementioned set of fitting parameters. However, these algorithms can easily become trapped in local extreme points and become unable to escape. This means that the results obtained by these algorithms may not be optimal, and thus, the data fitting effect cannot be guaranteed. Summary of the Invention

[0004] The embodiment of the present invention provides a method for calculating fitting parameters, which can improve the accuracy of the fitting parameters. In addition, the embodiment of the present invention also provides a positioning method, device and program product.

[0005] A method for calculating fitting parameters according to an embodiment of the present invention includes: a parameter initialization step, including: initializing multiple molecules, each molecule consisting of at least fitting parameters and energy values; a simulated annealing step, including: using simulated annealing to iterate the multiple molecules according to test data and an objective function model to calculate final fitting parameters; wherein the test data is collected from a first environment, the objective function model is an algorithm model used in a second environment, and the final fitting parameters are used to fit first data obtained from the first environment to second data in the second environment, so that the algorithm model can achieve a predetermined function based on the second data.

[0006] The test data, the first data and the second data are all RSSI data based on Bluetooth or distance data based on UWB.

[0007] Among them, the first environment is a real environment affected by environmental factors, the second environment is a standard environment not affected by environmental factors, and the algorithm model is a positioning algorithm model.

[0008] The simulated annealing step further includes: when iterating each molecule, when the internal energy of the molecule decreases, or when the internal energy of the molecule increases and is taken over by the next molecule, terminating the iteration of the molecule at the current temperature.

[0009] Wherein, when Δf is less than 0, the internal energy of the molecule is reduced, and Δf is calculated based on the following formula:

[0010] Δf=fm(xf i,j )-op i ;

[0011] xf i,j =fs(m i,j ,x);

[0012] m i,j =fop(m i,j-1 );

[0013] Among them, fop(m) is the update function of the variable, which is used to update the fitting parameters; m i,j is the fitting parameter of the ith molecule in the jth iteration; fs() is the fitting strategy, x is the test data, fm() is the objective function model, op i Represents the energy value of the i-th molecule.

[0014] Wherein, in the step of simulated annealing, further comprising:

[0015] When the internal energy of the molecule decreases, the fitting parameters and energy values ​​corresponding to the molecule are updated;

[0016] Determine whether the energy value corresponding to the molecule is less than a minimum value, where the initial value of the minimum value is randomly obtained in the step of initializing the parameters;

[0017] When the judgment result is yes, the minimum value and the final fitting parameter are updated.

[0018] Wherein, in the step of simulated annealing, further comprising:

[0019] When the internal energy of the molecule increases, the probability of escape of the molecule and the probability of receiving the next molecule are calculated;

[0020] Determining whether the molecule can be received by the next molecule based on the escape probability and the reception probability;

[0021] When it can be received, update the next molecule;

[0022] When it cannot be received, continue to iterate on the molecule until the iteration length exceeds the length of the Markov chain;

[0023] Wherein, the escape probability calculation formula is: po=exp(-Δf / (K1*T k ));

[0024] Wherein, the receiving probability calculation formula is:

[0025] Wherein, Δf= fm(xf i,j )-op i ;

[0026] Wherein, xf i,j = fs(m i,j ,x)

[0027] Wherein, K1 is the Boltzmann constant of escape, K2 is the Boltzmann constant of receiving; T k Is the current temperature; op i Is the energy value of the i th molecule; opm is the minimum value; For preventing the denominator from being 0; m i,j Is the fitting parameter of the i th molecule in the j th iteration; fs() is the fitting strategy, x is the test data, fm() is the target function model, op i Indicates the energy value of the i th molecule.

[0028] A positioning method of an embodiment of the application is used in a positioning device for positioning the position of a signal source, the signal source being capable of sending radio signals, the positioning device being provided with a plurality of radio receivers at different positions for receiving the radio signals and generating first data; the method comprises: obtaining fitting parameters; obtaining the first data; fitting the first data into second data according to the fitting parameters; and determining the position of the smart key according to the second data and a positioning algorithm model; wherein the fitting parameters are obtained by using the method of the embodiment of the application.

[0029] A computer device of an embodiment of the application comprises: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement the method of the embodiment of the application.

[0030] A computer program product of an embodiment of the application comprises: a computer program comprising executable instructions, which, when executed by a processor, implement the method of the embodiment of the application.

[0031] The embodiment of the application has the following beneficial effects:

[0032] In the embodiments of the present invention, by setting up multiple molecules (variables to be iterated) in the simulated annealing algorithm for iteration, if one molecule is stuck in a minimum point and cannot escape, multiple molecules are available to search for minimum points outside, thereby greatly increasing the probability of finding the optimal fitting parameters. Therefore, by improving the simulated annealing algorithm and applying it to the calculation of fitting parameters, the embodiments of the present invention can improve the accuracy of the fitting parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Other details and advantages of the present invention will become apparent from the detailed description provided below. It should be understood that the following drawings are merely illustrative and thus cannot be considered as limiting the present invention. The following detailed description will be given with reference to the accompanying drawings, in which:

[0034] Figure 1 It is a flowchart of the simulated annealing algorithm;

[0035] Figure 2 1 is a flow chart of an embodiment of a method for calculating fitting parameters of the present invention;

[0036] Figure 3 is a flow chart of another embodiment of the method for calculating fitting parameters of the present invention;

[0037] Figure 4 is a flow chart of an embodiment of a positioning method of the present invention; and

[0038] Figure 5 It is a flowchart of an embodiment of a computer device of the present invention. DETAILED DESCRIPTION

[0039] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and more understandable, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.

[0040] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of such features. Moreover, the terms "first", "second", etc. are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0041] In this article, the scheme of how to calculate the fitting parameters and how to locate based on the calculated fitting parameters will be described by taking PEPS (Passive-Entry-Passive-Start, keyless system) as an example. It should be noted that PEPS is only an application example of the present application and should not be construed as a limitation.

[0042] Among them, PEPS function is widely used in high-end vehicles, which mainly refers to that the vehicle can automatically detect whether the driver enters the specified range, and when it is detected, it can automatically realize the function of unlocking the door, etc. When the driver leaves the vehicle, it can automatically realize the locking of the door. The vehicle equipped with PEPS function can make the driver save a lot of cumbersome operation, and is deeply loved by users.

[0043] In order to realize the PEPS function, the vehicle needs to be able to locate the position of the smart key. The positioning can be realized based on Bluetooth technology or UWB (Ultra Wide Band, Ultra Wide Band) technology. For example, Bluetooth positioning can locate the target based on the principle that the Bluetooth signal strength decreases with the increase of distance, while the UWB positioning technology can use UWB to measure the distance and determine the position of the target based on the distance. In PEPS, the smart key (which can be played by a smart device such as a mobile phone) sends a radio signal, such as a Bluetooth or UWB signal. In the vehicle, a plurality of wireless receivers are arranged in advance for receiving Bluetooth signals or UWB signals, which can be distributed on different positions of the vehicle, such as the middle of the vehicle body, the front and rear ends, etc. These wireless receivers generate data for positioning based on the received signals, and transmit them to the central controller or domain controller through the in-vehicle network. Based on these positioning data, such as RSSI (Received Signal Strength Indication, Received Signal Strength Indication) data in Bluetooth or distance data in UWB, the controller can realize the positioning of the smart key.

[0044] However, the radio signal is easily affected by the environment and the transmitting source, thereby affecting the positioning accuracy. For example, in the Bluetooth-based positioning technology, the strength of the Bluetooth signal is easily affected by the environment, for example, the Bluetooth signal strength at the same position will change with the change of the environment, which makes the positioning algorithm model unable to accurately obtain the object position according to the Bluetooth signal strength, and there is a certain error.

[0045] To improve the accuracy of positioning, one way is to map the data in the actual environment to the standard environment, thereby reducing the interference of environmental factors. The process of this mapping is data fitting, that is, fitting the data in the actual environment to the data in the standard environment. In this process, a set of fitting parameters is needed. Therefore, the pros and cons of the fitting parameters are directly related to the final positioning accuracy.

[0046] For example, assume that a set of Bluetooth data in the actual environment is x, and the elements are x i , which needs to be fitted to the standard environment, that is, fitted to another set of Bluetooth data xt. We assume that the fitting parameter is m, and the elements are represented by m j , and the fitting result is xb, then xb=(m0x0+m1,m2x1+m3,m4x2+m5,...). Assume that the positioning algorithm model is fm(x), which is used to output the position information of the target. Therefore, we want to find a set of fitting parameters that can minimize the difference between the results of fm(xb) and fm(xt), so that we can accurately measure the position information of the target through the data in the actual environment.

[0047] Various ways can be used to find the fitting parameters described above, such as brute force search, simple greedy, simulated annealing, etc. Taking the simulated annealing method as an example, the simulated annealing method is a random optimization algorithm that uses the idea of object annealing. That is, at a high temperature, the molecules of the object will be disordered and will wander everywhere. When the temperature decreases, the stability of the molecules increases slowly, and the energy of the entire object also tends to be minimal. In addition, the search process of the simulated annealing algorithm uses the Metropolis criterion, that is, to accept a solution that is worse than the current solution with a certain probability, so it is possible to jump out of the local optimal solution and find the global optimal solution. However, the simulated annealing algorithm is prone to local extreme points and cannot jump out, so the fitting parameters calculated by the simulated annealing algorithm may not be accurate enough. In addition, the simulated annealing algorithm also has the problem of long time consumption. The following describes a specific implementation of the simulated annealing algorithm in conjunction with Figure 1 .

[0048] As shown in Figure 1 , it is a flowchart of the principle of the simulated annealing algorithm, which includes:

[0049] Step 101: Setting parameters. Set the initial temperature T0 and the termination temperature T e ; set the initial state of the variable x0; set the length L of the Markov chain, that is, the number of iterations at each temperature; set the Boltzmann constant K; set the update function fop(x) of the variable; set the target function fm(x); set the temperature decay strategy fde(T); set the initial optimal solution xb, which can be randomly generated; set K=0.

[0050] Step 102: Determine the current temperature T k Is the initial temperature T0 less than the final temperature T? e When the judgment result is no, execute step 103; otherwise, execute step 115.

[0051] Step 103: Set i = 1, j = 0. Here, i is the subscript of variable x, and the initial value of variable x is x0. j is used to control the number of iterations.

[0052] Step 104: Determine whether j is less than the length L of the Markov chain. If yes, execute step 105; otherwise, execute step 114.

[0053] Step 105: Update the variable x using the variable update function i =fop(x i-1 ).

[0054] Step 106: Calculate the increment of the objective function Δf=fm(x i )-fm(x i-1 ).

[0055] Step 107: Determine whether Δf is greater than 0. If yes, go to step 110. Otherwise, go to step 108.

[0056] Step 108: Calculate the probability p = exp(-Δf / (K*T k )).

[0057] Step 109: Determine whether the probability p1 is less than the probability p. If the result is yes, proceed to step 110. The probability p1 is a randomly initialized value. As can be seen from step 109, the larger the value of p, the more likely it is to be greater than p1. Therefore, there is a certain probability that step 109 will turn to step 110. Even in the case where Δf is less than 0, there is still a certain concept of receiving x. i is the new solution. If the judgment result is no, execute step 113, i.e. do not accept x i For a new solution.

[0058] Step 110, accept x i is a new solution, so-called accepting x i is a new solution, which may refer to using x in step 111. i To calculate the value of the objective function fm(x i ).

[0059] Step 111, determine fm(x i ) is less than fm(xb). If the judgment result is yes, execute step 112. Otherwise, execute step 113.

[0060] Step 112: update the optimal solution xb=x i .

[0061] Step 113: let i=i+1, j=j+1, and execute step 104.

[0062] Step 114: let k=k+1, and reduce the temperature T k =fde(T k-1 ), and execute step 102.

[0063] Step 105: output the optimal solution xb.

[0064] In Figure 1 , the iteration variable is only one group, and at each iteration, the algorithm can only jump out of the minimum point with a probability p. If the method enters the neighborhood of a minimum point with a very small probability p, it is difficult to jump out again. Therefore, Figure 1 the flow of the method is difficult to guarantee that the output optimal solution is the real global optimal solution. In addition, in the flow of Figure 1 , in order to more easily find the minimum value point, the initial temperature is generally set to be relatively large, and the length of the Markov sequence is set to be relatively long, thereby resulting in a large time overhead of the algorithm.

[0065] Therefore, Figure 1 the embodiment of the method exists the necessity of improvement. For this purpose, the embodiment of the present application proposes a method for calculating fitting parameters based on a simulated annealing algorithm, which improves the accuracy of the fitting parameters by improving the simulated annealing algorithm and applying it to the calculation of the fitting parameters. Specifically, the embodiment of the present application solves the problem that the simulated annealing algorithm is easy to fall into the extreme point and difficult to jump out by setting multiple molecules, i.e. multiple groups of variables. In addition, by introducing and designing the form of escape probability and acceptance probability, the molecules are more likely to reach the neighborhood of the minimum value and not easy to jump out. In addition, by improving the interrupt strategy, the time overhead is reduced. Thus, the embodiment of the present application can calculate more accurate fitting parameters in a shorter time.

[0066] As shown in Figure 2 , it is a flowchart of an embodiment of the method for calculating fitting parameters of the present application, comprising:

[0067] Step 201: initialization parameter step, comprising: initializing multiple molecules, each molecule being composed of at least fitting parameters and energy values.

[0068] Step 202: simulated annealing step, comprising: using simulated annealing, according to the test data and the target function model, iterating the multiple molecules to calculate the final fitting parameters.

[0069] Wherein, the test data is collected from a first environment (e.g., an actual environment), the objective function model (e.g., a positioning model) is an algorithm model used in a second environment (e.g., a standard environment, i.e., without considering environmental factors), and the final fitting parameter is used to fit the first data obtained from the first environment into second data in the second environment, so that the algorithm model can realize a predetermined function based on the second data.

[0070] The embodiment introduces multiple molecules, so that if one molecule falls into a minimum value point from which it cannot jump out, multiple molecules can search for the minimum value point outside, so that the probability of finding the minimum value is greatly increased, thereby improving the accuracy of the finally calculated fitting parameter.

[0071] For the convenience of understanding, the following will be combined with Figure 3 The process of calculating the fitting parameter of the embodiment of the application is described.

[0072] As Figure 3 shown, it is a flowchart of an embodiment of the method for calculating the fitting parameter of the application, which comprises:

[0073] Step 301: setting the parameter value, comprising: setting the initial temperature T0 and the termination temperature Te; setting the length L of the Markov chain, i.e., the iteration number; setting the escape Boltzmann constant K1; setting the received Boltzmann constant as K2; setting the update function fop(m) for updating the fitting parameter; setting the temperature decay strategy fde(T); the initial optimal parameter mb and the initial minimum value opm can be randomly generated; setting the number of molecules N, which can be usually set to 10-20; setting the molecular vector with a length of N, each molecule being a group of fitting parameters, and the element being represented by m i ; the molecular vector can be randomly initialized; setting the energy vector with a length of N, which corresponds to the energy value of each molecule, i.e., the output value of the algorithm model (i.e., the objective function model) under the action of each molecule, and the element being represented by op i ; the energy vector is initialized to a value greater than the initial minimum value. Set k=0.

[0074] Step 302: judging whether the current temperature T k is less than the termination temperature Te, if yes, executing step 318, if not, executing step 303.

[0075] Step 303: initializing i=0.

[0076] Step 304: judging whether i is less than N, if yes, executing step 305, if not, executing step 317.

[0077] Step 305: setting m i,0 = m i, and set j = 1. Where j is used to control the number of iterations. m i,j represents the i-th molecule in the j-th iteration.

[0078] Step 306: Determine whether j is less than L. If so, execute step 307. Otherwise, execute step 315.

[0079] Step 307: Update the fitting parameter m i,j =fop(m i,j-1 ). Calculate the new fitting result as xf i,j =fs(m i,j ,x), fs() represents the fitting strategy. Calculate the objective function increment Δf=fm(xf i,j )-op i Where x is the test data, such as a set of Bluetooth data, which can be collected from the actual environment. fm() is the algorithm model actually used, such as the positioning algorithm model.

[0080] Step 308: Determine whether Δf is less than 0. If it is less than 0, it indicates that the molecular internal energy has decreased, and then execute step 309 to accept the decrease in the molecular internal energy. If it is greater than 0, it indicates that the molecular internal energy has increased, and then execute step 312.

[0081] Step 309: Let m in the numerator vector i =m i,j , the energy vector op i =fm(xf i,j ).

[0082] Step 310: Determine op i Is it less than opm? If so, execute step 311; otherwise, execute step 315.

[0083] Step 311: Update the optimal solution: opm=op i ,mb=m i Then execute step 315.

[0084] Step 312: Calculate the escape probability po = exp(-Δf / (K1*T k )) and the probability of receiving in, A very small value is used to prevent the denominator from becoming zero.

[0085] Step 313: Determine whether the random probability p is less than po*pr. If so, proceed to step 314 to have the next molecule receive the escaped molecule. If not, proceed to step 316.

[0086] Step 314: Let m i+1 =m i,jAnd op i+1 =fm(xf i,j ). Then execute step 315.

[0087] In step 315 , increment i by 1 and execute step 304 .

[0088] In step 316 , add 1 to j and execute step 306 .

[0089] Step 317: Set k=k+1 and reduce the temperature T k =fde(T k-1 ), then execute step 302.

[0090] Step 318: Output the results, such as the minimum point mb and the minimum value opm. In some embodiments, the minimum value opm may not be output, but only mb. The output opm can be used to compare the quality of each set of fitting parameters.

[0091] In this embodiment, once the internal energy of a molecule is close to the lowest energy state, it is difficult for it to be disturbed by other molecules. Therefore, the molecule will continue to iterate in its own neighborhood. However, once a molecule with lower internal energy escapes from the surrounding area, the reception probability of the molecule will become 1 again. For example, from the formula of reception probability, it can be seen that when the internal energy of a molecule is close to the lowest state, then op i+1 The difference between and opm will be very small, then the probability of receiving will be close to 0, and the molecule will be less likely to receive other molecules. i <op i+1 , then the numerator of the reception probability is positive, the denominator is positive, and the entire fraction is positive. The exponential function value will be greater than 1, that is, the reception probability becomes 1. Therefore, the numerator of this embodiment is more likely to reach the neighborhood of the minimum value, and once it reaches the neighborhood of the minimum point, it is difficult to escape from that neighborhood. Therefore, the numerator has a greater probability of ultimately finding the minimum value and iterating in the neighborhood of the minimum value.

[0092] Furthermore, the algorithm stops the Markov chain loop once a molecule finds a lower energy state or an escaping molecule is absorbed. Therefore, even if the Markov chain can be set to a relatively long length, the time overhead is not excessive. This strategy can significantly reduce the time overhead for complex models with numerous extreme points, which require a longer Markov chain.

[0093] like Figure 4, is a flow chart of an embodiment of the positioning method of the present invention, which uses the fitting parameters calculated previously. This positioning method is mainly used in vehicles to locate the position of the smart key. In this positioning method, the smart key can send radio signals as a signal source, and multiple radio receivers are set at different positions in the vehicle to receive the radio signals sent by the smart key and generate first data, such as Bluetooth-based RSSI data or UWB distance data. The method includes: Step 401: Obtain fitting parameters. Step 402: Obtain first data. Step 403: Fit the first data to second data according to the fitting parameters. Step 404: Determine the position of the smart key based on the second data and a preset positioning algorithm model.

[0094] like Figure 5 FIG2 is a schematic diagram of a computer device according to an embodiment of the present invention. The computer device 5 includes a processor 50 and a memory 52 for storing executable instructions of the processor. The processor 50 is configured to execute the executable instructions to implement the method according to the embodiment of the present invention.

[0095] In addition, an embodiment of the present invention further provides a computer program product, including: a computer program, wherein the computer program includes executable instructions, and when the executable instructions are executed by a processor, the method according to the embodiment of the present invention is implemented.

[0096] The description of the above program product and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0097] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.

[0098] The computer storage medium / memory can be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Ferromagnetic Random Access Memory (FRAM), a Flash Memory, a magnetic surface storage, an optical disc, a Compact Disc Read-Only Memory (CD-ROM), or the like memory; or can be various terminals including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, and the like.

[0099] It should be noted that the above description is merely examples, rather than limiting the present application. In other embodiments of the present application, the method can have more, less or different steps, and the order, inclusion and function of the steps can be different from the described and illustrated. For example, usually a plurality of steps can be combined into a single step, and a single step can also be split into a plurality of steps. For those skilled in the art, the order of the steps can be changed without creative labor, which is within the protection scope of the present application.

[0100] The technical solutions of the present application, or the essence of the technical solutions or the whole or part of the technical solutions that make contributions to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor or a microcontroller to execute all or part of the steps of the method described in the various embodiments of the present application.

[0101] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program, when executed, performs steps including the above-mentioned method embodiments.

[0102] Although the present invention has been disclosed above with reference to preferred embodiments, the present invention is not limited thereto. Any changes and modifications made by those skilled in the art without departing from the spirit and scope of the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope defined by the claims.

Claims

1. A method for calculating fitting parameters, characterized in that, include: The step of initializing parameters includes: initializing a plurality of molecules, wherein each molecule is a variable to be iterated, and each molecule is composed of at least a fitting parameter and an energy value; The simulated annealing step includes: iterating the plurality of molecules according to the test data and the objective function model in a simulated annealing manner to calculate final fitting parameters, wherein when a molecule falls into a minimum point from which it cannot escape, other molecules search for minimum points outside the minimum point; The test data is collected from a first environment, the objective function model is an algorithm model used in a second environment, and the final fitting parameters are used to fit the first data obtained from the first environment to the second data in the second environment, so that the algorithm model can achieve a predetermined function based on the second data; Wherein, in the step of simulated annealing, further comprising: When iterating for each molecule, when the internal energy of the molecule decreases, the iteration of the molecule at the current temperature is terminated; or, when the internal energy of the molecule increases and is taken over by the next molecule, the iteration of the molecule at the current temperature is terminated; When the internal energy of the molecule decreases, the fitting parameters and energy values ​​corresponding to the molecule are updated; Determine whether the energy value corresponding to the molecule is less than the minimum value; When the judgment result is yes, updating the minimum value and the final fitting parameter; The test data, the first data and the second data are all RSSI data based on Bluetooth or distance data based on UWB.

2. The method for calculating fitting parameters according to claim 1, wherein: The first environment is a real environment affected by environmental factors, the second environment is a standard environment not affected by environmental factors, and the algorithm model is a positioning algorithm model.

3. The method for calculating fitting parameters according to claim 1, wherein: When Δf is less than 0, the internal energy of the molecule is reduced, and Δf is calculated based on the following formula: Δf=fm(xf i,j )-op i ; xf i,j =fs(m i,j ,x); m i,j =fop(m i,j-1 ); Among them, fop(m) is the update function of the variable, which is used to update the fitting parameters; m i,j is the fitting parameter of the ith molecule in the jth iteration; fs() is the fitting strategy, x is the test data, fm() is the objective function model, op i Represents the energy value of the i-th molecule.

4. The method for calculating fitting parameters according to claim 1, wherein: The initial value of the minimum value is randomly obtained in the step of initializing the parameters.

5. The method for calculating fitting parameters according to claim 1, wherein: In the simulated annealing step, further comprising: When the internal energy of the molecule increases, the probability of escape of the molecule and the probability of receiving the next molecule are calculated; Determining whether the molecule can be received by the next molecule based on the escape probability and the reception probability; When it can be received, update the next molecule; When it cannot be accepted, the iteration is continued on the molecule until the iteration length exceeds the length of the Markov chain.

6. The method for calculating fitting parameters according to claim 5, wherein: in, The calculation formula of the escape probability is: po = exp(-Δf / (K1*T k )); The calculation formula for the reception probability is: Where, Δf=fm(xf i,j )-op i ; Among them, xf i,j =fs(m i,j ,x) Where K1 is the escape Boltzmann constant, K2 is the receiving Boltzmann constant; T k is the current temperature; op i is the energy value of the i-th molecule; opm is the minimum value; Used to prevent the denominator from being 0; m i,j is the fitting parameter of the ith molecule in the jth iteration; fs() is the fitting strategy, x is the test data, fm() is the objective function model, op i Represents the energy value of the i-th molecule.

7. A positioning method, used in a positioning device, for locating the position of a signal source, wherein the signal source is capable of transmitting radio signals, and the positioning device is provided with a plurality of radio receivers at different positions for receiving the radio signals and generating first data; characterized in that: The method comprises: Get fitting parameters; obtaining the first data; fitting the first data into second data according to the fitting parameters; and determining the position of the signal source according to the second data and a positioning algorithm model; The fitting parameters are calculated using the method according to any one of claims 1 to 6.

8. A computer device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the executable instructions to implement the method according to any one of claims 1 to 6.

9. A computer program product comprising: A computer program comprising executable instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Fusion positioning method based on multi-base buoy array improved simulated annealing

    CN114578287A

  • Annealing type particle swarm method related to nonlinear inversion

    CN115169229A