WO2023273724A1 - Traffic analysis method, related device, and readable storage medium - Google Patents

Traffic analysis method, related device, and readable storage medium Download PDF

Info

Publication number
WO2023273724A1
WO2023273724A1 PCT/CN2022/095206 CN2022095206W WO2023273724A1 WO 2023273724 A1 WO2023273724 A1 WO 2023273724A1 CN 2022095206 W CN2022095206 W CN 2022095206W WO 2023273724 A1 WO2023273724 A1 WO 2023273724A1
Authority
WO
WIPO (PCT)
Prior art keywords
tensor
traffic
factor matrix
traffic data
road network
Prior art date
Application number
PCT/CN2022/095206
Other languages
French (fr)
Chinese (zh)
Inventor
蒋鑫
纪雅琪
王健
童恒金
杜豫川
都州扬
潘宁
刘成龙
曾俊益
曾程
敖星冉
吴荻非
Original Assignee
中移(上海)信息通信科技有限公司
中移智行网络科技有限公司
中国移动通信集团有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中移(上海)信息通信科技有限公司, 中移智行网络科技有限公司, 中国移动通信集团有限公司 filed Critical 中移(上海)信息通信科技有限公司
Publication of WO2023273724A1 publication Critical patent/WO2023273724A1/en

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0125Traffic data processing
    • G08G1/0129Traffic data processing for creating historical data or processing based on historical data
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/0104Measuring and analyzing of parameters relative to traffic conditions
    • G08G1/0137Measuring and analyzing of parameters relative to traffic conditions for specific applications

