A traffic prediction method for an internet of things device

By constructing a traffic prediction model using LSTM networks and fully connected neural networks, the problem of traffic imbalance caused by the personalized characteristics of IoT devices is solved, achieving accurate traffic prediction and optimized configuration.

CN117221143BActive Publication Date: 2025-11-04BEIJING SHUMI NETWORK TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311346000.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-11-04
Estimated Expiration
2043-10-17

AI Technical Summary

Technical Problem

The uneven data usage patterns of IoT devices due to their individual characteristics lead to resource waste or strain under traditional fixed data plans.

Method used

A traffic prediction model based on LSTM network and fully connected neural network is adopted. By regularly updating device profiles and traffic data, a model dataset is built, and sliding sampling and model training are performed to predict future device traffic.

Benefits of technology

It enables accurate traffic prediction based on device characteristics and historical traffic usage, optimizes traffic configuration, and avoids resource waste and strain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117221143B_ABST
    Figure CN117221143B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to a kind of traffic prediction methods of Internet of Things equipment, the method comprises: every first specified time length is to the portrait data of each device once collection, every second specified time length is to the traffic data of each device once collection, every third specified time length is to the device acquisition data sequence of each device once update;Traffic prediction model is constructed;Based on all device acquisition data sequence, model dataset is constructed;And based on model dataset, traffic prediction model is trained;After model training, the historical data sequence of any device is acquired at any time, and traffic prediction is carried out according to historical data sequence based on traffic prediction model.The traffic of device in future specified prediction time length can be predicted based on the individualized characteristics and historical traffic use of each Internet of Things equipment according to the present application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and particularly relates to a traffic prediction method of an Internet of Things device. BACKGROUND

[0002] An Internet of Things operation and maintenance service provider will deploy a large number of Internet of Things devices based on business development needs, and configure a fixed monthly traffic package for each Internet of Things device.

[0003] In addition, the Internet of Things operation and maintenance service provider finds through long-term operation that the Internet of Things devices will have obvious high / low traffic differences due to some individual characteristics, specifically: the device communication mode (including various wireless modes and various wired modes) set by the management personnel in the application scenario, the device behavior habit (the device activity in multiple specified time periods every day), the device priority (also known as the device importance level), the device type (including sensors, household devices, and industrial devices), and even the device user are all likely to cause large differences in the traffic usage state of the device; for example, the traffic consumption speed of an Internet of Things device with a wireless mode as the main communication mode will be higher than that of an Internet of Things device with a wired mode as the main communication mode, the traffic consumption speed of an Internet of Things device with a high activity level as reflected by the device behavior habit will be higher than that of an Internet of Things device with a low activity level, the traffic consumption speed of an Internet of Things device of an industrial device type or a sensor type will be higher than that of an Internet of Things device of a household device type, and the traffic consumption speed of an Internet of Things device of a young user will be higher than that of an Internet of Things device of an old user.

[0004] Such high / low traffic differences caused by individual characteristics of the device will inevitably cause the following problems in the traditional fixed traffic package configuration mode: the problem of waste of package resources for low-traffic devices, and the problem of package resource shortage for high-traffic devices.

[0005] In order to solve these problems, the Internet of Things operation and maintenance service provider uses a dynamic traffic configuration mode to replace the traditional fixed traffic package configuration mode, that is, an overall traffic pool is preconfigured, and dynamic traffic configuration is performed based on the overall traffic pool according to the individual characteristics and historical traffic usage of each Internet of Things device. However, whether this dynamic traffic configuration mode can achieve good traffic regulation effect needs to solve a key technical problem, that is, how to predict the traffic of each Internet of Things device in the next time period based on the individual characteristics and historical traffic usage of the device. SUMMARY

[0006] The present application aims at the defects of the prior art, and provides a traffic prediction method for Internet of Things devices, an electronic device, and a computer readable storage medium. The present application presets three time step parameters (first, second, and third specified time lengths), periodically profiles the individualized features of each Internet of Things device based on the first specified time length, periodically collects the phased traffic of each Internet of Things device based on the second specified time length, and periodically updates the device collection data sequence of each Internet of Things device based on the third specified time length according to one profile data and one or more phased traffic information corresponding to each Internet of Things device. The sliding sampling method is used to slide sample the target sequence-label data pairs of each device collection data sequence, and a group of target sequence-label data pairs obtained by each step of sampling constitutes a corresponding data record, and all the obtained data records constitute a model data set. The traffic prediction model is composed of multiple LSTM networks and fully connected neural networks. The traffic prediction model is trained based on the model data set. After the training is completed, the traffic prediction model is used to predict the traffic of any Internet of Things device within the future third specified time length. According to the present application, the traffic of the device within the future specified prediction time length (the third specified time length) can be predicted based on the individualized features and historical traffic usage of each Internet of Things device. In addition, the model data set suitable for different prediction time lengths can be set by adjusting the time step parameters based on the present application scheme, the traffic prediction model can be trained separately through the model data set suitable for different prediction time lengths, and the traffic of the device within different prediction time lengths in the future can be predicted based on different model training results.

[0007] To achieve the above object, a first aspect of an embodiment of the present application provides a traffic prediction method for Internet of Things devices, which comprises:

[0008] The device image information of each first IoT device within a latest first specified time length is updated every other first specified time length, and the latest first device image data is obtained and saved; and the device traffic of each first IoT device within a latest second specified time length is counted every other second specified time length, and the latest first device traffic data is obtained and saved; and the latest first device collection data is obtained by performing device data collection processing on the corresponding first device image data and one or more first device traffic data of each first IoT device every other third specified time length, and is stored in a preset first device collection data sequence; the first specified time length is greater than the third specified time length, the third specified time length is greater than the second specified time length, and the first specified time length is a multiple of the second and third specified time lengths, and the third specified time length is a multiple of the second specified time length; the first device collection data sequence is composed of a plurality of first device collection data sorted in chronological order;

[0009] A prediction model for predicting IoT device traffic is constructed based on an LSTM network and a fully connected neural network, denoted as a corresponding traffic prediction model;

[0010] A first model data set is constructed based on a preset target sequence sliding step, a target sequence length, and all first device collection data sequences, and the traffic prediction model is trained based on the first model data set; the target sequence sliding step is an integer greater than or equal to 1; the target sequence length is an integer greater than 1;

[0011] After the model training is completed, a first historical data sequence corresponding to any first IoT device is extracted from the first device collection data sequence corresponding to the first IoT device based on the target sequence length at any time, and the first historical data sequence is input into the traffic prediction model to obtain corresponding traffic prediction data; the traffic prediction data is the predicted traffic of the first IoT device within the third specified time length in the future.

[0012] Preferably, the first device image data includes a first device identifier, a first image time period, a first communication mode, a first behavior habit, a first priority, a first device type, and a first customer identifier; the first image time period includes a first start time and a first end time, and the time difference between the first start time and the first end time is consistent with the first specified time length;

[0013] The first device flow data includes a second device identifier, a first flow period, and a first device flow; the first flow period includes a second start time and a second end time, and the time difference between the second end time and the second start time is consistent with the second specified duration;

[0014] The first device acquisition data includes a third device identifier, a first acquisition period, a first communication mode code, a first behavior habit code, a first priority code, a first device type code, a first customer identifier code, and a first device flow code; the first acquisition period includes a third start time and a third end time, and the time difference between the third end time and the third start time is consistent with the third specified duration;

[0015] The first model data set includes a plurality of first data records; the first data record includes first target data sequence and first label data; the first target data sequence is composed of a plurality of first target data sorted in chronological order, and the number of first target data of the first target data sequence is consistent with the target sequence length; the first target data includes a second communication mode code, a second behavior habit code, a second priority code, a second device type code, a second customer identifier code, and a second device flow code; the first label data includes first label flow.

[0016] Preferably, the device portrait information of each first Internet of Things device within the latest first specified duration is updated every other preset first specified duration to obtain the latest first device portrait data and save, specifically including:

