Hybrid competition dynamic time slot allocation method and system based on BiConv-LSTM combined with improved ant colony algorithm
By adopting a hybrid method of BiConv-LSTM and improved ant colony algorithm in the smart grid, the problems of uniformity and randomness of time slot resource allocation in the smart grid are solved, efficient and stable time slot allocation is achieved, and the performance of the communication system is improved.
Patent Information
- Application Number
- CN202411563321.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-25
AI Technical Summary
In smart grids, the access of massive sensor equipment causes the communication network time slot resources to be unable to be evenly allocated, and the fixed allocation method leads to waste time slot resources. Dynamic time slot allocation requires time sequence correlation and randomness, which is difficult to effectively solve by existing algorithms.
The hybrid competition dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm is adopted. Time features are extracted through BiConv-LSTM, and the ant colony algorithm is improved to reconstruct pheromone concentration and heuristic information, and the flow difference factor and adaptive adjustment factor are introduced to optimize the time slot allocation.
A fast convergence time slot allocation scheme is realized, the throughput and stability of the communication system is improved, delay and resource waste are reduced, and the needs of high delay and high randomness in smart grids are adapted.
Smart Images

Figure CN119521395A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of communication resource allocation for smart grids, and in particular relates to a hybrid competitive dynamic time slot allocation method and system based on BiConv-LSTM combined with an improved ant colony algorithm. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] With the rapid development of multiple industries such as network technology and electronic products, the number of electronic devices connected to the network has exploded, which has promoted the development of network technology, and the fifth generation mobile communication technology (5G) has become more and more mature. In the field of power grids, various devices need to communicate and exchange frequently, such as: intelligent inspection robots, intelligent sensors, substation equipment, smart meters, etc. With the advancement of the implementation of smart grids, the access of massive intelligent communication devices is inevitable, which has brought considerable pressure to the power grid communication bearer network. Time slot resources are a type of communication resources and are the core concept of time division multiple access (TDMA) technology. By dividing time into several time slots of fixed length and allocating them to different power grid communication devices, multiple devices can share the same communication channel.
[0004] The time slot resources of the communication network cannot be evenly allocated, so when allocating time slot resources to devices, the fixed allocation method will lead to a waste of time slot resources. Reasonable allocation of time slot resources is an effective solution to optimize channel allocation, which has the advantages of increasing the capacity of the network system, reducing latency, and improving throughput. Common time slot allocation strategies include fixed allocation strategy and dynamic allocation strategy. Both have their advantages. Fixed time slot allocation is mainly used in scenarios with sufficient time slot resources, but in scenarios with massive sensor devices connected to smart grids and high latency requirements, research on dynamic time slot allocation is more promising and has more advantages.
[0005] At present, many related algorithm solutions have been proposed in the field of dynamic time slot allocation, including artificial intelligence (AI) algorithms, machine learning algorithms, heuristic algorithms, etc. For the problem of dynamic time slot allocation, it has a certain degree of temporal correlation and cannot be simply regarded as a Markov decision problem. In addition, since the time slot requirements of each device in the same network are very random, it is impossible to completely rely on supervised machine learning to obtain the time slot allocation solution. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with an improved ant colony algorithm, combining machine learning and heuristic algorithms to solve the Markov characteristics and randomness of time slot allocation. The present invention effectively extracts time features of different lengths by adding convolutional layers, bidirectional long short-term memory neural networks (Bi-directionalLSTM, Bi-LSTM) and bidirectional gated recurrent units (Bi-directional Gate Recurrent Unit, Bi-GRU) to LSTM variants. The present invention improves the ant colony algorithm, including the reconstruction of heuristic information, the introduction of flow differential factors and Gaussian distribution adaptive adjustment factors, etc., which can fully consider factors such as flow, delay, interference, etc. when selecting a path and effectively improve the convergence speed.
[0007] The present invention also proposes a hybrid competitive dynamic time slot allocation system based on BiConv-LSTM combined with an improved ant colony algorithm.
[0008] Terminology explanation:
[0009] 1. Rectified Linear Unit (ReLU): In neural networks, the ReLU activation function is used to perform nonlinear transformation on the input, mapping the negative value of the input to 0 and keeping the positive value unchanged. Its main advantage is that it is simple to calculate and effectively improves the convergence speed in deep neural networks. The mathematical expression is as follows:
[0010] f(x)=max(0,x) (1)
[0011] 2. Bidirectional Long Short-Term Memory (BiLSTM): This network structure consists of two independent LSTM units, which process the forward and reverse sequence information respectively. Combining the outputs of the two directions, BiLSTM can more comprehensively capture the forward and backward dependencies in the sequence data and better extract the features of long time series.
[0012] 3. Bidirectional Gated Recurrent Unit (BiGRU): This network consists of two directional GRU units, one direction processes the input from front to back, and the other direction processes the input from back to front. BiGRU has fewer parameters and is more efficient in processing short data sequences.
[0013] In order to achieve the above object, the present invention adopts the following technical solution:
[0014] A hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with an improved ant colony algorithm is suitable for building a communication system with distributed communication nodes. The communication system built with distributed communication nodes includes: sensor nodes, communication nodes, a central database, a control center, and communication links; including:
[0015] Step S1: The base station allocates fixed time slots to the sensor device for initialization and creates a time slot allocation table X to store the fixed allocations;
[0016] Step S2: Initialize the ant colony algorithm in combination with the BiConv-LSTM module, including:
[0017] Step S21: extracting data from the central database and inputting it into the BiConv-LSTM module for flow prediction to obtain predicted flow data;
[0018] Step S22: setting parameters, including the number of ants, the maximum number of iterations, the initial value of pheromone, the volatility coefficient, the pheromone and heuristic information control coefficient;
[0019] Step S3: Explore the optimal solution by improving the ant colony algorithm, including:
[0020] Step S31: Initialize the global pheromone concentration and create a pheromone table. The pheromone table includes the pheromone concentrations between various devices and is used to evaluate the priority relationship between two devices. Place m ants and each ant starts to select a path.
[0021] Step S32: After the entire ant colony completes a search, it is determined whether there is a new optimal solution. If so, the pheromone table is updated and iterated again; if not, the pheromone table is not updated and iterated again;
[0022] Step S33: during re-iteration, determine whether the maximum iteration has been reached. If not, re-execute step S3; if the maximum iteration has been reached, output the optimal path solution.
[0023] Step S4: Determine a time slot allocation scheme, including:
[0024] Step S41: Update the time slot allocation table X using the optimal path solution;
[0025] Step S42: determining whether there is a sensor occupying the contention channel for a long time, if there is a sensor occupying the contention channel for a long time, adjusting the time slot size of the sensor and re-updating the time slot allocation table; if there is no sensor occupying the contention channel for a long time, no adjustment is made;
[0026] Step S43: Allocate time slots for sensor devices according to the allocation scheme and send messages.
[0027] According to the preferred embodiment of the present invention, in step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data Q, as shown below:
[0028] Q = {q 1 ,q 2 ,…,q N}=LSTM{I 1 ,I 2 ,…,I N} (2)
[0029] Among them, q N represents the predicted traffic of the Nth device, I N Represents the historical traffic data of the Nth device, LSTM{} represents the LSTM module, which inputs historical traffic data and outputs predicted future traffic.
[0030] Preferably, according to the present invention, in step S22, according to the flow prediction result of the BiConv-LSTM module, the initial value of the pheromone concentration is:
[0031]
[0032] Among them, τ ij (0) is the initial value of pheromone, τ max and τ min are the upper and lower limits of pheromone, respectively, and q i is the flow data of sensor device i, q max and q min They represent the maximum and minimum values in the predicted traffic of all devices respectively.
[0033] According to a preferred embodiment of the present invention, in step S32, selecting a path includes:
[0034] The delay model is established based on the delay sensitivity of the sensor equipment. The specific formula is as follows:
[0035]
[0036] Among them, t 0j represents the delay of data transmission from sensor device j within one cycle, x k represents the size of the time slot block used by the kth sensor device, δ T represents the delay required for the unit time slot block, x k δ T represents the total transmission delay of the kth sensor device; t 0 Indicates the initial startup delay when the sensor device starts transmitting data;
[0037] According to the adjacent time slot size and physical distance d of the sensor devicesij Establish a co-channel interference model, the specific formula is as follows:
[0038]
[0039] Among them, L ij represents the co-frequency interference of sensor device i to sensor device j, d ij Represents the physical distance between two sensor devices, △x ij represents the time slot interval between two sensor devices, ξ 1 is the physical distance interference coefficient, and its value range is [0.1, 1]; ξ 2 is the time slot interval interference coefficient, and its value range is [0.01, 0.5];
[0040] The adaptive adjustment factor ε is introduced as follows:
[0041]
[0042] Among them, N c is the current iteration number, N max is the maximum number of iterations, and the adaptive adjustment factor follows Gaussian distribution, ω 2 It is an adjustable parameter. The larger ω is, the faster the convergence speed is.
[0043] The improved heuristic information is obtained based on the time delay model and the co-channel interference model and is defined as follows:
[0044]
[0045] Among them, a j is the priority coefficient, t' 0j is the delay of sensor device j after normalization to (0,1), η ij It is the heuristic information of the device;
[0046] In addition, the flow differential factor is introduced. The flow differential factor determines the future flow increase or decrease of the sensor device through the difference between the predicted flow and the current flow of the sensor device; the flow differential factor μ ij The specific formula is as follows:
[0047]
[0048] Among them, q j and They represent the predicted flow and current flow of the sensor device respectively. When the difference is 0, the flow difference factor is 0.5;
[0049] After an ant k completes a search, it locally updates the pheromone concentration according to certain rules. The formula for updating the pheromone concentration is as follows:
[0050]
[0051] τ ij (t+1)=ρ·τ ij (t)+△τ (11)
[0052] Among them, f all represents the optimization objective function after considering the time delay model and the same-frequency interference model, △τ represents the pheromone change value after the last cycle, ρ is the volatility coefficient; τ ij (t+1), τ ij (t) represents the next pheromone concentration value and the current pheromone concentration value of the device i→j respectively;
[0053] The probability of an ant choosing path i→j is The specific formula is as follows:
[0054]
[0055] Among them, α, β and γ are parameters that control the weights of pheromone concentration, heuristic information and flow difference factors, j k represents the set of time slot positions selected by the kth ant.
[0056] Preferably, in step S42, if a sensor occupies the contention channel for a long time, the time slot size of the sensor is adjusted and the time slot allocation table is updated again; including:
[0057] Step S421: Opening a time slot block B in an original frame as a contention channel to process a burst time slot request;
[0058] Step S422: Process the data according to step S21, and accept the device time slot demand data stored in the central database, including the time slot demand at several historical time points and the real-time time slot demand of the sensor device;
[0059] Step S423: Processing a large number of requests in a burst time slot. The specific process is as follows:
[0060] ① According to the magnitude of time slot requests, determine whether there are sudden time slot requests. Collect the time slot demands at several historical time points and calculate the average as the threshold. Judge the real-time demand and the historical demand. If the real-time time slot demand is greater than 2 times the threshold, it is determined that there are sudden time slot requests.
[0061] ② Dynamically increase the contention channel according to the request information, provide a large number of requests for the burst time slot, immediately open the contention channel, and adjust the time slot of the allocation table. The specific adjustment method is shown in the following formula:
[0062] B(t+1)=B 0 +κL(t) (13)
[0063] Among them, B 0 represents the initial contention channel size, L(t) represents the queue length of the burst time slot request at the current moment, κ is the influence coefficient of the queue length, and its value range is (0,1), and B(t+1) represents the increased contention channel size value at the next moment;
[0064] ③ Do not process the competing channels and update the original time slot allocation table.
[0065] Preferably, in step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data; including:
[0066] Step S21: extracting traffic data from the central database and performing data preprocessing. The specific process includes:
[0067] Step S211: receiving traffic usage data of all distributed sensors from a central database;
[0068] Step S212: the central database performs outlier processing, segmentation classification and Min-Max normalization operations on the collected data;
[0069] Step S22: Continue to summarize the equipment flow usage information in the historical data, collect flow data at different time intervals, and store them as long data and short data sequences containing T time points respectively as data sets for the long-term and short-term adaptive flow prediction module; the flow data format Q of each sensor device used for prediction after processing in As shown below:
[0070] Q in = {q in1 ,q in2 ,…,q inT} (14)
[0071] Where T is the length of the time series, q inT refers to the flow data at the Tth time point; Q in Used to input into the Bi-LSTM module for traffic prediction;
[0072] Step S23: Parameter initialization, setting the initial pheromone concentration and the initial value of the flow differential factor respectively.
[0073] Further preferably, long data processing and feature extraction specifically include:
[0074] Step S221: receiving long data input, extracting features of different scales through multiple groups of convolution modules with different convolution kernel sizes; a total of P convolution kernels are set, each convolution kernel W i The size is K, which represents the width of the time window covered by the convolution kernel, and the weights are as follows:
[0075] W i =[w i1 ,w i2 ,...,w ij ,...,w iK ] (15)
[0076] At time t, after the convolution kernel W i Rear output C i,t As shown below:
[0077]
[0078] Among them, q t+j-1 represents the flow data at the jth time point starting at time t; C i,t It represents the operation of performing dot product and summing the data of K time lengths from time t to the back with the convolution kernel;
[0079] Set the linear rectifier unit activation function, introduce nonlinear features, and output A after activation i,t As shown below:
[0080] A i,t =σ(C i,t ) (17)
[0081] σ(x)=max(0,x) (18)
[0082] After P convolution kernel operations, the generated multi-dimensional feature map is as follows:
[0083]
[0084] Among them, A 1,2 Represents the convolution kernel W 1 The feature generated at t = 2, A P,(T-K+1) Refers to the features generated by the convolution kernel P at the data point t=T-K+1;
[0085] Step S222: concatenate the feature maps extracted by each convolution kernel to form multi-scale features, which are combined into a richer feature representation; the concatenation formula is as follows:
[0086] A concat =concat(A (1) ,A (2) ,A (3) ,axis=3) (20)
[0087] Among them, A (1) Represents the feature map generated by the first convolution kernel, A concat It is the feature map after three convolution kernels are spliced together. axis=3 means splicing in 3 channel dimensions. Represents the dimension after concatenation;
[0088] Step S223: Use a bidirectional long short-term memory network to concatenate the feature map A concat Time series processing is performed to capture long-term dependencies in traffic data by considering both forward and backward time series information. The forward LSTM prediction formula is as follows:
[0089]
[0090] in, f t f and They represent the input gate, forget gate, and output gate respectively, σ is the sigmoid function, tanh is the hyperbolic sine function, is the memory unit update formula, and Represent the state and output of the current memory unit respectively, ⊙ is element-by-element multiplication, W is the weight term, b is the bias term, A t is the input feature map of time step t;
[0091] The backward LSTM prediction formula is as follows:
[0092]
[0093] According to the traffic data characteristics of the input T time steps, after Bi-LSTM prediction, the predicted traffic sequence of R time steps is output, as shown in the following formula:
[0094]
[0095] in, To predict traffic series, represents the predicted data for the next time step, Represents the predicted flow data for the Rth time step.
[0096] Further preferably, short data processing and feature extraction specifically include:
[0097] Step S231: Receive short data input, and fully extract overall trends and local features through average pooling and maximum pooling operations. The outputs after average pooling and maximum pooling operations are expressed by formulas (24) and (25) respectively:
[0098]
[0099] Among them, Q max_pool (t′,n) and Q avg_pool (t′,n) represents the values of the output data after maximum pooling and average pooling at time step t′ and sensor device n, respectively. R(t′) is the pooling sliding window defined on the input flow data. Q(t,n) refers to the input flow data sequence of sensor device n at time step t.
[0100] Step S232: concatenate the pooled features together to form a comprehensive feature vector To represent the main information features of short data; the splicing process is shown in formula (26):
[0101]
[0102] Step S233: Use a bidirectional recurrent gating unit to perform time series processing on the main information features of the spliced short data, while considering the forward and backward information of the data to capture the rapid changes and dependency features of short-term data; the forward GRU prediction formula is as follows:
[0103]
[0104] in, and Represent the update gate, reset gate, candidate activation and hidden state respectively, is the input feature vector of device n at time step t′, is the hidden state of the previous moment, which is updated by the fourth formula; and The weight matrix corresponding to each gate, is the bias term for each gate; Represents a candidate hidden state, which is used to generate the intermediate value of the hidden state at the current time step.
[0105] The backward GRU prediction formula is as follows:
[0106]
[0107] After the input traffic data passes through the bidirectional recurrent gating unit, the hidden state is concatenated, and the result is shown in the following formula:
[0108]
[0109] After processing all time steps, the hidden state of the last time step is obtained and input into the fully connected layer to obtain the prediction result. The formula is as follows:
[0110]
[0111] Among them, W out is the weight matrix of the fully connected layer, which transforms the hidden state h T Converted into predicted traffic data, b out is the bias term.
[0112] A hybrid competitive dynamic time slot allocation system based on BiConv-LSTM combined with an improved ant colony algorithm includes:
[0113] The multi-source data analysis module is configured to: receive sensor device data information from multiple sources; classify it into historical data and real-time data; continue to summarize the device traffic usage information in the historical data, store it as long data and short data respectively, as the data set of the long-term and short-term adaptive traffic prediction module; the real-time monitoring data contains the real-time information of the device time slot demand, providing a good data set for the competitive channel module to deal with various emergencies;
[0114] The long- and short-term adaptive traffic prediction module based on BiConv-LSTM is configured to: receive device traffic data, including long data and short data; select LSTM prediction method for processing according to data characteristics of different categories of data;
[0115] The contention channel module for handling sudden situations is configured to: receive device time slot demand data, use the contention channel as a buffer, and handle a large number of requests for sudden time slots;
[0116] The parameter initialization module is configured to: initialize the ant colony algorithm in combination with the BiConv-LSTM module;
[0117] The ant colony pathfinding module is configured to: explore the optimal solution by improving the ant colony algorithm;
[0118] The priority module is configured to control the priority of the ant colony algorithm time slot adjustment and the emergency time slot adjustment.
[0119] The beneficial effects of the present invention include the following aspects:
[0120] (1) The present invention uses the improved ant colony algorithm as the main body of dynamic time slot allocation, reconstructs pheromone concentration and heuristic information, introduces adaptive adjustment factors and flow differential factors, effectively utilizes BiConv-LSTM flow prediction results and fully considers delay requirements and interference between devices to achieve rapid convergence. In addition, through the effective exploration of the solution space by the ant colony, the optimal time slot allocation scheme is obtained, which effectively improves the throughput of the communication system and reduces the delay;
[0121] (2) The present invention proposes a new improved ant colony algorithm, including the reconstruction of pheromone concentration and heuristic information, and the introduction of flow differential factor and adaptive adjustment factor. The delay sensitivity of the device and the co-frequency interference between multiple devices are considered in the calculation of pheromone concentration and heuristic information, and the flow prediction information is used to influence the update of pheromone concentration. The introduction of flow differential factor can provide an adaptive processing solution for traffic mutation devices. The introduction of adaptive adjustment factor can achieve rapid convergence in the later stage of iteration with the help of the curve change characteristics of Gaussian distribution;
[0122] (3) The present invention provides a long-term and short-term adaptive traffic prediction module based on BiConv-LSTM to process device traffic data. The module can simultaneously focus on the change characteristics of traffic data at different scales. After data preprocessing, the long data is trained using Bi-LSTM combined with convolution processing, and the short-term device traffic data is trained using Bi-GRU combined with a pooling layer, so that the traffic at future moments can be predicted. Threshold processing is performed on the predicted value, and the mutated traffic prediction value is scaled or abnormal prediction values are removed, which can effectively avoid the maximum value of the incorrect prediction from affecting the overall stability. By weighting the predicted value and the original value, the final prediction scheme can be obtained. This makes the prediction result more stable, reduces the fluctuation range of the time slot block size of each sensor, and fine-tunes the ant colony algorithm during long-term operation, providing good robustness;
[0123] (4) The present invention provides a strategy for competing channels to deal with emergencies. A time slot block of a certain size is opened in the time slot frame as a "competitive channel" and is specifically used as a time slot block to deal with emergencies. According to the device time slot demand statistics, it is determined whether there are a large number of requests for burst time slots. If so, the competitive channel is dynamically increased, and the competitive channel is immediately opened for use by the sensor with a large number of burst requests, and the time slot allocation table is updated without considering the BiConv-LSTM prediction results. The competitive channel can effectively solve the special situation of a large number of requests for burst time slots. At the same time, by dynamically adjusting the size, it will not occupy too many resources, thereby improving the stability of the communication system;
[0124] (5) The present invention effectively combines the advantages of BiConv-LSTM, ant colony algorithm and buffer channel algorithms, and proposes a new solution for dynamic time slot allocation. First, the model organizes and segments the device data and applies it to the traffic prediction module to predict future traffic. The prediction results make targeted adjustments to the hyperparameters of the ant colony algorithm, and at the same time act on the pheromone concentration and path probability formulas, effectively helping the ant colony algorithm to converge quickly. BiConv-LSTM and the ant colony algorithm operate in a series structure. The buffer competition channel adopts a parallel architecture, which is synchronized with the BiConv-LSTM prediction and has the highest execution priority: when a large number of requests are found, the competition channel is executed immediately and the BiConv-LSTM prediction is blocked. The three algorithms rely on series and parallel interaction to find the optimal time slot allocation solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0125] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0126] Figure 1 It is a flow chart of a hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with an improved ant colony algorithm provided by an embodiment of the present invention;
[0127] Figure 2 The present invention provides a long-term and short-term adaptive traffic prediction method based on BiConv-LSTM.
[0128] Figure 3 It is a schematic diagram of a hybrid competitive dynamic time slot allocation system based on BiConv-LSTM combined with an improved ant colony algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0129] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0130] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0131] Example 1
[0132] The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with the improved ant colony algorithm is suitable for distributed communication nodes to build a communication system. The distributed communication node construction communication system includes: sensor nodes, communication nodes, central database, control center and communication links; sensor nodes are distributed sensor devices used to collect various information in the physical environment of the power grid, such as temperature, voltage, current, pressure, etc.; communication nodes, gateways as communication nodes, manage sensor nodes in a small range, and directly communicate wirelessly with the central control center; the central database is used to store, process and analyze the data transmitted by each node, and transmit the processed data to the control center for use; the control center is used to receive data from each node and perform time slot prediction and adjustment, and feed back the time slot allocation plan to each communication node; the communication link is used for each node and the central control center to interact and connect through a 5G wireless communication link based on time division multiple access technology; including:
[0133] Step S1: The base station allocates fixed time slots to the sensor device for initialization, creates a time slot allocation table X to store fixed allocations; a total of N devices use M time slot resources, and modifies the time slot allocation table X when the allocation scheme is dynamically updated later. The contention channel can directly update this table; X = {x i} N×M ; where x i is an indicator variable, indicating the time slot position allocated to the i-th device.
[0134] At the same time, time slot allocation has a uniqueness constraint, that is, for any time slot, there are:
[0135] Step S2: Initialize the ant colony algorithm in combination with the BiConv-LSTM module, including:
[0136] Step S21: extracting data from the central database and inputting it into the BiConv-LSTM module for flow prediction to obtain predicted flow data;
[0137] Step S22: Setting parameters, including the number of ants, the maximum number of iterations, the initial value of pheromone, the volatility coefficient, the pheromone and heuristic information control coefficient.
[0138] Step S3: Explore the optimal solution by improving the ant colony algorithm, including:
[0139] Step S31: Initialize the global pheromone concentration and create a pheromone table. The pheromone table includes the pheromone concentrations between various devices and is used to evaluate the priority relationship between two devices. Place m ants and each ant starts to select a path.
[0140] Step S32: After the entire ant colony completes a search, it is determined whether there is a new optimal solution. If so, the pheromone table is updated and iterated again; if not, the pheromone table is not updated and iterated again;
[0141] Step S33: during re-iteration, determine whether the maximum iteration has been reached. If not, re-execute step S3; if the maximum iteration has been reached, output the optimal path solution.
[0142] Step S4: Determine a time slot allocation scheme, including:
[0143] Step S41: Update the time slot allocation table X using the optimal path solution;
[0144] Step S42: determining whether there is a sensor occupying the contention channel for a long time, if there is a sensor occupying the contention channel for a long time, adjusting the time slot size of the sensor and re-updating the time slot allocation table; if there is no sensor occupying the contention channel for a long time, no adjustment is made;
[0145] Step S43: Allocate time slots for sensor devices according to the allocation scheme and send messages.
[0146] Example 2
[0147] The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm described in Example 1 is different in that:
[0148] In step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data Q, as shown below:
[0149] Q = {q 1 ,q 2 ,…,q N}=LSTM{I 1 ,I 2 ,…,I N} (2)
[0150] Among them, q N represents the predicted traffic of the Nth device, I N Represents the historical traffic data of the Nth device, LSTM{} represents the LSTM module, which inputs historical traffic data and outputs predicted future traffic.
[0151] In step S22, the parameter initialization phase refers to the prediction results of the BiConv-LSTM module and adjusts the parameters by weighting the BiConv-LSTM and the original time slot allocation scheme, so that the ant colony algorithm converges to the optimal solution more quickly. According to the traffic prediction results of the BiConv-LSTM module, the initial value of the pheromone concentration is:
[0152]
[0153] Among them, τ ij (0) is the initial value of pheromone, τ max and τ min are the upper and lower limits of the pheromone, respectively. The larger the difference between the two, the more the pheromone pays attention to the relative size of the device's flow. i is the flow data of sensor device i, q max and q min They represent the maximum and minimum values in the predicted traffic of all devices respectively.
[0154] In step S32, a path is selected, including:
[0155] The delay model is established based on the delay sensitivity of the sensor equipment. The specific formula is as follows:
[0156]
[0157] Among them, t 0j represents the delay of data transmission from sensor device j within one cycle, x k represents the size of the time slot block used by the kth sensor device, δ T represents the delay required for the unit time slot block, x k δ T represents the total transmission delay of the kth sensor device; t 0 Indicates the initial startup delay when the sensor device starts transmitting data;
[0158] According to the adjacent time slot size and physical distance d of the sensor devices ij Establish a co-channel interference model, the specific formula is as follows:
[0159]
[0160] Among them, L ij represents the co-frequency interference of sensor device i to sensor device j, d ij Represents the physical distance between two sensor devices, △x ij represents the time slot interval between two sensor devices, ξ 1 is the physical distance interference coefficient, and its value range is [0.1, 1]. The smaller the distance between sensor devices, the larger the coefficient should be. 2 is the time slot interval interference coefficient, and its value range is [0.01, 0.5];
[0161] Introducing the adaptive adjustment factor ε can effectively speed up the convergence speed, as shown below:
[0162]
[0163] Among them, N c is the current iteration number, N max is the maximum number of iterations, and the adaptive adjustment factor follows Gaussian distribution, ω 2 It is an adjustable parameter. The larger the ω is, the faster the convergence speed is. In actual situations, it is necessary to consider the order of magnitude of the maximum number of iterations and the actual convergence situation to make adjustments. For example, when N max When ω is 100, ω can be selected in the range of (1,10).
[0164] The improved heuristic information is obtained based on the time delay model and the co-channel interference model and is defined as follows:
[0165]
[0166] Among them, a j is the priority coefficient. The higher the latency requirement of the device, the greater the priority coefficient. 0j is the delay of sensor device j after normalization to (0,1), η ij It is the heuristic information of the device, which directly affects the path selection probability function. The larger the heuristic information of device ij, the more the algorithm tends to choose i→j;
[0167] In addition, the flow differential factor is introduced. The flow differential factor determines the future flow increase or decrease of the sensor device through the difference between the predicted flow and the current flow of the sensor device. If the flow of a certain device is predicted to increase significantly, it means that the flow demand of the sensor device has increased significantly, and the service quality demand has increased. The time slot allocation of the sensor device is given priority. The flow differential factor μ ij The specific formula is as follows:
[0168]
[0169] Among them, q j and They represent the predicted flow and current flow of the sensor device respectively. When the difference is 0, the flow difference factor is 0.5;
[0170] After an ant k completes a search, it locally updates the pheromone concentration according to certain rules. The formula for updating the pheromone concentration is as follows:
[0171]
[0172] τ ij (t+1)=ρ·τ ij (t)+△τ (11)
[0173] Among them, f allrepresents the optimization objective function after considering the time delay model and the same-frequency interference model, △τ represents the pheromone change value after the last cycle, ρ is the volatility coefficient; τ ij (t+1), τ ij (t) represents the next pheromone concentration value and the current pheromone concentration value of the device i→j respectively;
[0174] The probability of an ant choosing path i→j is The specific formula is as follows:
[0175]
[0176] Among them, α, β and γ are parameters that control the weights of pheromone concentration, heuristic information and flow difference factors, j k represents the set of time slot positions selected by the kth ant.
[0177] In step S42, if a sensor occupies the contention channel for a long time, the time slot size of the sensor is adjusted and the time slot allocation table is updated again; including:
[0178] Step S421: a certain size of time slot block B is opened in an original frame as a contention channel to process burst time slot requests;
[0179] Step S422: Process the data according to step S21, and accept the device time slot demand data stored in the central database, including the time slot demand of several (5) historical time points and the real-time time slot demand of the sensor device;
[0180] Step S423: Processing a large number of requests in a burst time slot. The specific process is as follows:
[0181] ① According to the magnitude of time slot requests, determine whether there are sudden time slot requests. Collect the time slot demands at several historical time points and calculate the average as the threshold. Judge the real-time demand and the historical demand. If the real-time time slot demand is greater than 2 times the threshold, it is determined that there are sudden time slot requests.
[0182] ② Dynamically increase the contention channel according to the request information, provide a large number of requests for the burst time slot, immediately open the contention channel, and adjust the time slot of the allocation table. The specific adjustment method is shown in the following formula:
[0183] B(t+1)=B 0 +κL(t) (13)
[0184] Among them, B 0Indicates the initial contention channel size, which can be set to 5%-10% of the total time slot resources, corresponding to dozens to hundreds of distributed devices. L(t) indicates the queue length of the burst time slot request at the current moment, κ is the influence coefficient of the queue length, the value range is (0,1), usually 0.5. B(t+1) indicates the increased contention channel size value at the next moment;
[0185] ③ Do not process the competing channels and update the original time slot allocation table.
[0186] In step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data; including:
[0187] Step S21: extracting flow data input from the central database and performing data preprocessing. The specific process includes:
[0188] Step S211: Receive the traffic usage data of all distributed sensors from the central database; the distributed sensors transmit the data information including traffic usage data, time slot demand data, voltage and current and other sensor data to the local communication node, sort them out and transmit them to the central database. The central database will store and record the receiving time of each piece of data according to the different time when the data is transmitted to the central database, and divide it into historical data and real-time data.
[0189] Step S212: The central database performs outlier processing, segmentation classification and Min-Max normalization operations on the collected data; including using the Z-Score method to determine outliers and delete outliers; normalizing the traffic usage data according to formula (29); using a sliding window to sample fixed data for training; dividing the data set into 80% training set and 20% test set;
[0190] Step S22: Continue to summarize the equipment traffic usage information in the historical data, collect traffic data at different time intervals, and store them as long data and short data sequences containing T time points respectively, as data sets for the long-term and short-term adaptive traffic prediction module; the real-time monitoring data contains real-time information on the equipment time slot requirements, providing a good data set for the competitive channel module to cope with various emergencies; the traffic data of each sensor device used for prediction after processing is in the form of Q in As shown below:
[0191] Q in = {q in1 ,q in2 ,…,q inT} (14)
[0192] Where T is the length of the time series, q inT refers to the flow data at the Tth time point; Qin Used to input into the Bi-LSTM module for traffic prediction;
[0193] Step S23: Parameter initialization: setting the pheromone initialization concentration and the initial value of the flow differential factor according to formulas (3) and (8) respectively.
[0194] Long data processing and feature extraction, including:
[0195] Step S221: receiving long data input, extracting features of different scales through multiple groups of convolution modules with different convolution kernel sizes; a total of P convolution kernels are set, each convolution kernel W i The size is K, which represents the width of the time window covered by the convolution kernel, and the weights are as follows:
[0196] W i =[w i1 ,w i2 ,...,w ij ,...,w iK ] (15)
[0197] At time t, after the convolution kernel W i Rear output C i,t As shown below:
[0198]
[0199] Among them, q t+j-1 represents the flow data at the jth time point starting at time t; C i,t It represents the operation of performing dot product and summing the data of K time lengths from time t to the back with the convolution kernel;
[0200] Set the ReLU activation function, introduce nonlinear features, and output A after activation i,t As shown below:
[0201] A i,t =σ(C i,t ) (17)
[0202] σ(x)=max(0,x) (18)
[0203] After P convolution kernel operations, the generated multi-dimensional feature map is as follows:
[0204]
[0205] Among them, A 1,2 Represents the convolution kernel W 1 The feature generated at t = 2, A P,(T-K+1) Refers to the features generated by the convolution kernel P at the data point t=T-K+1;
[0206] Step S222: concatenate the feature maps extracted by each convolution kernel to form multi-scale features, which are combined into a richer feature representation; the concatenation formula is as follows:
[0207] A concat =concat(A (1) ,A (2) ,A (3) ,axis=3) (20)
[0208] Among them, A (1) Represents the feature map generated by the first convolution kernel, A concat It is the feature map after three convolution kernels are spliced together. axis=3 means splicing in 3 channel dimensions. Represents the dimension after concatenation;
[0209] Step S223: Use a bidirectional long short-term memory network to concatenate the feature map A concat Time series processing is performed to capture long-term dependencies in traffic data by considering both forward and backward time series information. The forward LSTM prediction formula is as follows:
[0210]
[0211] in, f t f and They represent the input gate, forget gate, and output gate respectively, σ is the sigmoid function, tanh is the hyperbolic sine function, is the memory unit update formula, and Represent the state and output of the current memory unit respectively, ⊙ is element-by-element multiplication, W is the weight term, b is the bias term, A t is the input feature map of time step t; calculated by formula (20);
[0212] The backward LSTM prediction formula is the same as the above formula, but in the opposite direction. The backward LSTM prediction formula is as follows:
[0213]
[0214] According to the traffic data characteristics of the input T time steps, after Bi-LSTM prediction, the predicted traffic sequence of R time steps is output, as shown in the following formula:
[0215]
[0216] in, To predict traffic series, represents the predicted data for the next time step, Represents the predicted flow data for the Rth time step.
[0217] Short data processing and feature extraction, including:
[0218] Step S231: Receive short data input, and fully extract overall trends and local features through average pooling and maximum pooling operations. The outputs after average pooling and maximum pooling operations are expressed by formulas (24) and (25) respectively:
[0219]
[0220] Among them, Q max_pool (t′,n) and Q avg_pool (t′,n) represents the values of the output data after maximum pooling and average pooling at time step t′ and sensor device n, respectively. R(t′) is the pooling sliding window defined on the input flow data. Q(t,n) refers to the input flow data sequence of sensor device n at time step t. It is given by formula (14).
[0221] Step S232: concatenate the pooled features together to form a comprehensive feature vector To represent the main information features of short data; the splicing process is shown in formula (26):
[0222]
[0223] Step S233: Use a bidirectional recurrent gating unit to perform time series processing on the main information features of the spliced short data, while considering the forward and backward information of the data to capture the rapid changes and dependency features of short-term data; the forward GRU prediction formula is as follows:
[0224]
[0225] in, and Represent the update gate, reset gate, candidate activation and hidden state respectively, is the input feature vector of device n at time step t′, is the hidden state of the previous moment, which is updated by the fourth formula; and The weight matrix corresponding to each gate, is the bias term for each gate; Represents a candidate hidden state, which is used to generate the intermediate value of the hidden state at the current time step.
[0226] The backward GRU prediction formula is the same as the above formula, but in the opposite direction. The backward GRU prediction formula is as follows:
[0227]
[0228] After the input traffic data passes through the bidirectional recurrent gating unit, the hidden state is concatenated, and the result is shown in the following formula:
[0229]
[0230] After processing all time steps, the hidden state of the last time step is obtained and input into the fully connected layer to obtain the prediction result. The formula is as follows:
[0231]
[0232] Among them, W out is the weight matrix of the fully connected layer, which transforms the hidden state h T Converted into predicted traffic data, b out is the bias term. The final predicted flow result is the same as formula (23).
[0233] Example 3
[0234] A hybrid competitive dynamic time slot allocation system based on BiConv-LSTM combined with an improved ant colony algorithm includes:
[0235] The multi-source data analysis module is configured to: receive sensor device data information from multiple sources, including device flow usage information, device time slot demand information, voltage and current and other sensor information; have a category judgment attribute to achieve the summary and organization of all information, store and record the receiving time of each piece of data according to the different time when the data is transmitted to the central database, and classify it into historical data and real-time data; continue to summarize the device flow usage information in the historical data, collect flow data at different time intervals, and store them as long data and short data containing 1000 time points respectively, as the data set of the long-term and short-term adaptive flow prediction module; the real-time monitoring data contains the real-time information of the device time slot demand, providing a good data set for the competitive channel module to deal with various emergencies; have data preprocessing, segmentation and classification functions, including removing data outliers, and normalizing the flow usage data according to formula (29); use a sliding window to sample fixed data, the window size is set to 200, and a data set is generated with a step size of 5 for training; the data set is divided into 80% training set and 20% test set.
[0236] The long-term and short-term adaptive traffic prediction module based on BiConv-LSTM is configured to: receive device traffic data, including long data and short data; select appropriate LSTM prediction methods for processing according to the data characteristics of different categories of data; including: extracting different scale features of long data through multiple groups of convolution modules with different convolution kernel sizes, using Bi-LSTM for long-term prediction, and extracting short-term features of short data using different pooling operations, and using Bi-GRU for short-term prediction. According to the scale characteristics of the data, different prediction schemes are used to fuse the two neural networks of LSTM and GRU. A bidirectional prediction mechanism is introduced to fully understand the periodic characteristics of traffic data and improve prediction accuracy. Convolutional layers and pooling layers are added to more effectively identify features before prediction.
[0237] The contention channel module for handling emergencies is configured to: receive device time slot demand data, use the contention channel as a buffer, and handle a large number of burst time slot requests; the core of this module is to open up a certain size of time slot block in the original frame as a contention channel. The contention channel selects different processing methods according to the degree of burst time slot requests. If the burst time slot request is small, the contention channel is dynamically reduced or not processed, and the original time slot allocation table is updated. If the burst time slot request is large, the contention channel is dynamically increased and provided for the use of a large number of burst time slot requests. When dynamically increasing the contention channel, the original time slot allocation table is processed using an evaluation method, and the time slot usage of different sensors is evaluated differently. The shortening amount of the time slot block of the sensor is determined based on the evaluation.
[0238] The parameter initialization module is configured to initialize the ant colony algorithm in combination with the BiConv-LSTM module; it has a built-in weight processing attribute. The main function of the weight processing attribute is to receive the prediction results of the long-term and short-term adaptive traffic prediction module based on BiConv-LSTM, and perform weighted processing based on the prediction results and the current time slot allocation plan. The weighting coefficient is set by the LSTM prediction situation. Weighted processing can enhance the stability of the overall module, correct the gradient of the time slot allocation plan, and avoid significant changes in the time slot block when the time slot allocation changes dynamically. This module generates the final prediction allocation plan based on the weighted results, and based on this plan, performs parameter initialization in the ant colony pathfinding module, introduces traffic differential factors, and reconstructs heuristic information.
[0239] The ant colony pathfinding module is configured to: explore the optimal solution by improving the ant colony algorithm; after receiving the initialization parameters, the module creates a pheromone table and starts path search. m ants start to select a path. After a certain ant k completes a search, it locally updates the pheromone concentration according to certain rules. The present invention considers two models of device delay and co-frequency interference to reconstruct the pheromone concentration, adds an adaptive adjustment factor to the heuristic information to accelerate the convergence speed (such as formula 8), and introduces a traffic differential factor based on the traffic prediction result to establish an improved probability formula (13). After the entire ant colony completes a search, it determines whether there is a new optimal path. If so, update the pheromone table and iterate again; if not, do not update the pheromone table and iterate again. After reaching the maximum number of iterations, the optimal path solution is obtained, and it is determined whether there is a sensor device that occupies the contention channel for a long time. If so, adjust the time slot size of the sensor; if not, complete the time slot allocation table update, allocate time slots to the sensor according to the new time slot allocation plan, and send a message.
[0240] The priority module is configured to: control the priority of the ant colony algorithm time slot adjustment and the emergency time slot adjustment. Avoid conflicts in time slot adjustment. When a large number of emergency time slot requests are generated, the contention channel has the highest priority, shielding the predicted time slot allocation, giving priority to the contention channel, and updating the time slot allocation table to allocate time slots to sensor devices in a timely manner.
Claims
1. A hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with an improved ant colony algorithm is suitable for building a communication system with distributed communication nodes. The communication system built with distributed communication nodes includes: Sensor nodes, communication nodes, central database, control center and communication links; characterized by comprising: Step S1: The base station allocates fixed time slots to the sensor device for initialization and creates a time slot allocation table X to store the fixed allocations; Step S2: Initialize the ant colony algorithm in combination with the BiConv-LSTM module, including: Step S21: extracting data from the central database and inputting it into the BiConv-LSTM module for flow prediction to obtain predicted flow data; Step S22: setting parameters, including the number of ants, the maximum number of iterations, the initial value of pheromone, the volatility coefficient, the pheromone and heuristic information control coefficient; Step S3: Explore the optimal solution by improving the ant colony algorithm, including: Step S31: Initialize the global pheromone concentration and create a pheromone table. The pheromone table includes the pheromone concentrations between various devices and is used to evaluate the priority relationship between two devices. Place m ants and each ant starts to select a path. Step S32: After the entire ant colony completes a search, it is determined whether there is a new optimal solution. If so, the pheromone table is updated and iterated again; if not, the pheromone table is not updated and iterated again; Step S33: during re-iteration, determine whether the maximum iteration has been reached. If not, re-execute step S3; if the maximum iteration has been reached, output the optimal path solution. Step S4: Determine a time slot allocation scheme, including: Step S41: Update the time slot allocation table X using the optimal path solution; Step S42: determining whether there is a sensor occupying the contention channel for a long time, if there is a sensor occupying the contention channel for a long time, adjusting the time slot size of the sensor and re-updating the time slot allocation table; if there is no sensor occupying the contention channel for a long time, no adjustment is made; Step S43: Allocate time slots for sensor devices according to the allocation scheme and send messages.
2. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 1 is characterized in that: In step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data Q, as shown below: Q={q1,q2,…,q N }=LSTM{I1,I2,…,I N } (2) Among them, q N represents the predicted traffic of the Nth device, I N Represents the historical traffic data of the Nth device, LSTM{} represents the LSTM module, which inputs historical traffic data and outputs predicted future traffic.
3. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 1 is characterized in that: In step S22, according to the flow prediction result of the BiConv-LSTM module, the initial value of the pheromone concentration is: Among them, τ ij (0) is the initial value of pheromone, τ max and τ min are the upper and lower limits of pheromone, respectively, and q i is the flow data of sensor device i, q max and q min They represent the maximum and minimum values in the predicted traffic of all devices respectively.
4. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 1 is characterized in that: In step S32, a path is selected, including: The delay model is established based on the delay sensitivity of the sensor equipment. The specific formula is as follows: Among them, t 0j represents the delay of data transmission from sensor device j within one cycle, x k represents the size of the time slot block used by the kth sensor device, δ T represents the delay required for the unit time slot block, x k δ T represents the total transmission delay of the kth sensor device; t0 represents the initialization startup delay when the sensor device starts to transmit data; According to the adjacent time slot size and physical distance d of the sensor devices ij Establish a co-channel interference model, the specific formula is as follows: Among them, L ij represents the co-frequency interference of sensor device i to sensor device j, d ij Represents the physical distance between two sensor devices, △x ij represents the time slot interval between two sensor devices, ξ1 is the physical distance interference coefficient, and its value range is [0.1, 1]; ξ2 is the time slot interval interference coefficient, and its value range is [0.01, 0.5]; The adaptive adjustment factor ε is introduced as follows: Among them, N c is the current iteration number, N max is the maximum number of iterations, and the adaptive adjustment factor follows Gaussian distribution, ω 2 It is an adjustable parameter. The larger ω is, the faster the convergence speed is. The improved heuristic information is obtained based on the time delay model and the co-channel interference model and is defined as follows: Among them, a j is the priority coefficient, t' 0j is the delay of sensor device j after normalization to (0,1), η ij It is the heuristic information of the device; In addition, the flow differential factor is introduced. The flow differential factor determines the future flow increase or decrease of the sensor device through the difference between the predicted flow and the current flow of the sensor device; the flow differential factor μ ij The specific formula is as follows: Among them, q j and They represent the predicted flow and current flow of the sensor device respectively. When the difference is 0, the flow difference factor is 0.5; After an ant k completes a search, it locally updates the pheromone concentration. The formula for updating the pheromone concentration is as follows: Among them, f all represents the optimization objective function after considering the time delay model and the same-frequency interference model, △τ represents the pheromone change value after the last cycle, ρ is the volatility coefficient; τ ij (t+1), τ ij (t) represents the next pheromone concentration value and the current pheromone concentration value of the device i→j respectively; The probability of an ant choosing path i→j is The specific formula is as follows: Among them, α, β and γ are parameters that control the weights of pheromone concentration, heuristic information and flow difference factors, j k represents the set of time slot positions selected by the kth ant.
5. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 1 is characterized in that: In step S42, if a sensor occupies the contention channel for a long time, the time slot size of the sensor is adjusted and the time slot allocation table is updated again; including: Step S421: Opening a time slot block B in an original frame as a contention channel to process a burst time slot request; Step S422: Process the data according to step S21, and accept the device time slot demand data stored in the central database, including the time slot demand at several historical time points and the real-time time slot demand of the sensor device; Step S423: Processing a large number of requests for burst time slots.
6. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 5 is characterized in that: To handle a large number of requests in a burst time slot, the specific process is as follows: ① According to the magnitude of time slot requests, determine whether there are sudden time slot requests. Collect the time slot demands at several historical time points and calculate the average as the threshold. Judge the real-time demand and the historical demand. If the real-time time slot demand is greater than 2 times the threshold, it is determined that there are sudden time slot requests. ② Dynamically increase the contention channel according to the request information, provide a large number of requests for the burst time slot, immediately open the contention channel, and adjust the time slot of the allocation table. The specific adjustment method is shown in the following formula: B(t+1)=B0+κL(t) (13) Among them, B0 represents the initial contention channel size, L(t) represents the queue length of the burst time slot request at the current moment, κ is the influence coefficient of the queue length, and its value range is (0,1), and B(t+1) represents the increased contention channel size at the next moment; ③ Do not process the competing channels and update the original time slot allocation table.
7. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 1 is characterized in that: In step S21, data is extracted from the central database and input into the BiConv-LSTM module for flow prediction to obtain predicted flow data, including: Step S21: extracting flow data input from the central database and performing data preprocessing. The specific process includes: Step S211: receiving traffic usage data of all distributed sensors from a central database; Step S212: the central database performs outlier processing, segmentation classification and Min-Max normalization operations on the collected data; Step S22: Continue to summarize the equipment flow usage information in the historical data, collect flow data at different time intervals, and store them as long data and short data sequences containing T time points respectively as data sets for the long-term and short-term adaptive flow prediction module; the flow data format Q of each sensor device used for prediction after processing in As shown below: Q in ={q in1 ,q in2 ,…,q inT } (14) Where T is the length of the time series, q inT refers to the flow data at the Tth time point, Q in Used to input into the Bi-LSTM module for traffic prediction; Step S23: Parameter initialization, setting the initial pheromone concentration and the initial value of the flow differential factor respectively.
8. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 6 is characterized in that: Long data processing and feature extraction, including: Step S221: receiving long data input, extracting features of different scales through multiple groups of convolution modules with different convolution kernel sizes; a total of P convolution kernels are set, each convolution kernel W i The size is K, which represents the width of the time window covered by the convolution kernel, and the weights are as follows: IN i =[in i1 ,In i2 ,...,In ij ,...,In iK ] (15) At time t, after the convolution kernel W i Rear output C i,t As shown below: Among them, q t+j-1 represents the flow data at the jth time point starting at time t; C i,t It represents the operation of performing dot product and summing the data of K time lengths from time t to the back with the convolution kernel; Set the linear rectifier unit activation function, introduce nonlinear features, and output A after activation i,t As shown below: A i,t =σ(C i,t ) (17) σ(x)=max(0,x) (18) After P convolution kernel operations, the generated multi-dimensional feature map is as follows: Among them, A 1,2 A represents the feature generated by the convolution kernel W1 at t=2. P,(T-K+1) Refers to the features generated by the convolution kernel P at the data point t=T-K+1; Step S222: concatenate the feature maps extracted by each convolution kernel to form multi-scale features, which are combined into a richer feature representation; the concatenation formula is as follows: A concat =concat(A (1) ,A (2) ,A (3) ,axis=3) (20) Among them, A (1) Represents the feature map generated by the first convolution kernel, A concat It is the feature map after three convolution kernels are spliced together. axis=3 means splicing in 3 channel dimensions. Represents the dimension after splicing; Step S223: Use a bidirectional long short-term memory network to concatenate the feature map A concat Time series processing is performed to capture long-term dependencies in traffic data by considering both forward and backward time series information. The forward LSTM prediction formula is as follows: in, and They represent the input gate, forget gate, and output gate respectively, σ is the sigmoid function, tanh is the hyperbolic sine function, is the memory unit update formula, and Represent the state and output of the current memory unit respectively, ⊙ is element-by-element multiplication, W is the weight term, b is the bias term, A t is the input feature map of time step t; The backward LSTM prediction formula is as follows: According to the traffic data characteristics of the input T time steps, after Bi-LSTM prediction, the predicted traffic sequence of R time steps is output, as shown in the following formula: in, To predict traffic series, represents the predicted data for the next time step, Represents the predicted flow data for the Rth time step.
9. The hybrid competitive dynamic time slot allocation method based on BiConv-LSTM combined with improved ant colony algorithm according to claim 6, characterized in that: Short data processing and feature extraction, including: Step S231: Receive short data input, and fully extract overall trends and local features through average pooling and maximum pooling operations. The outputs after average pooling and maximum pooling operations are expressed by formulas (24) and (25) respectively: Among them, Q max_pool (t′,n) and Q avg_pool (t′,n) represents the values of the output data after maximum pooling and average pooling at time step t′ and sensor device n, respectively. R(t′) is the pooling sliding window defined on the input flow data. Q(t,n) refers to the input flow data sequence of sensor device n at time step t. Step S232: concatenate the pooled features together to form a comprehensive feature vector To represent the main information features of short data; the splicing process is shown in formula (26): Step S233: Use a bidirectional recurrent gating unit to perform time series processing on the main information features of the spliced short data, while considering the forward and backward information of the data to capture the rapid changes and dependency features of short-term data; the forward GRU prediction formula is as follows: in, and Represent the update gate, reset gate, candidate activation and hidden state respectively, is the input feature vector of device n at time step t′, is the hidden state of the previous moment, which is updated by the fourth formula; and The weight matrix corresponding to each gate, is the bias term for each gate; Represents the candidate hidden state, which is used to generate the intermediate value of the hidden state at the current time step; The backward GRU prediction formula is as follows: After the input traffic data passes through the bidirectional recurrent gating unit, the hidden state is concatenated, and the result is shown in the following formula: After processing all time steps, the hidden state of the last time step is obtained and input into the fully connected layer to obtain the prediction result. The formula is as follows: Among them, W out is the weight matrix of the fully connected layer, which transforms the hidden state h T Converted into predicted traffic data, b out is the bias term.
10. A hybrid competitive dynamic time slot allocation system based on BiConv-LSTM combined with an improved ant colony algorithm, including: The multi-source data analysis module is configured to: receive sensor device data information from multiple sources; And classified into historical data and real-time data; the device traffic usage information is further summarized in the historical data and stored as long data and short data respectively as the data set of the long-term and short-term adaptive traffic prediction module; the real-time monitoring data contains the real-time information of the device time slot demand, providing a good data set for the competitive channel module to deal with various emergencies; The long- and short-term adaptive traffic prediction module based on BiConv-LSTM is configured to: receive device traffic data, including long data and short data; select LSTM prediction method for processing according to data characteristics of different categories of data; The contention channel module for handling sudden situations is configured to: receive device time slot demand data, use the contention channel as a buffer, and handle a large number of requests for sudden time slots; The parameter initialization module is configured to: initialize the ant colony algorithm in combination with the BiConv-LSTM module; The ant colony pathfinding module is configured to: explore the optimal solution by improving the ant colony algorithm; The priority module is configured to control the priority of the ant colony algorithm time slot adjustment and the emergency time slot adjustment.