Definitions

  • the embodiments of the present application relate to the traffic field, and in particular, to a traffic analysis method, related equipment, and a readable storage medium.
  • Embodiments of the present application provide a traffic analysis method, related equipment, and a readable storage medium, so as to solve the problem of low traffic analysis accuracy in the prior art.
  • the embodiment of the present application provides a traffic analysis method, the method comprising:
  • a first tensor is generated, the length of the space dimension of the first tensor is S road sections in the target road network, and the time dimension
  • the length is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is an integer greater than 1;
  • the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  • the embodiment of the present application also provides a traffic analysis device, including:
  • a generating module configured to generate a first tensor according to the traffic data detected by each detector in the target road network within the first duration, the length of the spatial dimension of the first tensor being S in the target road network sections, the length of the time dimension is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is greater than 1 integer;
  • the fusion module is used to fuse the spatial dimension and the traffic data dimension in the first tensor by using the attention mechanism to obtain the second tensor;
  • the first determination module is configured to determine the target information of the target road network according to the third tensor
  • the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  • the embodiment of the present application also provides an electronic device, including: a transceiver, a memory, a processor, and a program stored in the memory and operable on the processor; the processor is used to Reading the program in the memory implements the method described in the aforementioned first aspect.
  • the embodiment of the present application further provides a readable storage medium for storing a program, and when the program is executed by a processor, the method described in the aforementioned first aspect is implemented.
  • the electronic device performs spatio-temporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, it performs fusion processing on the spatial dimension and the traffic data dimension in the first tensor to obtain the first tensor Two tensors, and then according to the second tensor, determine the target information of the target road network, the target information includes at least one of the following: traffic mode, traffic law and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.
  • Fig. 1 is a schematic flow chart of the traffic analysis method provided by the embodiment of the present application.
  • Fig. 2 is a schematic diagram of the first tensor provided by the embodiment of the present application.
  • Fig. 3 is a schematic diagram of feature extraction of the tensor provided by the embodiment of the present application.
  • FIG. 4 is a schematic diagram of the fusion of tensors provided by the embodiment of the present application.
  • Fig. 5 is a schematic diagram of the first model provided by the embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of the traffic analysis device provided by the implementation of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by the implementation of the present application.
  • the traffic analysis method in the embodiment of the present application may be executed by an electronic device.
  • electronic equipment can be servers, mobile phones, tablet computers (Tablet Personal Computer), laptop computers (Laptop Computer), personal digital assistants (Personal Digital Assistant, PDA), mobile Internet devices (Mobile Internet Device, MID ), wearable device (Wearable Device) or vehicle-mounted device, etc.
  • FIG. 1 is a schematic flowchart of a traffic analysis method provided in an embodiment of the present application. As shown in Figure 1, the following steps may be included:
  • Step 101 according to the traffic data detected by each detector in the target road network within the first time length, generate a first tensor, the length of the spatial dimension of the first tensor is S road sections in the target road network , the length of the time dimension is T time points within the first duration, and the length of the traffic data dimension is the R-type traffic data detected by the detector.
  • S and T are positive integers, and R is an integer greater than 1.
  • the detectors are arranged on each lane of each road section of the target road network.
  • one detector may be arranged on one lane of one road section, that is, one detector may be used to detect traffic data of one lane of one road section.
  • Each detector can detect the value of R-type traffic data according to a preset frequency, and the R-type traffic data can include but not limited to the average speed of each lane, occupancy rate, number of driving vehicles, lane occupancy time, etc., which can reflect the traffic state data .
  • the R-type traffic data may also be referred to as the R-type traffic state.
  • the electronic device can obtain the overall traffic status of the target network within the first period of time by acquiring the traffic data detected by each detector in the target network within the first period of time, and then can analyze the target network in the first period of time. Perceive the traffic state within the first duration, and use the perceived traffic state to predict the future traffic state of the target network.
  • the first preset duration can be set in advance according to demand, such as 1 hour or 1 day Wait.
  • the electronic device After the electronic device acquires the traffic data detected by each detector in the target network within the first time period, it can generate a first tensor, the first tensor is a multi-dimensional space-time tensor of traffic data, and the first The tensor includes all traffic data detected by the detectors of each road section in the target road network within the first time period.
  • the detector performs T detections within the first time period, and the detector detects R traffic data
  • the first tensor is S ⁇ T ⁇ R tensor, where S represents the length of the spatial dimension; T represents the length of the time dimension; R represents the length of the traffic data dimension.
  • the millimeter-wave radar has the following advantages: it is less affected by the environment, such as haze, rain, snow and light; the detection coverage is large, the viewing angle can reach 120°, and the detection distance can reach 250 meters; the engineering is simple; Additional computing power requirements; low maintenance costs.
  • the detector in this embodiment of the present application may be a millimeter-wave radar detector. In this way, the traffic data detected by the detector is more accurate, thereby further improving the accuracy of traffic analysis.
  • the detector in the embodiment of the present application may also be other types of detectors, such as a coil detector or a geomagnetic detector, which may be determined according to actual needs, which is not limited in the embodiment of the present application.
  • Step 102 using the attention mechanism to fuse the spatial dimension and traffic data dimension in the first tensor to obtain the second tensor.
  • the electronic device after the electronic device generates the first tensor, it can also use the attention mechanism to capture and identify the regional features of the spatial dimension and traffic data dimension in the first tensor, so as to improve the recognition and capture of regional features the accuracy. Since the more accurate the feature recognition and capture, the better the analysis effect of the traffic state. Therefore, the analysis of the traffic state by using the second tensor obtained by fusion can further improve the accuracy of the traffic state analysis.
  • Step 103 determine the target information of the target road network.
  • the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  • the electronic device may directly determine the target information of the target road network based on the second tensor obtained through fusion.
  • the electronic device may further detect whether there is a vacant value in the second tensor, and if there is a vacant value in the second tensor, fill in the second tensor, and use the first Three tensors, which determine the target information of the target road network. It can be seen that, compared with the first implementation manner, the accuracy of the target information of the target road network determined by the second implementation manner is higher.
  • the traffic mode may be characterized by a degree of congestion, and the degree of congestion in different traffic modes is different.
  • the traffic law can be represented by the average value of various traffic data in the target time or target space.
  • the future traffic state can be represented by multi-dimensional traffic data space-time tensor.
  • the electronic device performs spatiotemporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, fusion processing is performed on the spatial dimension and the traffic data dimension in the first tensor, The second tensor is obtained, and then the target information of the target road network is determined according to the second tensor, and the target information includes at least one of the following: traffic mode, traffic law, and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.
  • generating the first tensor according to the traffic data detected by each detector in the target road network within the first duration includes:
  • the electronic device may perform spatiotemporal stitching on the acquired traffic data to generate the first tensor.
  • the value of traffic data is highly correlated with the time dimension. After each unit of time, the value of each traffic data will change due to reasons such as vehicles entering, leaving or parking and waiting, accident collisions, etc. in each lane of the road network. Therefore, the electronic device may generate a time sequence according to the time sequence detected by the detector, and the time sequence includes the T time points.
  • the electronic device may generate a spatial sequence according to the spatial sequence of the S road sections, where the spatial sequence includes the S road sections.
  • R traffic data can be represented by R grid graphs, and the R grid graphs form a multi-dimensional traffic state space-time tensor according to the time-space correspondence, that is, the first tensor, where each grid graph represents a class For traffic data, each grid in the grid graph represents the value of a type of traffic data for a lane at a point in time.
  • the traffic data dimension of the first tensor is 3, but this does not limit the value of the traffic data dimension.
  • the temporal and spatial splicing of the traffic data of the target road network within the first time length can be realized, and the first tensor can be obtained.
  • the traffic state obtained by using the first tensor analysis can be more in line with the actual traffic state, which can improve the accuracy of traffic analysis.
  • the use of the attention mechanism to fuse the spatial dimension and the traffic data dimension in the first tensor to obtain the second tensor includes:
  • the intermediate tensor is input into the attention fusion network to obtain the weight value of each regional feature in the intermediate tensor;
  • the electronic device may use a feature extraction model to extract regional features of the spatial dimension and the traffic data dimension in the first tensor.
  • the feature extraction model can be a convolutional neural network, but is not limited thereto.
  • the convolutional neural network can use convolution kernels with different weights to extract the regional features of the input tensor. Convolution kernels of different sizes can capture regional features of different scales.
  • the first tensor is filtered and calculated by multiple convolution kernels to obtain the intermediate tensor ⁇ , and the size of the intermediate tensor ⁇ is H ⁇ W ⁇ T, where H represents the spatial dimension W represents the length of the traffic data dimension, and T represents the length of the time dimension.
  • the electronic device may input the intermediate tensor ⁇ into the attention fusion network to obtain the weight value ⁇ of each region feature in the intermediate tensor.
  • the attention fusion network can average each plane of the intermediate tensor ⁇ , compress 1 ⁇ 1 ⁇ T, and obtain the weight value ⁇ of each region feature in the intermediate tensor.
  • the electronic device may multiply the weight value ⁇ of each region feature by the first tensor to obtain a second tensor of depth fusion.
  • the electronic device can assign different weights to different regional features of the first tensor, and then fuse them to obtain a multi-dimensional traffic data tensor with an attention mechanism, thereby further improving the accuracy of traffic analysis.
  • the attention mechanism is used to fuse the spatial dimension and traffic data dimension in the first tensor, and after obtaining the second tensor, the third tensor is used to determine the Before the target information of the target road network, the method also includes:
  • the vacant value is filled by using a weight-based interpolation method to obtain a third tensor.
  • the detector may lack data collection due to at least one of the following factors: the detector is interfered by obstructions, buildings or bad weather; the detector is debugged, the built-in program has errors, and the like.
  • missing data can be filled. Filling in the gaps can be to use the collected traffic data to perform numerical interpolation or reasonable prediction in the missing places to make the data reasonable and complete.
  • vacant values can be filled in the following ways:
  • the vacant value is related to the state variable values of the front and back time series and the left and right space series. Therefore, the weighted method is used to find the expectation of the variables at the front, back, left, and right sides of the variable, so as to fill the vacant value at the center.
  • the weighting coefficients ⁇ 1 , ⁇ 2 , ⁇ 3 , and ⁇ 4 depend on the extent to which the vacancy value is affected by surrounding spatiotemporal variables, and can be specifically set according to actual needs, which is not limited in this embodiment of the present application. Generally, the greater the impact of surrounding variables on the traffic state value at the vacancy, the higher the weighting coefficient.
  • c can also be calculated by the following formula:
  • the target information includes traffic patterns.
  • the determining the target information of the target road network according to the third tensor includes:
  • the traffic mode of the target road network is determined according to the first factor matrix, the second factor matrix and the third factor matrix.
  • the electronic device uses tensor (Canonical Polyadic, CP) decomposition to determine the traffic mode. It should be noted that, in other implementation manners, the electronic device may also use the third tensor to determine the traffic mode in other ways, for example, the electronic device may determine the traffic mode by using the second model, and the input of the second model is the The third tensor is output as the first factor matrix, the second factor matrix, and the third factor matrix. The embodiment of the present application does not limit the way of determining the traffic mode according to the third tensor.
  • tensor Canonical Polyadic, CP
  • Traffic mode also known as traffic travel mode or traffic behavior mode
  • Traffic behavior mode reflects the inherent similarity between the traffic states of individuals or road segments within a given time and space range. In practical applications, individuals or road segments with significant similar connections can be classified into the same traffic mode.
  • the length of the spatial dimension of the third tensor is n road sections
  • the length of the time dimension is m time points
  • the length of the traffic data dimension is i-type traffic data
  • n and m are both positive integers
  • i is greater than 1 an integer of .
  • the size of the first factor matrix A corresponding to the time dimension obtained by performing CP decomposition on the third tensor is m ⁇ Q
  • the size of the second factor matrix B corresponding to the space dimension is n ⁇ Q
  • the size of the third factor matrix C corresponding to the data is i ⁇ Q, that is, the first factor matrix is an m ⁇ Q matrix
  • the second factor matrix B is an n ⁇ Q matrix
  • the third factor matrix C is i ⁇ Q matrix.
  • Q represents the number of traffic modes of the target road network
  • Q is a positive integer.
  • the electronic device may determine the traffic mode of the target road network based on the first factor matrix, the second factor matrix and the third factor matrix obtained through decomposition.
  • the determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix includes:
  • a Q group of traffic data sequences (also called a travel mode sequence or a state sequence) can be obtained.
  • Each group of travel modes includes three vectors of m ⁇ 1, n ⁇ 1, and i ⁇ 1, and each group of travel modes can be used to determine a traffic mode, so that Q groups of traffic data sequences can reveal Q types of traffic with different characteristics traffic pattern.
  • the determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix includes:
  • the traffic mode of the target road network is determined according to the optimized first factor matrix, second factor matrix and third factor matrix.
  • the third tensor is X
  • the relationship between X and the first factor matrix A, the second factor matrix B and the third factor matrix C can be expressed by the following formula:
  • the objective function f can reflect X and the second value difference between.
  • the objective function f can be expressed by the following formula:
  • the objective function f can be simplified as:
  • the gradient descent method can be used to solve the optimization decision variables a mr , b nr , c ir .
  • partial derivatives can be obtained for each decision variable first, and each decision variable can be updated using the partial derivative value, and iteratively updated until the objective function converges, that is, the optimum is achieved, that is, the difference between the first value and the second value is the smallest , the second value is infinitely close to the first value.
  • each factor matrix can be optimized, and the optimal first factor matrix, second factor matrix and third factor matrix can be used to determine the traffic mode of the target road network , so that the accuracy of traffic mode determination can be further improved.
  • the target information includes traffic rules.
  • the spatio-temporal law of traffic is reflected in a given space-time range, among individual travel individuals or travel sections, individuals or sections present a similar or identical state in a specific time period and space.
  • the traffic law can be represented by the average value of various traffic data in the target time or target space.
  • the determining the target information of the target road network according to the third tensor includes at least one of the following:
  • the time unit of the target duration includes at least one of the following: day; week; year; the spatial unit of the target space includes at least one of the following: lane; road section; road network; the value range of k is 1 to i .
  • the electronic device can perform daily and/or weekly and/or annual traffic status analysis.
  • time units also called time scales or aggregate units
  • A ⁇ a 1 ,a 2 ,a 3 ,a 4 ,...a k ⁇
  • a k represents the average value of the i-th traffic state of the target road network within the (o,p) time period.
  • the continuous statistical time of (o,p) is 1 month, and the state values of all 12 months in a year are calculated to obtain the annual traffic state analysis table.
  • the electronic device can perform lane-level and/or section-level and/or road-network-level traffic state analysis.
  • the lanes, road sections, and road networks detected by the detector are used as aggregate units to make statistics on various traffic states:
  • b k represents the average value of the i-th traffic state on the (q, u) section at time t n .
  • the above formula can be used to obtain the traffic status table of a certain lane level, a certain road section or a certain road network level in a city at a certain moment.
  • the target information includes future traffic status.
  • Traffic state prediction reflecting the prediction of various traffic states in the road sections detected by the millimeter-wave radar within a given time range in the future.
  • the multi-dimensional traffic data tensor established based on the data detected by the detector has strong temporal and spatial dependencies, and can make accurate predictions of future traffic conditions by using its tight temporal and spatial dependencies.
  • the determining the target information of the target road network according to the third tensor includes:
  • the first hidden state when the first model predicts the fourth tensor is determined by the third tensor and the historical hidden state, and the historical hidden state is the hidden state of the first model in the third duration State determination, the third duration is a previous duration of the first duration; the hidden state of the first model is used to determine the output of the first model.
  • the first model is used to predict the traffic state at a future moment
  • the input of the first model is the third tensor
  • the output is the tensor of the future duration corresponding to the third tensor , which can be used to reflect the traffic status of the target road network within a narrow time period.
  • the structure of the first model can be seen in Fig. 5, and the first model predicts the future traffic state and can comprise following three steps:
  • the above-mentioned duration is regarded as a moment in the following, and the future duration is the future moment.
  • the other variables of the predictive model are:
  • h (t) represents the hidden state of the model at time t, and h (t) is jointly determined by the input x (t) at the corresponding time and the hidden state h (t-1) at the previous moment.
  • o (t) represents the output of the model at time t, and o (t) is only determined by the model's current hidden state h (t) .
  • L (t) represents the loss function of the model at time t.
  • y (t) represents the true value at time t.
  • U, V, W represent the shared weight matrix in the prediction model.
  • the forward propagation calculation of the model is performed.
  • the hidden state h (t) at this moment is obtained from the multi-dimensional traffic state tensor x (t) at this moment and the hidden state h (t-1) at the previous moment:
  • the method further includes:
  • the weight value of the first model is adjusted to obtain the trained first model.
  • the loss function can be calculated by the following formula:
  • the gradient descent algorithm is used to calculate the partial derivatives of the decision variables v and V of the difference function L, iteratively calculate multiple rounds, and continuously update c and V to optimize the model and achieve accurate predictions.
  • the partial derivatives of the decision variables U, W, and b of the difference function L are gradually calculated by the stepwise gradient descent method, and iterative for multiple rounds, and the model is continuously updated to optimize the model and achieve accurate prediction.
  • the model parameters are iteratively optimized based on the loss function, and when the loss function is smaller than the specified threshold, no update is performed. Input the multi-dimensional traffic state variable at this moment into the model, and after calculation, the multi-dimensional traffic state variable corresponding to the space at the next moment can be obtained, that is, the prediction result can be obtained.
  • the electronic equipment collects the detection data of each millimeter-wave radar detection point on the target road network. According to the matching results between the stake number of the millimeter-wave radar and the map positioning, the continuous millimeter-wave radar data sets in the road network are spliced in time and space dimensions to restore the traffic status at the lane level.
  • each data tensor contains no less than two types of traffic status information, including but not limited to information such as average speed, occupancy rate, and number of vehicles in each lane in the road network.
  • the electronics output spliced and fused mmWave radar data.
  • the lane-level data tensor formed by splicing is deeply fused to obtain the millimeter-wave radar multi-dimensional traffic state tensor fused with multi-source information.
  • the millimeter-wave radar data formed by the fusion of electronic equipment formed by the fusion of electronic equipment.
  • the electronic device outputs the predicted traffic state value of the lane in the future.
  • This application adopts an effective data format for millimeter-wave radar data, and proposes an effective urban road network lane-level algorithm based on this data format, which can not only realize the travel mode analysis of traffic road network data, but also can analyze Interval specified roads for accurate traffic state prediction.
  • This application adopts the method of accurately splicing all the time range and area range data covered by the millimeter wave radar to realize the deep fusion of multi-source data generated by the millimeter wave radar, improve the accuracy of perception and prediction; and process the missing data , to adapt to the data problems existing in the real scene, and lay the foundation for the further use of millimeter-wave radar data in the future.
  • the data analysis and prediction method of the multi-dimensional millimeter-wave radar proposed in this application can adapt to the transmission of traffic roadside equipment in the 5G scenario, and can also be oriented to distributed computing and processing of data under edge computing.
  • This proposal can not only realize the travel mode analysis of traffic road network data in the existing technical environment, but also adapt to the rapid processing and calculation of traffic data in the future emerging technology scenarios.
  • FIG. 6 is one of the structural diagrams of the traffic analysis device provided by the embodiment of the present application.
  • the traffic analysis device 600 includes:
  • the generating module 601 is configured to generate a first tensor according to the traffic data detected by each detector in the target road network within the first duration, and the length of the spatial dimension of the first tensor is S road sections, the length of the time dimension is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is greater than 1 an integer of
  • Fusion module 602 for utilizing the attention mechanism to fuse the spatial dimension and the traffic data dimension in the first tensor to obtain the second tensor;
  • the first determination module 603 is configured to determine the target information of the target road network according to the third tensor
  • the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  • the generating module 601 includes:
  • a generation submodule is used to generate a time sequence corresponding to T time points detected by each detector in the target road network, and a space sequence corresponding to S road sections in the target road network;
  • the splicing sub-module is used to splice the value of the R-type traffic data corresponding to each time point in the time series and the value of the R-type traffic data corresponding to each road segment in the space sequence to obtain the first tensor.
  • the fusion module 602 includes:
  • the extraction submodule is used to extract the regional features of the spatial dimension and the traffic data dimension in the first tensor to obtain an intermediate tensor;
  • the first acquisition submodule is used to input the intermediate tensor into the attention fusion network to obtain the weight value of each region feature in the intermediate tensor;
  • the second acquisition sub-module is configured to multiply the weight value of each region feature by the first tensor to obtain a second tensor.
  • the traffic analysis device 600 also includes:
  • a detection module configured to detect whether there is a vacant value in the second tensor
  • the first obtaining module is configured to, in the case that there is a vacant value in the second tensor, use a weight-based interpolation method to fill in the vacant value to obtain a third tensor.
  • the first determining module 603 includes:
  • the decomposition sub-module is used to perform tensor decomposition on the third tensor to obtain the first factor matrix corresponding to the time dimension, the second factor matrix corresponding to the space dimension, and the third factor matrix corresponding to the traffic data;
  • a determining submodule configured to determine the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix.
  • the determining submodule includes:
  • a construction unit configured to construct an objective function, the objective function is used to reflect the difference between a first value and a second value, the first value is the value of the third tensor, and the second value is based on the The first factor matrix, the second factor matrix and the third factor matrix are calculated;
  • an optimization unit configured to optimize the first factor matrix, the second factor matrix, and the third factor matrix according to the objective function
  • the determining unit is configured to determine the traffic mode of the target road network according to the optimized first factor matrix, second factor matrix and third factor matrix.
  • the length of the spatial dimension of the third tensor is n road sections, the length of the time dimension is m time points, the length of the traffic data dimension is i-type traffic data, n and m are both positive integers, i is an integer greater than 1;
  • the first factor matrix is an m ⁇ Q matrix
  • the second factor matrix is an n ⁇ Q matrix
  • the third factor matrix is an i ⁇ Q matrix
  • Q is a positive integer
  • the determination submodule includes:
  • a first acquisition unit configured to obtain Q groups of traffic data sequences according to the first factor matrix, the second factor matrix and the third factor matrix
  • the second acquiring unit is configured to acquire Q traffic modes corresponding to the Q group of traffic data sequences.
  • the length of the traffic data dimension of the third tensor is traffic data of type i, where i is an integer greater than 1;
  • the first determination module 603 is used for at least one of the following:
  • the time unit of the target duration includes at least one of the following: day; week; year; the spatial unit of the target space includes at least one of the following: lane; road section; road network; the value range of k is 1 to i .
  • the first determination module 603 is configured to:
  • the first hidden state when the first model predicts the fourth tensor is determined by the third tensor and the historical hidden state, and the historical hidden state is the hidden state of the first model in the third duration State determination, the third duration is a previous duration of the first duration; the hidden state of the first model is used to determine the output of the first model.
  • the traffic analysis device 600 also includes:
  • the second acquisition module is used to acquire the sample tensor
  • a third acquisition module configured to input the sample tensor into the untrained first model to obtain a fifth tensor
  • a second determining module configured to determine a loss function corresponding to the first model according to the sample tensor and the fifth tensor;
  • the adjusting module is used to adjust the weight value of the first model according to the loss function to obtain the trained first model.
  • the traffic analysis device 600 can realize various processes of the method embodiment in FIG. 1 in the embodiment of the present application, and achieve the same beneficial effect. To avoid repetition, details are not repeated here.
  • the embodiment of the present application also provides an electronic device.
  • the electronic device may include a processor 701, a memory 702, and a program 7021 stored in the memory 702 and operable on the processor 701.
  • the program 7021 is executed by the processor 701, the method embodiment corresponding to FIG. 1 may be implemented. Any steps in the method and achieving the same beneficial effect will not be repeated here.
  • the storage medium is, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • magnetic disk or an optical disk and the like.
  • the electronic device performs spatio-temporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, it performs fusion processing on the spatial dimension and the traffic data dimension in the first tensor to obtain the first tensor Two tensors, and then according to the second tensor, determine the target information of the target road network, the target information includes at least one of the following: traffic mode, traffic law and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Traffic Control Systems (AREA)

Abstract

A traffic analysis method, a related device, and a readable storage medium, relating to the field of traffic. The method comprises: step 101, generating a first tensor according to traffic data detected by detectors in a target road network within a first duration, wherein the length of a spatial dimension of the first tensor is S road segments in the target road network, the length of a temporal dimension is T time points within the first duration, the length of a traffic data dimension is R types of traffic data detected by the detectors, S and T are both positive integers, and R is an integer greater than 1; step 102, fusing the spatial dimension and the traffic data dimension in the first tensor by using an attention mechanism to obtain a second tensor; and step 103, determining target information of the target road network according to a third tensor, wherein the third tensor is the second tensor or is determined on the basis of the second tensor, and the target information comprises at least one of the following: a traffic mode, a traffic pattern, and a future traffic state. By performing traffic analysis using multi-dimensional traffic data, the accuracy of traffic analysis is improved.