[0017] From the device start working time of each first Internet of Things device, every other preset first specified duration, the current time is taken as the corresponding first end time; and the time obtained by subtracting the first specified duration from the first end time is taken as the corresponding first start time; and the first start time and the first end time obtained this time are used to form a corresponding first portrait period;

[0018] And the device identifier information, device communication mode information, device behavior habit information, device priority information, device type information, and device customer identifier information of each first Internet of Things device in the first portrait period set by the management user of the current application scenario to which it belongs are extracted as the corresponding first device identifier, first communication mode, first behavior habit, first priority, first device type, and first customer identifier;

[0019] and the first customer identifier of each of the first Internet of Things devices, the first image period, the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identifier to form a latest first device image data and save.

[0020] Preferably, the device flow of each of the first Internet of Things devices in the latest second specified time period is counted every second specified time period to obtain the latest first device flow data and save, specifically including:

[0021] From the device start working time of each of the first Internet of Things devices, the current time is taken as the corresponding second end time every second specified time period, the time obtained by subtracting the second specified time from the second end time is taken as the corresponding second start time, and the second start time and the second end time obtained this time are taken to form a corresponding first flow period;

[0022] The device identifier information of each of the first Internet of Things devices in the first flow period set by the management user of the current application scene to which the device belongs is taken as the corresponding second device identifier;

[0023] The total amount of data flow used by each of the first Internet of Things devices in the first flow period is queried through a preset device flow query interface, and the query result is taken as the corresponding first device flow;

[0024] The second device identifier, the first flow period and the first device flow of each of the first Internet of Things devices are taken to form a latest first device flow data and save.

[0025] Preferably, the device data of each of the first Internet of Things devices is collected every third specified time period to obtain the latest first device collection data and store in a preset first device collection data sequence, specifically including:

[0026] From the device start working time of each of the first Internet of Things devices, the current time is taken as the corresponding third end time every second specified time period, the time obtained by subtracting the third specified time from the third end time is taken as the corresponding third start time, and the third start time and the third end time obtained this time are taken to form a corresponding first collection period;

[0027] and from the plurality of first device image data of each of the first Internet of Things devices, select the first device image data corresponding to the first image time period with the largest time period intersection with the first collection time period as corresponding current device image data; and take the first device identifier of the current device image data as corresponding third device identifier; and perform one-hot encoding processing on the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identifier of the current device image data based on a preset image data one-hot encoding rule to obtain corresponding first communication mode encoding, first behavior habit encoding, first priority encoding, first device type encoding and first customer identifier encoding;

[0028] and from the plurality of first device traffic data of each of the first Internet of Things devices, select one or more first device traffic data corresponding to one or more first traffic time periods within the first collection time period to form a corresponding first device traffic data sequence; and perform summation calculation on the first device traffic of all the first device traffic data of the first device traffic data sequence to obtain a corresponding first traffic sum; and take the first traffic sum as corresponding first device traffic encoding;

[0029] and by the third device identifier, the first collection time period, the first communication mode encoding, the first behavior habit encoding, the first priority encoding, the first device type encoding, the first customer identifier encoding and the first device traffic encoding corresponding to each of the first Internet of Things devices, a latest first device collection data is added to the tail of the corresponding first device collection data sequence.

[0030] Preferably, the traffic prediction model is composed of a specified number M of first LSTM networks and a first fully connected neural network; the input end of the first first LSTM network is the model input end, the output end of the previous first LSTM network is connected with the input end of the next first LSTM network, the output end of the last first LSTM network is connected with the input end of the first fully connected neural network, and the output end of the first fully connected neural network is the model output end; M≥1;

[0031] When the specified number M is 1, the traffic prediction model inputs the first input tensor X of this time into the only first LSTM network for time series feature prediction and outputs the corresponding first time series feature tensor H; then inputs the first time series feature tensor H into the first fully connected neural network for traffic regression calculation and outputs the corresponding first predicted traffic;

[0032] The flow prediction model inputs the first input tensor X of the model input of the time into the first first LSTM network to perform time sequence feature prediction and outputs the corresponding first time sequence feature tensor H i The flow prediction model inputs the first input tensor X of the model input of the time into the first first LSTM network to perform time sequence feature prediction and outputs the corresponding first time sequence feature tensor H i+1 , 1≤i≤M-1; and the first time sequence feature tensor H M is input into the first full connection neural network to perform flow regression calculation and output the corresponding first predicted flow.

[0033] Preferably, the first model data set is constructed based on the preset target sequence sliding step, target sequence length and all the first device collected data sequences, and specifically includes:

[0034] Step 71, all the first device collected data sequences form a corresponding first sequence set; and the first first device collected data sequence of the first sequence set is taken as a corresponding current device collected data sequence;

[0035] Step 72, the data index of the first first device collected data in the current device collected data sequence is set to 1, the data index of the second first device collected data is set to 2, and the data indexes of the subsequent first device collected data in the sequence are set one by one; and the first sliding number is set to 1;

[0036] Step 73, the current starting data index is set to (first sliding number-1)*target sequence sliding step+1; the current ending data index is set to current starting data index+target sequence length-1; and the current label data index is set to current ending data index+1;

[0037] Step 74, whether the maximum data index in the current device collected data sequence is greater than or equal to the current label data index is identified; if yes, go to step 75; if no, go to step 78;

[0038] Step 75, all the first device collected data from the current starting data index to the current ending data index in the current device collected data sequence are extracted and sorted in chronological order to form a corresponding first data sequence; the number of the first device collected data of the first data sequence is consistent with the target sequence length;

[0039] Step 76, all the first communication mode encodings in the first data sequence, all the first communication mode encodings, all the first behavior habit encodings, all the first priority encodings, all the first device type encodings, all the first customer identification encodings and all the first device traffic encodings are extracted to form corresponding first communication mode encoding sequences, first behavior habit encoding sequences, first priority encoding sequences, first device type encoding sequences, first customer identification encoding sequences and first device traffic encoding sequences respectively; and based on the preset normalization rule, the first communication mode encoding sequences, the first behavior habit encoding sequences, the first priority encoding sequences, the first device type encoding sequences, the first customer identification encoding sequences and the first device traffic encoding sequences are respectively calculated to obtain corresponding second communication mode encoding sequences, second behavior habit encoding sequences, second priority encoding sequences, second device type encoding sequences, second customer identification encoding sequences and second device traffic encoding sequences.

[0040] Among them, the second communication mode encoding sequence is composed of a plurality of second communication mode encodings sorted in chronological order, and the first and second communication mode encodings correspond one by one; the second behavior habit encoding sequence is composed of a plurality of second behavior habit encodings sorted in chronological order, and the first and second behavior habit encodings correspond one by one; the second priority encoding sequence is composed of a plurality of second priority encodings sorted in chronological order, and the first and second priority encodings correspond one by one; the second device type encoding sequence is composed of a plurality of second device type encodings sorted in chronological order, and the first and second device type encodings correspond one by one; the second customer identification encoding sequence is composed of a plurality of second customer identification encodings sorted in chronological order, and the first and second customer identification encodings correspond one by one; the second device traffic encoding sequence is composed of a plurality of second device traffic encodings sorted in chronological order, and the first and second device traffic encodings correspond one by one;

[0041] Step 77, encode a group of the second communication mode corresponding to each of the first device collection data in the first data sequence, the second behavior habit code, the second priority code, the second device type code, the second customer identification code and the second device traffic code into a corresponding first target data; and sort all the first target data obtained in chronological order to form a corresponding first target data sequence; and extract the first device traffic code of the first device collection data corresponding to the current tag data index in the current device collection data sequence as the corresponding first tag traffic; and form a corresponding first data record from the first target data sequence and the first tag data obtained; and add 1 to the first sliding number and return to step 73;

[0042] Step 78, identify whether the current device collection data sequence is the last first device collection data sequence in the first sequence set; if yes, go to step 79; if no, take the next first device collection data sequence in the first sequence set as the new current device collection data sequence and return to step 72;

