Inter-building combined positioning method and device
By using the multi-head sparse probability self-attention mechanism and the position prediction model of distillation operation on the logistics robot, combined with the weighted fusion technology, the problem of low positioning accuracy of the logistics robot is solved, and higher navigation accuracy and performance are achieved.
Patent Information
- Application Number
- CN202411519795.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2024-11-26
AI Technical Summary
The existing logistics robot positioning technology has the problem of low positioning accuracy, especially in long-distance navigation and long-term operation, the accumulated error is relatively significant, and the initial calibration is difficult.
Using machine learning-based combined positioning method between buildings, the motion data is obtained through sensors installed on the logistics robot, and the position prediction model is input to predict the current position of the logistics robot, and the position prediction model of multi-head sparse probability self-attention mechanism and distillation operation is used. , combined with weighted fusion technology, improve positioning accuracy.
It effectively avoids the problem of low positioning accuracy caused by sensor errors, is suitable for long-distance and long-term logistics distribution tasks, and improves the navigation accuracy and performance of logistics robots.
Smart Images

Figure CN119022922A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular to a method and device for combined positioning between buildings. Background Art
[0002] With the development of computer and Internet technology, more and more offline businesses in users' daily life can be realized through the Internet, such as shopping. With the increasing frequency of residents' online shopping activities, traditional manual delivery can no longer meet the logistics and distribution needs, and logistics and distribution have encountered unprecedented challenges.
[0003] At present, in order to solve the problem of manual delivery, a solution to achieve logistics delivery through logistics robots has been proposed. Specifically, the logistics robot has built-in sensors such as accelerometers, gyroscopes and magnetometers to obtain its own acceleration, angular velocity and direction data, and estimates the robot's posture change relative to the starting position by deducing and fusing these data, and realizes positioning and navigation.
[0004] However, the existing technology has the problem of low positioning accuracy. Summary of the invention
[0005] The present application provides a combined positioning method and device between buildings to solve the problem of low positioning accuracy in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a combined positioning method between buildings, including: When the logistics robot performs logistics distribution, the motion data of the logistics robot is obtained through sensors installed on the logistics robot; Input the motion data and the starting position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; Based on the predicted position, the current position of the logistics robot is determined.
[0007] In a possible design, determining the current position of the logistics robot according to the predicted position includes: Determining a measurement position of the logistics robot according to the motion data and the starting position of the logistics robot; The current position of the logistics robot is determined according to the predicted position and the measured position.
[0008] In a possible design, determining the current position of the logistics robot according to the predicted position and the measured position includes: If the distance difference between the measured position and the predicted position is greater than a preset distance, the predicted position is determined as the current position of the logistics robot; If the distance difference between the measured position and the predicted position is less than or equal to a preset distance, an intermediate position between the measured position and the predicted position is determined as the current position of the logistics robot.
[0009] In a possible design, determining the current position of the logistics robot according to the predicted position and the measured position includes: The measured position and the predicted position are weightedly fused according to a first weight and a second weight, and a calculation result of the weighted fusion is determined as the current position of the logistics robot, wherein the first weight is a weight value pre-set for the measured position, and the second weight is a weight value pre-set for the predicted position.
[0010] In one possible design, the motion data includes acceleration, angular velocity and direction collected at each collection moment; Correspondingly, obtaining the motion data of the logistics robot through the sensor installed on the logistics robot includes: The motion data of the logistics robot is obtained by installing an accelerometer, a gyroscope and a magnetometer on the logistics robot.
[0011] In a possible design, before the logistics robot performs logistics distribution, the method further includes: Acquire a training set, wherein the training set includes driving data of multiple sample logistics robots, wherein the driving data includes a sample starting position of the sample logistics robot, sample motion data of the sample logistics robot during driving, and a sample position determined by GPS; Based on the training set, model training is performed on the initial model to obtain a location prediction model; Among them, the initial model includes an encoder and a decoder, the encoder is composed of a first input layer, a position encoding layer and an encoder layer stack, and the encoder layer adopts a multi-head sparse probabilistic self-attention mechanism and a distillation operation; the decoder is composed of a second input layer, a decoder layer and an output layer stack, and the decoder layer adopts the multi-head sparse probabilistic self-attention mechanism and a multi-head attention mechanism.
[0012] In a possible design, after determining the current position of the logistics robot according to the predicted position, the method further includes: The position prediction model is updated according to the motion data of the logistics robot, the starting position and the current position to obtain an updated position prediction model.
[0013] In a possible design, inputting the motion data and the starting position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model includes: Input the motion data, the starting position, the travel distance and the environmental information of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; Correspondingly, the driving data of the sample logistics robot also includes the sample driving distance and sample environment information of the sample logistics robot during the driving process.
[0014] In one possible design, the method further includes: The logistics robot is navigated according to the current position of the logistics robot and the pre-planned path.
[0015] In a second aspect, an embodiment of the present application provides a combined positioning device between buildings, including: An acquisition module, used to acquire motion data of the logistics robot through sensors installed on the logistics robot when the logistics robot performs logistics distribution; An input module, used to input the motion data and the starting position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; A determination module is used to determine the current position of the logistics robot based on the predicted position.
[0016] In a possible design, the determining module is specifically used to: Determining a measurement position of the logistics robot according to the motion data and the starting position of the logistics robot; The current position of the logistics robot is determined according to the predicted position and the measured position.
[0017] In a possible design, the determining module is specifically used to: If the distance difference between the measured position and the predicted position is greater than a preset distance, the predicted position is determined as the current position of the logistics robot; If the distance difference between the measured position and the predicted position is less than or equal to a preset distance, an intermediate position between the measured position and the predicted position is determined as the current position of the logistics robot.
[0018] In a possible design, the determining module is specifically used to: The measured position and the predicted position are weightedly fused according to a first weight and a second weight, and a calculation result of the weighted fusion is determined as the current position of the logistics robot, wherein the first weight is a weight value pre-set for the measured position, and the second weight is a weight value pre-set for the predicted position.
[0019] In one possible design, the motion data includes acceleration, angular velocity and direction collected at each collection moment; Accordingly, the acquisition module is specifically used for: The motion data of the logistics robot is obtained by installing an accelerometer, a gyroscope and a magnetometer on the logistics robot.
[0020] In a possible design, before the logistics robot performs logistics distribution, the inter-building combined positioning device further includes: The acquisition module is further used to acquire a training set, wherein the training set includes driving data of multiple sample logistics robots, wherein the driving data includes a sample starting position of the sample logistics robot, sample motion data of the sample logistics robot during driving, and a sample position determined by a global positioning system (GPS); A training module, used to perform model training on the initial model based on the training set to obtain a location prediction model; Among them, the initial model includes an encoder and a decoder, the encoder is composed of a first input layer, a position encoding layer and an encoder layer stack, and the encoder layer adopts a multi-head sparse probabilistic self-attention mechanism and a distillation operation; the decoder is composed of a second input layer, a decoder layer and an output layer stack, and the decoder layer adopts the multi-head sparse probabilistic self-attention mechanism and a multi-head attention mechanism.
[0021] In a possible design, after determining the current position of the logistics robot according to the predicted position, the inter-building combined positioning device further includes: An updating module is used to update the position prediction model according to the motion data of the logistics robot, the starting position and the current position, and obtain an updated position prediction model.
[0022] In a possible design, the input module is specifically used for: Input the motion data, the starting position, the travel distance and the environmental information of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; Correspondingly, the driving data of the sample logistics robot also includes the sample driving distance and sample environment information of the sample logistics robot during the driving process.
[0023] In a possible design, the inter-building combined positioning device also includes a navigation module for navigating the logistics robot according to the current position of the logistics robot and a pre-planned path.
[0024] The embodiment of the present application provides a combined inter-building positioning method and device. In this method, when the logistics robot performs logistics distribution, the motion data of the logistics robot is obtained through the sensor installed on the logistics robot, the motion data and the starting position of the logistics robot are input into the position prediction model, the predicted position output by the position prediction model is obtained, and the current position of the logistics robot is determined according to the predicted position. In this technical solution, when the logistics robot performs logistics distribution, the starting position and motion data of the logistics robot are processed by the position prediction model to predict the predicted position of the logistics robot, so that the current position of the logistics robot is determined according to the predicted position, which can effectively avoid the problem of positioning accuracy caused by the error of the sensor. At the same time, because the position prediction model is suitable for processing longer time series, it can help the logistics robot to perform long-distance positioning and navigation, thereby improving the performance of the logistics robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0026] Figure 1 A schematic diagram of a flow chart of a first embodiment of a combined positioning method between buildings provided in an embodiment of the present application; Figure 2 A schematic diagram of a flow chart of a second embodiment of a combined positioning method between buildings provided in an embodiment of the present application; Figure 3 A flowchart of Embodiment 3 of the combined positioning method between buildings provided in the embodiment of the present application; Figure 4 A schematic diagram of the structure of the initial model provided in the embodiment of the present application; Figure 5 A schematic diagram of the training process of the initial model provided in the embodiment of the present application; Figure 6 A schematic diagram of the structure of the combined positioning device between buildings provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0027] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] Before introducing the embodiments of the present application, the application background of the embodiments of the present application is first explained: Traditional logistics distribution methods usually involve manually driving fuel vehicles or takeaway trucks to deliver goods to their destinations. However, this method of logistics distribution between buildings consumes a lot of labor and is also inefficient.
[0030] In order to solve this problem, existing technologies have proposed a solution to replace manual delivery with logistics robots. Specifically, logistics robots have built-in sensors such as accelerometers, gyroscopes, and magnetometers to obtain their own acceleration, angular velocity, and direction data. By deriving and fusing these data, the robot's posture change relative to the starting position is estimated, and positioning and navigation are achieved.
[0031] However, the above solution has the following problems: 1. Accumulated error: The inertial navigation system uses sensors to measure the robot's acceleration, angular velocity, direction and other information to deduce the motion trajectory, but these sensors have certain accuracy errors, and the errors will continue to accumulate over time. After long-term operation, the accumulated errors may cause a large gap between the position determined by the sensor data and the actual position of the logistics robot.
[0032] 2. Initial calibration difficulties: The inertial navigation system requires accurate initial calibration to ensure the correct starting attitude and position. However, as the running time increases and the environment changes, the error during sensor initialization may cause calibration difficulties, thus affecting the positioning accuracy.
[0033] 3. Not suitable for long-distance navigation: Inertial navigation systems are suitable for relatively short-distance navigation tasks, but for long-distance navigation or long-term operation, the cumulative error will be more significant. Therefore, in long-distance navigation scenarios, inertial navigation systems may perform poorly.
[0034] In summary, the existing method of achieving logistics distribution through logistics robots has the problem of low positioning accuracy.
[0035] In order to solve the above-mentioned technical problems, the present application provides a combined inter-building positioning method and device, which can predict the position of a logistics robot based on motion data collected by sensors installed on the logistics robot through machine learning, thereby avoiding the problem of low accuracy of position determination due to sensor errors.
[0036] The technical solution of the present application is described in detail below through specific embodiments.
[0037] It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0038] Figure 1 This is a flow chart of the first embodiment of the combined positioning method between buildings provided in the present application. Figure 1 As shown, the combined positioning method between buildings can be implemented by the following steps: S11. When the logistics robot is performing logistics distribution, the movement data of the logistics robot is obtained through the sensors installed on the logistics robot.
[0039] The execution subject of the embodiment of the present application is an electronic device, which can be a terminal device, such as a laptop, a mobile phone, a desktop computer, etc., or a server. In practical applications, the electronic device is specifically a terminal device or a server, which can be determined according to actual conditions and is not specifically limited.
[0040] Among them, motion data includes: acceleration, angular velocity and direction.
[0041] In a possible implementation, the motion data of the logistics robot is obtained by installing an accelerometer, a gyroscope, and a magnetometer on the logistics robot.
[0042] S12. Input the motion data and the starting position of the logistics robot into the position prediction model to obtain the predicted position output by the position prediction model.
[0043] Among them, the starting position of the logistics robot is the position of the logistics robot at the starting point.
[0044] Among them, the position prediction model is obtained by pre-training the initial model. The position prediction model adopts a sparse probabilistic self-attention mechanism. By screening out the most important query vectors, it achieves the purpose of reducing time complexity and memory usage to 0, greatly reducing the network size; it also adopts a self-attention distillation operation (referred to as distillation operation) to reduce the dimension and network parameters through regular convolution and pooling operations; a generative decoder is also proposed, which can generate all prediction sequences in one step, avoiding the error accumulation caused by step-by-step prediction, shortening the prediction time, and making it suitable for processing longer time series.
[0045] It should be understood that the specific process of training the initial model and then generating the location prediction model will be described in Figure 3 The details are described in detail in the embodiment shown and will not be repeated here.
[0046] Optionally, the motion data, the starting position of the logistics robot, the driving distance and the environmental information may be input into the position prediction model to obtain the predicted position output by the position prediction model.
[0047] Among them, the driving distance can be obtained through the wheel speed sensor of the logistics robot, and the environmental information can be obtained through the visual sensor of the logistics robot.
[0048] The environmental information includes weather conditions, such as whether it is raining or snowing, and road conditions, such as whether the road surface is slippery, whether there is construction, etc.
[0049] S13. Determine the current position of the logistics robot based on the predicted position.
[0050] In one possible implementation, the predicted position may be directly determined as the current position of the logistics robot.
[0051] In another possible implementation, the measured position of the logistics robot may be determined based on the motion data of the logistics robot, and the current position of the logistics robot may be determined by combining the measured position and the predicted position.
[0052] It should be understood that the implementation principles and steps of this method will be Figure 2 The detailed description is given in the illustrated embodiment and will not be repeated here.
[0053] The combined inter-building positioning method provided in the embodiment of the present application, when the logistics robot performs logistics distribution, obtains the motion data of the logistics robot through the sensor installed on the logistics robot, inputs the motion data and the starting position of the logistics robot into the position prediction model, obtains the predicted position output by the position prediction model, and determines the current position of the logistics robot according to the predicted position. In this technical solution, when the logistics robot performs logistics distribution, the starting position and motion data of the logistics robot are processed by the position prediction model, thereby predicting the predicted position of the logistics robot, so that the current position of the logistics robot is determined according to the predicted position, which can effectively avoid the problem of positioning accuracy caused by the error of the sensor. At the same time, because the position prediction model is suitable for processing longer time series, it can help the logistics robot to perform long-distance positioning and navigation, thereby improving the performance of the logistics robot.
[0054] Next, through Figure 2 The illustrated embodiment describes the implementation process and principle of S13 in detail.
[0055] Figure 2 This is a flow chart of Embodiment 2 of the combined positioning method between buildings provided in the present application. Figure 2 As shown, S13 can be implemented by the following steps: S21. Determine the measurement position of the logistics robot according to the motion data and the starting position of the logistics robot.
[0056] In one possible implementation, the motion data may be calibrated, and then a filtering algorithm, such as a Kalman filter or an extended Kalman filter, may be used to smooth and estimate the calibrated motion data to obtain processed motion data. Then, pose estimation and tracking are performed based on the processed motion data. Finally, the measured position of the logistics robot is determined based on the estimated pose change and the initial pose.
[0057] S22. Determine the current position of the logistics robot based on the predicted position and the measured position.
[0058] In one possible implementation, if the distance difference between the measured position and the predicted position is greater than a preset distance, the predicted position is determined as the current position of the logistics robot. If the distance difference between the measured position and the predicted position is less than or equal to the preset distance, the middle position between the measured position and the predicted position is determined as the current position of the logistics robot.
[0059] In this implementation, if the distance difference between the measured position and the predicted position is greater than the preset distance, it means that the error of the data collected by the sensor is large, that is, the accuracy of the determined measured position is low. Therefore, the predicted position should be taken as the standard at this time, that is, the predicted position is determined as the current position of the logistics robot. If the distance difference between the measured position and the predicted position is less than or equal to the preset distance, it means that the difference between the measured distance and the predicted distance is not large, so the two can be fused, and the middle position of the two can be determined as the current position, which improves the accuracy of position determination.
[0060] In another possible implementation, the measured position and the predicted position are weightedly fused according to the first weight and the second weight, and the calculation result of the weighted fusion is determined as the current position of the logistics robot.
[0061] The first weight is a weight value pre-set for the measured position, and the second weight is a weight value pre-set for the predicted position.
[0062] Specifically, the current position of the logistics robot can be calculated by the following formula: ; Among them, P is the current position of the logistics robot, A is the first weight, B is the second weight, To measure the position, For the predicted location.
[0063] In the above method, by weighting the positions calculated by the two methods (measured position and predicted position), a final position (current position) that takes into account the advantages and disadvantages of different methods is obtained, which can effectively improve the accuracy and stability of positioning.
[0064] Optionally, in some embodiments, the position prediction model may also be updated according to the motion data, starting position and current position of the logistics robot to obtain an updated position prediction model.
[0065] Optionally, the position prediction model may be updated according to the motion data, starting position, driving distance, environmental information and current position of the logistics robot to obtain an updated position prediction model.
[0066] In this embodiment, the location prediction model is updated while being used, so that the updated location prediction model can be used for location prediction subsequently, which greatly improves the accuracy of the prediction results, shortens the time for training the initial model in the early stage, and effectively saves training costs.
[0067] Optionally, in some embodiments, the logistics robot can also be navigated according to the current position of the logistics robot and a pre-planned path.
[0068] In actual applications, before the logistics robot performs logistics distribution, it is necessary to pre-plan the travel path of the logistics robot according to the destination and starting point of the goods distribution. After determining the current position of the logistics robot, the path to be traveled in the path can be determined in combination with the pre-planned path, and then the logistics robot can be navigated and controlled to continue traveling along the path to be traveled. Since the accuracy of the current position of the logistics robot is high, navigating the logistics robot based on the current position can effectively improve the accuracy of navigation.
[0069] Based on the method of any of the above embodiments, the process of generating a location prediction model through model training is explained in detail below.
[0070] Figure 3 This is a flow chart of Embodiment 3 of the combined positioning method between buildings provided in the present application. Figure 3 As shown, the inter-building combined positioning method may include the following steps: S31. Obtain a training set.
[0071] The training set includes driving data of multiple sample logistics robots, and the driving data includes sample starting positions of the sample logistics robots, sample motion data of the sample logistics robots during driving, and sample positions determined by the Global Positioning System (GPS).
[0072] Optionally, the driving data also includes sample driving distance and sample environmental information of the sample logistics robot during driving.
[0073] In practical applications, GPS, accelerometer, gyroscope and magnetometer can be pre-installed on the sample logistics robot. The sample position of the sample logistics robot is determined by GPS, and the sample motion data of the sample logistics robot is jointly determined by the accelerometer, gyroscope and magnetometer. The sample logistics robot can be placed in an area with a strong GPS signal to ensure the accuracy of the acquired sample position, control the movement of the sample logistics robot, and collect the driving data of the sample logistics robot in real time during the driving process.
[0074] Optionally, wheel speed sensors and visual sensors can be pre-installed on the sample logistics robot, and the sample travel distance and sample environment information can be collected in real time during driving.
[0075] S32. Based on the training set, perform model training on the initial model to obtain a location prediction model.
[0076] Since the sample position of the sample logistics robot determined by GPS has high accuracy, the sample position can be used as the target value, and the sample starting posture and sample motion data of each sample logistics robot can be used as input to train the initial model and obtain the position prediction model.
[0077] Optionally, since the driving distance is also a key factor in determining the current position of the logistics robot, the sample driving distance can be used as an input to participate in the model training, thereby improving the accuracy of the location prediction model.
[0078] Optionally, since the environment in which the logistics robot is located also affects the driving of the logistics robot, for example, when the ground is slippery, the driving distance and sample environmental information of the logistics robot per unit time under the same acceleration are different, and thus the driving location is also different. Therefore, the sample environmental information can also be used as input to participate in the model training, thereby improving the accuracy of the position prediction model.
[0079] The initial model includes an encoder and a decoder. The encoder consists of a stack of the first input layer, a position encoding layer, and an encoder layer. The encoder layer uses a multi-head sparse probabilistic self-attention mechanism and a distillation operation. The decoder consists of a stack of the second input layer, a decoder layer, and an output layer. The decoder layer uses a multi-head sparse probabilistic self-attention mechanism and a multi-head attention mechanism.
[0080] Next, through Figure 4 The illustrated embodiment explains the structure of the initial model.
[0081] Figure 4 This is a schematic diagram of the structure of the initial model provided in the embodiment of the present application. Figure 4 As shown in the figure, the initial model is built on the basis of the Informer model, including the encoder / decoder. The encoder and decoder are explained separately below. Encoder
[0082] First, in the first input layer, the input vector of the sensor data stream The input time series data is mapped into a dimension of It is very important for the initial model to adopt the multi-head attention mechanism. of The vector is positionally encoded using sine-cosine position encoding, adding the order information of the sequence to the initial model.
[0083] Assume that the input vector The length is T, for position and dimensions , the sine and cosine position encoding formulas of the encoding layer are as follows: when (b is an integer, that is, is an even number): ; when (b is an integer, that is, is an odd number): ; The time series is truncate by adding the input vector to the positional encoding vector element-wise. The sequential information in the data is encoded through the position encoding layer. The sequential information of the query vector Q is entered into the initial model, and finally the position encoding vector is generated and sent to the input of the multi-head sparse probabilistic self-attention mechanism of the encoder layer, including the query vector Q, and generally also includes the correlation vector K of the query information and other information, and the vector V of the query information; the uniform distribution and attention probability distribution of the query vector Q are calculated at the encoder layer; the Kullback-Leibler Divergence (KL) divergence is used to measure the similarity between the uniform distribution and the attention probability distribution of the query vector Q; when the similarity value reaches the preset threshold, the query vector Q plays a leading role in the attention distribution, and the vectors in the query vector that exceed the threshold are selected to form a new query vector , recalculate the multi-head sparse probabilistic self-attention mechanism based on the new query vector.
[0084] The main process is, Represents the input sequence The vector representation of each element in after position encoding is As the initial model input. , , .in, , , is the weight matrix, which is randomly initialized and the gradient is updated according to the loss in the initial model training. Q, K, and V are the inputs of the multi-head sparse probabilistic self-attention mechanism. The calculation process of the multi-head sparse probabilistic self-attention mechanism can be expressed as: ; Among them, Q, K, V are query vector (query), key vector (key) and value vector (value), the matrix d is the scaling factor increased to prevent the gradient from disappearing, soft max() is the activation function, and T represents the transposition operation.
[0085] The probability form of the attention coefficient of the i-th Query is: ; in, is the i-th element of the query vector Q, is the i-th element of the key vector K, is the lth element of the key vector K, is the j-th element of the value vector V. is an asymmetric exponential kernel function, , is the expectation under the attention probability distribution, represents the attention probability distribution.
[0086] use represents uniform distribution, represents the length of the Q vector, that is, the input length; if the query vector The probability distribution of attention Far from uniform distribution , then the query vector For attention weights that play a major role, the query vector should be retained , use the KL divergence formula to measure the attention probability distribution and uniform distribution The similarity between them can be expressed as: ; In the above formula, the first term yes For all keys, a logarithm-sum-exponential (LSE), the second term is their arithmetic mean.
[0087] Represents the query vector The probability distribution of attention With uniform distribution The difference measure between them is large, which means that the query vector Play a leading role in the attention distribution, selecting these main query vectors The component vector replaces the Q matrix in the attention formula, and the new attention formula can be expressed as: ; Furthermore, a channel can be introduced between the encoder layers to connect the multi-head sparse probabilistic self-attention mechanism. That is, the output of the multi-head sparse probabilistic self-attention mechanism does not pass through the residual mechanism, normalization layer, and fully connected layer, but is transmitted to the next encoder layer through the direct attention channel as an additional input of the multi-head attention module, which can be expressed as: ; In the above formula, Prev represents the output of the multi-head sparse probabilistic self-attention mechanism of the previous encoder, and its initial value is set to 0.
[0088] Since the output feature map of the multi-head sparse probabilistic self-attention mechanism has redundant combinations of values V, a higher weight is given to the dominant features through the distillation operation, and the feature map of the multi-head sparse probabilistic self-attention mechanism of the next encoder layer is generated. The process of the distillation operation from layer j to layer j+1 is as follows: ; in, After distillation, The transpose of the output data of the layer, is the maximum pooling operation, Contains the key operations in the attention block and the multi-head probsparse self-attention mechanism. C and D are parameters related to the key operations and the multi-head probsparse self-attention mechanism. Conv1d represents a one-dimensional convolution operation on a time series, and uses the Exponential Linear Unit (ELU) as the activation function. The self-attention distillation operation is used to solve the time series problem raised by Informer, so that the decoder layer of each layer shortens the length of the input sequence by half, which greatly saves the memory overhead and computing time of the encoder. Decoder
[0089] A standard decoder structure is used in the decoder part, which consists of the second input layer, the decoder layer and the output layer. The decoder input starts from the last data point of the encoder input. The second input layer maps the decoder through the fully connected neural network of the second input layer to dimensional vector, and the position encoding vector is added element by element to encode the sequential information in the time series data. The generated position encoding vector is sent to the decoder layer, which is composed of a multi-head attention mechanism and a multi-head sparse probabilistic self-attention mechanism to alleviate the slowdown in long-term generation of inference predictions. The multi-head sparse probabilistic self-attention mechanism applies hidden multi-head attention (English: masked multi-head attention) in the calculation. Different from the multi-head sparse probabilistic self-attention in the encoder, the multi-head sparse probabilistic self-attention mechanism in the decoder sets the dot product of the multi-head sparse probabilistic self-attention mechanism to prevent each position from paying attention to future information and avoid autoregression. , and finally the final position output is obtained through a fully connected layer in the output layer.
[0090] based on Figure 4 The following is a specific example to explain the model training process.
[0091] Figure 5 The following is a schematic diagram of the training process of the initial model provided in the embodiment of the present application. Figure 5 As shown, the training process may include the following steps: Step 1: Build the initial model.
[0092] based on Figure 4 The contents in the illustrated embodiment are used to construct an initial model.
[0093] Step 2: Collect driving data of multiple sample logistics robots.
[0094] Step 3: Divide the driving data of multiple sample logistics robots into a training set, a validation set, and a test set, and standardize the training set, the validation set, and the test set to obtain a preprocessed training set, a preprocessed validation set, and a preprocessed test set.
[0095] The data set is input as training set, validation set and test set in a certain ratio (for example, 7:2:1).
[0096] Among them, the sample starting posture, sample motion data, sample driving distance and sample environmental information of the sample logistics robot are determined as the input data of the initial model to regress the sample position of the sample logistics robot.
[0097] A fixed-length sliding time window method is used to construct the Yes. Among them, When is the first M observations, are the last N observations, The pairs constitute the sample pairs used for model training and evaluation.
[0098] Before applying the sliding window to obtain features and labels, in order to improve the prediction accuracy of the initial model, the data is normalized. The StandardScaler principle is used to normalize the mean and variance. Standard deviation standardization (StandardScale) makes the processed data conform to the standard normal distribution, that is, the mean is 0 and the standard deviation is 1. The conversion function is: ; in, is the mean of all sample data, is the standard deviation of all sample data, x is the driving data of the sample logistics robot, It is the normalized driving data of the sample logistics robot.
[0099] Then, a sliding window is run on the normalized driving data of the sample logistics robot to obtain training samples with features and labels, which are the first M and last N observations, respectively, that is,
[0100] Step 4: Positionally encode the preprocessed training set, validation set, and test set data to obtain model input data.
[0101] After standardizing the training set, validation set, and test set, The positive residue position is encoded and mapped through the fully connected neural network of the input layer as dimensional vector. The formula of the encoding layer is as follows: when (b is an integer, that is is an even number): ; when (b is an integer, that is is an odd number): ; Step 5: Select a preset batch size of data from the standardized and encoded training set, input it into the constructed initial model, and train the initial model. In a preferred solution, the preset batch size (English: batch size) can be set to 15; Step 6: Calculate the loss between the predicted value and the true value of the data of the current preset batch size.
[0102] Among them, the mean squared error (MSE) loss is used to train the network, and the loss function can be expressed by the following formula: ; in, is the predicted output of the i-th sample, is the label value of the i-th sample, and n is the number of samples.
[0103] Step 7: Based on the loss value, the error is back-propagated through the Adaptive Moment Estimation (ADAM) method to update the model network weight parameters.
[0104] In a preferred embodiment, , , , .in, To control the first-order momentum, To control the second-order momentum, is the fuzzy factor, and lr is the learning rate.
[0105] Step 8: Check whether all the data in the training set have been trained. If yes, execute step 9; if not, execute step 5.
[0106] Step 9: Input the validation set into the initial model and calculate the loss value between the predicted value and the true value of the validation set.
[0107] Step 10: Determine whether the training has converged and reached the maximum number of iterations based on the loss value. If so, complete the training. Otherwise, proceed to step 11.
[0108] Step 11: Increase the current number of iterations by 1 and execute step 5.
[0109] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0110] Figure 6 This is a schematic diagram of the structure of the combined positioning device between buildings provided in the embodiment of the present application. Figure 6 As shown, the inter-building combined positioning device 60 includes: The acquisition module 61 is used to acquire the motion data of the logistics robot through sensors installed on the logistics robot when the logistics robot performs logistics distribution.
[0111] The input module 62 is used to input the motion data and the starting position of the logistics robot into the position prediction model to obtain the predicted position output by the position prediction model.
[0112] The determination module 63 is used to determine the current position of the logistics robot according to the predicted position.
[0113] In a possible design, the determination module 63 is specifically configured to: According to the motion data and starting position of the logistics robot, the measurement position of the logistics robot is determined.
[0114] Based on the predicted position and the measured position, the current position of the logistics robot is determined.
[0115] In a possible design, the determination module 63 is specifically configured to: If the distance difference between the measured position and the predicted position is greater than the preset distance, the predicted position is determined as the current position of the logistics robot.
[0116] If the distance difference between the measured position and the predicted position is less than or equal to the preset distance, the middle position between the measured position and the predicted position is determined as the current position of the logistics robot.
[0117] In a possible design, the determination module 63 is specifically configured to: The measured position and the predicted position are weightedly fused according to the first weight and the second weight, and the calculation result of the weighted fusion is determined as the current position of the logistics robot, wherein the first weight is a weight value set in advance for the measured position, and the second weight is a weight value set in advance for the predicted position.
[0118] In one possible design, the motion data includes acceleration, angular velocity, and direction collected at each collection moment.
[0119] Accordingly, the acquisition module 61 is specifically used for: The motion data of the logistics robot is obtained through the accelerometer, gyroscope and magnetometer installed on the logistics robot.
[0120] In a possible design, before the logistics robot performs logistics distribution, the inter-building combined positioning device 60 further includes: The acquisition module 61 is also used to acquire a training set, which includes driving data of multiple sample logistics robots. The driving data includes a sample starting position of the sample logistics robot, sample motion data of the sample logistics robot during driving, and a sample position determined by the global positioning system GPS.
[0121] The training module is used to perform model training on the initial model based on the training set to obtain a location prediction model.
[0122] The initial model includes an encoder and a decoder. The encoder consists of a stack of the first input layer, a position encoding layer, and an encoder layer. The encoder layer uses a multi-head sparse probabilistic self-attention mechanism and a distillation operation. The decoder consists of a stack of the second input layer, a decoder layer, and an output layer. The decoder layer uses a multi-head sparse probabilistic self-attention mechanism and a multi-head attention mechanism.
[0123] In a possible design, after determining the current position of the logistics robot according to the predicted position, the inter-building combined positioning device 60 further includes: The updating module is used to update the position prediction model according to the motion data, starting posture and current position of the logistics robot to obtain the updated position prediction model.
[0124] In a possible design, the input module 62 is specifically used for: The motion data, the starting position of the logistics robot, the driving distance and the environmental information are input into the position prediction model to obtain the predicted position output by the position prediction model.
[0125] Correspondingly, the driving data of the sample logistics robot also includes the sample driving distance and sample environmental information of the sample logistics robot during the driving process.
[0126] In a possible design, the inter-building combined positioning device 60 also includes a navigation module for navigating the logistics robot according to the current position of the logistics robot and a pre-planned path.
[0127] The inter-building combined positioning device provided in the embodiment of the present application can be used to execute the inter-building combined positioning method in any of the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0128] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0129] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device may include: a processor 71, a memory 72, and computer program instructions stored in the memory 72 and executable on the processor 71. When the processor 71 executes the computer program instructions, the combined positioning method between buildings provided in any of the aforementioned embodiments is implemented.
[0130] Optionally, the above-mentioned components of the electronic device may be connected via a system bus.
[0131] The memory 72 may be a separate storage unit or a storage unit integrated in the processor. The number of processors is one or more.
[0132] Optionally, the electronic device may further include a communication interface for interacting with other devices.
[0133] It should be understood that the processor 71 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0134] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0135] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The above-mentioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the above-mentioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0136] The electronic device provided in the embodiment of the present application can be used to execute the inter-building combined positioning method provided in any of the above method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0137] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed on a computer, the computer executes the above-mentioned inter-building combined positioning method.
[0138] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0139] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0140] An embodiment of the present application also provides a computer program product, which includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, the above-mentioned inter-building combined positioning method can be implemented.
[0141] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A combined positioning method between buildings, It is characterized in that include: When the logistics robot performs logistics distribution, the motion data of the logistics robot is obtained through sensors installed on the logistics robot; Inputting the motion data and the starting position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; Based on the predicted position, the current position of the logistics robot is determined.
2. The method according to claim 1, It is characterized in that Determining the current position of the logistics robot according to the predicted position includes: Determining a measurement position of the logistics robot according to the motion data and the starting position of the logistics robot; The current position of the logistics robot is determined according to the predicted position and the measured position.
3. The method according to claim 2, It is characterized in that Determining the current position of the logistics robot according to the predicted position and the measured position includes: If the distance difference between the measured position and the predicted position is greater than a preset distance, the predicted position is determined as the current position of the logistics robot; If the distance difference between the measured position and the predicted position is less than or equal to a preset distance, an intermediate position between the measured position and the predicted position is determined as the current position of the logistics robot.
4. The method according to claim 2, It is characterized in that Determining the current position of the logistics robot according to the predicted position and the measured position includes: Performing weighted fusion on the measured position and the predicted position according to the first weight and the second weight, and determining a calculation result of the weighted fusion as the current position of the logistics robot; The first weight is a weight value pre-set for the measured position, and the second weight is a weight value pre-set for the predicted position.
5. The method according to any one of claims 1 to 4, It is characterized in that The motion data includes acceleration, angular velocity and direction collected at each collection moment; Correspondingly, obtaining the motion data of the logistics robot through the sensor installed on the logistics robot includes: The motion data of the logistics robot is obtained by installing an accelerometer, a gyroscope and a magnetometer on the logistics robot.
6. The method according to any one of claims 1 to 4, It is characterized in that Before the logistics robot performs logistics distribution, the method further includes: Acquire a training set, wherein the training set includes driving data of multiple sample logistics robots, wherein the driving data includes a sample starting position of the sample logistics robot, sample motion data of the sample logistics robot during driving, and a sample position determined by a global positioning system (GPS); Based on the training set, model training is performed on the initial model to obtain the position prediction model; Among them, the initial model includes an encoder and a decoder, the encoder is composed of a first input layer, a position encoding layer and an encoder layer stack, and the encoder layer adopts a multi-head sparse probabilistic self-attention mechanism and a distillation operation; the decoder is composed of a second input layer, a decoder layer and an output layer stack, and the decoder layer adopts the multi-head sparse probabilistic self-attention mechanism and a multi-head attention mechanism.
7. The method according to any one of claims 1 to 4, It is characterized in that After determining the current position of the logistics robot according to the predicted position, the method further includes: The position prediction model is updated according to the motion data of the logistics robot, the starting position and the current position to obtain an updated position prediction model.
8. The method according to claim 6, It is characterized in that The step of inputting the motion data and the initial position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model includes: Input the motion data, the starting position, the travel distance and the environmental information of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; Correspondingly, the driving data of the sample logistics robot also includes the sample driving distance and sample environment information of the sample logistics robot during the driving process.
9. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The logistics robot is navigated according to the current position of the logistics robot and the pre-planned path.
10. A combined positioning device between buildings, It is characterized in that include: An acquisition module, used to acquire motion data of the logistics robot through sensors installed on the logistics robot when the logistics robot performs logistics distribution; An input module, used to input the motion data and the starting position of the logistics robot into a position prediction model to obtain a predicted position output by the position prediction model; A determination module is used to determine the current position of the logistics robot based on the predicted position.
Citation Information
Patent Citations
INS (inertial navigation system)-assisted wireless indoor mobile robot positioning method
CN103148855A
Indoor logistics trolley positioning method and terminal equipment
CN109974698A
Robot positioning method and device, and robot
CN110567458A
Mobile robot indoor positioning mapping method based on multi-sensor fusion
CN112284376A
Vehicle positioning method, system and device and computer readable storage medium
CN114111774A