Description

交通分析方法、相关设备及可读存储介质Traffic analysis method, related equipment and readable storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年06月29日提交中国专利局、申请号为202110727130.5、申请名称为“交通分析方法、相关设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110727130.5 and the application title "traffic analysis method, related equipment and readable storage medium" submitted to the China Patent Office on June 29, 2021, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请实施例涉及交通领域,尤其涉及一种交通分析方法、相关设备及可读存储介质。The embodiments of the present application relate to the traffic field, and in particular, to a traffic analysis method, related equipment, and a readable storage medium.
背景技术Background technique
随着交通领域的快速发展,交通拥堵日益加剧。为了保证交通管理措施合理有效,有必要获取路网上的交通数据,以利用获取到的交通数据对交通进行分析。现有技术中,仅利用单一的交通数据进行交通分析,导致交通分析的准确度较低。With the rapid development of the transportation field, traffic congestion is increasing day by day. In order to ensure that the traffic management measures are reasonable and effective, it is necessary to obtain the traffic data on the road network, and use the obtained traffic data to analyze the traffic. In the prior art, only a single traffic data is used for traffic analysis, resulting in low accuracy of traffic analysis.
发明内容Contents of the invention
本申请实施例提供一种交通分析方法、相关设备及可读存储介质,以解决现有技术中交通分析的准确度较低的问题。Embodiments of the present application provide a traffic analysis method, related equipment, and a readable storage medium, so as to solve the problem of low traffic analysis accuracy in the prior art.
为解决上述问题,本申请是这样实现的:In order to solve the above problems, the application is implemented as follows:
第一方面,本申请实施例提供了一种交通分析方法,所述方法包括:In the first aspect, the embodiment of the present application provides a traffic analysis method, the method comprising:
根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段,时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据,S和T均为正整数,R为大于1的整数;According to the traffic data detected by each detector in the target road network within the first time length, a first tensor is generated, the length of the space dimension of the first tensor is S road sections in the target road network, and the time dimension The length is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is an integer greater than 1;
利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量;Using an attention mechanism to fuse the spatial dimension and traffic data dimension in the first tensor to obtain a second tensor;
根据第三张量,确定所述目标路网的目标信息;Determine the target information of the target road network according to the third tensor;
其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
第二方面,本申请实施例还提供一种交通分析装置,包括:In the second aspect, the embodiment of the present application also provides a traffic analysis device, including:
生成模块,用于根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段,时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据,S和T均为正整数,R为大于1的整数;A generating module, configured to generate a first tensor according to the traffic data detected by each detector in the target road network within the first duration, the length of the spatial dimension of the first tensor being S in the target road network sections, the length of the time dimension is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is greater than 1 integer;
融合模块,用于利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量;The fusion module is used to fuse the spatial dimension and the traffic data dimension in the first tensor by using the attention mechanism to obtain the second tensor;
第一确定模块,用于根据第三张量,确定所述目标路网的目标信息;The first determination module is configured to determine the target information of the target road network according to the third tensor;
其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
第三方面,本申请实施例还提供一种电子设备,包括:收发机、存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;所述处理器,用于读取存储器中的程序实现如前述第一方面所述方法。In the third aspect, the embodiment of the present application also provides an electronic device, including: a transceiver, a memory, a processor, and a program stored in the memory and operable on the processor; the processor is used to Reading the program in the memory implements the method described in the aforementioned first aspect.
第四方面,本申请实施例还提供一种可读存储介质,用于存储程序,所述程序被处理器执行时实现如前述第一方面所述方法。In a fourth aspect, the embodiment of the present application further provides a readable storage medium for storing a program, and when the program is executed by a processor, the method described in the aforementioned first aspect is implemented.
在本申请实施例中,电子设备对检测器检测到的多维度交通数据进行时空拼接,得到第一张量;之后,对所述第一张量中的空间维度和交通数据维度进行融合处理,得到第二张量,进而根据第二张量,确定所述目标路网的目标信息,所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。可见,本申请实施例的电子设备全面利用了检测器检测到的多维度交通数据对目标路网的交通进行分析,从而可以提高交通分析的准确度。In the embodiment of the present application, the electronic device performs spatio-temporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, it performs fusion processing on the spatial dimension and the traffic data dimension in the first tensor to obtain the first tensor Two tensors, and then according to the second tensor, determine the target information of the target road network, the target information includes at least one of the following: traffic mode, traffic law and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that need to be used in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本申请实施例提供的交通分析方法的流程示意图;Fig. 1 is a schematic flow chart of the traffic analysis method provided by the embodiment of the present application;
图2是本申请实施例提供的第一张量的示意图;Fig. 2 is a schematic diagram of the first tensor provided by the embodiment of the present application;
图3是本申请实施例提供的张量的特征提取示意图;Fig. 3 is a schematic diagram of feature extraction of the tensor provided by the embodiment of the present application;
图4是本申请实施例提供的张量的融合示意图;FIG. 4 is a schematic diagram of the fusion of tensors provided by the embodiment of the present application;
图5是本申请实施例提供的第一模型的示意图;Fig. 5 is a schematic diagram of the first model provided by the embodiment of the present application;
图6是本申请实施提供的交通分析装置的结构示意图;Fig. 6 is a schematic structural diagram of the traffic analysis device provided by the implementation of the present application;
图7是本申请实施提供的电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by the implementation of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
本申请实施例中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。此外,本申请中使用“和/或”表示所连接对象的至少其中之一,例如A和/或B和/或C,表示包含单独A,单独B,单独C,以及A和B都存在,B和C都存在,A和C都存在,以及A、B和C都存在的7种情况。The terms "first", "second" and the like in the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus. In addition, the use of "and/or" in this application means at least one of the connected objects, such as A and/or B and/or C, means that A alone, B alone, C alone, and both A and B exist, Both B and C exist, both A and C exist, and there are 7 situations where A, B, and C all exist.
以下对本申请实施例提供的交通分析方法进行说明。The traffic analysis method provided by the embodiment of the present application will be described below.
本申请实施例的交通分析方法可以由电子设备执行。在实际应用中,电子设备可以是服务器、手机、平板电脑(Tablet Personal Computer)、膝上型电脑(Laptop Computer)、个人数字助理(Personal Digital Assistant,PDA)、移动上网装置(Mobile Internet Device,MID)、可穿戴式设备(Wearable Device)或车载设备等。The traffic analysis method in the embodiment of the present application may be executed by an electronic device. In practical applications, electronic equipment can be servers, mobile phones, tablet computers (Tablet Personal Computer), laptop computers (Laptop Computer), personal digital assistants (Personal Digital Assistant, PDA), mobile Internet devices (Mobile Internet Device, MID ), wearable device (Wearable Device) or vehicle-mounted device, etc.
参见图1,图1是本申请实施例提供的交通分析方法的流程示意图。如图1所示,可以包括以下步骤:Referring to FIG. 1 , FIG. 1 is a schematic flowchart of a traffic analysis method provided in an embodiment of the present application. As shown in Figure 1, the following steps may be included:
步骤101、根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段, 时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据。S和T均为正整数,R为大于1的整数。 Step 101, according to the traffic data detected by each detector in the target road network within the first time length, generate a first tensor, the length of the spatial dimension of the first tensor is S road sections in the target road network , the length of the time dimension is T time points within the first duration, and the length of the traffic data dimension is the R-type traffic data detected by the detector. Both S and T are positive integers, and R is an integer greater than 1.
在实际应用中,检测器布设在所述目标路网的各路段的各车道上。可选地,可以在一个路段的一个车道上布设一个检测器,即一个检测器可以用于检测一个路段的一个车道的交通数据。In practical applications, the detectors are arranged on each lane of each road section of the target road network. Optionally, one detector may be arranged on one lane of one road section, that is, one detector may be used to detect traffic data of one lane of one road section.
各检测器可以按照预设频率检测R类交通数据的值,所述R类交通数据可以但不仅限于包括各车道的平均速度、占用率、行驶车辆数量和车道占有时间等可以反应交通状态的数据。在本申请实施例中,R类交通数据也可以称为R类交通状态。Each detector can detect the value of R-type traffic data according to a preset frequency, and the R-type traffic data can include but not limited to the average speed of each lane, occupancy rate, number of driving vehicles, lane occupancy time, etc., which can reflect the traffic state data . In the embodiment of the present application, the R-type traffic data may also be referred to as the R-type traffic state.
在本步骤中,电子设备可以通过获取目标网络中各检测器在第一时长内检测到的交通数据,获取所述目标网络在第一时长内的整体交通状态,进而可以对所述目标网络在第一时长内的交通状态进行感知,并可以利用感知到的交通状态对所述目标网络的未来交通状态进行预测,所述第一预设时长可以预先根据需求设定,如1小时或1天等。In this step, the electronic device can obtain the overall traffic status of the target network within the first period of time by acquiring the traffic data detected by each detector in the target network within the first period of time, and then can analyze the target network in the first period of time. Perceive the traffic state within the first duration, and use the perceived traffic state to predict the future traffic state of the target network. The first preset duration can be set in advance according to demand, such as 1 hour or 1 day Wait.
电子设备在获取到目标网络中各检测器在第一时长内检测到的交通数据之后,可以生成第一张量,所述第一张量为多维度的交通数据时空张量,所述第一张量包括所述目标路网中各路段的检测器在第一时长内检测到的全部交通数据。After the electronic device acquires the traffic data detected by each detector in the target network within the first time period, it can generate a first tensor, the first tensor is a multi-dimensional space-time tensor of traffic data, and the first The tensor includes all traffic data detected by the detectors of each road section in the target road network within the first time period.
可以理解地是,在所述目标网络包括S个路段,检测器在所述第一时长内进行T次检测,检测器检测R类交通数据的情况下,所述第一张量为S×T×R张量,其中,S表示空间维度的长度大小;T表示时间维度的长度大小;R表示交通数据维度的长度大小。It can be understood that, when the target network includes S road sections, the detector performs T detections within the first time period, and the detector detects R traffic data, the first tensor is S×T ×R tensor, where S represents the length of the spatial dimension; T represents the length of the time dimension; R represents the length of the traffic data dimension.
考虑到毫米波雷达具有以下优势:受环境影响小,如受雾霾、雨雪和光线影响较小;检测覆盖范围大,视角可达120°,检测距离可达250米;工程化简单;无额外算力要求;维护成本低。本申请实施例中的检测器可以为毫米波雷达检测器,这样,通过检测器检测到的交通数据更准确,从而可以进一步提高交通分析的准确度。当然,可以理解地是,本申请实施例的检测器也可以为其他类型的检测器,如线圈检测器或地磁检测器等,具体可根据实际需求决定,本申请实施例对此不做限定。Considering that the millimeter-wave radar has the following advantages: it is less affected by the environment, such as haze, rain, snow and light; the detection coverage is large, the viewing angle can reach 120°, and the detection distance can reach 250 meters; the engineering is simple; Additional computing power requirements; low maintenance costs. The detector in this embodiment of the present application may be a millimeter-wave radar detector. In this way, the traffic data detected by the detector is more accurate, thereby further improving the accuracy of traffic analysis. Of course, it can be understood that the detector in the embodiment of the present application may also be other types of detectors, such as a coil detector or a geomagnetic detector, which may be determined according to actual needs, which is not limited in the embodiment of the present application.
步骤102、利用注意力机制对所述第一张量中的空间维度和交通数据维度 进行融合,得到第二张量。 Step 102, using the attention mechanism to fuse the spatial dimension and traffic data dimension in the first tensor to obtain the second tensor.
在本申请实施例中,电子设备在生成所述第一张量之后,还可以利用注意力机制对第一张量中空间维度和交通数据维度的区域特征进行捕捉和识别,以提高区域特征识别和捕捉的准确度。由于特征识别和捕捉越准确,交通状态的分析效果越佳,因此,利用融合得到的第二张量进行交通状态的分析,可以进一步提高交通状态分析的准确度。In the embodiment of the present application, after the electronic device generates the first tensor, it can also use the attention mechanism to capture and identify the regional features of the spatial dimension and traffic data dimension in the first tensor, so as to improve the recognition and capture of regional features the accuracy. Since the more accurate the feature recognition and capture, the better the analysis effect of the traffic state. Therefore, the analysis of the traffic state by using the second tensor obtained by fusion can further improve the accuracy of the traffic state analysis.
步骤103、根据第三张量,确定所述目标路网的目标信息。 Step 103, according to the third tensor, determine the target information of the target road network.
其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
具体实现时,第一实现方式中,电子设备可以直接基于融合得到的第二张量,确定所述目标路网的目标信息。第二实现方式中,电子设备可以进一步检测所述第二张量中是否存在空缺值,并在所述第二张量中存在空缺值的情况下,对所述第二张量进行补缺,利用补缺得到的第三张量,确定所述目标路网的目标信息。可见,相比于第一实现方式,通过第二实现方式确定的所述目标路网的目标信息的准确度更高。During specific implementation, in the first implementation manner, the electronic device may directly determine the target information of the target road network based on the second tensor obtained through fusion. In the second implementation manner, the electronic device may further detect whether there is a vacant value in the second tensor, and if there is a vacant value in the second tensor, fill in the second tensor, and use the first Three tensors, which determine the target information of the target road network. It can be seen that, compared with the first implementation manner, the accuracy of the target information of the target road network determined by the second implementation manner is higher.
在本申请实施例中,所述交通模式可以通过拥塞程度表征,不同交通模式的拥塞程度不同。交通规律可以通过目标时间或目标空间内各类交通数据的平均值表征。未来交通状态可以通过多维度的交通数据时空张量表征。In this embodiment of the present application, the traffic mode may be characterized by a degree of congestion, and the degree of congestion in different traffic modes is different. The traffic law can be represented by the average value of various traffic data in the target time or target space. The future traffic state can be represented by multi-dimensional traffic data space-time tensor.
本申请实施例的交通分析方法,电子设备对检测器检测到的多维度交通数据进行时空拼接,得到第一张量;之后,对所述第一张量中的空间维度和交通数据维度进行融合处理,得到第二张量,进而根据第二张量,确定所述目标路网的目标信息,所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。可见,本申请实施例的电子设备全面利用了检测器检测到的多维度交通数据对目标路网的交通进行分析,从而可以提高交通分析的准确度。In the traffic analysis method of the embodiment of the present application, the electronic device performs spatiotemporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, fusion processing is performed on the spatial dimension and the traffic data dimension in the first tensor, The second tensor is obtained, and then the target information of the target road network is determined according to the second tensor, and the target information includes at least one of the following: traffic mode, traffic law, and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.
在本申请实施例中,可选地,所述根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,包括:In the embodiment of the present application, optionally, generating the first tensor according to the traffic data detected by each detector in the target road network within the first duration includes:
生成目标路网中各检测器检测的T个时间点对应的时间序列,及与所述目标路网中S个路段对应的空间序列;Generate a time sequence corresponding to T time points detected by each detector in the target road network, and a space sequence corresponding to S road sections in the target road network;
拼接所述时间序列中各时间点对应的R类交通数据的值,及所述空间序列中各路段对应的R类交通数据的值,得到第一张量。Concatenating the value of the R-type traffic data corresponding to each time point in the time series and the value of the R-type traffic data corresponding to each road segment in the space series to obtain the first tensor.
在本可选实施方式中,电子设备在获取到目标网络中各检测器在第一时长内检测到的交通数据之后,可以对获取到的交通数据进行时空拼接,生成第一张量。In this optional implementation manner, after the electronic device acquires the traffic data detected by each detector in the target network within the first duration, it may perform spatiotemporal stitching on the acquired traffic data to generate the first tensor.
具体实现时,交通数据的值与时间维度具有高度相关性。经过每一单位时间之后,道路路网各车道因车辆的驶入、驶离或停车等待、事故碰撞等原因,各交通数据的值都会发生变化。因此,电子设备可以按照检测器检测的时间顺序,生成时间序列,所述时间序列包括所述T个时间点。In actual implementation, the value of traffic data is highly correlated with the time dimension. After each unit of time, the value of each traffic data will change due to reasons such as vehicles entering, leaving or parking and waiting, accident collisions, etc. in each lane of the road network. Therefore, the electronic device may generate a time sequence according to the time sequence detected by the detector, and the time sequence includes the T time points.
同一路网各个路段之间、同一路段各条车道之间,因车辆的交替驶入,或在前后车辆、左右车辆之间相互作用下,车道的速度、占有率等交通数据会发生变化。因此,电子设备可以按照S个路段的空间顺序,生成空间序列,所述空间序列包括所述S个路段。Traffic data such as speed and occupancy of the lanes will change due to the alternate entry of vehicles, or the interaction between front and rear vehicles, and left and right vehicles between various road sections of the same road network and between lanes of the same road section. Therefore, the electronic device may generate a spatial sequence according to the spatial sequence of the S road sections, where the spatial sequence includes the S road sections.
电子设备在生成所述时间序列和所述空间序列之后,基于时间和空间的维度,形成一张具有时间信息、空间相对关系的网格图。R类交通数据可采用R张网格图表示,R张网格图按照时空对应关系形成一个多维度的交通状态时空张量,即第一张量,其中,每一张网格图代表一类交通数据,网格图中的每一个网格代表一个车道在一个时间点的一类交通数据的值。为方便理解,请参见图2,在图2中,所述第一张量的交通数据维度为3,但并不因此限制交通数据维度的取值。After generating the time series and the space series, the electronic device forms a grid map with time information and spatial relative relationships based on time and space dimensions. R traffic data can be represented by R grid graphs, and the R grid graphs form a multi-dimensional traffic state space-time tensor according to the time-space correspondence, that is, the first tensor, where each grid graph represents a class For traffic data, each grid in the grid graph represents the value of a type of traffic data for a lane at a point in time. For easy understanding, please refer to FIG. 2 . In FIG. 2 , the traffic data dimension of the first tensor is 3, but this does not limit the value of the traffic data dimension.
通过上述方式,可以实现所述目标路网在第一时长内的交通数据在时空上的拼接,得到第一张量,这样,利用第一张量分析得到的交通状态,可以更符合实际的交通状态,即可以提高交通分析的准确度。Through the above method, the temporal and spatial splicing of the traffic data of the target road network within the first time length can be realized, and the first tensor can be obtained. In this way, the traffic state obtained by using the first tensor analysis can be more in line with the actual traffic state, which can improve the accuracy of traffic analysis.
在本申请实施例中,可选地,所述利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量,包括:In the embodiment of the present application, optionally, the use of the attention mechanism to fuse the spatial dimension and the traffic data dimension in the first tensor to obtain the second tensor includes:
提取所述第一张量中空间维度和交通数据维度的区域特征,得到中间张量;Extracting the regional features of the spatial dimension and the traffic data dimension in the first tensor to obtain an intermediate tensor;
将所述中间张量输入注意力融合网络,得到所述中间张量中各区域特征的权重值;The intermediate tensor is input into the attention fusion network to obtain the weight value of each regional feature in the intermediate tensor;
将所述各区域特征的权重值与所述第一张量相乘,得到第二张量。Multiplying the weight value of each region feature with the first tensor to obtain a second tensor.
具体实现时,电子设备可以利用特征提取模型提取所述第一张量中空间维度和交通数据维度的区域特征。特征提取模型可以为卷积神经网络,但不仅限于此。卷积神经网络可以利用不同权重的卷积核,对输入张量的区域特征进行 提取。不同尺寸的卷积核能够捕捉不同尺度的区域特征。During specific implementation, the electronic device may use a feature extraction model to extract regional features of the spatial dimension and the traffic data dimension in the first tensor. The feature extraction model can be a convolutional neural network, but is not limited thereto. The convolutional neural network can use convolution kernels with different weights to extract the regional features of the input tensor. Convolution kernels of different sizes can capture regional features of different scales.
如图3所示,在特征提取模型中,第一张量经多个卷积核过滤计算,得到中间张量π,中间张量π的尺寸大小为H×W×T,其中H表示空间维度的长度大小,W表示交通数据维度的长度大小,T表示时间维度的长度大小。As shown in Figure 3, in the feature extraction model, the first tensor is filtered and calculated by multiple convolution kernels to obtain the intermediate tensor π, and the size of the intermediate tensor π is H×W×T, where H represents the spatial dimension W represents the length of the traffic data dimension, and T represents the length of the time dimension.
电子设备可以将中间张量π输入注意力融合网络中,得到所述中间张量中各区域特征的权重值ε。如图4所示,注意力融合网络可将中间张量π的各平面求均值,压缩1×1×T,得到所述中间张量中各区域特征的权重值ε。The electronic device may input the intermediate tensor π into the attention fusion network to obtain the weight value ε of each region feature in the intermediate tensor. As shown in Figure 4, the attention fusion network can average each plane of the intermediate tensor π, compress 1×1×T, and obtain the weight value ε of each region feature in the intermediate tensor.
之后,如图4所示,电子设备可以将各区域特征的权重值ε与所述第一张量相乘,得到深度融合的第二张量。Afterwards, as shown in FIG. 4 , the electronic device may multiply the weight value ε of each region feature by the first tensor to obtain a second tensor of depth fusion.
通过上述方式,电子设备可以赋予第一张量的不同区域特征不同权重,进而融合得到具有注意力机制的多维度交通数据张量,从而可以进一步提高交通分析的准确度。Through the above method, the electronic device can assign different weights to different regional features of the first tensor, and then fuse them to obtain a multi-dimensional traffic data tensor with an attention mechanism, thereby further improving the accuracy of traffic analysis.
在本申请实施例中,可选地,所述利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量之后,所述根据第三张量,确定所述目标路网的目标信息之前,所述方法还包括:In the embodiment of the present application, optionally, the attention mechanism is used to fuse the spatial dimension and traffic data dimension in the first tensor, and after obtaining the second tensor, the third tensor is used to determine the Before the target information of the target road network, the method also includes:
检测所述第二张量是否存在空缺值;detecting whether there is a missing value in the second tensor;
在所述第二张量存在空缺值的情况下,利用基于权值的插值法补缺所述空缺值,得到第三张量。If there is a vacant value in the second tensor, the vacant value is filled by using a weight-based interpolation method to obtain a third tensor.
在本可选实施方式中,考虑到检测器可能因以下至少一项因素出现采集数据的缺失:检测器受到遮挡物、建筑物或恶劣天气的干扰;检测器的调试、内置程序出现错误等。为了提高交通分析的准确度,可以对缺失数据进行补缺。补缺可以是利用采集到的交通数据,在缺失处进行数值的插补或合理预测,使得数据合理且完整。In this optional implementation, it is considered that the detector may lack data collection due to at least one of the following factors: the detector is interfered by obstructions, buildings or bad weather; the detector is debugged, the built-in program has errors, and the like. In order to improve the accuracy of traffic analysis, missing data can be filled. Filling in the gaps can be to use the collected traffic data to perform numerical interpolation or reasonable prediction in the missing places to make the data reasonable and complete.
具体实现时,可以通过以下方式对空缺值进行补缺:In specific implementation, vacant values can be filled in the following ways:
1)搜索每一个维度层的空缺值,定位空缺值的位置。给定一个交通数据变量ri∈R在时空层上的分布:1) Search for the vacant value of each dimension layer, and locate the position of the vacant value. Given the distribution of a traffic data variable ri∈R on the spatio-temporal layer:
C={(s 1,t 1,r i),(s 1,t 2,r i),…(s 1,t k-1,r i),(s 1,t k+1,r i)…(s m,t n,r i)} C={(s 1 ,t 1 ,r i ),(s 1 ,t 2 ,r i ),…(s 1 ,t k-1 ,r i ),(s 1 ,t k+1 ,r i )…(s m ,t n ,r i )}
判定空缺值为c=(s 1,t k,r i),即表示在空间t k处,在时间s 1处缺少了交通数据r i的值。 The judging vacancy value is c=(s 1 , t k , ri ), which means that the value of traffic data ri is missing at time s 1 in space t k .
2)采用基于权值的插值法补缺空缺值。空缺值与前后时间序列、左右空间 序列状态变量值相关,因此采用加权的方式对该处变量前后左右四处的变量求期望,以补缺中心处空缺值。2) Use the weight-based interpolation method to fill in the vacant values. The vacant value is related to the state variable values of the front and back time series and the left and right space series. Therefore, the weighted method is used to find the expectation of the variables at the front, back, left, and right sides of the variable, so as to fill the vacant value at the center.
c=α 1(s 0,t k-1,r i)+α 2(s 0,t k+1,r i)+α 3(s 2,t k-1,r i)+α 4(s 2,t k+1,r i) c=α 1 (s 0 ,t k-1 , ri )+α 2 (s 0 ,t k+1 , ri )+α 3 (s 2 ,t k-1 , ri )+α 4 ( s 2 ,t k+1 ,r i )
Σα 1234=1 Σα 1234 =1
其中,加权系数α 1、α 2、α 3、α 4取决于空缺值受四周时空变量的影响程度,具体可根据实际需求设定,本申请实施例对此不做限定。一般地,周围变量对空缺处的交通状态值的影响程度越大,加权系数越高。 Among them, the weighting coefficients α 1 , α 2 , α 3 , and α 4 depend on the extent to which the vacancy value is affected by surrounding spatiotemporal variables, and can be specifically set according to actual needs, which is not limited in this embodiment of the present application. Generally, the greater the impact of surrounding variables on the traffic state value at the vacancy, the higher the weighting coefficient.
需要说明的是,上述c的计算公式仅为示例,并不因此限制c的计算方式,如,c也可以通过以下公式计算得到:It should be noted that the above calculation formula of c is only an example, and does not limit the calculation method of c. For example, c can also be calculated by the following formula:
c=α 1(s 1,t k-1,r i)+α 2(s 1,t k+1,r i)+α 3(s 0,t k,r i)+α 4(s 2,t k,r i) c=α 1 (s 1 ,t k-1 ,r i )+α 2 (s 1 ,t k+1 ,r i )+α 3 (s 0 ,t k ,r i )+α 4 (s 2 ,t k ,r i )
以下对本申请实施例中目标路网的目标信息的确定进行说明。The determination of the target information of the target road network in the embodiment of the present application will be described below.
一、所述目标信息包括交通模式。1. The target information includes traffic patterns.
在此情况下,可选地,所述根据第三张量,确定所述目标路网的目标信息,包括:In this case, optionally, the determining the target information of the target road network according to the third tensor includes:
对第三张量进行张量分解,得到与时间维度对应的第一因子矩阵,与空间维度对应的第二因子矩阵,及与交通数据对应的第三因子矩阵;Perform tensor decomposition on the third tensor to obtain the first factor matrix corresponding to the time dimension, the second factor matrix corresponding to the space dimension, and the third factor matrix corresponding to the traffic data;
根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式。The traffic mode of the target road network is determined according to the first factor matrix, the second factor matrix and the third factor matrix.
在本可选实施方式中,电子设备利用张量(Canonical Polyadic,CP)分解确定交通模式。需要说明的是,在其他实施方式中,电子设备也可以利用其他方式使用所述第三张量确定交通模式,如电子设备可以利用第二模型确定交通模式,所述第二模型的输入为所述第三张量,输出为所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,本申请实施例并不限制根据所述第三张量确定交通模式的方式。In this optional implementation manner, the electronic device uses tensor (Canonical Polyadic, CP) decomposition to determine the traffic mode. It should be noted that, in other implementation manners, the electronic device may also use the third tensor to determine the traffic mode in other ways, for example, the electronic device may determine the traffic mode by using the second model, and the input of the second model is the The third tensor is output as the first factor matrix, the second factor matrix, and the third factor matrix. The embodiment of the present application does not limit the way of determining the traffic mode according to the third tensor.
交通模式,也可以称为交通出行模式或交通行为模式,反映在给定时间空间范围内,各个出行个体或行驶路段中,个体或路段的交通状态之间存在着的内在相似联系。在实际应用中,可以将存在着显著相似联系的个体或路段划分为同一种交通模式。Traffic mode, also known as traffic travel mode or traffic behavior mode, reflects the inherent similarity between the traffic states of individuals or road segments within a given time and space range. In practical applications, individuals or road segments with significant similar connections can be classified into the same traffic mode.
假设所述第三张量的空间维度的长度为n个路段,时间维度的长度为m个时间点,交通数据维度的长度为i类交通数据,n和m均为正整数,i为大于1 的整数。Assume that the length of the spatial dimension of the third tensor is n road sections, the length of the time dimension is m time points, the length of the traffic data dimension is i-type traffic data, n and m are both positive integers, and i is greater than 1 an integer of .
那么,对所述第三张量进行CP分解得到的与时间维度对应的第一因子矩阵A的大小为m×Q,与空间维度对应的第二因子矩阵B的大小为n×Q,与交通数据对应的第三因子矩阵C的大小为i×Q,即所述第一因子矩阵为m×Q矩阵,所述第二因子矩阵B为n×Q矩阵,所述第三因子矩阵C为i×Q矩阵。其中,Q表示所述目标路网的交通模式个数,Q为正整数。Then, the size of the first factor matrix A corresponding to the time dimension obtained by performing CP decomposition on the third tensor is m×Q, and the size of the second factor matrix B corresponding to the space dimension is n×Q. The size of the third factor matrix C corresponding to the data is i×Q, that is, the first factor matrix is an m×Q matrix, the second factor matrix B is an n×Q matrix, and the third factor matrix C is i ×Q matrix. Wherein, Q represents the number of traffic modes of the target road network, and Q is a positive integer.
之后,电子设备可以基于分解得到的所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式。Afterwards, the electronic device may determine the traffic mode of the target road network based on the first factor matrix, the second factor matrix and the third factor matrix obtained through decomposition.
可选地,所述根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式,包括:Optionally, the determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix includes:
根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,得到Q组交通数据序列;Obtaining Q groups of traffic data sequences according to the first factor matrix, the second factor matrix and the third factor matrix;
获取与所述Q组交通数据序列对应的Q个交通模式。Acquiring Q traffic modes corresponding to the Q group of traffic data sequences.
具体实现时,电子设备可以依次对所求得的第一因子矩阵A、第二因子矩阵B和第三因子矩阵C,按照行或列q=1,2,3,…,Q依次提取展开,可得到Q组交通数据序列(也可以称为出行模式序列或状态序列)。每一组出行模式包括为m×1,n×1,i×1的三个向量,每一组出行模式可以用于确定一个交通模式,从而Q组交通数据序列可以揭示Q类特征各异的交通模式。During specific implementation, the electronic device may sequentially extract and expand the obtained first factor matrix A, second factor matrix B, and third factor matrix C according to row or column q=1, 2, 3, ..., Q, A Q group of traffic data sequences (also called a travel mode sequence or a state sequence) can be obtained. Each group of travel modes includes three vectors of m×1, n×1, and i×1, and each group of travel modes can be used to determine a traffic mode, so that Q groups of traffic data sequences can reveal Q types of traffic with different characteristics traffic pattern.
对于第一因子矩阵A、第二因子矩阵B和第三因子矩阵C的求解,可以通过以下方式实现:For the solution of the first factor matrix A, the second factor matrix B and the third factor matrix C, it can be realized in the following way:
可选地,所述根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式,包括:Optionally, the determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix includes:
构造目标函数,所述目标函数用于反映第一值和第二值之间的差异,所述第一值为所述第三张量的值,所述第二值基于所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵计算得到;constructing an objective function that reflects the difference between a first value that is a value of the third tensor and a second value that is based on the first factor matrix , the second factor matrix and the third factor matrix are calculated;
根据所述目标函数,优化所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵;optimizing the first factor matrix, the second factor matrix and the third factor matrix according to the objective function;
根据优化后的第一因子矩阵、第二因子矩阵和第三因子矩阵,确定所述目标路网的交通模式。The traffic mode of the target road network is determined according to the optimized first factor matrix, second factor matrix and third factor matrix.
记所述第三张量为X,X与第一因子矩阵A、第二因子矩阵B和第三因子矩 阵C的关系可以通过以下公式表示:Note that the third tensor is X, and the relationship between X and the first factor matrix A, the second factor matrix B and the third factor matrix C can be expressed by the following formula:
Figure PCTCN2022095206-appb-000001
Figure PCTCN2022095206-appb-000001
X中的元素与第一因子矩阵A、第二因子矩阵B和第三因子矩阵C中的元素的关系可以通过以下公式表示:The relationship between the elements in X and the elements in the first factor matrix A, the second factor matrix B and the third factor matrix C can be expressed by the following formula:
Figure PCTCN2022095206-appb-000002
Figure PCTCN2022095206-appb-000002
构造目标函数f,目标函数f可反映X与第二值
Figure PCTCN2022095206-appb-000003
之间的差异。可选地,目标函数f可通过以下公式表示:
Construct the objective function f, the objective function f can reflect X and the second value
Figure PCTCN2022095206-appb-000003
difference between. Optionally, the objective function f can be expressed by the following formula:
Figure PCTCN2022095206-appb-000004
Figure PCTCN2022095206-appb-000004
目标函数f可简化为:The objective function f can be simplified as:
Figure PCTCN2022095206-appb-000005
Figure PCTCN2022095206-appb-000005
为优化因子矩阵,可以利用梯度下降法求解优化决策变量a mr,b nr,c ir。可选地,可以先对各个决策变量求偏导,利用偏导值更新各个决策变量,多次迭代更新直至目标函数收敛,即达到最优,即第一值与第二值之间的差异最小化,第二值无限接近第一值。可以理解地是,当目标函数达到最优时,各因子矩阵可以达到最优,可以利用最优的第一因子矩阵、第二因子矩阵和第三因子矩阵,确定所述目标路网的交通模式,从而可以进一步提高交通模式确定的准确率。 To optimize the factor matrix, the gradient descent method can be used to solve the optimization decision variables a mr , b nr , c ir . Optionally, partial derivatives can be obtained for each decision variable first, and each decision variable can be updated using the partial derivative value, and iteratively updated until the objective function converges, that is, the optimum is achieved, that is, the difference between the first value and the second value is the smallest , the second value is infinitely close to the first value. It can be understood that when the objective function is optimized, each factor matrix can be optimized, and the optimal first factor matrix, second factor matrix and third factor matrix can be used to determine the traffic mode of the target road network , so that the accuracy of traffic mode determination can be further improved.
各个决策变量的更新可以通过下列公式实现:The update of each decision variable can be achieved by the following formula:
Figure PCTCN2022095206-appb-000006
Figure PCTCN2022095206-appb-000006
Figure PCTCN2022095206-appb-000007
Figure PCTCN2022095206-appb-000007
Figure PCTCN2022095206-appb-000008
Figure PCTCN2022095206-appb-000008
Figure PCTCN2022095206-appb-000009
Figure PCTCN2022095206-appb-000009
Figure PCTCN2022095206-appb-000010
Figure PCTCN2022095206-appb-000010
Figure PCTCN2022095206-appb-000011
Figure PCTCN2022095206-appb-000011
二、所述目标信息包括交通规律。2. The target information includes traffic rules.
交通时空规律,反映在给定的时空范围内,各个出行个体或出行路段中,个体或路段在特定的时间段、空间里,呈现出相似或相同状态。交通规律可以通过目标时间或目标空间内各类交通数据的平均值表征。The spatio-temporal law of traffic is reflected in a given space-time range, among individual travel individuals or travel sections, individuals or sections present a similar or identical state in a specific time period and space. The traffic law can be represented by the average value of various traffic data in the target time or target space.
在此情况下,可选地,所述根据第三张量,确定所述目标路网的目标信息,包括以下至少一项:In this case, optionally, the determining the target information of the target road network according to the third tensor includes at least one of the following:
1)获取所述目标路网的第k类交通数据在目标时长内的平均值;1) Obtain the average value of the kth traffic data of the target road network within the target duration;
2)获取所述目标路网的目标空间的第k类交通数据在所述第一时长内的平均值;2) Obtain the average value of the kth traffic data in the target space of the target road network within the first duration;
其中,所述目标时长的时间单位包括以下至少一项:日;周;年;所述目标空间的空间单位包括以下至少一项:车道;路段;路网;k的取值范围为1至i。Wherein, the time unit of the target duration includes at least one of the following: day; week; year; the spatial unit of the target space includes at least one of the following: lane; road section; road network; the value range of k is 1 to i .
对于1),电子设备可以进行日和/或周和/或年交通状态分析。For 1), the electronic device can perform daily and/or weekly and/or annual traffic status analysis.
在时间尺度上,分别以检测器检测的小时、一周七日和一年十二月为时间单位(也可以称为时间尺度或集计单位),对各类交通数据进行统计:On the time scale, the hours detected by the detector, seven days a week, and December a year are used as time units (also called time scales or aggregate units) to collect statistics on various types of traffic data:
Figure PCTCN2022095206-appb-000012
Figure PCTCN2022095206-appb-000012
A={a 1,a 2,a 3,a 4,…a k} A={a 1 ,a 2 ,a 3 ,a 4 ,…a k }
其中,a k表示在(o,p)时间段内,目标路网的第i个交通状态的平均值。 Among them, a k represents the average value of the i-th traffic state of the target road network within the (o,p) time period.
当时间尺度为日,(o,p)的持续统计时间为1小时,对一天内所有24小时的状态值进行计算,得到日交通状态分析表。When the time scale is day, and the continuous statistical time of (o,p) is 1 hour, the state values of all 24 hours in a day are calculated to obtain the daily traffic state analysis table.
当时间尺度为周,(o,p)的持续统计时间为1日,对一周内所有7日的状态值进行计算,得到周交通状态分析表。When the time scale is a week, and the continuous statistical time of (o,p) is 1 day, the state values of all 7 days in a week are calculated to obtain a weekly traffic state analysis table.
当时间尺度为年,(o,p)的持续统计时间为1个月,对一年内所有12个月的状态值进行计算,得到年交通状态分析表。When the time scale is year, the continuous statistical time of (o,p) is 1 month, and the state values of all 12 months in a year are calculated to obtain the annual traffic state analysis table.
对于2),电子设备可以进行车道级和/或路段级和/或路网级交通状态分析。For 2), the electronic device can perform lane-level and/or section-level and/or road-network-level traffic state analysis.
在空间尺度上,分别以检测器检测的车道、路段以及路网为集计单位,对各类交通状态进行统计:On the spatial scale, the lanes, road sections, and road networks detected by the detector are used as aggregate units to make statistics on various traffic states:
Figure PCTCN2022095206-appb-000013
Figure PCTCN2022095206-appb-000013
B={b 1,b 2,b 3,b 4,…b k} B={b 1 ,b 2 ,b 3 ,b 4 ,…b k }
其中,b k表示在t n时刻的(q,u)路段,第i个交通状态的平均值。利用上述公式即可得出在某时刻,城市某车道级、某路段或某路网级交通状态表。 Among them, b k represents the average value of the i-th traffic state on the (q, u) section at time t n . The above formula can be used to obtain the traffic status table of a certain lane level, a certain road section or a certain road network level in a city at a certain moment.
三、所述目标信息包括未来交通状态。3. The target information includes future traffic status.
基于所述第三张量,可进行未来时刻交通状态的预测。交通状态预测,反映在未来给定的时间范围内,预测毫米波雷达所探测的路段中的各项交通状态。基于检测器检测到的数据所建立的多维度交通数据张量,时空依赖关系强,能够利用其紧密的时空依赖关系对未来交通状态做出精准预测。Based on the third tensor, it is possible to predict the traffic state in the future. Traffic state prediction, reflecting the prediction of various traffic states in the road sections detected by the millimeter-wave radar within a given time range in the future. The multi-dimensional traffic data tensor established based on the data detected by the detector has strong temporal and spatial dependencies, and can make accurate predictions of future traffic conditions by using its tight temporal and spatial dependencies.
可选地,所述根据第三张量,确定所述目标路网的目标信息,包括:Optionally, the determining the target information of the target road network according to the third tensor includes:
将所述第三张量输入训练好的第一模型中,预测得到第四张量,所述第四张量用于反映所述目标路网在第二时长内的交通状态,所述第二时长为所述第一时长的下一个时长;Input the third tensor into the trained first model, and predict the fourth tensor, which is used to reflect the traffic state of the target road network within the second time period, and the second The duration is the next duration of the first duration;
其中,所述第一模型预测所述第四张量时的第一隐藏状态由所述第三张量和历史隐藏状态确定,所述历史隐藏状态为所述第一模型在第三时长的隐藏状态确定,所述第三时长为所述第一时长的上一个时长;所述第一模型的隐藏状态用于确定所述第一模型的输出。Wherein, the first hidden state when the first model predicts the fourth tensor is determined by the third tensor and the historical hidden state, and the historical hidden state is the hidden state of the first model in the third duration State determination, the third duration is a previous duration of the first duration; the hidden state of the first model is used to determine the output of the first model.
在本可选实施方式中,利用第一模型预测未来时刻的交通状态,所述第一模型的输入为所述第三张量,输出为与所述第三张量对应的未来时长的张量,可以用于反映所述目标路网在狭义时长内的交通状态。In this optional implementation manner, the first model is used to predict the traffic state at a future moment, the input of the first model is the third tensor, and the output is the tensor of the future duration corresponding to the third tensor , which can be used to reflect the traffic status of the target road network within a narrow time period.
第一模型的结构可以参见图5,第一模型预测未来交通状态可以包括以下三步:The structure of the first model can be seen in Fig. 5, and the first model predicts the future traffic state and can comprise following three steps:
1)输入各项变量。1) Enter the variables.
为方便理解,以下将上述时长视为时刻,未来时长即为未来时刻。按照时间序列排序整理变量依次输入x (1),x (2),…,x (t),分别表示在t时刻由电子设备计算得到的第三张量。预测模型的其它变量为: For the convenience of understanding, the above-mentioned duration is regarded as a moment in the following, and the future duration is the future moment. Sorting and sorting the variables according to the time series, input x (1) , x (2) ,…, x (t) in order, respectively representing the third tensor calculated by the electronic device at time t. The other variables of the predictive model are:
h (t)表示在t时刻时模型的隐藏状态,h (t)由对应时刻的输入x (t)和上一时刻的 隐藏状态h (t-1)共同决定。 h (t) represents the hidden state of the model at time t, and h (t) is jointly determined by the input x (t) at the corresponding time and the hidden state h (t-1) at the previous moment.
o (t)代表在t时刻模型的输出,o (t)只由模型当前的隐藏状态h (t)决定。 o (t) represents the output of the model at time t, and o (t) is only determined by the model's current hidden state h (t) .
L (t)代表在t时刻模型的损失函数。 L (t) represents the loss function of the model at time t.
y (t)代表在t时刻的真实值。 y (t) represents the true value at time t.
U,V,W代表预测模型中的共享权值矩阵。U, V, W represent the shared weight matrix in the prediction model.
2)前向传播计算。2) Forward propagation calculation.
基于上述规定变量,进行模型的前向传播计算。对于任意一时刻t,该时刻的隐藏状态h (t)由该时刻的多维度交通状态张量x (t)和上一时刻的隐藏状态h (t-1)得到: Based on the above specified variables, the forward propagation calculation of the model is performed. For any moment t, the hidden state h (t) at this moment is obtained from the multi-dimensional traffic state tensor x (t) at this moment and the hidden state h (t-1) at the previous moment:
h (t)=tan(z (t))=tan(Ux (t)+Wh (t-1)+b) h (t) = tan(z (t) ) = tan(Ux (t) +Wh (t-1) +b)
通过对t时刻的隐藏变量进行两次共享权值矩阵运算,得出该时刻对多维度交通状态的估计值
Figure PCTCN2022095206-appb-000014
By performing two shared weight matrix operations on the hidden variables at time t, the estimated value of the multi-dimensional traffic state at this time is obtained
Figure PCTCN2022095206-appb-000014
o (t)=Vh (t)+c o (t) = Vh (t) +c
Figure PCTCN2022095206-appb-000015
Figure PCTCN2022095206-appb-000015
3)后向传播优化。3) Backpropagation optimization.
为了实现对未来交通状态的准确预测,需衡量上一时刻得出的交通状态的估计值
Figure PCTCN2022095206-appb-000016
和真实交通状态值y (t)之间的差异进行量化,建立两者之间的损失函数(也可以称为差异函数)L。
In order to achieve an accurate prediction of the future traffic state, it is necessary to weigh the estimated value of the traffic state obtained at the previous moment
Figure PCTCN2022095206-appb-000016
and the real traffic state value y (t) to quantify the difference, and establish a loss function (also called a difference function) L between the two.
可选地,所述将所述第三张量输入训练好的第一模型中,预测得到第四张量之前,所述方法还包括:Optionally, before the third tensor is input into the trained first model, and before the fourth tensor is predicted, the method further includes:
获取样本张量;Get the sample tensor;
将所述样本张量输入未训练的第一模型,得到第五张量;inputting the sample tensor into the untrained first model to obtain a fifth tensor;
根据所述样本张量和所述第五张量,确定与所述第一模型对应的损失函数;determining a loss function corresponding to the first model according to the sample tensor and the fifth tensor;
根据所述损失函数,调整所述第一模型的权重值,得到训练好的第一模型。According to the loss function, the weight value of the first model is adjusted to obtain the trained first model.
所述损失函数可以通过以下公式计算得到:The loss function can be calculated by the following formula:
Figure PCTCN2022095206-appb-000017
Figure PCTCN2022095206-appb-000017
通过梯度下降算法对差异函数L的决策变量v,V求偏导,迭代计算多轮,不断更新c,V以优化模型,实现准确的预测。The gradient descent algorithm is used to calculate the partial derivatives of the decision variables v and V of the difference function L, iteratively calculate multiple rounds, and continuously update c and V to optimize the model and achieve accurate predictions.
Figure PCTCN2022095206-appb-000018
Figure PCTCN2022095206-appb-000018
Figure PCTCN2022095206-appb-000019
Figure PCTCN2022095206-appb-000019
Figure PCTCN2022095206-appb-000020
Figure PCTCN2022095206-appb-000020
Figure PCTCN2022095206-appb-000021
Figure PCTCN2022095206-appb-000021
通过逐步梯度下降法对差异函数L的决策变量U,W,b逐步求偏导,迭代多轮,不断更新以优化模型,实现准确的预测。The partial derivatives of the decision variables U, W, and b of the difference function L are gradually calculated by the stepwise gradient descent method, and iterative for multiple rounds, and the model is continuously updated to optimize the model and achieve accurate prediction.
Figure PCTCN2022095206-appb-000022
Figure PCTCN2022095206-appb-000022
逐步更新W:Gradually update W:
Figure PCTCN2022095206-appb-000023
Figure PCTCN2022095206-appb-000023
Figure PCTCN2022095206-appb-000024
Figure PCTCN2022095206-appb-000024
更新U:UPDATE U:
Figure PCTCN2022095206-appb-000025
Figure PCTCN2022095206-appb-000025
Figure PCTCN2022095206-appb-000026
Figure PCTCN2022095206-appb-000026
更新b:Update b:
Figure PCTCN2022095206-appb-000027
Figure PCTCN2022095206-appb-000027
Figure PCTCN2022095206-appb-000028
Figure PCTCN2022095206-appb-000028
在训练模型时,基于损失函数对模型参数进行迭代优化,当损失函数小于规定阈值时,不再进行更新。将该时刻的多维度交通状态变量输入模型,计算过后,便可得出下一时刻对应空间的多维度交通状态变量,即得出预测结果。When training the model, the model parameters are iteratively optimized based on the loss function, and when the loss function is smaller than the specified threshold, no update is performed. Input the multi-dimensional traffic state variable at this moment into the model, and after calculation, the multi-dimensional traffic state variable corresponding to the space at the next moment can be obtained, that is, the prediction result can be obtained.
本申请实施例中介绍的多种可选的实施方式,在彼此不冲突的情况下可以相互结合实现,也可以单独实现,对此本申请实施例不作限定。The various optional implementation manners introduced in the embodiments of the present application may be implemented in combination with each other if they do not conflict with each other, or may be implemented independently, which is not limited in the embodiments of the present application.
本申请实施例包括以下内容:The embodiment of this application includes the following contents:
电子设备收集目标路网各毫米波雷达检测点的检测数据。依据毫米波雷达的桩号与地图定位匹配的结果,对路网中连续的毫米波雷达数据集进行时间、空间维度的拼接,还原车道级的交通状态。其中,每个数据张量所含有的交通状态信息不少于两类,包括但不限于路网内各车道的平均速度、占有率、行驶车辆数量等信息。The electronic equipment collects the detection data of each millimeter-wave radar detection point on the target road network. According to the matching results between the stake number of the millimeter-wave radar and the map positioning, the continuous millimeter-wave radar data sets in the road network are spliced in time and space dimensions to restore the traffic status at the lane level. Among them, each data tensor contains no less than two types of traffic status information, including but not limited to information such as average speed, occupancy rate, and number of vehicles in each lane in the road network.
电子设备输出拼接和融合后的毫米波雷达数据。依据本申请的毫米波雷达多源数据融合算法,对所拼接形成的车道级数据张量进行深度融合,获得融合多源信息的毫米波雷达多维度交通状态张量。The electronics output spliced and fused mmWave radar data. According to the millimeter-wave radar multi-source data fusion algorithm of the present application, the lane-level data tensor formed by splicing is deeply fused to obtain the millimeter-wave radar multi-dimensional traffic state tensor fused with multi-source information.
电子设备补缺所融合后形成的毫米波雷达数据。The millimeter-wave radar data formed by the fusion of electronic equipment.
电子设备输出所预测的未来时刻车道的交通状态值。The electronic device outputs the predicted traffic state value of the lane in the future.
本申请实施例至少具有如下有益效果:The embodiment of the present application has at least the following beneficial effects:
本申请采用一种针对于毫米波雷达数据的有效数据格式,基于该数据格式提出有效的城市路网车道级算法,不仅能够实现对交通路网数据的出行模式分析,并且能够对未来某段时间间隔指定道路进行准确的交通状态预测。This application adopts an effective data format for millimeter-wave radar data, and proposes an effective urban road network lane-level algorithm based on this data format, which can not only realize the travel mode analysis of traffic road network data, but also can analyze Interval specified roads for accurate traffic state prediction.
本申请采用将毫米波雷达覆盖的所有时间范围、区域范围数据准确的拼接的方法,实现对毫米波雷达产生的多源数据进行深度融合,提升感知和预测的准确程度;并且对缺失数据进行处理,适应真实场景中存在的数据问题,为后续对毫米波雷达数据的进一步使用奠定基础。This application adopts the method of accurately splicing all the time range and area range data covered by the millimeter wave radar to realize the deep fusion of multi-source data generated by the millimeter wave radar, improve the accuracy of perception and prediction; and process the missing data , to adapt to the data problems existing in the real scene, and lay the foundation for the further use of millimeter-wave radar data in the future.
本申请提出的多维度毫米波雷达的数据分析、预测方法,能够适应5G场景下的交通路侧设备传输,同时能够面向边缘计算下数据的分布式计算和处理。本提案不仅能够实现对现有技术环境下交通路网数据进行出行模式分析,并且能够适应未来新兴技术场景下的交通数据快速处理和计算。The data analysis and prediction method of the multi-dimensional millimeter-wave radar proposed in this application can adapt to the transmission of traffic roadside equipment in the 5G scenario, and can also be oriented to distributed computing and processing of data under edge computing. This proposal can not only realize the travel mode analysis of traffic road network data in the existing technical environment, but also adapt to the rapid processing and calculation of traffic data in the future emerging technology scenarios.
参见图6,图6是本申请实施例提供的交通分析装置的结构图之一。如图6所示,交通分析装置600包括:Referring to FIG. 6, FIG. 6 is one of the structural diagrams of the traffic analysis device provided by the embodiment of the present application. As shown in Figure 6, the traffic analysis device 600 includes:
生成模块601,用于根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段,时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据,S和T均为正整数,R为大于1的整数;The generating module 601 is configured to generate a first tensor according to the traffic data detected by each detector in the target road network within the first duration, and the length of the spatial dimension of the first tensor is S road sections, the length of the time dimension is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is greater than 1 an integer of
融合模块602,用于利用注意力机制对所述第一张量中的空间维度和交通 数据维度进行融合,得到第二张量;Fusion module 602, for utilizing the attention mechanism to fuse the spatial dimension and the traffic data dimension in the first tensor to obtain the second tensor;
第一确定模块603,用于根据第三张量,确定所述目标路网的目标信息;The first determination module 603 is configured to determine the target information of the target road network according to the third tensor;
其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
可选地,所述生成模块601,包括:Optionally, the generating module 601 includes:
生成子模块,用于生成目标路网中各检测器检测的T个时间点对应的时间序列,及与所述目标路网中S个路段对应的空间序列;A generation submodule is used to generate a time sequence corresponding to T time points detected by each detector in the target road network, and a space sequence corresponding to S road sections in the target road network;
拼接子模块,用于拼接所述时间序列中各时间点对应的R类交通数据的值,及所述空间序列中各路段对应的R类交通数据的值,得到第一张量。The splicing sub-module is used to splice the value of the R-type traffic data corresponding to each time point in the time series and the value of the R-type traffic data corresponding to each road segment in the space sequence to obtain the first tensor.
可选地,所述融合模块602,包括:Optionally, the fusion module 602 includes:
提取子模块,用于提取所述第一张量中空间维度和交通数据维度的区域特征,得到中间张量;The extraction submodule is used to extract the regional features of the spatial dimension and the traffic data dimension in the first tensor to obtain an intermediate tensor;
第一获取子模块,用于将所述中间张量输入注意力融合网络,得到所述中间张量中各区域特征的权重值;The first acquisition submodule is used to input the intermediate tensor into the attention fusion network to obtain the weight value of each region feature in the intermediate tensor;
第二获取子模块,用于将所述各区域特征的权重值与所述第一张量相乘,得到第二张量。The second acquisition sub-module is configured to multiply the weight value of each region feature by the first tensor to obtain a second tensor.
可选地,所述交通分析装置600还包括:Optionally, the traffic analysis device 600 also includes:
检测模块,用于检测所述第二张量是否存在空缺值;A detection module, configured to detect whether there is a vacant value in the second tensor;
第一获取模块,用于在所述第二张量存在空缺值的情况下,利用基于权值的插值法补缺所述空缺值,得到第三张量。The first obtaining module is configured to, in the case that there is a vacant value in the second tensor, use a weight-based interpolation method to fill in the vacant value to obtain a third tensor.
可选地,在所述目标信息包括交通模式的情况下,所述第一确定模块603包括:Optionally, when the target information includes a traffic mode, the first determining module 603 includes:
分解子模块,用于对第三张量进行张量分解,得到与时间维度对应的第一因子矩阵,与空间维度对应的第二因子矩阵,及与交通数据对应的第三因子矩阵;The decomposition sub-module is used to perform tensor decomposition on the third tensor to obtain the first factor matrix corresponding to the time dimension, the second factor matrix corresponding to the space dimension, and the third factor matrix corresponding to the traffic data;
确定子模块,用于根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式。A determining submodule, configured to determine the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix.
可选地,所述确定子模块,包括:Optionally, the determining submodule includes:
构造单元,用于构造目标函数,所述目标函数用于反映第一值和第二值之间的差异,所述第一值为所述第三张量的值,所述第二值基于所述第一因子矩 阵、所述第二因子矩阵和所述第三因子矩阵计算得到;a construction unit, configured to construct an objective function, the objective function is used to reflect the difference between a first value and a second value, the first value is the value of the third tensor, and the second value is based on the The first factor matrix, the second factor matrix and the third factor matrix are calculated;
优化单元,用于根据所述目标函数,优化所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵;an optimization unit, configured to optimize the first factor matrix, the second factor matrix, and the third factor matrix according to the objective function;
确定单元,用于根据优化后的第一因子矩阵、第二因子矩阵和第三因子矩阵,确定所述目标路网的交通模式。The determining unit is configured to determine the traffic mode of the target road network according to the optimized first factor matrix, second factor matrix and third factor matrix.
可选地,所述第三张量的空间维度的长度为n个路段,时间维度的长度为m个时间点,交通数据维度的长度为i类交通数据,n和m均为正整数,i为大于1的整数;Optionally, the length of the spatial dimension of the third tensor is n road sections, the length of the time dimension is m time points, the length of the traffic data dimension is i-type traffic data, n and m are both positive integers, i is an integer greater than 1;
所述第一因子矩阵为m×Q矩阵,所述第二因子矩阵为n×Q矩阵,所述第三因子矩阵为i×Q矩阵,Q为正整数;The first factor matrix is an m×Q matrix, the second factor matrix is an n×Q matrix, the third factor matrix is an i×Q matrix, and Q is a positive integer;
所述确定子模块,包括:The determination submodule includes:
第一获取单元,用于根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,得到Q组交通数据序列;A first acquisition unit, configured to obtain Q groups of traffic data sequences according to the first factor matrix, the second factor matrix and the third factor matrix;
第二获取单元,用于获取与所述Q组交通数据序列对应的Q个交通模式。The second acquiring unit is configured to acquire Q traffic modes corresponding to the Q group of traffic data sequences.
可选地,所述第三张量的交通数据维度的长度为i类交通数据,i为大于1的整数;Optionally, the length of the traffic data dimension of the third tensor is traffic data of type i, where i is an integer greater than 1;
在所述目标信息包括交通规律的情况下,所述第一确定模块603用于以下至少一项:When the target information includes traffic rules, the first determination module 603 is used for at least one of the following:
获取所述目标路网的第k类交通数据在目标时长内的平均值;Obtain the average value of the kth traffic data of the target road network within the target duration;
获取所述目标路网的目标空间的第k类交通数据在所述第一时长内的平均值;Obtaining the average value of the kth type of traffic data in the target space of the target road network within the first time period;
其中,所述目标时长的时间单位包括以下至少一项:日;周;年;所述目标空间的空间单位包括以下至少一项:车道;路段;路网;k的取值范围为1至i。Wherein, the time unit of the target duration includes at least one of the following: day; week; year; the spatial unit of the target space includes at least one of the following: lane; road section; road network; the value range of k is 1 to i .
可选地,在所述目标信息包括未来交通状态的情况下,所述第一确定模块603用于:Optionally, when the target information includes the future traffic state, the first determination module 603 is configured to:
将所述第三张量输入训练好的第一模型中,预测得到第四张量,所述第四张量用于反映所述目标路网在第二时长内的交通状态,所述第二时长为所述第一时长的下一个时长;Input the third tensor into the trained first model, and predict the fourth tensor, which is used to reflect the traffic state of the target road network within the second time period, and the second The duration is the next duration of the first duration;
其中,所述第一模型预测所述第四张量时的第一隐藏状态由所述第三张量 和历史隐藏状态确定,所述历史隐藏状态为所述第一模型在第三时长的隐藏状态确定,所述第三时长为所述第一时长的上一个时长;所述第一模型的隐藏状态用于确定所述第一模型的输出。Wherein, the first hidden state when the first model predicts the fourth tensor is determined by the third tensor and the historical hidden state, and the historical hidden state is the hidden state of the first model in the third duration State determination, the third duration is a previous duration of the first duration; the hidden state of the first model is used to determine the output of the first model.
可选地,所述交通分析装置600还包括:Optionally, the traffic analysis device 600 also includes:
第二获取模块,用于获取样本张量;The second acquisition module is used to acquire the sample tensor;
第三获取模块,用于将所述样本张量输入未训练的第一模型,得到第五张量;A third acquisition module, configured to input the sample tensor into the untrained first model to obtain a fifth tensor;
第二确定模块,用于根据所述样本张量和所述第五张量,确定与所述第一模型对应的损失函数;A second determining module, configured to determine a loss function corresponding to the first model according to the sample tensor and the fifth tensor;
调整模块,用于根据所述损失函数,调整所述第一模型的权重值,得到训练好的第一模型。The adjusting module is used to adjust the weight value of the first model according to the loss function to obtain the trained first model.
交通分析装置600能够实现本申请实施例中图1方法实施例的各个过程,以及达到相同的有益效果,为避免重复,这里不再赘述。The traffic analysis device 600 can realize various processes of the method embodiment in FIG. 1 in the embodiment of the present application, and achieve the same beneficial effect. To avoid repetition, details are not repeated here.
本申请实施例还提供一种电子设备。请参见图7,电子设备可以包括处理器701、存储器702及存储在存储器702上并可在处理器701上运行的程序7021,程序7021被处理器701执行时可实现图1对应的方法实施例中的任意步骤及达到相同的有益效果,此处不再赘述。The embodiment of the present application also provides an electronic device. Referring to FIG. 7, the electronic device may include a processor 701, a memory 702, and a program 7021 stored in the memory 702 and operable on the processor 701. When the program 7021 is executed by the processor 701, the method embodiment corresponding to FIG. 1 may be implemented. Any steps in the method and achieving the same beneficial effect will not be repeated here.
本领域普通技术人员可以理解实现上述实施例方法的全部或者部分步骤是可以通过程序指令相关的硬件来完成,所述的程序可以存储于一可读取介质中。本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时可实现上述图1对应的方法实施例中的任意步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Those skilled in the art can understand that all or part of the steps for implementing the methods of the above embodiments can be completed by program instructions related hardware, and the program can be stored in a readable medium. The embodiment of the present application also provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any step in the above-mentioned method embodiment corresponding to FIG. 1 can be implemented, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
所述的存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。The storage medium is, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
以上所述是本申请实施例的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above is the preferred implementation of the embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles described in the present application, some improvements and modifications can also be made. These improvements and Retouching should also be regarded as the protection scope of this application.
工业实用性Industrial Applicability
在本申请实施例中,电子设备对检测器检测到的多维度交通数据进行时空 拼接,得到第一张量;之后,对所述第一张量中的空间维度和交通数据维度进行融合处理,得到第二张量,进而根据第二张量,确定所述目标路网的目标信息,所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。可见,本申请实施例的电子设备全面利用了检测器检测到的多维度交通数据对目标路网的交通进行分析,从而可以提高交通分析的准确度。In the embodiment of the present application, the electronic device performs spatio-temporal splicing on the multi-dimensional traffic data detected by the detector to obtain the first tensor; after that, it performs fusion processing on the spatial dimension and the traffic data dimension in the first tensor to obtain the first tensor Two tensors, and then according to the second tensor, determine the target information of the target road network, the target information includes at least one of the following: traffic mode, traffic law and future traffic state. It can be seen that the electronic device in the embodiment of the present application makes full use of the multi-dimensional traffic data detected by the detector to analyze the traffic of the target road network, thereby improving the accuracy of the traffic analysis.