[0043] Step 79, form a corresponding first model data set from all the first data records obtained.

[0044] Preferably, the model training of the traffic prediction model based on the first model data set specifically includes:

[0045] Step 81, randomly divide the first model data set into three sub-data sets in a preset ratio, denoted as a corresponding first training data set, a first validation data set and a first test data set; the data record ratio of the first training data set, the first validation data set and the first test data set is consistent with the preset ratio; the default preset ratio is 70:15:15;

[0046] Step 82, set a first loss function and a first evaluation function based on a mean square error function; and select any one of a plurality of preset model parameter optimization algorithms as a corresponding first optimization algorithm; and specify a mean square error threshold as a corresponding first evaluation threshold; and initialize the model parameters of the traffic prediction model;

[0047] Wherein,

[0048] First loss function = (Y * -Y) 2 , Y * is the tag traffic, Y is the predicted traffic;

[0049] Y for label traffic i N for prediction traffic, N for sample number, 1≤i≤N;

[0050] The plurality of model parameter optimization algorithms include an SGD algorithm and an Adam algorithm; the model parameters include a weight / deflection parameter set and a hyperparameter set;

[0051] Step 83, based on the first training data set, the first loss function and the first optimization algorithm, a round of training is performed on the traffic prediction model; and at the end of the current round of training, based on the first verification data set, the first evaluation function and the first evaluation threshold, the training of the traffic prediction model is evaluated once to obtain a corresponding first evaluation result; the first evaluation result includes training up to standard and training not up to standard;

[0052] Step 84, the first evaluation result is identified; if the first evaluation result is training up to standard, go to step 85; if the first evaluation result is training not up to standard, the hyperparameter set of the traffic prediction model is adjusted once, and at the end of the adjustment, return to step 83 for a new round of training and evaluation;

[0053] Step 85, based on the first test data set, the first evaluation function and the first evaluation threshold, the prediction performance of the traffic prediction model is tested to obtain a corresponding first test result; the first test result includes performance up to standard and performance not up to standard;

[0054] Step 86, the first test result is identified; if the first test result is performance not up to standard, the first model data set is randomly divided into three sub-data sets according to the preset proportion as a new first training data set, a first verification data set and a first test data set, and returns to step 83 for retraining; if the first test result is performance up to standard, the training is ended and the model training of the traffic prediction model is confirmed to be successful.

[0055] The second aspect of the embodiment of the application provides an electronic device, comprising a memory, a processor and a transceiver;

[0056] The processor is used for coupling with the memory, reading and executing instructions in the memory, so as to realize the method in the first aspect;

[0057] The transceiver is coupled with the processor, and the transceiver is controlled by the processor to perform message transceiving.

[0058] The third aspect of the embodiment of the present application provides a computer readable storage medium, which stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method in the first aspect.

[0059] The embodiment of the present application provides a traffic prediction method for Internet of Things devices, an electronic device and a computer readable storage medium; the present application predefines three time step parameters (first, second and third specified time lengths), periodically portraits the individual characteristics of each Internet of Things device based on the first specified time length, periodically collects the phased traffic of each Internet of Things device based on the second specified time length, and periodically updates the corresponding device collection data sequence according to one portrait data and one or more phased traffic information of each Internet of Things device based on the third specified time length; and the sliding sampling method is used to perform sliding sampling of target sequence-label data pairs on each device collection data sequence, and a group of target sequence-label data pairs obtained by each step sampling constitutes a corresponding data record, and all the obtained data records constitute a model data set; a traffic prediction model is composed of multiple LSTM networks and fully connected neural networks; the traffic prediction model is trained based on the model data set; and after the training is completed, the traffic prediction model is used to predict the traffic of any Internet of Things device within the future third specified time length. The technical problem of how to predict the traffic of the device within the future specified prediction time length (third specified time length) based on the individual characteristics and historical traffic usage of each Internet of Things device is solved by the present application; in addition, the model data set suitable for different prediction time lengths can be set by adjusting the time step parameters based on the present application scheme, and the traffic prediction model can be trained separately through these model data sets suitable for different prediction time lengths, and the traffic of the device within different prediction time lengths in the future can be predicted based on different model training results, that is, the present application scheme not only solves the traffic prediction problem of the Internet of Things device, but also provides a dynamic prediction processing mechanism based on adjustable time step parameters. BRIEF DESCRIPTION OF DRAWINGS

[0060] Figure 1 A traffic prediction method for Internet of Things devices provided by the first embodiment of the present application is shown in the figure;

[0061] Figure 2 The structure diagram of the traffic prediction model provided by the first embodiment of the present application is shown in the figure;

[0062] Figure 3 The structure diagram of the electronic device provided by the second embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0063] In order to make the objects, technical solutions and advantages of the present application clearer, the following further describes the present application in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of the present application.

[0064] The embodiment one of the present application provides a traffic prediction method of an Internet of Things device, which comprises the following steps. Figure 1 The traffic prediction method of the Internet of Things device provided by the embodiment one of the present application is shown in a schematic diagram, which mainly comprises the following steps.

[0065] Step 1: every first specified time length, the device portrait information of each first Internet of Things device in the latest first specified time length is updated to obtain the latest first device portrait data and is saved; every second specified time length, the device traffic of each first Internet of Things device in the latest second specified time length is counted to obtain the latest first device traffic data and is saved; and every third specified time length, the first device portrait data and one or more first device traffic data of each first Internet of Things device are collected to obtain the latest first device collection data and are stored in a preset first device collection data sequence.

[0066] Here, the embodiment of the present application sets three time step parameters: the first, second and third specified time lengths. The unit of the time step parameter is not limited and can be set arbitrarily according to the specific application requirement. The first specified time length is greater than the third specified time length, the third specified time length is greater than the second specified time length, and the first specified time length is a multiple of the second and third specified time lengths, and the third specified time length is a multiple of the second specified time length. The multiple time length mentioned here is an integer multiple, and the minimum value of the integer multiple is 2 times. The first device collection data sequence is composed of multiple first device collection data sorted in chronological order.

[0067] Specifically, step 11: every first specified time length, the device portrait information of each first Internet of Things device in the latest first specified time length is updated to obtain the latest first device portrait data and is saved.

[0068] The first device portrait data comprises a first device identifier, a first portrait time period, a first communication mode, a first behavior habit, a first priority, a first device type and a first customer identifier. The first portrait time period comprises a first start time and a first end time, and the time difference between the first end time and the first start time is consistent with the first specified time length.

[0069] Specifically comprising: step 111, taking the current time as a corresponding first end time every first specified time length from the device start working time of each first Internet of Things device; and taking the time obtained by subtracting the first specified time length from the first end time as a corresponding first start time; and taking the first start time and the first end time obtained this time as a corresponding first imaging time period;

[0070] Here, the device start working time of each first Internet of Things device is the first boot time after each device is put into operation by default;

[0071] Step 112, extracting the device identification information, device communication mode information, device behavior habit information, device priority information, device type information and device customer identification information of each first Internet of Things device in the first imaging time period set by the management user of the current application scenario to which the device belongs as the corresponding first device identification, first communication mode, first behavior habit, first priority, first device type and first customer identification;

[0072] Here, each first Internet of Things device of the embodiment of the application belongs to a specified application scenario, i.e., the above-mentioned current application scenario to which the device belongs, and each application scenario of the embodiment of the application should have at least one management user for operation and maintenance, i.e., the above-mentioned management user of the current application scenario to which the device belongs. The management user can be a manual user, or a user management interface, module, device, server or platform realized by software or hardware service; the management user is responsible for regularly setting some individualized characteristic information of each first Internet of Things device, such as device identification information, device communication mode information, device behavior habit information, device priority information, device type information and device customer identification information; wherein the device identification information is the unique device identification information set by the management user for the current first Internet of Things device; the device communication mode information is the communication mode information set by the management user for the current first Internet of Things device, including wireless GPRS communication mode, wireless data short message communication mode, wired USB communication mode, wired serial port communication mode and wired RJ45 communication mode; the device behavior habit information is the first device activity sequence set by the management user for the current first Internet of Things device; the first device activity sequence is composed of a plurality of first time period average activity degrees, and each first time period average activity degree corresponds to a pre-set first single day time period; the device priority information is the device importance level information set by the management user for the current first Internet of Things device, including a plurality of device levels; the device type information is the type information set by the management user for the current first Internet of Things device, including sensor type, household device type and industrial device type; and the device customer identification information is the device user identity information set by the management user for the current first Internet of Things device;

