Model training method, data processing method, device, medium and program product
By generating embedded codes for road space units and training a business-specific second model separately, the problem of wasted hardware resources in existing technologies is solved, achieving more efficient model training and resource utilization.
Patent Information
- Application Number
- CN202210667057.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-06-13
AI Technical Summary
In the prior art, the training equipment trains the model for each traffic indicator, resulting in a large consumption and waste of hardware resources.
The characteristic data of the road space unit is input into the first model to generate the embedded code, and the first model used to generate the embedded code is trained separately, and the second model with fewer parameters corresponding to different businesses is trained separately to avoid repeated training of the first model.
It reduces the consumption and waste of electronic equipment hardware resources and improves the efficiency of model training and resource utilization.
Smart Images

Figure CN115049045B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of transportation, and in particular to a model training method, a data processing method, an equipment, a medium and a program product. BACKGROUND
[0002] Traffic index prediction in a road network is crucial, for example, future short congestion prediction, short speed prediction, short flow prediction, road safety risk early warning, etc. of a certain road section determine the selection of driving route. Currently, the training device can train a corresponding model for each traffic index. Obviously, this model training method will cause a large consumption and waste of hardware resources of the training device. SUMMARY
[0003] The present application provides a model training method, a data processing method, an equipment, a medium and a program product, thereby reducing the large consumption and waste of hardware resources of the training device.
[0004] In a first aspect, a model training method is provided, comprising: inputting feature data of a first road space unit in T time slices into a first model to obtain embedded coding of the first road space unit, T being a positive integer; training the first model according to the embedded coding of the first road space unit; inputting feature data of a second road space unit in T time slices into the trained first model to obtain embedded coding of the second road space unit; inputting the embedded coding of the second road space unit into M second models to obtain M groups of traffic indexes of the second road space unit, M being an integer greater than 1; and training the corresponding second models according to the M groups of traffic indexes of the second road space unit.
[0005] In a second aspect, a data processing method is provided, comprising: inputting feature data of a third road space unit in T time slices into a first model trained by the above-mentioned model training method to obtain embedded coding of the third road space unit, T being a positive integer; and inputting the embedded coding of the third road space unit into any one of the second models trained by the above-mentioned model training method to obtain a traffic index of the third road space unit.
[0006] In a third aspect, a model training apparatus is provided, comprising: a first input module, a first training module, a second input module, a third input module, and a second training module, wherein the first input module is configured to input feature data of a first road space unit in T time slices into a first model to obtain an embedded code of the first road space unit, T being a positive integer; the first training module is configured to train the first model according to the embedded code of the first road space unit; the second input module is configured to input feature data of a second road space unit in T time slices into the trained first model to obtain an embedded code of the second road space unit; the third input module is configured to input the embedded code of the second road space unit into M second models to obtain M groups of traffic indexes of the second road space unit, M being an integer greater than 1; and the second training module is configured to train the corresponding second models according to the M groups of traffic indexes of the second road space unit.
[0007] In a fourth aspect, a data processing apparatus is provided, comprising: a first input module and a second input module, wherein the first input module is configured to input feature data of a third road space unit in T time slices into a first model trained by the model training method to obtain an embedded code of the third road space unit, T being a positive integer; and the second input module is configured to input the embedded code of the third road space unit into any one of the second models trained by the model training method to obtain a traffic index of the third road space unit.
[0008] In a fifth aspect, an electronic device is provided, comprising: a processor and a memory configured to store a computer program, the processor being configured to invoke and run the computer program stored in the memory to execute the method in the first aspect, the second aspect, or any implementation manner thereof.
[0009] In a sixth aspect, a computer readable storage medium is provided, configured to store a computer program, the computer program causing a computer to execute the method in the first aspect, the second aspect, or any implementation manner thereof.
[0010] In a seventh aspect, a computer program product is provided, comprising computer program instructions, the computer program instructions causing a computer to execute the method in the first aspect, the second aspect, or any implementation manner thereof.
[0011] In an eighth aspect, a computer program is provided, the computer program causing a computer to execute the method in the first aspect, the second aspect, or any implementation manner thereof.
[0012] In the embodiment of the present application, considering that multiple services for the same road space unit all involve the embedded encoding of the entry feature data of the road space unit in T time slices, based on this, during model training, the electronic device can separately train a first model for generating embedded encoding, and respectively train a second model with fewer parameters corresponding to different services, thereby avoiding repeated training of the first model, and further reducing the large consumption and waste of hardware resources of the electronic device. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0014] Figure 1 A system architecture diagram related to the embodiment of the present application is provided.
[0015] Figure 2 A flowchart of a model training method provided by the embodiment of the present application is provided.
[0016] Figure 3A A schematic diagram of the first model provided by the embodiment of the present application is provided.
[0017] Figure 3B A schematic diagram of the fully connected layer provided by the embodiment of the present application is provided.
[0018] Figure 4 A schematic diagram of the encoder module of the TCN model provided by the embodiment of the present application is provided.
[0019] Figure 5 A schematic diagram of the LSTM model provided by the embodiment of the present application is provided.
[0020] Figure 6A A schematic diagram of the GRU model provided by the embodiment of the present application is provided.
[0021] Figure 6B A schematic diagram of the encoder (Encoder) module in the Transformer model provided by the embodiment of the present application is provided.
[0022] Figure 7 A flowchart of a data processing method provided by the embodiment of the present application is provided.
[0023] Figure 8 A schematic diagram of a data processing method provided by the embodiment of the present application is provided.
[0024] Figure 9A schematic diagram of a model training device 900 provided by an embodiment of the present application is shown in FIG. 1.
[0025] Figure 10 A schematic diagram of a data processing device 1000 provided by an embodiment of the present application is shown in FIG. 2.
[0026] Figure 11 A schematic block diagram of an electronic device 1100 provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0028] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not necessarily have to include those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.
[0029] Before introducing the technical solutions of the present application, the related knowledge of the technical solutions of the present application will be described first as follows:
[0030] Road space unit, also known as basic space unit or space unit, refers to a link, a segment, or a road.
[0031] Embedding: a vector for multi-dimensional description of a road space unit.
[0032] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, is to effectively integrate advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) in transportation, service control and vehicle manufacturing, to strengthen the connection between vehicles, roads and users, so as to form a comprehensive transportation system that ensures safety, improves efficiency, improves environment and saves energy.
[0033] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS), simply referred to as vehicle infrastructure cooperative system, is a development direction of Intelligent Traffic System (ITS). Vehicle infrastructure cooperative system is to use advanced wireless communication and new generation Internet technology to implement dynamic real-time information interaction between vehicles and roads in all directions, and to carry out vehicle active safety control and road cooperative management on the basis of full-time and space dynamic traffic information collection and fusion, to fully realize the effective cooperation of man, vehicle and road, to ensure traffic safety and improve traffic efficiency, so as to form a safe, efficient and environmentally friendly road traffic system.
[0034] In some embodiments, the system architecture of the embodiment of the present application is as shown in Figure 1
[0035] Figure 1 For a system architecture diagram related to the embodiment of the present application, the user equipment 101, the data collection equipment 102, the training equipment 103, the execution equipment 104, the database 105 and the content library 106.
[0036] Among them, the data collection equipment 102 is used to read the training data from the content library 106, and store the read training data into the database 105. The training data related to the embodiment of the present application can be the feature data of the road space unit in T time slices, or the embedded code of the road space unit and the traffic index.
[0037] The training equipment 103 trains the first model based on the feature data of the road space unit in T time slices maintained in the database 105, so that the first model can obtain the embedded code of the road space unit. Or, the training equipment 103 trains the second model based on the embedded code of the road space unit maintained in the database 105, so that the second model can predict the traffic index of the road space unit.
[0038] In addition, refer to Figure 1 The execution device 104 is configured with an I / O interface 107 to interact with external devices for data. For example, the I / O interface receives the feature data of the road space unit to be predicted at T time slices sent by the user device 101. The computing module 108 in the execution device 104 processes the feature data of the road space unit to be predicted at T time slices using the trained first model, outputs the embedded code of the road space unit to be predicted, and sends the corresponding result to the user device 101 through the I / O interface. Alternatively, the I / O interface receives the embedded code to be predicted sent by the user device 101. The computing module 108 in the execution device 104 processes the embedded code to be predicted using the trained second model, outputs the traffic index, and sends the corresponding result to the user device 101 through the I / O interface.
[0039] The user device 101 can include a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), or other terminal devices with a browser function.
[0040] The execution device 104 can be a server.
[0041] For example, the server can be a rack server, a blade server, a tower server, or a cabinet server, etc. The server can be a standalone test server, or a test server cluster composed of multiple test servers.
[0042] In this embodiment, the execution device 104 is connected with the user device 101 through a network. The network can be an intranet, the Internet, a global system for mobile communication (GSM), a wideband code division multiple access (WCDMA), a fourth generation (4G) network, a fifth generation (5G) network, Bluetooth, wireless fidelity (Wi-Fi), a call network, or other wireless or wired networks.
[0043] It should be noted that, Figure 1The positional relationship between the devices, apparatuses, modules and the like shown in the figure is not intended to constitute any limitation. In some embodiments, the data collection device 102, the user device 101, the training device 103 and the execution device 104 can be the same device. The database 105 can be distributed on one server or multiple servers, and the content library 106 can be distributed on one server or multiple servers.
[0044] The technical solutions of the embodiments of the present application will be described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments.
[0045] Figure 2 A flowchart of a model training method provided by the embodiments of the present application is shown in FIG. 10. The method can be executed by a computer, a desktop computer, a notebook computer or any electronic device, for example, the method can be executed by the training device 103 in FIG. 9, but is not limited thereto, for example, as shown in FIG. 10, the method can include the following steps: Figure 1 Figure 2
[0046] S210: input the feature data of the first road space unit in T time slices into the first model to obtain the embedded code of the first road space unit, T being a positive integer;
[0047] S220: train the first model according to the embedded code of the first road space unit;
[0048] S230: input the feature data of the second road space unit in T time slices into the trained first model to obtain the embedded code of the second road space unit;
[0049] S240: input the embedded code of the second road space unit into M second models to obtain M groups of traffic indicators of the second road space unit, M being an integer greater than 1;
[0050] S250: train the corresponding second model according to the M groups of traffic indicators of the second road space unit.
[0051] It should be understood that the first road space unit is a road space unit for training the first model, and the number of the first road space unit can be N, wherein N is a positive integer.
[0052] It should be understood that the time slice can also be referred to as a time slice, a time period, etc., for example, a time slice can be 5 minutes, 10 minutes, etc.
[0053] It should be understood that, for any road space unit, the feature data of the road space unit in any time slice can include any one of, but not limited to, a traffic performance index (TPI), a speed, a mean real travel time (rtt_time), a free flow time (ffs_time), a flow, a bidirectional or unidirectional (rc), a road length (len), a smooth travel length (smooth_length), a slow travel length (slow_length), a jam travel length (jam_length), and a block travel length (block_length) of the road space unit in the time slice.
[0054] Optionally, the electronic device can obtain the feature data of any road space unit in any time slice from the situational awareness module in the traffic base station, and the feature data can be real-time data or dynamic data.
[0055] It should be understood that the road space unit in the embodiments of the present application can be any road space unit, for example, a first road space unit used in the training stage of the first model, a second road space unit used in the execution stage of the first model, or a third road space unit used in the execution stage of the first model and the second model.
[0056] Optionally, Figure 3A A schematic diagram of the first model provided by the embodiments of the present application is shown in FIG. 1, which can include an input layer, a fully connected layer, and a time series feature extraction layer. Figure 3A The input layer is used to input the feature data of the road space unit in T time slices; the fully connected layer is used to perform nonlinear transformation on the feature data of the road space unit in T time slices to obtain the nonlinear transformed feature data of the road space unit in T time slices; and the time series feature extraction layer is used to perform feature extraction on the time series dynamic data in the nonlinear transformed feature data to generate the embedded code of the road space unit.
[0057] Optionally, the input data of the input layer can be X∈R N×T×B , X represents the feature data of each road space unit in N road space units in T time slices, N represents the number of road space units, T represents the number of time slices, and B represents the dimension of the feature data of each road space unit in each time slice. Further, the input layer can perform normalization processing on the feature data and input the normalized feature data to the fully connected layer.
[0058] Optionally, the fully connected layer can perform a nonlinear transformation on the feature data of each of the N road space units at the T time slices using a sigma (FC()) such that X ∈ R N×T×B may be projected into a higher dimensional feature space to enrich the representation of the feature data. Wherein, FC() represents a parametric fully connected layer, and sigma represents a nonlinear activation function.
[0059] Figure 3B A schematic diagram of the fully connected layer provided by the embodiments of the present application is shown in Figure 3B , the input of the fully connected layer is X ∈ R N×T×B , and the output is H ∈ R N×T×V , representing the nonlinear transformed feature data of each of the N road space units at the T time slices, wherein N represents the number of road space units, T represents the number of time slices, and V represents the dimension of the nonlinear transformed feature data of each road space unit at each time slice.
[0060] Optionally, the input data of the time series feature extraction layer can be H ∈ R N×T×V , and the output is Z ∈ R N×S , representing the embedded encoding of each space unit of the N road space units, wherein N represents the number of road space units, and S represents the dimension of the embedded encoding of each space unit. Taking the nth road space unit as an example, the input data of the time series feature extraction layer can be , wherein H n ∈ R T×V , represents the nonlinear transformed feature data of the nth road space unit at the tth time slice, and H n represents the nonlinear transformed feature data of the nth road space unit at the T time slices. The output data of the time series feature extraction layer can be Z N ∈ R S , representing the embedded encoding of the nth road space unit.
[0061] Optionally, the neural network time series model can be a Temporal Convolutional Network (TCN) based on a Convolutional Neural Network (CNN), a Long Short-Term Memory (LSTM) based on a Recurrent Neural Network (RNN), a Gated Recurrent Unit (GRU), a Transformer model based on an Attention mechanism, a Spatial Temporal Graph Convolutional Networks (STGCN) algorithm integrating spatial and temporal features, and the like, but is not limited thereto.
[0062] In the TCN model, the Encoder module uses dilated convolution (Dilated Conv) to extract dynamic feature information from the input time series and generates an embedded code with a fixed dimension, which is suitable for scenarios with a large time-dependent span.
[0063] For example, Figure 4 The schematic diagram of the Encoder module of the TCN model provided by the embodiments of the present application is shown in Figure 4 As shown, the feature data of the nth road space unit after nonlinear transformation of T time slices can be used as the input of the Encoder module, and after processing by layers with expansion coefficients of 1, 2, 4, and 8, the embedded code Z N of the nth road space unit can be obtained.
[0064] The LSTM model uses parameter-shared forget, input, and output gates to control the discard, forget, and output of information, can pass in the required historical information and discard the unnecessary historical information, and can process long-term and short-term information dependencies at the same time.
[0065] For example, Figure 5 The schematic diagram of the LSTM model provided by the embodiments of the present application is shown in Figure 5 The embedded code Z N of the nth road space unit can be obtained by the following formula:
[0066] f t = σ (W f · [h t-1 , x t ] + b f )
[0067] i t= σ(W i · [h t-1 , x t ] + b i )
[0068]
[0069]
[0070] o t = σ(W o · [h t-1 , x t ] + b o )
[0071] h t = o t * tanh(C t )
[0072] wherein x t in the formula is the feature data of the nth road space unit after nonlinear transformation in the tth time slice , h t-1 is a full zero vector in the first calculation, W f , W i , W C , W o are parameter vectors, b f , b i , b C , b o are bias parameters, σ represents a nonlinear activation function, and the finally obtained h T is the embedded coding Z N of the nth road space unit.
[0073] The GRU model is a variant of the LSTM, combines the forgetting gate and the input gate into an update gate, and also mixes the state of the neuron (Cell) and the hidden state, and is simpler than the LSTM.
[0074] For example, Figure 6A is a schematic diagram of the GRU model provided by the embodiment of the application, in combination with Figure 6A , the embedded coding Z N of the nth road space unit can be obtained through the following formula:
[0075] z t = σ(W z · [h t-1 , x t ])
[0076] r t = σ(W r · [ht-1 x t ])
[0077]
[0078]
[0079] where x t is the feature data of the nth road space unit after nonlinear transformation in the tth time slice h t-1 is the initial value of the parameter vector W z , W r , W T is the embedding code Z N of the nth road space unit.
[0080] The encoder (Encoder) module in the Transformer model based on the attention mechanism can be composed of N = 6 identical layers, Figure 6B The schematic diagram of the encoder (Encoder) module in the Transformer model provided by the embodiment of the present application is shown in Figure 6B Each layer contains two sub-layers. The first is a self-attention network using a multi-head self-attention mechanism, and the second is a fully connected feedforward network. The feedforward network can improve the expression ability of the model by adding a fully connected layer with a nonlinear activation function. Both of the two sub-layers use residual connection (ADD) and layer normalization (Norm).
[0081] The self-attention mechanism is also called intra-attention, which is an attention mechanism that relates different positions in a single sequence in order to compute an interaction representation of the sequence. It has been proven to be very effective in many fields such as machine reading, text summarization or image description generation. In the self-attention mechanism, K = V = Q. Therefore, in the self-attention mechanism, the attention (Attention) value can be calculated by the following formula:
[0082]
[0083] In the embodiment of the present application, K, V, Q are all the feature data H n of the nth road space unit after nonlinear transformation in T time slices, n represents the dimension of Q or K, and softmax() represents a normalized exponential function.
[0084] MultiHead attention mechanism is not only to calculate attention once, but to calculate attention on multiple subspaces in parallel multiple times, and finally to simply connect the attention on multiple subspaces and linearly convert to the expected dimension. The multi-head attention value can be calculated by the following formula:
[0085]
[0086] wherein, W O is a parameter matrix to be learned, each of which represents a transformation, and the resulting MultiHead(Q, K, V) is the embedded encoding Z N of the nth road space unit.
[0087] Optionally, the electronic device can use an unsupervised training method to train the first model, the core idea of which is to train the parameters of the first model so that the distance between the N embedded encodings is maximized as a whole, and the purpose of maximization is to make the features of each road space unit be described in detail in a high-dimensional space. Wherein, the electronic device can use the following formula to train the parameters of the first model simultaneously:
[0088]
[0089] denotes the parameters of the first model after training, z i denotes the embedded encoding corresponding to the ith road space unit, z j denotes the embedded encoding corresponding to the jth road space unit, wherein z i and z j are related to the parameters of the first model, Dist() represents a distance function, which can be a cosine similarity function, a Euclidean distance function, a standardized Euclidean distance function, etc., and arg max() represents training the parameters of the first model so that the distance between the N embedded encodings is maximized as a whole.
[0090] It should be understood that the electronic device is not limited to using the above formula to train the parameters of the first model, but can also deform the above formula to train the parameters of the first model, for example, the electronic device can use the following formula to train the parameters of the first model:
[0091]
[0092] It should be understood that the second road space unit is a road space unit for training the second model, and the number of the second road space unit can be one or more.
[0093] The electronic device can input the feature data of the second road space unit in the T time slices into the trained first model to obtain the embedded code of the second road space unit before training the second model. The second model can be a nonlinear fully connected neural network for specific services. For example, the future short-term congestion prediction, short-term speed prediction, short-term flow prediction, and road safety risk warning services correspond to independent nonlinear fully connected neural networks, respectively.
[0094] Optionally, the electronic device can train the corresponding second model according to the M groups of traffic indicators of the second road space unit by using a supervised training method.
[0095] For example, any training sample corresponding to the second model can include the embedded code of the second road space unit and the real traffic indicator corresponding to the second road space unit. Based on this, the electronic device can train the second model by using the following formula:
[0096]
[0097] represents the parameters of the second model, K represents the number of training samples of the second model, p i represents the predicted traffic indicator corresponding to the i-th road space unit, p i represents the real traffic indicator corresponding to the i-th road space unit.
[0098] It should be understood that the electronic device is not limited to using the above formula to train the parameters of the second model, and the above formula can be transformed to train the parameters of the second model.
[0099] Optionally, the M groups of traffic indicators and the M second models correspond one by one. For example, the traffic indicator corresponding to the second model A is the future short-term congestion indicator, the traffic indicator corresponding to the second model B is the short-term speed indicator, the traffic indicator corresponding to the second model C is the short-term flow indicator, and the traffic indicator corresponding to the second model D is the road safety risk indicator.
[0100] In the embodiment of the present application, considering that the multiple services for the same road space unit all involve embedded encoding of the feature data of the road space unit in T time slices, based on this, during model training, the electronic device can separately train a first model for generating embedded encoding, and separately train a second model with fewer parameters corresponding to different services, that is, the first model is completely decoupled from the services, which avoids repeated training of the first model, thereby reducing the large consumption and waste of hardware resources of the electronic device. For example, the traffic indicators of the two services of road traffic prediction and road safety risk early warning are short-time traffic indicators and road safety risk indicators of the road space unit, both of which are related to the feature data of the road space unit in T time slices, that is, both need to use the embedded encoding of the road space unit, based on this, the electronic device can separately train a first model for generating embedded encoding and separately train a second model corresponding to the two services.
[0101] Figure 7 A flowchart of a data processing method is provided for the embodiment of the present application. The method can be executed by a computer, a desktop computer, a notebook computer, or any electronic device, for example, the method can be executed by the execution device 104 in Figure 1 , but is not limited thereto, as shown in Figure 7 , the method can include the following steps:
[0102] S710: input the feature data of the third road space unit in T time slices into the first model trained by the above model training method, to obtain the embedded encoding of the third road space unit, T being a positive integer;
[0103] S720: input the embedded encoding of the third road unit into any one of the second models trained by the above model training method, to obtain the traffic indicator of the third road space unit.
[0104] It should be understood that the third road space unit is any road space unit in the execution stage.
[0105] It should be understood that any one of the second models in S720 can be a service model for predicting future short-time congestion, a service model for predicting short-time speed, a service model for predicting short-time traffic, a service model for predicting road safety risk, etc.
[0106] Figure 8 A data processing method diagram is provided for the embodiment of the present application, as shown in Figure 8If the embedded encoding of the third road space unit is input into the short-time congestion prediction model, a future short-time congestion indicator will be obtained, if the embedded encoding of the third road space unit is input into the short-time speed prediction model, a short-time speed indicator will be obtained, if the embedded encoding of the third road space unit is input into the short-time flow prediction model, a short-time flow indicator will be obtained, and if the embedded encoding of the third road space unit is input into the safety risk prediction model, a road safety risk indicator will be obtained.
[0107] In the embodiment of the present application, the electronic device can input the feature data of the third road space unit in T time slices into the first model which has been trained through unsupervised learning, generate the embedded encoding of the third road space unit, and input the embedded encoding into the second model related to a specific business scenario, and finally output the required traffic indicators.
[0108] Figure 9 A schematic diagram of a model training device 900 provided in the embodiment of the present application is shown in FIG. 9. Figure 9 The device 900 can include a first input module 910, a first training module 920, a second input module 930, a third input module 940, and a second training module 950. The first input module 910 is configured to input the feature data of a first road space unit in T time slices into a first model to obtain the embedded encoding of the first road space unit, where T is a positive integer. The first training module 920 is configured to train the first model according to the embedded encoding of the first road space unit. The second input module 930 is configured to input the feature data of a second road space unit in T time slices into the trained first model to obtain the embedded encoding of the second road space unit. The third input module 940 is configured to input the embedded encoding of the second road space unit into M second models to obtain M groups of traffic indicators of the second road space unit, where M is an integer greater than 1. The second training module 950 is configured to train the corresponding second models according to the M groups of traffic indicators of the second road space unit.
[0109] Optionally, the first model includes an input layer, a fully connected layer, and a time sequence feature extraction layer. The input layer is configured to input the feature data of the road space unit in T time slices. The fully connected layer is configured to perform nonlinear transformation on the feature data of the road space unit in T time slices to obtain the nonlinear transformed feature data of the road space unit in T time slices. The time sequence feature extraction layer is configured to perform feature extraction on the time sequence dynamic data in the nonlinear transformed feature data to generate the embedded encoding of the road space unit.
[0110] Optionally, the first training module 920 is specifically configured to: calculate distances between the embedded encodings of the N first road space units; and train the first model according to the distances between the embedded encodings of the N first road space units.
[0111] Optionally, the first training module 920 is specifically configured to: calculate a quotient of a sum of the distances between the embedded encodings of the N first road space units and N, to obtain a quotient result; and train the first model to maximize the quotient result.
[0112] Optionally, the second model is a nonlinear fully connected neural network.
[0113] Optionally, the second training module 950 is specifically configured to: train the corresponding second model according to the M groups of traffic indexes of the second road space unit respectively by using a supervised training method.
[0114] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, details are not described herein. Specifically, Figure 9 The device 900 shown can perform Figure 2 corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the device 900 are respectively to realize corresponding flows in each method Figure 2 in the device 900. To be brief, details are not described herein.
[0115] The device 900 of the embodiments of the present application is described above in the functional module perspective. It should be understood that the functional module can be realized by hardware, or by instructions in the form of software, or by a combination of hardware and software modules. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits and / or instructions in the form of software in the hardware in the processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing and completed by the processor, or completed by a combination of hardware and software modules in the code processing. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps in the above method embodiments.
[0116] Figure 10 A schematic diagram of a data processing device 1000 provided by the embodiments of the present application is shown in Figure 10As shown, the apparatus 1000 includes a first input module 1010 and a second input module 1020, where the first input module 1010 is configured to input feature data of a third road space unit in T time slices into a first model trained by the model training method, to obtain an embedded code of the third road space unit, where T is a positive integer; and the second input module 1020 is configured to input the embedded code of the third road space unit into any second model trained by the model training method, to obtain a traffic index of the third road space unit.
[0117] It should be understood that the apparatus embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, details are not described herein. Specifically, Figure 10 The apparatus 1000 as shown can perform the method embodiments. Figure 7 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the apparatus 1000 are respectively for realizing corresponding procedures in each method in the Figure 7 For brevity, details are not described herein.
[0118] The apparatus 1000 of the embodiments of the present application is described above in connection with the accompanying drawings from the perspective of functional modules. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in a processor and / or instructions of software, and the steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing performed by a processor, or executed by a combination of hardware and software modules in a code processing processor. Alternatively, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps in the above method embodiments.
[0119] Figure 11 is a schematic block diagram of the electronic device 1100 provided by the embodiments of the present application.
[0120] As shown in Figure 11 The electronic device 1100 can include:
[0121] The memory 1110 is configured to store a computer program and transmit the program code to the processor 1120. In other words, the processor 1120 can call and run the computer program from the memory 1110 to implement the method in the embodiments of the present application.
[0122] For example, the processor 1120 can be configured to perform the above-described method embodiments according to instructions in the computer program.
[0123] In some embodiments of the application, the processor 1120 can include, but is not limited to:
[0124] A general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc.
[0125] In some embodiments of the application, the memory 1110 includes, but is not limited to:
[0126] volatile memory and / or non-volatile memory. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), which is used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a synch link DRAM (SLDRAM), and a Direct Rambus RAM (DR RAM).
[0127] In some embodiments of the present application, the computer program can be divided into one or more modules, which are stored in the memory 1110 and executed by the processor 1120 to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.
[0128] As shown in Figure 11 The electronic device can further include:
[0129] The transceiver 1130 can be connected to the processor 1120 or the memory 1110.
[0130] The processor 1120 can control the transceiver 1130 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 1130 can include a transmitter and a receiver. The transceiver 1130 can further include an antenna, and the number of antennas can be one or more.
[0131] It should be understood that various components in the electronic device are connected through a bus system, wherein the bus system includes a data bus, a power supply bus, a control bus and a state signal bus in addition to a data bus.
[0132] The present application also provides a computer storage medium, which stores a computer program, and the computer program makes the computer execute the method of the above-mentioned method embodiment when executed by the computer. Alternatively, the present application embodiment also provides a computer program product containing instructions, which makes the computer execute the method of the above-mentioned method embodiment when executed by the computer.
[0133] When implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media can be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired computer program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, or a twisted pair, as examples, then the coaxial cable, fiber optic cable, or twisted pair are included in the definition of medium. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), and Blu-Ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0134] In one embodiment, the techniques described herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the techniques can be realized in whole or in part in a computer-readable medium during execution of software by a computer-based system, a processing device based system, or other system(s). Computer-readable media can include computer storage media and communication media. Storage media can be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, semiconductor memory, such as erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), or flash memory, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, functional modules can comprise components of an integrated circuit, programmable logic device, a field programmable gate array (FPGA), or other logic device implemented in a hardware device. In one embodiment, a functional module can comprise a computer program product that can be traded as a product. In another embodiment, a functional module can comprise a computer program product that can be downloaded or transferred via a network, such as the Internet, Intranet, Extranet, or a local area network.
[0135] In several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method can be implemented in other manners. For example, the described apparatus embodiments are merely schematic. For example, the division of the modules is merely logical function division. There can be another division manner for the actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices, or modules, and can be in electrical, mechanical, or other forms.
[0136] The modules illustrated as separate components may or may not be physically separate, and the components illustrated as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected as needed to achieve the purpose of the embodiments of the present application. For example, the functional modules in various embodiments of the present application can be integrated into one processing module, or each module can be physically present separately, or two or more modules can be integrated into one module.
[0137] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A model training method, characterized in that: include: Inputting feature data of the first road space unit in T time slices into the first model to obtain an embedded code of the first road space unit, where T is a positive integer; training the first model based on the embedded encoding of the first road spatial unit; Inputting the feature data of the second road space unit in T time slices into the trained first model to obtain an embedded code of the second road space unit; Inputting the embedded code of the second road space unit into M second models to obtain M groups of traffic indicators of the second road space unit, where M is an integer greater than 1; Training corresponding second models according to the M groups of traffic indicators of the second road space unit; Wherein, the first model includes: The input layer is used to input the characteristic data of the road space unit in T time slices; a fully connected layer, configured to perform a nonlinear transformation on the feature data of the road space unit in T time slices to obtain the feature data of the road space unit after the nonlinear transformation in T time slices; The time series feature extraction layer is used to extract features from the time series dynamic data in the feature data after the nonlinear transformation and generate the embedded code of the road space unit.
2. The method according to claim 1, characterized in that The step of training the first model according to the embedded coding of the first road space unit comprises: Calculating distances between the embedded codes of N first road space units; The first model is trained based on the distances between the embedded codes of N first road spatial units.
3. The method according to claim 2, characterized in that The step of training the first model according to the distances between the embedded codes of the N first road space units comprises: Calculating the quotient of the sum of the distances between the embedded codes of the N first road space units and the N distances to obtain a quotient result; The first model is trained to maximize the quotient result.
4. The method according to any one of claims 1 to 3, characterized in that The second model is a nonlinear fully connected neural network.
5. The method according to claim 4, characterized in that The training of corresponding second models according to the M groups of traffic indicators of the second road space unit includes: A supervised training method is used to train corresponding second models according to the M groups of traffic indicators of the second road space unit.
6. A data processing method, characterized in that: include: Inputting feature data of the third road spatial unit in T time slices into the first model trained by the method according to any one of claims 1 to 5 to obtain an embedded code of the third road spatial unit, where T is a positive integer; The embedded code of the third road space unit is input into any second model trained by the method according to any one of claims 1 to 5 to obtain the traffic index of the third road space unit.
7. A model training device, characterized in that: include: A first input module is configured to input feature data of a first road spatial unit in T time slices into a first model to obtain an embedded code of the first road spatial unit, where T is a positive integer; A first training module, configured to train the first model according to the embedded coding of the first road space unit; A second input module is configured to input feature data of the second road space unit in T time slices into the trained first model to obtain an embedded code of the second road space unit; a third input module, configured to input the embedded code of the second road space unit into M second models to obtain M groups of traffic indicators of the second road space unit, where M is an integer greater than 1; The second training module is configured to train corresponding second models according to the M groups of traffic indicators of the second road space unit; wherein the first model includes: The input layer is used to input the characteristic data of the road space unit in T time slices; a fully connected layer, configured to perform a nonlinear transformation on the feature data of the road space unit in T time slices to obtain the feature data of the road space unit after the nonlinear transformation in T time slices; The time series feature extraction layer is used to extract features from the time series dynamic data in the feature data after the nonlinear transformation and generate the embedded code of the road space unit.
8. A data processing device, characterized in that: include: A first input module is configured to input feature data of a third road spatial unit in T time slices into a first model trained by the method according to any one of claims 1 to 5, to obtain an embedded code of the third road spatial unit, where T is a positive integer; The second input module is used to input the embedded code of the third road space unit into any second model trained by the method as described in any one of claims 1 to 5 to obtain the traffic index of the third road space unit.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 6.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Traffic time prediction model training method, traffic time prediction method, and equipment
CN113762595A