Claims (13)

  1. 一种交通分析方法,包括:A traffic analysis method comprising:
    根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段,时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据,S和T均为正整数,R为大于1的整数;According to the traffic data detected by each detector in the target road network within the first time length, a first tensor is generated, the length of the space dimension of the first tensor is S road sections in the target road network, and the time dimension The length is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is an integer greater than 1;
    利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量;Using an attention mechanism to fuse the spatial dimension and traffic data dimension in the first tensor to obtain a second tensor;
    根据第三张量,确定所述目标路网的目标信息;Determine the target information of the target road network according to the third tensor;
    其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  2. 根据权利要求1所述的方法,其中,所述根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,包括:The method according to claim 1, wherein said generating the first tensor according to the traffic data detected by each detector in the target road network within the first duration includes:
    生成目标路网中各检测器检测的T个时间点对应的时间序列,及与所述目标路网中S个路段对应的空间序列;Generate a time sequence corresponding to T time points detected by each detector in the target road network, and a space sequence corresponding to S road sections in the target road network;
    拼接所述时间序列中各时间点对应的R类交通数据的值,及所述空间序列中各路段对应的R类交通数据的值,得到第一张量。Concatenating the value of the R-type traffic data corresponding to each time point in the time series and the value of the R-type traffic data corresponding to each road segment in the space series to obtain the first tensor.
  3. 根据权利要求1所述的方法,其中,所述利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量,包括:The method according to claim 1, wherein said utilizing the attention mechanism to fuse the spatial dimension and traffic data dimension in the first tensor to obtain a second tensor, comprising:
    提取所述第一张量中空间维度和交通数据维度的区域特征,得到中间张量;Extracting the regional features of the spatial dimension and the traffic data dimension in the first tensor to obtain an intermediate tensor;
    将所述中间张量输入注意力融合网络,得到所述中间张量中各区域特征的权重值;The intermediate tensor is input into the attention fusion network to obtain the weight value of each regional feature in the intermediate tensor;
    将所述各区域特征的权重值与所述第一张量相乘,得到第二张量。Multiplying the weight value of each region feature with the first tensor to obtain a second tensor.
  4. 根据权利要求1所述的方法,其中,所述利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量之后,所述根据第三张量,确定所述目标路网的目标信息之前,所述方法还包括:The method according to claim 1, wherein said use of the attention mechanism fuses the spatial dimension and the traffic data dimension in the first tensor, and after obtaining the second tensor, according to the third tensor, determine the Before the target information of the target road network, the method also includes:
    检测所述第二张量是否存在空缺值;detecting whether there is a missing value in the second tensor;
    在所述第二张量存在空缺值的情况下,利用基于权值的插值法补缺所述空缺值,得到第三张量。If there is a vacant value in the second tensor, the vacant value is filled by using a weight-based interpolation method to obtain a third tensor.
  5. 根据权利要求1所述的方法,其中,在所述目标信息包括交通模式的情况下,所述根据第三张量,确定所述目标路网的目标信息,包括:The method according to claim 1, wherein, when the target information includes a traffic mode, determining the target information of the target road network according to the third tensor comprises:
    对第三张量进行张量分解,得到与时间维度对应的第一因子矩阵,与空间维度对应的第二因子矩阵,及与交通数据对应的第三因子矩阵;Perform tensor decomposition on the third tensor to obtain the first factor matrix corresponding to the time dimension, the second factor matrix corresponding to the space dimension, and the third factor matrix corresponding to the traffic data;
    根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式。The traffic mode of the target road network is determined according to the first factor matrix, the second factor matrix and the third factor matrix.
  6. 根据权利要求5所述的方法,其中,所述根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式,包括:The method according to claim 5, wherein said determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix comprises:
    构造目标函数,所述目标函数用于反映第一值和第二值之间的差异,所述第一值为所述第三张量的值,所述第二值基于所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵计算得到;constructing an objective function that reflects the difference between a first value that is a value of the third tensor and a second value that is based on the first factor matrix , the second factor matrix and the third factor matrix are calculated;
    根据所述目标函数,优化所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵;optimizing the first factor matrix, the second factor matrix and the third factor matrix according to the objective function;
    根据优化后的第一因子矩阵、第二因子矩阵和第三因子矩阵,确定所述目标路网的交通模式。The traffic mode of the target road network is determined according to the optimized first factor matrix, second factor matrix and third factor matrix.
  7. 根据权利要求5所述的方法,其中,所述第三张量的空间维度的长度为n个路段,时间维度的长度为m个时间点,交通数据维度的长度为i类交通数据,n和m均为正整数,i为大于1的整数;The method according to claim 5, wherein the length of the spatial dimension of the third tensor is n road sections, the length of the time dimension is m time points, the length of the traffic data dimension is i type traffic data, n and m is a positive integer, i is an integer greater than 1;
    所述第一因子矩阵为m×Q矩阵,所述第二因子矩阵为n×Q矩阵,所述第三因子矩阵为i×Q矩阵,Q为正整数;The first factor matrix is an m×Q matrix, the second factor matrix is an n×Q matrix, the third factor matrix is an i×Q matrix, and Q is a positive integer;
    所述根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,确定所述目标路网的交通模式,包括:The determining the traffic mode of the target road network according to the first factor matrix, the second factor matrix and the third factor matrix includes:
    根据所述第一因子矩阵、所述第二因子矩阵和所述第三因子矩阵,得到Q组交通数据序列;Obtaining Q groups of traffic data sequences according to the first factor matrix, the second factor matrix and the third factor matrix;
    获取与所述Q组交通数据序列对应的Q个交通模式。Acquiring Q traffic modes corresponding to the Q group of traffic data sequences.
  8. 根据权利要求1所述的方法,其中,所述第三张量的交通数据维度的长度为i类交通数据,i为大于1的整数;The method according to claim 1, wherein the length of the traffic data dimension of the third tensor is type i traffic data, and i is an integer greater than 1;
    在所述目标信息包括交通规律的情况下,所述根据第三张量,确定所述目标路网的目标信息,包括以下至少一项:In the case where the target information includes traffic laws, the determination of the target information of the target road network according to the third tensor includes at least one of the following:
    获取所述目标路网的第k类交通数据在目标时长内的平均值;Obtain the average value of the kth traffic data of the target road network within the target duration;
    获取所述目标路网的目标空间的第k类交通数据在所述第一时长内的平均值;Obtaining the average value of the kth type of traffic data in the target space of the target road network within the first time period;
    其中,所述目标时长的时间单位包括以下至少一项:日;周;年;所述目标空间的空间单位包括以下至少一项:车道;路段;路网;k的取值范围为1至i。Wherein, the time unit of the target duration includes at least one of the following: day; week; year; the spatial unit of the target space includes at least one of the following: lane; road section; road network; the value range of k is 1 to i .
  9. 根据权利要求1所述的方法,其中,在所述目标信息包括未来交通状态的情况下,所述根据第三张量,确定所述目标路网的目标信息,包括:The method according to claim 1, wherein, when the target information includes a future traffic state, determining the target information of the target road network according to the third tensor comprises:
    将所述第三张量输入训练好的第一模型中,预测得到第四张量,所述第四张量用于反映所述目标路网在第二时长内的交通状态,所述第二时长为所述第一时长的下一个时长;Input the third tensor into the trained first model, and predict the fourth tensor, which is used to reflect the traffic state of the target road network within the second time period, and the second The duration is the next duration of the first duration;
    其中,所述第一模型预测所述第四张量时的第一隐藏状态由所述第三张量和历史隐藏状态确定,所述历史隐藏状态为所述第一模型在第三时长的隐藏状态确定,所述第三时长为所述第一时长的上一个时长;所述第一模型的隐藏状态用于确定所述第一模型的输出。Wherein, the first hidden state when the first model predicts the fourth tensor is determined by the third tensor and the historical hidden state, and the historical hidden state is the hidden state of the first model in the third duration State determination, the third duration is a previous duration of the first duration; the hidden state of the first model is used to determine the output of the first model.
  10. 根据权利要求9所述的方法,其中,所述将所述第三张量输入训练好的第一模型中,预测得到第四张量之前,所述方法还包括:The method according to claim 9, wherein, before inputting the third tensor into the trained first model, before the fourth tensor is predicted, the method further comprises:
    获取样本张量;Get the sample tensor;
    将所述样本张量输入未训练的第一模型,得到第五张量;inputting the sample tensor into the untrained first model to obtain a fifth tensor;
    根据所述样本张量和所述第五张量,确定与所述第一模型对应的损失函数;determining a loss function corresponding to the first model according to the sample tensor and the fifth tensor;
    根据所述损失函数,调整所述第一模型的权重值,得到训练好的第一模型。According to the loss function, the weight value of the first model is adjusted to obtain the trained first model.
  11. 一种交通分析装置,包括:A traffic analysis device, comprising:
    生成模块,用于根据目标路网中各检测器在第一时长内检测到的交通数据,生成第一张量,所述第一张量的空间维度的长度为所述目标路网中的S个路段,时间维度的长度为所述第一时长内的T个时间点,交通数据维度的长度为所述检测器检测的R类交通数据,S和T均为正整数,R为大于1的整数;A generating module, configured to generate a first tensor according to the traffic data detected by each detector in the target road network within the first duration, the length of the spatial dimension of the first tensor being S in the target road network sections, the length of the time dimension is T time points in the first duration, the length of the traffic data dimension is the R type traffic data detected by the detector, S and T are both positive integers, and R is greater than 1 integer;
    融合模块,用于利用注意力机制对所述第一张量中的空间维度和交通数据维度进行融合,得到第二张量;The fusion module is used to fuse the spatial dimension and the traffic data dimension in the first tensor by using the attention mechanism to obtain the second tensor;
    第一确定模块,用于根据第三张量,确定所述目标路网的目标信息;The first determination module is configured to determine the target information of the target road network according to the third tensor;
    其中,所述第三张量为所述第二张量或基于所述第二张量确定;所述目标信息包括以下至少一项:交通模式、交通规律以及未来交通状态。Wherein, the third tensor is the second tensor or is determined based on the second tensor; the target information includes at least one of the following: traffic mode, traffic law, and future traffic state.
  12. 一种电子设备,包括:收发机、存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;其中,所述处理器,用于读取存储器中的程序实现如权利要求1至10中任一项所述的交通分析方法。An electronic device, comprising: a transceiver, a memory, a processor, and a program stored on the memory and operable on the processor; wherein, the processor is used to read the program in the memory to implement the following The traffic analysis method according to any one of claims 1 to 10.
  13. 一种可读存储介质,用于存储程序,其中,所述程序被处理器执行时实现如权利要求1至10中任一项所述的交通分析方法。A readable storage medium for storing a program, wherein when the program is executed by a processor, the traffic analysis method according to any one of claims 1 to 10 is implemented.