[0073] It should be noted that when the management user sets the first device activity sequence, the activity of the current first Internet of Things device in each first single-day period of each day in the recent specified working period is first counted to obtain the corresponding first period activity, then the average of all first period activities corresponding to each first single-day period in the recent specified working period is obtained to obtain the corresponding first period average activity, and then all the first period average activities obtained are used to form the corresponding first device activity sequence;

[0074] Step 113, and each first Internet of Things device is composed of a latest first device portrait data and saved, which is composed of the first device identifier, the first portrait period, the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identifier corresponding to each first Internet of Things device;

[0075] Step 12, and the device traffic of each first Internet of Things device in the recent second specified time length is processed to obtain the latest first device traffic data and saved every second specified time length;

[0076] Among them, the first device traffic data includes the second device identifier, the first traffic period and the first device traffic; the first traffic period includes the second start time and the second end time, and the time difference between the second end time and the second start time is consistent with the second specified time length;

[0077] Specifically, it includes: step 121, from the device start working time of each first Internet of Things device, the current time is taken as the corresponding second end time every second specified time length; and the time obtained by subtracting the second specified time length from the second end time is taken as the corresponding second start time; and the second start time and the second end time obtained this time are used to form a corresponding first traffic period;

[0078] Here, the device start working time of each first Internet of Things device is the first boot time after each device is put into operation by default;

[0079] Step 122, and the device identifier information of each first Internet of Things device in the first traffic period set by the management user of the current application scene to which the device belongs is taken as the corresponding second device identifier;

[0080] Step 123, and the total amount of data traffic used by each first Internet of Things device in the first traffic period is queried through a preset device traffic query interface, and the query result is taken as the corresponding first device traffic;

[0081] Here, the device traffic query interface of the embodiment of the application is a query service interface set in advance, through which the total amount of data traffic of any first Internet of Things device in any period can be queried;

[0082] Step 124, and each first Internet of Things device corresponding to the second device identification, the first traffic period and the first device traffic into a latest first device traffic data and save;

[0083] Step 13, and every other preset third specified time length according to each first Internet of Things device corresponding to a first device portrait data and one or more first device traffic data device data acquisition processing to get the latest first device acquisition data into the preset first device acquisition data sequence;

[0084] Wherein, the first device acquisition data sequence includes a plurality of first device acquisition data; the first device acquisition data includes a third device identification, a first acquisition period, a first communication mode code, a first behavior habit code, a first priority code, a first device type code, a first customer identification code and a first device traffic code; the first acquisition period includes a third start time and a third end time, and the time difference between the third end time and the third start time is consistent with the third specified time length;

[0085] Specifically includes: step 131, from the device start working time of each first Internet of Things device, every other preset third specified time length, the current time as the corresponding third end time; and the third end time minus the third specified time length to get the time as the corresponding third start time, and by the third start time and the third end time obtained this time, a corresponding first acquisition period is formed;

[0086] Here, consistent with the foregoing, the device start working time of each first Internet of Things device is the first time of starting up after each device is put into operation;

[0087] Step 132, and from the plurality of first device portrait data of each first Internet of Things device, select the first device portrait data corresponding to the first portrait period with the largest intersection of the first acquisition period as the corresponding current device portrait data; and the first device identification of the current device portrait data is used as the corresponding third device identification; and the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identification of the current device portrait data are processed by the preset portrait data one-hot encoding rule to obtain the corresponding first communication mode code, the first behavior habit code, the first priority code, the first device type code and the first customer identification code;

[0088] Here, the portrait data one-hot encoding rule of the embodiment of the application is actually a data processing rule for converting the encoding values of various data, and the specific conversion rule for various data (first communication mode, first behavior habit, first priority, first device type and first customer identification) is not limited by the embodiment of the application, which can be configured based on the actual application scenario;

[0089] Step 134: Select one or more first device traffic data corresponding to one or more first traffic periods within the first collection period from multiple first device traffic data of each first IoT device to form a corresponding first device traffic data sequence; calculate the sum of the first device traffic of all first device traffic data in the first device traffic data sequence to obtain the corresponding first traffic sum; and use the first traffic sum as the corresponding first device traffic code.

[0090] Step 135: A new first device collection data is added to the end of the corresponding first device collection data sequence, consisting of the third device identifier, first collection period, first communication mode code, first behavior habit code, first priority code, first device type code, first customer identifier code, and first device traffic code corresponding to each first IoT device.

[0091] Step 2: Construct a prediction model for predicting IoT device traffic based on LSTM network and fully connected neural network, denoted as the corresponding traffic prediction model;

[0092] Here, LSTM network and fully connected neural network are two well-known neural network structures. For detailed network calculation methods, please refer to the publicly available technical documents. They will not be elaborated further here. The following only describes the structure and function of the traffic prediction model built on LSTM network and fully connected neural network in the embodiments of the present invention.

[0093] like Figure 2 As shown in the structural diagram of the traffic prediction model provided in Embodiment 1 of the present invention, the traffic prediction model of the present invention consists of a specified number M first LSTM networks and a first fully connected neural network, where M≥1; the internal connection relationship of the traffic prediction model is as follows: the input end of the first first LSTM network is the model input end, the output end of the previous first LSTM network is connected to the input end of the next first LSTM network, the output end of the last first LSTM network is connected to the input end of the first fully connected neural network, and the output end of the first fully connected neural network is the model output end;

[0094] When the specified number M is 1, the traffic prediction model inputs the first input tensor X into a unique first LSTM network to predict the temporal features and outputs the corresponding first temporal feature tensor H; then, the first temporal feature tensor H is input into a first fully connected neural network to perform traffic regression calculation and output the corresponding first predicted traffic.

[0095] The flow prediction model inputs the first input tensor X input by the current model into the first first LSTM network to perform time sequence feature prediction and outputs the corresponding first time sequence feature tensor H i The next first LSTM network is input as an input tensor to perform time sequence feature prediction and output the corresponding first time sequence feature tensor H i+1 1≤i≤M-1; and the first time sequence feature tensor H M is output by the last first LSTM network, and the first full connection neural network is input to perform flow regression calculation and output the corresponding first predicted flow.

[0096] Step 3, based on the preset target sequence sliding step, target sequence length and all first device collected data sequences, a first model data set is constructed to obtain a corresponding first model data set; and based on the first model data set, the flow prediction model is trained;

[0097] The target sequence sliding step is an integer greater than or equal to 1; the target sequence length is an integer greater than 1; the first model data set includes a plurality of first data records; the first data record includes a first target data sequence and a first label data; the first target data sequence is composed of a plurality of first target data sorted in chronological order, and the number of first target data of the first target data sequence is consistent with the target sequence length; the first target data includes a second communication mode code, a second behavior habit code, a second priority code, a second device type code, a second customer identifier code and a second device flow code; the first label data includes a first label flow;

[0098] Specifically, step 31, based on the preset target sequence sliding step, target sequence length and all first device collected data sequences, a first model data set is constructed to obtain a corresponding first model data set;

[0099] Specifically, step 311, a first sequence set is composed of all first device collected data sequences; and the first device collected data sequence of the first sequence set is taken as a corresponding current device collected data sequence;

