Position prediction method, device, computer equipment and storage medium
By conducting deep learning model training on the historical operating parameters of trackless manned amusement equipment, real-time prediction and special-stunt processing of equipment location are realized, and the problems of real-time monitoring and special-stunt error of equipment in the existing technology are solved, and the safety of equipment is improved. Visitor experience.
Patent Information
- Application Number
- CN202011442185.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-08
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-12-08
AI Technical Summary
The prior art is difficult to realize real-time monitoring of trackless manned amusement equipment, especially in the case of disconnection of the network, which poses that are threatened by tourists, and the infrared-triggered stunts have large errors, affecting the tourists' experience.
By obtaining the historical operating parameters of the device, training the deep learning model for position prediction, and using the prediction results to perform equipment trick processing, real-time monitoring of trackless manned amusement equipment is achieved, and the error triggered by the trick is reduced through the deep learning model.
Real-time monitoring of trackless manned amusement equipment is realized, which reduces the security risks in the case of disconnection of the network, and improves the experience of tourists through precise stunt triggers.
Smart Images

Figure CN112529158B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for calculating a device position, and more specifically to a method, device, computer equipment and storage medium for predicting a position. Background Art
[0002] PLC, sensors and other data acquisition technologies are being deployed more and more widely in large-scale amusement equipment, generating massive amounts of real-time status data every day to monitor the operating conditions of large-scale amusement equipment. However, the massive amounts of data obtained through various information acquisition devices have not been fully and effectively analyzed and utilized. On the one hand, the operating status of the equipment cannot be fully and timely understood, such as the locations where fault alarms frequently occur. On the other hand, valuable information about the equipment has not been mined to solve engineering and technical problems and reduce equipment costs. For example, large-scale trackless manned amusement equipment reads the equipment location information through the wireless network and takes corresponding actions based on traditional triggering methods. In the event of a network outage, the master control is likely to lose control of the current location of the equipment. In extreme cases, this can have an adverse impact on the safety of tourists. In addition, the error of infrared-based triggering stunts is large, resulting in a poor experience for tourists.
[0003] Therefore, it is necessary to design a new method to achieve real-time monitoring of trackless manned amusement equipment and improve the tourists' experience. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the prior art and provide a location prediction method, device, computer equipment and storage medium.
[0005] To achieve the above object, the present invention adopts the following technical solution: a location prediction method, comprising:
[0006] Get the data packet with device information to get the initial data packet;
[0007] Parsing the initial data packet to obtain a parsing result;
[0008] Determining whether the initial data packet is a control signal according to the analysis result;
[0009] If the initial data packet is not a control signal, the parsing result is input into a position prediction model to perform position prediction to obtain a prediction result;
[0010] Packing the location data that meets the requirements according to the prediction results to obtain target data;
[0011] Feedback the target data to the terminal so that the terminal performs device special processing;
[0012] Among them, the location prediction model is obtained by training a deep learning model by using several historical operating parameter information of the equipment as a sample set.
[0013] A further technical solution is: the position prediction model is obtained by training a deep learning model using several historical operating parameter information of the device as a sample set, including:
[0014] Obtain historical operating parameters of the equipment and filter them to obtain a sample set;
[0015] Divide the sample set into training set, validation set and test set;
[0016] Build deep learning models;
[0017] Input the training set into the deep learning model for training to obtain the initial model;
[0018] Use the validation set to validate the initial model;
[0019] When the initial model is successfully verified, the test set is used to test the initial model;
[0020] When the initial model test is successful, the initial model is a position prediction model.
[0021] A further technical solution is: the training set is input into the deep learning model for training to obtain an initial model, including:
[0022] Inputting the training set into a deep learning model;
[0023] Calculating a reset gate and an update gate of the deep learning model;
[0024] Compute candidate hidden states;
[0025] Use the update gate of the current time step to combine the hidden state of the previous time step and the candidate hidden state of the current time step to obtain the hidden state of the current time step;
[0026] Calculate the output of the fully connected layer, and use the activation function to calculate the fully connected output layer to obtain the training result;
[0027] An initial model is determined according to the training result and the training set.
[0028] A further technical solution is as follows: the calculating of the candidate hidden state includes:
[0029] Multiply the reset gate output value of the current time step by the hidden state of the previous time step to get the product;
[0030] The product is concatenated with the input value of the current time step in the training set, and the candidate hidden state is calculated through a fully connected layer with an activation function.
[0031] A further technical solution is: inputting the analysis result into a position prediction model to perform position prediction to obtain a prediction result, including:
[0032] The analysis result is input into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and the prediction result is stored in a queue according to the device number.
[0033] A further technical solution is: before inputting the analysis result into the position prediction model to perform position prediction to obtain the prediction result, it also includes:
[0034] Determine whether the current running state of the device is in the stopped state;
[0035] If the current running state of the device is in a stopped state, the position data corresponding to the specified number of steps of the input time step is obtained as a prediction result, and the position data that meets the requirements is packaged according to the prediction result to obtain the target data;
[0036] If the current running state of the device is not in the stopped state, the Euclidean distance set of the positions before and after the input time step is counted;
[0037] Determining whether the device is in an offline state according to the Euclidean distance set;
[0038] If the device is not in a disconnected state, the step of inputting the analysis result into a location prediction model to perform location prediction to obtain a prediction result;
[0039] If the device is in an offline state, the predicted data is used to replace the data in the offline state to obtain a parsing result, and the parsing result is input into a position prediction model for position prediction to obtain a prediction result.
[0040] A further technical solution is: feeding back the target data to the terminal so that the terminal performs device special processing, including:
[0041] The target data is fed back to the terminal so that the terminal compares the target data with the stunt triggering position. When the error between the target data and the stunt triggering position meets the requirement, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt triggering position does not meet the requirement, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
[0042] The present invention also provides a position prediction device, comprising:
[0043] A data packet acquisition unit, used for acquiring a data packet with device information to obtain an initial data packet;
[0044] A parsing unit, used for parsing the initial data packet to obtain a parsing result;
[0045] A signal determination unit, configured to determine whether the initial data packet is a control signal according to the analysis result;
[0046] A prediction unit, configured to input the analysis result into a position prediction model to perform position prediction to obtain a prediction result if the initial data packet is not a control signal;
[0047] A packaging unit, used for packaging the position data meeting the requirements according to the prediction result to obtain target data;
[0048] The feedback unit is used to feed back the target data to the terminal so that the terminal can perform device special processing.
[0049] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0050] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0051] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention trains a position prediction model through historical operating parameters, and the position prediction model is a deep learning model that learns the time features in the time series. The position prediction model is used to predict the position data of the equipment at the next moment, and the data is packaged and sent to the terminal, which makes a judgment to trigger the stunt content, thereby realizing real-time monitoring of the trackless manned amusement equipment. The combination of position prediction based on deep learning and stunt triggering controls the error within an extremely small and allowable error range, thereby improving the tourists' experience.
[0052] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0054] Figure 1 A schematic diagram of an application scenario of a location prediction method provided by an embodiment of the present invention;
[0055] Figure 2 A schematic diagram of a flow chart of a location prediction method provided by an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of the training process of the location prediction model provided by an embodiment of the present invention;
[0057] Figure 4 A two-dimensional trajectory diagram of the sessions provided by an embodiment of the present invention;
[0058] Figure 5 The X-coordinate trajectory diagram of the training set provided by the embodiment of the present invention;
[0059] Figure 6 A Y coordinate trajectory diagram of a training set provided by an embodiment of the present invention;
[0060] Figure 7 A schematic diagram of a flow chart of a location prediction method provided by another embodiment of the present invention;
[0061] Figure 8 A schematic block diagram of a position prediction device provided by an embodiment of the present invention;
[0062] Fig. 9 A schematic block diagram of a position prediction device provided by another embodiment of the present invention;
[0063] Fig.10 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0066] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0067] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0068] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of the location prediction method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a position prediction method provided in an embodiment of the present invention. The position prediction method is applied in a server, which exchanges data with a terminal and a device, wherein the device refers to a controllable device such as a trackless manned amusement device, and after predicting the position, the server sends the data to the terminal, which compares the data to trigger the corresponding stunt content.
[0069] Figure 2 FIG. 1 is a flow chart of a location prediction method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S170.
[0070] S110: Acquire a data packet carrying device information to obtain an initial data packet.
[0071] In this embodiment, the initial data packet refers to a data packet with device information such as the position (X, Y) of the trackless manned amusement equipment, the number of the trackless manned amusement equipment, the sending time, the operating status signal of the trackless manned amusement equipment, and the format is json.
[0072] Specifically, the server and the terminal are connected for communication via the TCP (Transmission Control Protocol), and the terminal, ie, the master control, sends a data packet in json format to the server at a frequency of 100 ms.
[0073] TCP protocol, specifically, the terminal is responsible for sending control signals and position data signals. The control signal is sent irregularly, and the data signal is sent regularly at a frequency of 100ms. When the trackless manned amusement equipment arrives at the upper platform and is ready to depart, it will send a control signal, including four fields, data type, i.e. control signal or data signal, time, trackless manned amusement equipment number, and equipment status, i.e. departure from the upper platform / parking at the lower platform; after receiving the control signal, the terminal starts to send data signals regularly, including five fields, trackless manned amusement equipment position (X, Y), trackless manned amusement equipment number, sending time, and trackless manned amusement equipment operation status signal.
[0074] The field of the running state signal of the trackless manned amusement equipment is used to record the parking state and running state of the trackless manned amusement equipment. The parking state is represented by '0' and the running state is represented by '1'.
[0075] S120: Parse the initial data packet to obtain a parsing result.
[0076] In this embodiment, the parsing result refers to the device information obtained after unpacking the initial data packet.
[0077] S130, judging whether the initial data packet is a control signal according to the analysis result;
[0078] S140: If the initial data packet is a control signal, start a corresponding thread to prepare for prediction.
[0079] If the initial data packet is a control signal, indicating that the trackless manned amusement equipment x (x=1, 2, 3...) has been dispatched, the corresponding thread is started to prepare for prediction.
[0080] S150: If the initial data packet is not a control signal, the analysis result is input into a position prediction model to perform position prediction to obtain a prediction result.
[0081] If the initial data packet is not a control signal, then the initial data packet is a data signal, and the data is stored in different queues according to the device number; the position data in the received initial data packet is stored in different queues because there may be more than one trackless manned amusement equipment running on the track at the same time, so a queue needs to be allocated to each device to store the received raw data to avoid confusion in the subsequent prediction process.
[0082] In one embodiment, the above step S150 includes:
[0083] The analysis result is input into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and the prediction result is stored in a queue according to the device number.
[0084] Specifically, the prediction results are stored in queue z (z=1, 2, 3...) according to the device number; the parsing results are reshaped into three-dimensional data. The GRU (Gated Recurrent Unit) model requires the data to be input into the model in a specified three-dimensional form, such as (input time step, batch sample number, feature number). In this embodiment, the input time step is 10, that is, the sliding window size is 10, and it slides 4 units each time; because it is a two-dimensional coordinate (X, Y), the feature number is 2.
[0085] In this embodiment, an input and output format of 10 steps predicting 8 steps is adopted, and the data acquisition frequency is 100ms / frame, that is, the position data of the first 10 steps is input, and the predicted data of the next 8 steps, i.e. 800ms, is obtained.
[0086] In this embodiment, the location prediction model is obtained by training a deep learning model using several historical operating parameter information of the device as a sample set.
[0087] For the position prediction model, it is a position prediction model based on time series, such as the differential autoregressive moving average model, also known as the ARIMA model, the hidden Markov model and other statistical methods were widely used before the popularity of deep learning, but the use of these statistical methods are based on some assumptions and restrictions, which will undoubtedly increase the prediction error. The biggest advantage of deep learning lies in the automatic extraction of features, that is, learning features through big data, and transforming the feature representation of the sample in the original space into a new feature space through layer-by-layer feature transformation, so that classification or prediction is easier and more accurate. In the deep learning model, recurrent neural networks are also widely used due to their powerful modeling capabilities in time series data.
[0088] Specifically, this example uses the GRU model to learn the temporal features in the position sequence. Compared with the traditional RNN (Recurrent Neural Network), the GRU network adds a reset gate and an update gate. The reset gate is used to discard historical information that is not related to the prediction, which helps to capture short-term dependencies in the sequence. The update gate can control how the hidden state should be updated by the candidate hidden state containing the current time step information, which helps to capture long-term dependencies in the sequence. In addition, compared with LSTM, the GRU structure is relatively simple and the computational efficiency is faster. While meeting the prediction accuracy requirements, it can better meet the requirements of the present invention for a higher prediction frequency in the real-time prediction stage.
[0089] During the training process, the training set is input into the model, and then into the GRU model. After the reset gate and update gate update the hidden state, the activation function calculates the prediction of the next 8 steps on the fully connected output layer, that is, {(X t+1 , Y t+1 ), (X t+2 , Y t+2 ), (X t+3 , Y t+3 ), (X t+4 , Y t+4 ), (X t+5 , Y t+5 ), (X t+6 , Y t+6 ), (X t+7 , Y t+7 ), (Xt+8 , Y t+8 )}.
[0090] In one embodiment, the above-mentioned location prediction model is obtained by training a deep learning model using several historical operating parameter information of the device as a sample set, including S151 to S157.
[0091] S151. Obtain historical operating parameters of the device and filter them to obtain a sample set.
[0092] In this embodiment, the sample set refers to the data used for training and testing the model.
[0093] Specifically, the historical operating parameters of x (x=1, 2, 3, ...) trackless manned amusement equipment are collected from the PLC of the trackless manned amusement equipment; the trackless manned amusement equipment starts from the upper platform and runs to the lower platform along a fixed track route, and the relevant information of this process is used as a historical data. The historical operating parameters refer to the historical operating parameter information of all trackless manned amusement equipment collected from the PLC, including four fields: collection time, coordinate X (m), coordinate Y (m), and operating status, where the operating status is a binary indicator, 0 represents that the trackless manned amusement equipment is stopped in the track, and 1 represents that the trackless manned amusement equipment is running; where the coordinates (X, Y) jointly determine the actual position of the trackless manned amusement equipment in the track at a certain moment. The position data of each field is arranged in time series as follows:
[0094] Pos = {(X 1 , Y 1 ), (X 2 , Y 2 )...(X i , Y i )...(X n , Y n )}, 1≤i≤n;
[0095] The data acquisition frequency is 100ms, that is, two adjacent trajectory points, for example (X i , Y i ) and (X i+1 , Y i+1 ) is 100ms.
[0096] After obtaining the historical operating parameters, the session is taken as the basic analysis unit, the recent n session data is selected, and the abnormal sessions are eliminated to form a sample set; in this embodiment, the recent n session data is the 40 session data collected for each trackless manned amusement equipment before the day, and a large number of abnormal parking session data are eliminated. Of course, in other embodiments, the recent n session data can also include other values of the number of sessions, depending on the actual situation.
[0097] S152, dividing the sample set into a training set, a validation set, and a test set;
[0098] In this embodiment, the sample set is divided into a training set, a test set, and a validation set, and the data is reshaped into an input form acceptable to the model. The training set is used to train the deep learning model, the validation set is suitable for validating the trained deep learning model, and the test set is used to test the validated deep learning model.
[0099] The reason why the data of the last 40 parking lots are selected as training data is that the accuracy of the model trained by the 40 parking lots has reached the accuracy requirement, so there is no need to further train the model with more data. After eliminating abnormal parking lots, the training data is divided into training set, validation set and test set in a ratio of 2:1:1. The number of samples in the training set is 140,000.
[0100] S153. Build a deep learning model.
[0101] In this embodiment, the deep learning model is but not limited to the GRU model.
[0102] S154: Input the training set into the deep learning model for training to obtain an initial model.
[0103] In this embodiment, the initial model refers to a deep learning model trained by a training set.
[0104] In one embodiment, the above-mentioned step S154 may include steps S1541 - S1546 .
[0105] S1541. Input the training set into the deep learning model.
[0106] In this embodiment, the training set {(X t-n , Y t-n ), (X t-n-2 , Y t-n-2 ), (X t-n-3 , Y t-n-3 ), (X t-n-4 , Y t-n-4 ), (X t-n-5 , Y t-n-5 )...(X t , Y t )} is input into the deep learning model.
[0107] The hidden variable stores the historical information of the sequence up to the current time step, representing the state or memory of the neural network at the current time step. Therefore, the hidden variable is also called the hidden state. The calculation of the hidden variable at time step t is determined by the input of the current time step and the hidden variable of the previous time step.
[0108] The GRU model introduces the concepts of reset gate and update gate, thereby modifying the way hidden states are calculated in recurrent neural networks.
[0109] S1542. Calculate the reset gate and update gate of the deep learning model.
[0110] In this embodiment, assuming that the number of hidden units is h, given a small batch input X at time step t t ∈R n×d , where the number of samples is n, the number of inputs is d, and the hidden state H of the previous time step t-1 ∈R n×h ; n×d, n×h are matrices.
[0111] Reset Gate R t ∈R n×h and update gate Z t ∈R n×h The calculation is as follows:
[0112] R t =σ(X t W xr +H t-1 W hr +b r );Z t =σ(X t W xz +H t-1 W hz +b z ), where W xr , W xz ∈R d×h and W hr , W hz ∈R h ×h is the weight parameter, b r , b z ∈R 1×h The bias parameter σ is a sigmoid function, which is often used as an activation function of a neural network to map variables between 0 and 1.
[0113] S1543. Calculate candidate hidden states.
[0114] In this embodiment, the candidate hidden states are initially discarded through an update gate to remove historical information irrelevant to the prediction.
[0115] In one embodiment, the above-mentioned step S1543 may include steps S15431 - S15432 .
[0116] S15431, multiplying the reset gate output value of the current time step by the hidden state of the previous time step to obtain a product;
[0117] S15432. Concatenate the product with the input value of the current time step in the training set, and calculate the candidate hidden state through a fully connected layer containing an activation function.
[0118] Specifically, reset the gate R at the current time step t The output of the previous time step is the same as the hidden state H t-1 Do element-wise multiplication. If the reset gate R t If the value of the element is close to 0, it means that the gate R is reset. t The corresponding hidden state element is 0, that is, the hidden state of the previous time step is discarded. If the reset gate R t If the value of the element in is close to 1, it means that the hidden state of the previous time step is retained. The result of element-wise multiplication is added to the input X of the current time step. t The candidate hidden state is calculated through a fully connected layer with an activation function tanh.
[0119] In this embodiment, the candidate hidden state at time step t is The calculation is: Among them, W xh ∈R d×h and W hh ∈R h×h is the weight parameter, b h ∈R 1×h is the bias parameter, tanh represents the hyperbolic tangent function, and its value range is [-1, 1].
[0120] S1544. Use the update gate of the current time step to combine the hidden state of the previous time step and the candidate hidden state of the current time step to obtain the hidden state of the current time step.
[0121] Use the update gate Z of the current time step t To the hidden state H of the previous time step t-1 and the candidate hidden state at the current time step Do the combination to get the hidden state H of the current time step t t ∈R n×h :
[0122]
[0123] From this, we can see that the update gate controls how the candidate hidden state containing the current time step updates the current hidden state.
[0124] S1545. Calculate the output of the fully connected layer, and use the activation function to calculate the fully connected output layer to obtain the training result.
[0125] In this embodiment, the output O of the fully connected layer is:t W 0 +b 0 ; Among them, W 0 ∈R h×q is the weight parameter of the output layer, b 0 ∈R 1×q is the bias parameter of the output layer.
[0126] Using the Relu function, the output of the fully connected layer is transformed nonlinearly to output the predicted value P at time t. t .P t =Relu(O), where the Relu function is also a commonly used activation function in neural networks, mapping variables to between 0 and 1.
[0127] S1546. Determine an initial model according to the training results and the training set.
[0128] When the error between the training result and the actual result of the training set meets the preset conditions, it means that the training result meets the requirements. At this time, the deep learning model that generates the training result can be used as the initial model for the location prediction of the device.
[0129] S155. Use the validation set to validate the initial model;
[0130] S156. When the initial model is successfully verified, the initial model is tested using the test set;
[0131] S157. When the initial model test is successful, the initial model is a position prediction model.
[0132] When the initial model verification is unsuccessful, step S153 is executed. When the initial model test is unsuccessful, step S153 is also executed, and the training is repeated until a position prediction model is generated.
[0133] Specifically, the position prediction model is screened out using RMSE (Root Mean Squared Error) and hit rate as model evaluation criteria. RMSE reflects the error level of the overall fitting result, and the hit rate reflects the accuracy of the prediction when a small range of deviation is allowed.
[0134] The GRU model based on deep learning is a method that uses big data to automatically extract and convert features, and integrates feature learning into the model building process, reducing the incompleteness caused by human-designed features. Due to its powerful learning ability, it greatly improves the model's prediction accuracy.
[0135] S160: Packing the location data that meets the requirements according to the prediction results to obtain target data.
[0136] In this embodiment, the target data refers to the predicted position data of multiple trackless manned amusement equipment at the next moment, which is packaged into data in json format.
[0137] S170: Feedback the target data to the terminal so that the terminal performs device special processing
[0138] In this embodiment, the target data is sent to the terminal at a frequency of 100 ms; the terminal compares the received position information with the actual stunt triggering position to determine whether to trigger the corresponding stunt and the corresponding stunt number.
[0139] Specifically, the target data is fed back to the terminal so that the terminal compares the target data with the stunt trigger position. When the error between the target data and the stunt trigger position meets the requirement, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt trigger position does not meet the requirement, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
[0140] The server sends the location data of the next moment to the terminal at a fixed time, and the server completes a complete cycle of data reception-data analysis-data transmission. Next, the terminal associates the number of the trackless manned amusement equipment according to the received location information, and compares it with the stunt trigger position. If the error between the predicted position and the stunt position i is within 10cm, i=1, 2...n, i represents the stunt number, and there is at most one stunt trigger for the same trackless manned amusement equipment at the same time, then it is considered that the trackless manned amusement equipment has reached a specific position i, and the corresponding stunt number i is triggered to play stunt i. At this point, the terminal completes a complete cycle of data transmission-predicted data reception-stunt triggering. If the error between the predicted position and all stunt positions exceeds 10cm, it is considered that the trackless manned amusement equipment has not reached any stunt position and will not be processed.
[0141] In one embodiment, after the above step S170, the method further includes:
[0142] The target results and the initial data package are stored in the database separately.
[0143] For example, we use trackless manned amusement equipment as an example to apply the position prediction system. Trackless manned amusement equipment operates periodically according to the standard curve, so the running trajectory of each game is similar or close within the allowable error range. Therefore, only historical position data is selected as input during the prediction, and factors such as the number of passengers and temperature are not considered. On the one hand, because our track is fixed and the running trajectory of each equipment is similar, the historical time step is sufficient to become the most important influencing factor; on the other hand, the model training results also show that the model trained based on the historical time step has met the accuracy requirements. The daily running times, excluding abnormal parking and malfunctioning times, are about 200 times, which is enough for model training, providing conditions for updating the model regularly.
[0144] First, the position prediction model is trained. First, the device position data is obtained from the PLC, including the acquisition time, position X (mm), position Y (mm), and device center point position (mm). In this embodiment, the acquisition frequency is 100ms, as shown in Table 1:
[0145] Table 1. Unprocessed raw data collected
[0146] Collection time Position X Position Y Equipment center point location 00:03:47.900 28919.43945 35487.40234 78854.20313 00:03:48.000 28919.44531 35487.62109 78854.20313 00:03:48.100 28919.44922 35487.62109 78854.20313 00:03:48.200 28919.44531 35487.40234 78852.89844 00:03:48.300 28919.44531 35487.62109 78853 00:03:48.400 28919.44531 35487.62109 78853 00:03:48.500 28919.44531 35487.62109 78853 00:03:48.600 28919.44531 35487.62109 78853 00:03:48.700 28919.45117 35487.40234 78854.20313 00:03:48.800 28919.44531 35487.62109 78854.20313 00:03:48.900 28919.44531 35487.62109 78853 00:03:49.000 28919.44531 35487.62109 78855.60156 00:03:49.100 28919.44531 35486.74609 78854.20313
[0147] Secondly, Table 1 collects all the running data of the trackless manned amusement equipment on that day. Model training is based on sessions, so it is necessary to divide the sessions first. Coordinate point A (46982.755, 33692.7379) represents the beginning of a session, and coordinate point B (49642.5218, 12874.2782) represents the end of a session. These two coordinate points A and B are used to divide the original data into multiple sessions. The running trajectory of each session after division is as follows Figure 4 As shown in the figure, the games are screened and the games with abnormal parking and other phenomena are eliminated. 40 normal games are selected as training data, among which the trend diagrams of position X and position Y are shown in the figure below. Figure 5 and Figure 6 As shown, the data is finally standardized and reshaped into a 3D form, input into the model, predicted, and the best model is selected based on RMSE and hit rate.
[0148] In this embodiment, the structure of the position prediction model is a 2-layer GRU model, and the model parameters are set as follows: the batch size is 128, the number of neurons is 128, the loss function selects the mean square error, the optimization algorithm selects the Adam algorithm, and the learning rate is 0.001. The loss function is also called the target optimization function. Minimizing the loss function during the model training process is the training goal. As a regression prediction problem, the present invention selects the mean square error as the loss function, which represents the error level between the true value and the fitting result. The optimization algorithm can be used to minimize the loss function. The Adam optimization algorithm combines the advantages of the two algorithms, AdaGrad and RMSProp. It is currently a more popular optimization algorithm due to its efficient calculation and faster convergence speed.
[0149] The lightweight model structure built by the location prediction model in this embodiment, on the one hand, is based on the fact that after testing different model structures, it was found that the 2-layer GRU model has achieved good prediction accuracy. On the other hand, considering that in the real-time prediction stage, the prediction tasks of multiple devices need to be completed simultaneously within 100ms, the smaller model structure reduces the pressure on the real-time prediction system and ensures system stability.
[0150] As shown in Table 2, taking device 4, i.e., DeviceNo, as an example, Repeat represents the number of times the model is trained in a loop, which is 8 here. Roundid represents the number of test sets, where 10 fields of data are used as test sets to verify the accuracy of the model. RMSE represents the degree of dispersion of the predicted data relative to the real data, the smaller the better. For example, the RMSE = 18.056 in the first row of Table 2 means that the average error between the predicted value and the actual value of the first test set is about 18 mm. Rate_500, Rate_200, Rate_100, and Rate_50 represent the hit rates within 500mm / 200mm / 100mm / 50mm, respectively, that is, given a tolerable prediction error of 500mm / 200mm / 100mm / 50mm, if the distance s between the actual position and the predicted position is less than 500mm / 200mm / 100mm / 50mm, the prediction is considered accurate, i.e., a hit, otherwise it is considered inaccurate. The hit rate is the ratio of the number of hits to the total number of predictions. The larger the hit rate, the higher the prediction accuracy. It is expressed as:
[0151]
[0152] Table 2. Model evaluation table
[0153]
[0154] Therefore, according to Table 2, the model with Repeat=6 is selected, and the average Rmse is 12.834, and the average Rate_50 reaches 99.5%. The model training process for other trackless manned amusement equipment is the same as the above steps.
[0155] In the process of real-time location prediction, the server and the terminal communicate through the TCP protocol. The terminal will send control signals from time to time and send json data packets to the server at a frequency of 100ms, including data type Cmdtype (Data / Control), trackless manned amusement equipment position Pos_X, Pos_Y, trackless manned amusement equipment number Carno, sending time Time, trackless manned amusement equipment operation status signal Net (0 / 1). The Json package formats are as follows:
[0156] {"Cmdtype":"Control","Time":"11:32:09:282","Control":[
[0157] {"Carno":"1","Cmd":"1"}]}
[0158] {"Cmdtype":"Data","Time":"14:14:25.150","Data":[
[0159] {"Carno":"1","Net":"1","Pos_X":"35099.691","Pos_Y":"53807.957"},
[0160] {"Carno":"3","Net":"1","Pos_X":"29954.195","Pos_Y":"53820.707"},
[0161] {"Carno":"4","Net":"0","Pos_X":"29954.195","Pos_Y":"29954.195"}]
[0162] }.
[0163] First, the server receives the JSON data packet sent by the terminal through the receiving thread and unpacks it. If it is a control signal, it sends feedback information to indicate that the control signal has been received to establish a connection. If it is a data signal, the location data is stored in different queues Q according to the device number. i , i = 1, 2, 3 ..., i represents the number of the trackless manned amusement equipment running on the track; secondly, continuously select i The latest 10-step position data is taken out in the form of a sliding window, that is, sliding 4 units each time. 10×2 , input model m i , and predict the position data P for the next 8 steps 8×2In addition, if there are multiple trackless manned amusement equipment online on the track at the same time, this embodiment implements the position prediction of each trackless manned amusement equipment separately in multiple threads.
[0164] The predicted location data is packaged into JSON format and sent to the terminal through the sending thread at a frequency of 100ms. The JSON package format is as follows:
[0165] {“Cmdtype”:”Data”,
[0166] "Time":"14:14:25.150",
[0167] "Data":[{"Carno":"1","Pos_X":"35099.691","Pos_Y":"53807.957"},
[0168] {"Carno":"3","Pos_X":"29954.195","Pos_Y":"53820.707"},
[0169] {"Carno":"4","Pos_X":"29954.195","Pos_Y":"29954.195"}]}
[0170] Finally, the terminal compares the received position information with the actual stunt position. If the error between the predicted position and the stunt position i is within 10 cm, i = 1, 2…n represents the stunt number, and at most one stunt is triggered for the same trackless manned amusement device at the same time, then the trackless manned amusement device is considered to have reached a specific position i, and the corresponding stunt number i is triggered to play stunt i. If the error between the predicted position and all stunt positions exceeds 10 cm, it is considered that the trackless manned amusement device has not reached any stunt position, and the input data will not be processed. The stunt triggering logic for all trackless manned devices is the same as above. After sending the data, the server stores the predicted data and the received original data in the database through the storage thread.
[0171] Another point to note is that data reception, multi-model prediction, data transmission, and data storage in the real-time prediction stage are all completed under the asynchronous framework and multi-threading technology. Asynchronous programming greatly improves the performance of the real-time prediction system.
[0172] The position prediction model can be transplanted to different types of trackless manned amusement equipment projects. The above system can achieve high-precision position prediction and real-time tracking of trackless manned amusement equipment, solving the problem that on-site technicians cannot grasp the actual position of trackless manned amusement equipment in time when the network is disconnected. The combination of position prediction and project stunt triggering greatly improves the accuracy of stunt triggering, and well replaces the problem of rough and large errors in traditional stunt triggering. For the same trackless manned amusement equipment, in the same operating environment and without obvious mechanical failures, the position trajectories of similar sessions are similar or almost the same. Therefore, using a large amount of historical session data to learn the inherent patterns contained in the operating trajectory of the same amusement equipment and use it for trajectory prediction will achieve a higher prediction accuracy.
[0173] The above-mentioned position prediction method trains a position prediction model through historical operating parameters. The position prediction model is a deep learning model that learns the time features in the time series. The position prediction model is used to predict the location data of the equipment at the next moment, and the data is packaged and sent to the terminal. The terminal makes a judgment to trigger the stunt content, thereby realizing real-time monitoring of the trackless manned amusement equipment. The combination of position prediction based on deep learning and stunt triggering can control the error within an extremely small and allowable error range, thereby improving the tourist experience.
[0174] Figure 7 FIG. 1 is a flow chart of a location prediction method provided by another embodiment of the present invention. Figure 7 As shown, the location prediction method of this embodiment includes steps S210-S320. Steps S210-S240 are similar to steps S110-S140 in the above embodiment, and steps S300-S320 are similar to steps S150-S170 in the above embodiment, which are not described here. The following is a detailed description of steps S250-S290 added in this embodiment.
[0175] S250: Determine whether the current running state of the device is in a stopped state.
[0176] The equipment is frequently disconnected from the Internet during operation. This is an inherent problem of the equipment and also a problem that needs to be solved in position prediction, that is, predicting the current position of the equipment when the Internet is disconnected. When the Internet is disconnected, the device disconnection signal cannot be received immediately, and the received data is the same, and the data received in the parking state has the same presentation form, which leads to confusion between the two states of the equipment disconnection and parking. Therefore, if the operating status of the trackless manned amusement equipment is known, it can be determined whether the trackless manned amusement equipment is currently disconnected from the Internet. If abnormal parking or disconnection occurs during the operation of the trackless manned amusement equipment, it will affect the accuracy of the model prediction. Therefore, it is necessary to provide an "out-of-state" prediction method to improve the overall prediction accuracy of the model.
[0177] Specifically, each time data such as {(X 1 , Y 1 ), (X 2 , Y 2 ), (X 3 , Y 3 ), (X 4 , Y 4 ), (X 5 , Y 5 ), (X 6 , Y 6 ), (X 7 , Y 7 ), (X 8 , Y 8 ), (X 9 , Y 9 ), (X 10 , Y 10 )} Before inputting the model, first determine the running state of the device when the position needs to be predicted, and count the number of stops j in the running state field of the input data according to whether the running state field in the input time step is 0. If j ≥ 4, the device is in a stopped state, and if j < 4, the current running state of the device is not in a stopped state.
[0178] S260. If the current running state of the device is in a stopped state, the position data corresponding to the specified number of steps of the input time step is obtained as a prediction result, and the step S310 is executed.
[0179] If the current running state of the device is stopped, the predicted position of the next 8 steps is replaced by the position of the 10th step of the input time step, that is, the output prediction result is {(X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 ), (X 10 , Y 10 )}.
[0180] S270: If the current running state of the device is not in the stopped state, a set of Euclidean distances before and after the input time step is counted.
[0181] In this embodiment, the Euclidean distance set D of the previous and next positions of the input time step is counted: {D1 ,D 2 ,D 3 ,D 4 ,D 5 ,D 6 ,D 7 ,D 8 ,D 9},in D 2 ,D 3 The calculation of ... is similar.
[0182] S280: Determine whether the device is in an offline state according to the Euclidean distance set.
[0183] Furthermore, the number of network disconnections is counted based on whether the first-order difference Euclidean distance of the input time step is less than 10 cm, that is, the elements D in the Euclidean distance set D that are less than 10 cm are counted. i The set E:{D i},1≤i≤9If the element subscripts in E are discontinuous or the element subscripts are continuous and the set E<4, it is considered that the trackless manned amusement equipment is not disconnected from the network, and the GRU model continues to be used for prediction; (v) If the element subscripts in E are continuous and the set E>=4, it is considered that the trackless manned amusement equipment is disconnected from the network.
[0184] If the device is not in a disconnected state, execute step S300;
[0185] S290. If the device is in an offline state, use the predicted data to replace the data in the offline state to obtain a parsing result, and execute step S300.
[0186] Assume that the data at the time of network disconnection is {(X 3 ,Y 3 ),(X 4 ,Y 4 ),(X 5 ,Y 5 ), (X 6 ,Y 6 ),(X 7 ,Y 7 )}, because the data is not updated when the network is disconnected, the position remains unchanged, that is, X 3 =X 4 =X 5 =X 6 =X 7 , Y 3 =Y 4 =Y 5 =Y 6 =Y 7 , and this abnormal data will seriously affect the accuracy of GRU model prediction, so consider using the predicted data To replace the data at the time of network disconnection, the data input to the model is Finally, input the GRU model for prediction.
[0187] A hybrid prediction model based on running state prediction and GRU was established to solve the impact of the static state on the prediction accuracy. A lightweight real-time position prediction interactive system based on asynchronous framework and multi-threading technology is provided for trackless manned amusement equipment. On the one hand, it greatly reduces the system deployment cost, and on the other hand, it realizes the position prediction of multiple devices. It also provides a new prediction-based stunt triggering method for trackless manned equipment, which also reduces the project operation cost to a certain extent.
[0188] Figure 8 is a schematic block diagram of a position prediction device 300 provided in an embodiment of the present invention. Figure 8 As shown, corresponding to the above position prediction method, the present invention also provides a position prediction device 300. The position prediction device 300 includes a unit for executing the above position prediction method, and the device can be configured in a server. Figure 8 The location prediction device 300 includes a data packet acquisition unit 301, a parsing unit 302, a signal determination unit 303, a prediction unit 309, a packaging unit 310 and a feedback unit 311.
[0189] The data packet acquisition unit 301 is used to acquire a data packet with device information to obtain an initial data packet;
[0190] The parsing unit 302 is used to parse the initial data packet to obtain a parsing result;
[0191] A signal determination unit 303, configured to determine whether the initial data packet is a control signal according to the analysis result;
[0192] A prediction unit 309, configured to input the parsing result into a position prediction model to perform position prediction to obtain a prediction result if the initial data packet is not a control signal;
[0193] A packing unit 310 is used to pack the position data that meets the requirements according to the prediction result to obtain target data;
[0194] The feedback unit 311 is used to feed back the target data to the terminal so that the terminal can perform device special effects processing.
[0195] In one embodiment, the above-mentioned location prediction device 300 also includes a model construction unit, which is used to train a deep learning model using several historical operating parameter information of the device as a sample set to obtain a location prediction model.
[0196] In one embodiment, the model building unit includes a sample set acquisition subunit, a division subunit, a model building subunit, a training subunit, a verification subunit, a testing subunit and a model acquisition subunit.
[0197] The sample set acquisition subunit is used to obtain the historical operating parameters of the equipment and screen them to obtain the sample set; the division subunit is used to divide the sample set into a training set, a verification set and a test set; the model establishment subunit is used to build a deep learning model; the training subunit is used to input the training set into the deep learning model for training to obtain an initial model; the verification subunit is used to verify the initial model using the verification set; the testing subunit is used to test the initial model using the test set when the initial model verification is successful; the model acquisition subunit is used to test the initial model as a location prediction model when the initial model test is successful.
[0198] In one embodiment, the training subunit includes an input module, a first calculation module, a second calculation module, a combination module, a third calculation module and a determination module.
[0199] An input module is used to input the training set into the deep learning model; a first calculation module is used to calculate the reset gate and update gate of the deep learning model; a second calculation module is used to calculate the candidate hidden state; a combination module is used to use the update gate of the current time step to combine the hidden state of the previous time step and the candidate hidden state of the current time step to obtain the hidden state of the current time step; a third calculation module is used to calculate the output of the fully connected layer, and the fully connected output layer is calculated by the activation function to obtain the training result; a determination module is used to determine the initial model according to the training result and the training set.
[0200] In one embodiment, the second calculation module includes a multiplication submodule and a connection submodule.
[0201] A multiplication submodule is used to multiply the reset gate output value of the current time step with the hidden state of the previous time step to obtain a product; a connection submodule is used to connect the product with the input value of the current time step in the training set, and calculate the candidate hidden state through a fully connected layer containing an activation function.
[0202] In one embodiment, the prediction unit 309 is used to input the analysis result into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and store the prediction result in a queue according to the device number.
[0203] In one embodiment, the feedback unit 311 is used to feed back the target data to the terminal so that the terminal compares the target data with the stunt trigger position. When the error between the target data and the stunt trigger position meets the requirements, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt trigger position does not meet the requirements, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
[0204] Fig. 9 FIG. 3 is a schematic block diagram of a position prediction device 300 provided in another embodiment of the present invention. Fig. 9 As shown, the location prediction device 300 of this embodiment is based on the above embodiment and adds a stop judgment unit 304, a result acquisition unit 305, a set calculation unit 306, a network disconnection judgment unit 307 and a replacement unit 308.
[0205] The stop judgment unit 304 is used to judge whether the current running state of the device is in a stop state; the result acquisition unit 305 is used to obtain the position data corresponding to the specified number of steps of the input time step as the prediction result if the current running state of the device is in a stop state, and perform packaging of the position data that meets the requirements according to the prediction result to obtain the target data; the set calculation unit 306 is used to count the Euclidean distance set of the front and back positions of the input time step if the current running state of the device is not in a stop state; the network disconnection judgment unit 307 is used to judge whether the device is in a network disconnection state according to the Euclidean distance set; if the device is not in a network disconnection state, execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result; the replacement unit 308 is used to replace the data in the network disconnection state with the prediction data if the device is in a network disconnection state to obtain the analysis result, and execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result.
[0206] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned position prediction device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0207] The above-mentioned position prediction device 300 can be implemented in the form of a computer program. The computer program can be implemented in the form of a computer program. Fig.10 Runs on the computer device shown.
[0208] See also Fig.10 , Fig.10 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0209] See also Fig.10 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0210] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 may execute a location prediction method.
[0211] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0212] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a location prediction method.
[0213] The network interface 505 is used to communicate with other devices over the network. Fig.10 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0214] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0215] Acquire a data packet with device information to obtain an initial data packet; parse the initial data packet to obtain a parsing result; determine whether the initial data packet is a control signal based on the parsing result; if the initial data packet is not a control signal, input the parsing result into a position prediction model for position prediction to obtain a prediction result; package the position data that meets the requirements based on the prediction result to obtain target data; and feed back the target data to a terminal so that the terminal performs device special effects processing.
[0216] Among them, the location prediction model is obtained by training a deep learning model by using several historical operating parameter information of the equipment as a sample set.
[0217] In one embodiment, when the processor 502 implements the step of obtaining the location prediction model by training a deep learning model using several historical operating parameter information of the device as a sample set, the processor 502 specifically implements the following steps:
[0218] Obtain historical operating parameters of the equipment and screen them to obtain a sample set; divide the sample set into a training set, a validation set and a test set; build a deep learning model; input the training set into the deep learning model for training to obtain an initial model; use the validation set to verify the initial model; when the initial model is successfully verified, use the test set to test the initial model; when the initial model test is successful, the initial model is a location prediction model.
[0219] In one embodiment, when the processor 502 implements the step of inputting the training set into the deep learning model for training to obtain the initial model, the processor 502 specifically implements the following steps:
[0220] The training set is input into the deep learning model; the reset gate and the update gate of the deep learning model are calculated; the candidate hidden state is calculated; the hidden state of the previous time step and the candidate hidden state of the current time step are combined using the update gate of the current time step to obtain the hidden state of the current time step; the output of the fully connected layer is calculated, and the fully connected output layer is calculated by the activation function to obtain the training result; the initial model is determined according to the training result and the training set.
[0221] In one embodiment, when the processor 502 implements the step of calculating the candidate hidden state, the processor 502 specifically implements the following steps:
[0222] The reset gate output value of the current time step is multiplied by the hidden state of the previous time step to obtain a product; the product is connected with the input value of the current time step in the training set, and the candidate hidden state is calculated through a fully connected layer with an activation function.
[0223] In one embodiment, when the processor 502 implements the step of inputting the analysis result into the position prediction model to perform position prediction to obtain the prediction result, the processor 502 specifically implements the following steps:
[0224] The analysis result is input into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and the prediction result is stored in a queue according to the device number.
[0225] In one embodiment, before implementing the step of inputting the analysis result into the position prediction model to perform position prediction to obtain a prediction result, the processor 502 further implements the following steps:
[0226] Determine whether the current running state of the device is in a stopped state; if the current running state of the device is in a stopped state, obtain the position data corresponding to the specified number of steps of the input time step as the prediction result, and execute the packaging of the position data that meets the requirements according to the prediction result to obtain the target data; if the current running state of the device is not in a stopped state, count the Euclidean distance set of the front and back positions of the input time step; determine whether the device is in a disconnected state according to the Euclidean distance set; if the device is not in a disconnected state, execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result; if the device is in a disconnected state, use the predicted data to replace the data in the disconnected state to obtain the analysis result, and execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result.
[0227] In one embodiment, the processor 502 implements the following steps when implementing the step of feeding back the target data to the terminal so that the terminal performs the device special effects processing:
[0228] The target data is fed back to the terminal so that the terminal compares the target data with the stunt triggering position. When the error between the target data and the stunt triggering position meets the requirement, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt triggering position does not meet the requirement, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
[0229] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0230] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0231] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0232] Acquire a data packet with device information to obtain an initial data packet; parse the initial data packet to obtain a parsing result; determine whether the initial data packet is a control signal based on the parsing result; if the initial data packet is not a control signal, input the parsing result into a position prediction model for position prediction to obtain a prediction result; package the position data that meets the requirements based on the prediction result to obtain target data; and feed back the target data to a terminal so that the terminal performs device special effects processing.
[0233] Among them, the location prediction model is obtained by training a deep learning model by using several historical operating parameter information of the equipment as a sample set.
[0234] In one embodiment, when the processor executes the computer program to implement the step that the location prediction model is obtained by training a deep learning model using several historical operating parameter information of the device as a sample set, the processor specifically implements the following steps:
[0235] Obtain historical operating parameters of the equipment and screen them to obtain a sample set; divide the sample set into a training set, a validation set and a test set; build a deep learning model; input the training set into the deep learning model for training to obtain an initial model; use the validation set to verify the initial model; when the initial model is successfully verified, use the test set to test the initial model; when the initial model test is successful, the initial model is a location prediction model.
[0236] In one embodiment, when the processor executes the computer program to implement the step of inputting the training set into the deep learning model for training to obtain the initial model, the processor specifically implements the following steps:
[0237] The training set is input into the deep learning model; the reset gate and the update gate of the deep learning model are calculated; the candidate hidden state is calculated; the hidden state of the previous time step and the candidate hidden state of the current time step are combined using the update gate of the current time step to obtain the hidden state of the current time step; the output of the fully connected layer is calculated, and the fully connected output layer is calculated by the activation function to obtain the training result; the initial model is determined according to the training result and the training set.
[0238] In one embodiment, when the processor executes the computer program to implement the step of calculating the candidate hidden states, the processor specifically implements the following steps:
[0239] The reset gate output value of the current time step is multiplied by the hidden state of the previous time step to obtain a product; the product is connected with the input value of the current time step in the training set, and the candidate hidden state is calculated through a fully connected layer with an activation function.
[0240] In one embodiment, when the processor executes the computer program to implement the step of inputting the analysis result into the position prediction model to perform position prediction to obtain a prediction result, the processor specifically implements the following steps:
[0241] The analysis result is input into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and the prediction result is stored in a queue according to the device number.
[0242] In one embodiment, before the processor executes the computer program to implement the step of inputting the analysis result into the position prediction model to perform position prediction to obtain a prediction result, the processor further implements the following steps:
[0243] Determine whether the current running state of the device is in a stopped state; if the current running state of the device is in a stopped state, obtain the position data corresponding to the specified number of steps of the input time step as the prediction result, and execute the packaging of the position data that meets the requirements according to the prediction result to obtain the target data; if the current running state of the device is not in a stopped state, count the Euclidean distance set of the front and back positions of the input time step; determine whether the device is in a disconnected state according to the Euclidean distance set; if the device is not in a disconnected state, execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result; if the device is in a disconnected state, use the predicted data to replace the data in the disconnected state to obtain the analysis result, and execute the input of the analysis result into the position prediction model for position prediction to obtain the prediction result.
[0244] In one embodiment, when the processor executes the computer program to implement the step of feeding back the target data to the terminal so that the terminal performs the device special effects processing, the processor specifically implements the following steps:
[0245] The target data is fed back to the terminal so that the terminal compares the target data with the stunt triggering position. When the error between the target data and the stunt triggering position meets the requirement, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt triggering position does not meet the requirement, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
[0246] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0247] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0248] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0249] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0250] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0251] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A location prediction method, characterized in that: Applied to trackless manned amusement equipment projects, including: Get the data packet with device information to get the initial data packet; Parsing the initial data packet to obtain a parsing result; Determining whether the initial data packet is a control signal according to the analysis result; If the initial data packet is not a control signal, the parsing result is input into a position prediction model to perform position prediction to obtain a prediction result; Packing the location data that meets the requirements according to the prediction results to obtain target data; Feedback the target data to the terminal so that the terminal performs device special processing; Wherein, the position prediction model is obtained by training a deep learning model using several historical operating parameter information of the equipment as a sample set; The location prediction model is obtained by training a deep learning model using several historical operating parameter information of the device as a sample set, including: Obtain historical operating parameters of the equipment and filter them to obtain a sample set; Divide the sample set into training set, validation set and test set; Build deep learning models; Input the training set into the deep learning model for training to obtain the initial model; Use the validation set to validate the initial model; When the initial model is successfully verified, the test set is used to test the initial model; When the initial model test is successful, the initial model is a position prediction model; Before inputting the analysis result into the position prediction model to perform position prediction to obtain the prediction result, the method further includes: Determine whether the current running state of the device is in the stopped state; If the current running state of the device is in a stopped state, the position data corresponding to the specified number of steps of the input time step is obtained as a prediction result, and the position data that meets the requirements is packaged according to the prediction result to obtain the target data; If the current running state of the device is not in the stopped state, the Euclidean distance set of the positions before and after the input time step is counted; Determining whether the device is in an offline state according to the Euclidean distance set; If the device is not in a disconnected state, the step of inputting the analysis result into a location prediction model to perform location prediction to obtain a prediction result; If the device is in an offline state, the predicted data is used to replace the data in the offline state to obtain a parsing result, and the parsing result is input into a position prediction model for position prediction to obtain a prediction result.
2. The position prediction method according to claim 1, characterized in that: The step of inputting the training set into the deep learning model for training to obtain an initial model includes: Inputting the training set into a deep learning model; Calculating a reset gate and an update gate of the deep learning model; Compute candidate hidden states; Use the update gate of the current time step to combine the hidden state of the previous time step and the candidate hidden state of the current time step to obtain the hidden state of the current time step; Calculate the output of the fully connected layer, and use the activation function to calculate the fully connected output layer to obtain the training result; An initial model is determined according to the training result and the training set.
3. The position prediction method according to claim 2, characterized in that: The calculating of the candidate hidden states comprises: Multiply the reset gate output value of the current time step by the hidden state of the previous time step to get the product; The product is concatenated with the input value of the current time step in the training set, and the candidate hidden state is calculated through a fully connected layer with an activation function.
4. The position prediction method according to claim 1, characterized in that: The step of inputting the analysis result into a position prediction model to perform position prediction to obtain a prediction result includes: The analysis result is input into the position prediction model in the form of a sliding window to perform position prediction to obtain a prediction result, and the prediction result is stored in a queue according to the device number.
5. The position prediction method according to claim 1, characterized in that: Feeding back the target data to the terminal so that the terminal performs device special processing includes: The target data is fed back to the terminal so that the terminal compares the target data with the stunt triggering position. When the error between the target data and the stunt triggering position meets the requirement, the terminal triggers the stunt content corresponding to the corresponding stunt number; when the error between the target data and the stunt triggering position does not meet the requirement, the terminal does not trigger the stunt content corresponding to the corresponding stunt number.
6. A position prediction device, characterized in that Applied to trackless manned amusement equipment projects, including: A data packet acquisition unit, used for acquiring a data packet with device information to obtain an initial data packet; A parsing unit, used for parsing the initial data packet to obtain a parsing result; A signal determination unit, configured to determine whether the initial data packet is a control signal according to the analysis result; A prediction unit, configured to input the analysis result into a position prediction model to perform position prediction to obtain a prediction result if the initial data packet is not a control signal; A packaging unit, used for packaging the position data meeting the requirements according to the prediction result to obtain target data; A feedback unit, used for feeding back the target data to the terminal so that the terminal performs device special effects processing; The location prediction device also includes a model construction unit, which is used to train a deep learning model using a number of historical operating parameter information of the device as a sample set to obtain a location prediction model; The model building unit includes a sample set acquisition subunit, a division subunit, a model building subunit, a training subunit, a verification subunit, a testing subunit and a model acquisition subunit; The sample set acquisition subunit is used to acquire the historical operating parameters of the equipment and screen them to obtain the sample set; the division subunit is used to divide the sample set into a training set, a verification set and a test set; the model establishment subunit is used to build a deep learning model; the training subunit is used to input the training set into the deep learning model for training to obtain an initial model; the verification subunit is used to verify the initial model using the verification set; the test subunit is used to test the initial model using the test set when the initial model is successfully verified; the model acquisition subunit is used to determine that when the initial model is successfully tested, the initial model is a position prediction model; The location prediction device further includes: a stop judgment unit, a result acquisition unit, a set calculation unit, a network disconnection judgment unit, and a replacement unit; A stop judgment unit is used to judge whether the current running state of the device is in a stop state; a result acquisition unit is used to obtain the position data corresponding to the specified number of steps of the input time step as the prediction result if the current running state of the device is in a stop state, and to package the position data that meets the requirements according to the prediction result to obtain the target data; a set calculation unit is used to count the Euclidean distance set of the front and back positions of the input time step if the current running state of the device is not in a stop state; a network disconnection judgment unit is used to judge whether the device is in a network disconnection state according to the Euclidean distance set; if the device is not in a network disconnection state, the analysis result is input into the position prediction model for position prediction to obtain the prediction result; a replacement unit is used to replace the data in the network disconnection state with the prediction data if the device is in a network disconnection state to obtain the analysis result, and the analysis result is input into the position prediction model for position prediction to obtain the prediction result.
7. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 can be implemented.
Citation Information
Patent Citations
Position prediction method, apparatus, device, and readable storage medium
CN109410275A
Method for predicting positioning, device, storage medium, and electronic equipment
CN109462821A