PCT/CN2022/095206 2021-06-29 2022-05-26 Traffic analysis method, related device, and readable storage medium WO2023273724A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110727130.5 2021-06-29
CN202110727130.5A CN113256986B (en) 2021-06-29 2021-06-29 Traffic analysis method, related device and readable storage medium

Publications (1)

Publication Number Publication Date
WO2023273724A1 true WO2023273724A1 (en) 2023-01-05

Family

ID=77190268

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/095206 WO2023273724A1 (en) 2021-06-29 2022-05-26 Traffic analysis method, related device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN113256986B (en)
WO (1) WO2023273724A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113256986B (en) * 2021-06-29 2021-10-26 中移(上海)信息通信科技有限公司 Traffic analysis method, related device and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017220000A (en) * 2016-06-07 2017-12-14 日本電信電話株式会社 Flow rate prediction device, pattern estimation device, flow rate prediction method, pattern estimation method and program
JP2018195244A (en) * 2017-05-22 2018-12-06 日本電信電話株式会社 Od traffic prediction device, method, and program
CN110428614A (en) * 2019-07-11 2019-11-08 银江股份有限公司 A kind of traffic congestion temperature spatio-temporal prediction method based on non-negative tensor resolution
CN110766942A (en) * 2019-10-18 2020-02-07 北京大学 Traffic network congestion prediction method based on convolution long-term and short-term memory network
CN110827546A (en) * 2019-11-21 2020-02-21 银江股份有限公司 Signalized intersection road section short-term speed prediction method
CN112734100A (en) * 2020-12-31 2021-04-30 北京航空航天大学 Road network travel time prediction method based on tensor neural network
CN112988760A (en) * 2021-04-27 2021-06-18 北京航空航天大学 Tensor decomposition-based traffic space-time big data missing completion method
CN113256986A (en) * 2021-06-29 2021-08-13 中移(上海)信息通信科技有限公司 Traffic analysis method, related device and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10853720B1 (en) * 2017-04-26 2020-12-01 EMC IP Holding Company LLC Traffic condition forecasting using matrix compression and deep neural networks
CN109215372B (en) * 2018-10-15 2021-04-06 百度在线网络技术(北京)有限公司 Road network information updating method, device and equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017220000A (en) * 2016-06-07 2017-12-14 日本電信電話株式会社 Flow rate prediction device, pattern estimation device, flow rate prediction method, pattern estimation method and program
JP2018195244A (en) * 2017-05-22 2018-12-06 日本電信電話株式会社 Od traffic prediction device, method, and program
CN110428614A (en) * 2019-07-11 2019-11-08 银江股份有限公司 A kind of traffic congestion temperature spatio-temporal prediction method based on non-negative tensor resolution
CN110766942A (en) * 2019-10-18 2020-02-07 北京大学 Traffic network congestion prediction method based on convolution long-term and short-term memory network
CN110827546A (en) * 2019-11-21 2020-02-21 银江股份有限公司 Signalized intersection road section short-term speed prediction method
CN112734100A (en) * 2020-12-31 2021-04-30 北京航空航天大学 Road network travel time prediction method based on tensor neural network
CN112988760A (en) * 2021-04-27 2021-06-18 北京航空航天大学 Tensor decomposition-based traffic space-time big data missing completion method
CN113256986A (en) * 2021-06-29 2021-08-13 中移(上海)信息通信科技有限公司 Traffic analysis method, related device and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HU XUE , PENG DUN-LU: "Imputation Algorithm for Multimodal Missing Traffic Data Based on Tensor", JOURNAL OF CHINESE COMPUTER SYSTEMS, vol. 42, no. 1, 11 January 2021 (2021-01-11), pages 105 - 110, XP093020235, ISSN: 1000-1220 *