[0100] Step 312, the data index of the first device collected data in the current device collected data sequence is set to 1, the data index of the second device collected data is set to 2, and the data index of each subsequent first device collected data is set in turn; and the first sliding number is set to 1;

[0101] Step 313, set the current starting data index = (the first sliding number - 1) * the target sequence sliding step size + 1; set the current ending data index = the current starting data index + the target sequence length - 1; and set the current label data index = the current ending data index + 1;

[0102] Step 314, identify whether the maximum data index in the current device acquisition data sequence is greater than or equal to the current label data index; if yes, go to step 315; if no, go to step 318;

[0103] Step 315, extract all the first device acquisition data in the current device acquisition data sequence from the current starting data index to the current ending data index, sort them in chronological order to form a corresponding first data sequence; the number of first device acquisition data in the first data sequence is consistent with the target sequence length;

[0104] Step 316, extract all the first communication mode codes, all the first communication mode codes, all the first behavior habit codes, all the first priority codes, all the first device type codes, all the first customer identification codes and all the first device traffic codes in the first data sequence to form corresponding first communication mode code sequences, first behavior habit code sequences, first priority code sequences, first device type code sequences, first customer identification code sequences and first device traffic code sequences; and based on the preset normalization rules, perform sequence code normalization calculation on the first communication mode code sequences, the first behavior habit code sequences, the first priority code sequences, the first device type code sequences, the first customer identification code sequences and the first device traffic code sequences to obtain corresponding second communication mode code sequences, second behavior habit code sequences, second priority code sequences, second device type code sequences, second customer identification code sequences and second device traffic code sequences;

[0105] Among them, the second communication mode code sequence is composed of multiple second communication mode codes sorted in chronological order, and the first and second communication mode codes correspond one by one; the second behavior habit code sequence is composed of multiple second behavior habit codes sorted in chronological order, and the first and second behavior habit codes correspond one by one; the second priority code sequence is composed of multiple second priority codes sorted in chronological order, and the first and second priority codes correspond one by one; the second device type code sequence is composed of multiple second device type codes sorted in chronological order, and the first and second device type codes correspond one by one; the second customer identification code sequence is composed of multiple second customer identification codes sorted in chronological order, and the first and second customer identification codes correspond one by one; and the second device traffic code sequence is composed of multiple second device traffic codes sorted in chronological order, and the first and second device traffic codes correspond one by one;

[0106] Here, the normalization rule preset in the embodiments of the present invention is a commonly used mean normalization method or standardization method;

[0107] For example, it is known that the first communication mode encoding sequence is composed of K first communication mode codes D1 of the target sequence length. j Composition, where K is an integer greater than 1, 1≤j≤K;

[0108] If the normalization rule is mean normalization, then it is encoded with each of the first communication mode codes D1. j The corresponding second communication mode code D2 j for:

[0109]

[0110] in, Encode D1 for all first communication modes j The mean, D1 max D1 min Encode D1 for all first communication modes j The maximum and minimum values ​​in;

[0111] If the normalization rule is a standardization method, then it is encoded with each of the first communication modes, D1. j The corresponding second communication mode code D2 j for:

[0112]

[0113] Where μ is the encoding of all first communication modes D1 j The mean of σ is the encoding of all first communication modes D1. j Standard deviation;

[0114] Step 317: Combine a set of second communication mode codes, second behavior habit codes, second priority codes, second device type codes, second customer identifier codes, and second device traffic codes corresponding to the data collected by each first device in the first data sequence to form a corresponding first target data; and sort all the obtained first target data in chronological order to form a corresponding first target data sequence; extract the first device traffic code of the first device data collected by the current tag data index in the current device data sequence as the corresponding first tag traffic; and combine the obtained first target data sequence and the first tag data to form a corresponding first data record; and increment the first sliding count by 1 and return to step 313;

[0115] Step 318, identify whether the current device collection data sequence is the last first device collection data sequence of the first sequence set; if yes, go to step 319; if no, take the next first device collection data sequence in the first sequence set as the new current device collection data sequence, and return to step 312;

[0116] Step 319, form the corresponding first model data set by all the first data records obtained;

[0117] Step 32, model training of the traffic prediction model based on the first model data set;

[0118] Specifically, it includes: step 321, randomly divide the first model data set into three sub-data sets according to a preset ratio, denoted as the corresponding first training data set, the first validation data set and the first test data set;

[0119] Here, the data record ratio of the first training data set, the first validation data set and the first test data set is consistent with the preset ratio; wherein the preset ratio is 70:15:15 by default;

[0120] Step 322, set the first loss function and the first evaluation function based on the mean square error function; and select one of the preset multiple model parameter optimization algorithms as the corresponding first optimization algorithm; and specify a mean square error threshold as the corresponding first evaluation threshold; and initialize the model parameters of the traffic prediction model;

[0121] Wherein,

[0122] The first loss function = (Y * -Y) 2 , Y * is the label traffic, Y is the predicted traffic;

[0123] is the label traffic, Y i is the predicted traffic, N is the sample number, and 1≤i≤N;

[0124] The multiple model parameter optimization algorithms include the SGD algorithm and the Adam algorithm;

[0125] The model parameters include the weight / deflection parameter set and the hyperparameter set;

[0126] Step 323, one round of training of the traffic prediction model based on the first training data set, the first loss function and the first optimization algorithm; and at the end of this round of training, evaluate the training compliance status of the traffic prediction model based on the first validation data set, the first evaluation function and the first evaluation threshold to obtain the corresponding first evaluation result;

[0127] Specifically comprising: step 3231, based on the first training data set, the first loss function and the first optimization algorithm, the flow prediction model is trained for one round;

[0128] Specifically comprising: step 32311, the first data record of the first training data set is taken as the corresponding current data record; and according to the algorithm principle of the first optimization algorithm, the optimization objective function of the optimization algorithm is constructed as the corresponding first objective function according to the model parameters of the flow prediction model and the first loss function;

[0129] Here, under the premise of optimization algorithm determination, model structure determination, model parameter set determination and loss function determination, the corresponding optimization objective function, i.e. the first objective function, can be obtained based on the algorithm principle and the loss function structure, so it is not further described here; What needs to be explained is that the first loss function used in the embodiment of the application is the mean square error function, and the characteristic of the mean square error function is that the more accurate the prediction is, the smaller the corresponding loss value is, so the embodiment of the application needs to optimize towards the direction of making the first objective function reach the minimum value when optimizing the model parameters based on the first objective function;

[0130] Step 32312, the first target data sequence of the current data record and the first label data are taken as the corresponding current target data sequence and the current label flow; and the current target data sequence is inputted into the input tensor conversion to obtain the corresponding first input tensor X according to the input tensor data format of the flow prediction model;

[0131] Step 32313, the first input tensor X is inputted into the flow prediction model to obtain the corresponding first predicted flow;

[0132] Step 32314, the first predicted flow and the current label flow are inputted into the first loss function to obtain the corresponding first loss value;

[0133] Here, based on the function expression of the first loss function in the foregoing, it can be known that:

[0134] The first loss value=(current label flow-first predicted flow) 2 ;

[0135] Step 32315, whether the first loss value satisfies the preset first loss value range is identified; if the first loss value does not satisfy the first loss value range, the weight / deflection parameter set of the flow prediction model is adjusted once based on the first optimization algorithm towards the direction of making the first objective function reach the minimum value;

[0136] Here, the first loss value range is a pre-set loss value range parameter;

[0137] Step 32316, identify whether the current data record is the last first data record of the first training data set; if not, take the next first data record of the first training data set as the new current data record and return to step 32312 to continue training; if yes, end the current round of training;

[0138] Step 3232, and at the end of the current round of training, evaluate the training compliance status of the flow prediction model based on the first validation data set, the first evaluation function and the first evaluation threshold to obtain the corresponding first evaluation result;

[0139] Wherein, the first evaluation result includes training compliance and training non-compliance;

[0140] Specifically includes: step 32321, take the number of first data records of the first validation data set as the corresponding sample number N; and convert the first target data sequence of each first data record of the first validation data set into a corresponding second input tensor according to the input tensor data format of the flow prediction model; and input each second input tensor into the flow prediction model for flow prediction processing to obtain the corresponding predicted flow Y i ; and take the first label data of each first data record of the first validation data set as the corresponding label flow And each predicted flow Y i and the corresponding label flow Composed of a set of corresponding prediction-label data pairs; and take the obtained sample number N and N prediction-label data pairs into the first evaluation function to obtain the corresponding first evaluation value;

[0141] Here, based on the function expression of the first evaluation function in the foregoing:

[0142]

[0143] Step 32322, and identify whether the first evaluation value exceeds the first evaluation threshold; if not, set the corresponding first evaluation result as training compliance; if yes, set the corresponding first evaluation result as training non-compliance;

[0144] Step 324, identify the first evaluation result; if the first evaluation result is training compliance, go to step 325; if the first evaluation result is training non-compliance, adjust the hyperparameter set of the flow prediction model once, and return to step 323 to perform a new round of training and evaluation when the adjustment is completed;

[0145] The one adjustment of the hyperparameter set of the flow prediction model specifically comprises: constructing an optimization objective function of the optimization algorithm according to the model parameters of the flow prediction model and the first evaluation function as a corresponding second objective function according to the algorithm principle of the first optimization algorithm; and adjusting the hyperparameter set of the flow prediction model once based on the first optimization algorithm towards the direction of making the second objective function reach a minimum value;

[0146] Here, under the premise of optimization algorithm determination, model structure determination, model parameter set determination and loss function determination, the corresponding optimization objective function, that is, the second objective function, can be obtained based on the algorithm principle and the loss function structure, and therefore it will not be further described here; what needs to be explained is that the loss function used by the embodiment of the application is a mean square error function, and the characteristic of the mean square error function is that the more accurate the prediction is, the smaller the corresponding loss value is, so the embodiment of the application needs to optimize towards the direction of making the second objective function reach a minimum value when performing model parameter optimization based on the second objective function;

[0147] Step 325, testing the prediction performance of the flow prediction model based on the first test data set, the first evaluation function and the first evaluation threshold to obtain a corresponding first test result;

[0148] The first test result includes performance meeting the standard and performance not meeting the standard.

[0149] Specifically, it comprises: step 3251, taking the number of first data records of the first test data set as a corresponding sample number N; and performing input tensor conversion on the first target data sequence of each first data record of the first test data set according to the input tensor data format of the flow prediction model to obtain a corresponding third input tensor; and inputting each third input tensor into the flow prediction model to perform flow prediction processing to obtain a corresponding predicted flow Y i ; and taking the first label data of each first data record of the first test data set as a corresponding label flow Each predicted flow Y i and the corresponding label flow comprise a corresponding prediction-label data pair; and taking the obtained sample number N and N prediction-label data pairs into the first evaluation function to obtain a corresponding second evaluation value;

[0150] Here, based on the function expression of the first evaluation function in the foregoing, it can be known that:

[0151]

[0152] Step 3252, and identifying whether the second evaluation value exceeds the first evaluation threshold; if not, setting the corresponding first test result as performance meeting the standard; if so, setting the corresponding first test result as performance not meeting the standard.

[0153] Step 326, the first test result is identified; if the first test result is not up to standard, the first model data set is randomly divided into three sub-data sets as a new first training data set, a first validation data set and a first test data set according to a preset proportion, and step 323 is returned to retrain; if the first test result is up to standard, the training is ended and it is confirmed that the model training of the traffic prediction model is successful this time.

[0154] Step 4, after the model training is ended, the first historical data sequence corresponding to any first Internet of Things device is obtained by performing the nearest historical data sequence extraction processing on the first device collected data sequence corresponding to any first Internet of Things device based on the target sequence length at any time; and the first historical data sequence is input into the traffic prediction model to perform the traffic prediction processing to obtain the corresponding traffic prediction data.

[0155] The traffic prediction data is the predicted traffic of the current first Internet of Things device within a future third specified time length.

[0156] Specifically, step 41, after the model training is ended, the first historical data sequence corresponding to any first Internet of Things device is obtained by performing the nearest historical data sequence extraction processing on the first device collected data sequence corresponding to any first Internet of Things device based on the target sequence length at any time.

[0157] The first historical data sequence is composed of a plurality of first historical data sorted in chronological order, and the number of the first historical data of the first historical data sequence is consistent with the target sequence length; the first historical data includes third communication mode encoding, third behavior habit encoding, third priority encoding, third device type encoding, third customer identifier encoding and third device traffic encoding.

[0158] Specifically, step 411, at any time, the first device collected data sequence corresponding to any first Internet of Things device is taken as the corresponding current device collected data sequence; and the first device collected data of the target sequence length in the current device collected data sequence is extracted and sorted in chronological order to form the corresponding second data sequence.

[0159] Step 412, extract all first communication mode encodings, all first communication mode encodings, all first behavior habit encodings, all first priority encodings, all first device type encodings, all first customer identification encodings and all first device traffic encodings in the second data sequence to form corresponding historical communication mode encoding sequences, historical behavior habit encoding sequences, historical priority encoding sequences, historical device type encoding sequences, historical customer identification encoding sequences and historical device traffic encoding sequences; and based on the preset normalization rule, perform sequence encoding normalization calculation on the historical communication mode encoding sequences, the historical behavior habit encoding sequences, the historical priority encoding sequences, the historical device type encoding sequences, the historical customer identification encoding sequences and the historical device traffic encoding sequences to obtain corresponding third communication mode encoding sequences, third behavior habit encoding sequences, third priority encoding sequences, third device type encoding sequences, third customer identification encoding sequences and third device traffic encoding sequences;

[0160] Among them, the third communication mode encoding sequence is composed of a plurality of third communication mode encodings sorted in chronological order, and the first and third communication mode encodings correspond one by one; the third behavior habit encoding sequence is composed of a plurality of third behavior habit encodings sorted in chronological order, and the first and third behavior habit encodings correspond one by one; the third priority encoding sequence is composed of a plurality of third priority encodings sorted in chronological order, and the first and third priority encodings correspond one by one; the third device type encoding sequence is composed of a plurality of third device type encodings sorted in chronological order, and the first and third device type encodings correspond one by one; the third customer identification encoding sequence is composed of a plurality of third customer identification encodings sorted in chronological order, and the first and third customer identification encodings correspond one by one; the third device traffic encoding sequence is composed of a plurality of third device traffic encodings sorted in chronological order, and the first and third device traffic encodings correspond one by one;

[0161] Here, the processing mode of the current step is consistent with the processing mode of the aforementioned step 316;

[0162] Step 413, form a corresponding first historical data by a group of third communication mode encodings, third behavior habit encodings, third priority encodings, third device type encodings, third customer identification encodings and third device traffic encodings corresponding to each first device collected data in the second data sequence; and sort the obtained all first historical data in chronological order to form a corresponding first historical data sequence;

[0163] Step 42, input the first historical data sequence into the traffic prediction model for traffic prediction processing to obtain corresponding traffic prediction data;

[0164] Specifically, this includes: converting the first historical data sequence into an input tensor according to the input tensor data format of the traffic prediction model to obtain the corresponding fourth input tensor; inputting the fourth input tensor into the traffic prediction model for traffic prediction processing and using the output predicted traffic as the corresponding traffic prediction data; wherein, the traffic prediction data is the predicted traffic of the current first IoT device within a third specified time period in the future.

[0165] Here, based on the temporal relationship between the data sequence corresponding to the model input tensor and the label data during the model training process mentioned above, we can see that the traffic prediction data output by the traffic prediction model is the predicted traffic within the third specified time period in the future.

[0166] Figure 3 This is a schematic diagram of an electronic device provided in Embodiment 2 of the present invention. This electronic device can be the aforementioned terminal device or server, or it can be a terminal device or server connected to the aforementioned terminal device or server that implements the method of the embodiments of the present invention. Figure 3 As shown, the electronic device may include: a processor 301 (e.g., CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transmission and reception operations of the transceiver 303. The memory 302 may store various instructions for performing various processing functions and implementing the processing steps described in the foregoing method embodiments. Preferably, the electronic device involved in the embodiments of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to realize communication connections between components. The communication port 306 is used for communication between the electronic device and other peripherals.

[0167] exist Figure 3 The system bus 305 mentioned can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. The communication interface is used to enable communication between the database access device and other devices (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk drive.

[0168] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0169] It should be noted that the embodiments of the present application also provide a computer readable storage medium, which stores instructions, and when the instructions run on a computer, the computer executes the method provided in the above embodiments.

[0170] The embodiments of the present application also provide a chip for running instructions, which is used to execute the processing steps described in the foregoing method embodiments.

[0171] The embodiment of the present application provides a traffic prediction method of an Internet of Things device, an electronic device and a computer readable storage medium; the present application presets three time step parameters (first, second and third specified time lengths), and periodically portraits the individualized features of each Internet of Things device based on the first specified time length, periodically collects the phased traffic of each Internet of Things device based on the second specified time length, and periodically updates the corresponding device collection data sequence according to one portrait data and one or more phased traffic information of each Internet of Things device based on the third specified time length; and the sliding sampling mode is used to perform sliding sampling of the target sequence-label data pair of each device collection data sequence, and a group of target sequence-label data pairs obtained by each step sampling constitutes a corresponding data record, and all the obtained data records constitute a model data set; and the traffic prediction model is composed of multiple LSTM networks and fully connected neural networks; and the traffic prediction model is trained based on the model data set; and the traffic prediction model is used to perform prediction processing on the traffic of any Internet of Things device within the future third specified time length after the training is completed. The technical problem of how to predict the traffic of the device within the future specified prediction time length (the third specified time length) based on the individualized features and historical traffic usage of each Internet of Things device is solved by the present application; in addition, the model data set suitable for different prediction time lengths can be set by adjusting the time step parameters based on the present application scheme, and the traffic prediction model can be trained individually through the model data set suitable for different prediction time lengths, and the traffic of the device within different prediction time lengths in the future can be predicted based on different model training results, that is, the present application scheme not only solves the traffic prediction problem of the Internet of Things device, but also provides a dynamic prediction processing mechanism based on adjustable time step parameters.

[0172] Those skilled in the art should further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized in electronic hardware, computer software or a combination of both, and in order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0173] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and

[0174] The above detailed description describes the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for traffic prediction of an Internet of Things device, the method comprising: The method comprises: Every other preset first designated time length, the device image information of each first Internet of Things device in the last first designated time length is updated to obtain the latest first device image data and saved; and every other preset second designated time length, the device traffic of each first Internet of Things device in the last second designated time length is statistically processed to obtain the latest first device traffic data and saved; and every other preset third designated time length, according to one first device image data and one or more first device traffic data corresponding to each first Internet of Things device, a device data acquisition processing is performed to obtain the latest first device acquisition data and store it in a preset first device acquisition data sequence; the first designated time length is greater than the third designated time length, the third designated time length is greater than the second designated time length, and the first designated time length is a multiple of the second and third designated time lengths, respectively, and the third designated time length is a multiple of the second designated time length; the first device acquisition data sequence is composed of a plurality of first device acquisition data sorted in chronological order; the first device image data includes first device identification, first image period, first communication mode, first behavior habit, first priority, first device type and first customer identification; the first device traffic data includes second device identification, first traffic period and first device traffic; the second device identification is the device identification information of the first Internet of Things device in the first traffic period set by the management user of the current application scene to which it belongs; An LSTM network and a fully connected neural network are used to construct a prediction model for predicting the traffic of Internet of Things devices, denoted as a corresponding traffic prediction model; Based on a preset target sequence sliding step, a target sequence length and all first device acquisition data sequences, a first model data set is constructed, and the traffic prediction model is trained based on the first model data set; the target sequence sliding step is an integer greater than or equal to 1; the target sequence length is an integer greater than 1; After the model training is completed, at any time, based on the target sequence length, the first historical data sequence corresponding to any first Internet of Things device is extracted from the first device acquisition data sequence corresponding to the first Internet of Things device, and the first historical data sequence is input into the traffic prediction model to obtain the corresponding traffic prediction data; the traffic prediction data is the predicted traffic of the first Internet of Things device in the future third designated time length; The method comprises: From the device starting moment of each of the first Internet of Things devices, every other preset third specified time length is taken as the corresponding third end time; and the time obtained by subtracting the third specified time length from the third end time is taken as the corresponding third starting time, and the third starting time and the third end time obtained this time form a corresponding first collection period; And from the first device image data of each of the first Internet of Things devices, the first device image data corresponding to the first image period with the largest period intersection with the first collection period is selected as the corresponding current device image data; and the first device identifier of the current device image data is taken as the corresponding third device identifier; and the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identifier of the current device image data are processed by one-hot encoding according to the preset image data one-hot encoding rule to obtain the corresponding first communication mode code, first behavior habit code, first priority code, first device type code and first customer identifier code; And from the first device traffic data of each of the first Internet of Things devices, one or more first device traffic data corresponding to one or more first traffic periods within the first collection period are selected to form a corresponding first device traffic data sequence; and the first device traffic of all the first device traffic data of the first device traffic data sequence is summed to obtain a corresponding first traffic sum; and the first traffic sum is taken as the corresponding first device traffic code; And the third device identifier, the first collection period, the first communication mode code, the first behavior habit code, the first priority code, the first device type code, the first customer identifier code and the first device traffic code corresponding to each of the first Internet of Things devices form a latest first device collection data added to the sequence tail of the corresponding first device collection data sequence.

2. The traffic prediction method of the Internet of Things device according to claim 1, characterized in that: The first image period includes a first starting time and a first end time, and the time difference between the first end time and the first starting time is consistent with the first specified time length; The first traffic period includes a second starting time and a second end time, and the time difference between the second end time and the second starting time is consistent with the second specified time length; The first device collection data includes a third device identifier, a first collection period, a first communication mode code, a first behavior habit code, a first priority code, a first device type code, a first customer identifier code and a first device traffic code; the first collection period includes a third starting time and a third end time, and the time difference between the third end time and the third starting time is consistent with the third specified time length; The first model data set includes a plurality of first data records; the first data record includes first target data sequence and first label data; the first target data sequence is composed of a plurality of first target data in chronological order, and the number of the first target data of the first target data sequence is consistent with the target sequence length; the first target data includes second communication mode code, second behavior habit code, second priority code, second device type code, second customer identification code and second device flow code; the first label data includes first label flow. 3.The traffic prediction method of the IoT device of claim 2, wherein, The first device image data is obtained by performing data update processing on the device image information of each first Internet of Things device within the latest first specified time interval every first specified time interval, and is saved, specifically including: From the device starting working time of each first Internet of Things device, every first specified time interval, the current time is taken as the corresponding first end time; and the time obtained by subtracting the first specified time interval from the first end time is taken as the corresponding first start time; and the first start time and the first end time obtained this time are taken to form a corresponding first image time period; And the device identification information, device communication mode information, device behavior habit information, device priority information, device type information and device customer identification information of each first Internet of Things device in the first image time period set by the management user of the current application scene to which it belongs are extracted as the corresponding first device identification, first communication mode, first behavior habit, first priority, first device type and first customer identification; And the first device identification, the first image time period, the first communication mode, the first behavior habit, the first priority, the first device type and the first customer identification of each first Internet of Things device are taken to form a latest first device image data and save. 4.The traffic prediction method of the IoT device of claim 2, wherein, The first device flow data is obtained by performing flow statistics processing on the device flow of each first Internet of Things device within the latest second specified time interval every second specified time interval, and is saved, specifically including: From the device starting working time of each first Internet of Things device, every second specified time interval, the current time is taken as the corresponding second end time; and the time obtained by subtracting the second specified time interval from the second end time is taken as the corresponding second start time; and the second start time and the second end time obtained this time are taken to form a corresponding first flow time period; And the device identification information of each first Internet of Things device in the first flow time period set by the management user of the current application scene to which it belongs is taken as the corresponding second device identification; And the total amount of data flow used by each first Internet of Things device in the first flow time period is queried through a preset device flow query interface, and the query result is taken as the corresponding first device flow; And the second device identifier corresponding to each of the first Internet of Things device, the first traffic period and the first device traffic form a latest first device traffic data and save.

5. The traffic prediction method of the Internet of Things device according to claim 1, characterized in that, The traffic prediction model is composed of a specified number M of first LSTM networks and a first fully connected neural network; the input end of the first first LSTM network is the model input end, the output end of the previous first LSTM network is connected with the input end of the next first LSTM network, the output end of the last first LSTM network is connected with the input end of the first fully connected neural network, and the output end of the first fully connected neural network is the model output end; M≥1; When the specified number M is 1, the first input tensor X of this time model input is input into the only first LSTM network for time series feature prediction and outputs the corresponding first time series feature tensor H; Then the first time series feature tensor H is input into the first fully connected neural network for traffic regression calculation to output the corresponding first predicted traffic; The traffic prediction model will input the first input tensor X of the model input of this time into the first first LSTM network for time series feature prediction and output the corresponding first time series feature tensor H1 when the specified number M is greater than 1; then the first time series feature tensor H i is input into the next first LSTM network as an input tensor for time series feature prediction and the corresponding first time series feature tensor H i+1 is output, 1≤i≤M-1; then the first time series feature tensor H M output by the last first LSTM network is input into the first full connection neural network for traffic regression calculation and the corresponding first predicted traffic is output. 6.The traffic prediction method of an IoT device according to claim 2, wherein, The first model data set is obtained by constructing the model training data set based on the preset target sequence sliding step, target sequence length and all first device acquisition data sequences, specifically including: Step 71, all the first device acquisition data sequences form a corresponding first sequence set; and the first first device acquisition data sequence of the first sequence set is taken as a corresponding current device acquisition data sequence; Step 72, the data index of the first first device acquisition data in the current device acquisition data sequence is set to 1, the data index of the second first device acquisition data is set to 2, and the data indexes of the subsequent first device acquisition data in the sequence are set one by one; and the first sliding number is set to 1; Step 73, set current start data index=(first sliding number-1)*target sequence sliding step+1; and set current end data index=current start data index+target sequence length-1; and set current label data index=current end data index+1; Step 74, identify whether the maximum data index in the current device acquisition data sequence is greater than or equal to the current label data index; if yes, go to step 75; if no, go to step 78; Step 75, all the first device acquisition data from the current start data index to the current end data index in the current device acquisition data sequence are extracted and sorted in chronological order to form a corresponding first data sequence; the number of first device acquisition data of the first data sequence is consistent with the target sequence length; Step 76, extract all the first communication mode encodings, all the first communication mode encodings, all the first behavior habit encodings, all the first priority encodings, all the first device type encodings, all the first customer identification encodings and all the first device traffic encodings in the first data sequence respectively to form corresponding first communication mode encoding sequences, first behavior habit encoding sequences, first priority encoding sequences, first device type encoding sequences, first customer identification encoding sequences and first device traffic encoding sequences; and based on the preset normalization rule, the first communication mode encoding sequence, the first behavior habit encoding sequence, the first priority encoding sequence, the first device type encoding sequence, the first customer identification encoding sequence and the first device traffic encoding sequence are respectively calculated to obtain corresponding second communication mode encoding sequence, second behavior habit encoding sequence, second priority encoding sequence, second device type encoding sequence, second customer identification encoding sequence and second device traffic encoding sequence; Wherein, the second communication mode encoding sequence is composed of a plurality of second communication mode encodings sorted in time sequence, the first and second communication mode encodings correspond one by one; the second behavior habit encoding sequence is composed of a plurality of second behavior habit encodings sorted in time sequence, the first and second behavior habit encodings correspond one by one; the second priority encoding sequence is composed of a plurality of second priority encodings sorted in time sequence, the first and second priority encodings correspond one by one; the second device type encoding sequence is composed of a plurality of second device type encodings sorted in time sequence, the first and second device type encodings correspond one by one; the second customer identification encoding sequence is composed of a plurality of second customer identification encodings sorted in time sequence, the first and second customer identification encodings correspond one by one; the second device traffic encoding sequence is composed of a plurality of second device traffic encodings sorted in time sequence, the first and second device traffic encodings correspond one by one; Step 77, a group of second communication mode encodings, second behavior habit encodings, second priority encodings, second device type encodings, second customer identification encodings and second device traffic encodings corresponding to each first device collection data in the first data sequence form a corresponding first target data; and the first target data sequence is sorted in time sequence; and the first device traffic encoding of the first device collection data corresponding to the current label data index in the current device collection data sequence is extracted as the corresponding first label traffic; and the first target data sequence and the first label data form a corresponding first data record; and the first sliding number is increased by 1 and returned to step 73; Step 78, identify whether the current device collection data sequence is the last first device collection data sequence of the first sequence set; if yes, go to step 79; if no, take the next first device collection data sequence in the first sequence set as a new current device collection data sequence, and return to step 72; Step 79, form a corresponding first model data set by all the first data records obtained. 7.The traffic prediction method of an IoT device according to claim 2, wherein, The model training of the traffic prediction model based on the first model data set specifically includes: Step 81, randomly divide the first model data set into three sub data sets according to a preset ratio, denoted as a corresponding first training data set, a first validation data set and a first test data set; the data record ratio of the first training data set, the first validation data set and the first test data set is consistent with the preset ratio; the preset ratio is 70:15:15 by default; Step 82, set a first loss function and a first evaluation function based on a mean square error function; and select any one of a plurality of model parameter optimization algorithms as a corresponding first optimization algorithm; and specify a mean square error threshold as a corresponding first evaluation threshold; and initialize the model parameters of the traffic prediction model; Wherein, First loss function = (Y * - Y) 2 , Y * is the label flow, Y is the predicted flow; Y for label traffic, i N for predicted traffic, N is the number of samples, 1≤i≤N; The plurality of model parameter optimization algorithms include SGD algorithm and Adam algorithm; the model parameters include weight / deflection parameter set and hyperparameter set; Step 83, train the traffic prediction model based on the first training data set, the first loss function and the first optimization algorithm for one round; and at the end of this round of training, evaluate the training completion state of the traffic prediction model based on the first validation data set, the first evaluation function and the first evaluation threshold to obtain a corresponding first evaluation result; the first evaluation result includes training completion and training failure; Step 84, identify the first evaluation result; if the first evaluation result is training completion, go to step 85; if the first evaluation result is training failure, adjust the hyperparameter set of the traffic prediction model once, and return to step 83 for a new round of training and evaluation at the end of the adjustment; Step 85, test the prediction performance of the traffic prediction model based on the first test data set, the first evaluation function and the first evaluation threshold to obtain a corresponding first test result; the first test result includes performance completion and performance failure; Step 86, identify the first test result; if the first test result is performance failure, randomly divide the first model data set into three sub data sets according to the preset ratio as a new first training data set, a first validation data set and a first test data set, and return to step 83 for retraining; if the first test result is performance completion, end the training and confirm that the model training of the traffic prediction model is successful this time.

8. An electronic device, comprising: Including: Memory, processor and transceiver; The processor is coupled with the memory to read and execute instructions in the memory to implement the method of any one of claims 1-7. The transceiver is coupled with the processor to be controlled by the processor to perform message transceiving.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, which, when executed by a computer, cause the computer to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Network traffic prediction method of LSTM model based on attention mechanism

    CN111970163A

  • Internet of Things node flow prediction system and method

    CN112333046A