Also Published As

Publication number Publication date
CN113256986B (en) 2021-10-26
CN113256986A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN110766942B (en) Traffic network congestion prediction method based on convolution long-term and short-term memory network
EP3822852B1 (en) Method, apparatus, computer storage medium and program for training a trajectory planning model
CN111612243A (en) Traffic speed prediction method, system and storage medium
CN105628951A (en) Method and device for measuring object speed
CN112508173A (en) Traffic space-time sequence multi-step prediction method, system and storage medium
WO2023273724A1 (en) Traffic analysis method, related device, and readable storage medium
CN113762267B (en) Semantic association-based multi-scale binocular stereo matching method and device
WO2023207411A1 (en) Traffic determination method and apparatus based on spatio-temporal data, and device and medium
CN116311091A (en) Vehicle counting method based on pyramid density perception attention network
CN116206306A (en) Inter-category characterization contrast driven graph roll point cloud semantic annotation method
Yu et al. A short-term traffic flow prediction method based on spatial–temporal correlation using edge computing
CN114169425B (en) Training target tracking model and target tracking method and device
CN116580322A (en) Unmanned aerial vehicle infrared small target detection method under ground background
CN113792598B (en) Vehicle-mounted camera-based vehicle collision prediction system and method
WO2022026402A1 (en) Shape-based vehicle classification using laser scan and neural network
CN116861262A (en) Perception model training method and device, electronic equipment and storage medium
CN114742280B (en) Road condition prediction method and corresponding model training method, device, equipment and medium
CN116486624A (en) Traffic flow prediction method and system based on space-time diagram convolutional neural network
CN116129234A (en) Attention-based 4D millimeter wave radar and vision fusion method
CN114023074B (en) Traffic jam prediction method, device and medium based on multiple signal sources
Nguyen et al. Complex event analysis for traffic risk prediction based on 3D-CNN with multi-sources urban sensing data
Wang et al. Drosophila-inspired 3D moving object detection based on point clouds
Di et al. An automatic and integrated self-diagnosing system for the silting disease of drainage pipelines based on SSAE-TSNE and MS-LSTM
Jiangzhou et al. Research on real-time object detection algorithm in traffic monitoring scene
CN106652443B (en) Method for predicting short-time traffic volume of expressway with similar longitudinal and transverse dimensions

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831547

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE