Disclosure of Invention
The present invention is directed to overcome at least one of the above-mentioned drawbacks (disadvantages) of the prior art, and to provide a network edge machine learning training method, which is used to solve the problems of long network transmission delay, and low data privacy and security of machine learning training data.
The invention adopts the technical scheme that a network edge machine learning training method comprises the following steps:
the method comprises the steps that an edge server receives a machine learning training task and reads task information of the machine learning training task;
the edge server determines a data source set according to the task information, wherein one data source in the data source set corresponds to one Internet of things terminal in an edge network where the edge server is located;
the edge server sends a data acquisition request to the Internet of things terminal corresponding to the determined data source set;
the Internet of things terminal receives the data acquisition request and sends a channel allocation request to a base station of the edge network according to the data acquisition request;
the base station receives the channel allocation request and allocates channels to the Internet of things terminal according to the channel allocation request;
the terminal of the Internet of things sends a local data set to the edge server through the distributed channel;
and the edge server receives the local data set, executes a machine learning training task according to the local data set and returns a training result.
In the invention, an edge server is deployed at the edge of a network, a local data set generated by an Internet of things terminal or other mobile terminals is transmitted to the edge server of the same edge network through wireless channel resources distributed by a base station, and the edge server receives and executes a machine learning training task from a user according to the local data set, so that the machine learning training task sinks from a cloud computing center to the edge of the network, thereby not only reducing network transmission delay and improving the user experience of the Internet of things service, but also ensuring that the data does not leave the edge network area where the data source is located, and greatly improving the privacy and the safety of the data.
Further, the task information comprises a data type required by the task; the edge server determines a data source set according to the task information, and the method comprises the following steps:
the edge server counts all the Internet of things terminals of an edge network where the edge server is located and the data types collected by all the Internet of things terminals;
and the edge server selects the Internet of things terminal with the same collected data type as the data type required by the task, and determines the data source set according to the selected Internet of things terminal.
According to the method for determining the terminal of the Internet of things according to the data type required by the task in the task information, the edge server can be effectively prevented from carrying out communication interaction with the terminal of the Internet of things without corresponding type data, and waste of network bandwidth resources and energy consumption of terminal equipment of the Internet of things is avoided.
Further, the sending, by the edge server, a data acquisition request to the internet of things terminal corresponding to the determined data source set includes:
the edge server generates a machine learning training task identification number according to the received machine learning training task;
the edge server generates a data acquisition request comprising the machine learning training task identification number according to the machine learning training task identification number, and sends the data acquisition request to the Internet of things terminal corresponding to the confirmed data source set;
the internet of things terminal receives the data acquisition request and sends a channel allocation request to a base station of the edge network according to the data acquisition request, and the method comprises the following steps:
the internet of things terminal receives the data acquisition request, generates a channel allocation request comprising the machine learning training task identification number according to the data acquisition request, and sends the channel allocation request to a base station of the edge network;
the base station receives the channel allocation request, allocates channels for the internet of things terminal according to the channel allocation request, and the method comprises the following steps:
the base station receives the channel allocation request, and the terminals of the Internet of things with the same machine learning training task identification number in the received channel allocation request form a terminal set;
the base station selects a corresponding channel set according to the machine learning training task identification number in the channel allocation request, wherein different machine learning training task identification numbers correspond to different channel sets;
and the base station distributes the selected channels in the channel set for each Internet of things terminal in the terminal set.
In the invention, before the base station distributes the channels to the terminals of the Internet of things, the terminals of the Internet of things with the same machine learning training task identification number in the received channel distribution request form a terminal set, and channel resources are distributed to the terminals of the Internet of things with the same machine learning training task identification number.
Further, the allocating, by the base station, the selected channel in the channel set for each internet of things terminal in the terminal set includes:
the base station performs initialization channel allocation on each Internet of things terminal in the terminal set according to the selected channel in the channel set to obtain an initialization channel allocation result;
the base station calculates data uploading delay of each Internet of things terminal in the terminal set on different distribution channels according to the initialized channel distribution result, wherein the data uploading delay of each Internet of things terminal on different distribution channels is the delay of each Internet of things terminal for sending a local data set to the edge server through different distribution channels;
the base station updates the initialized channel allocation result according to the data uploading delay to obtain an updated channel allocation result;
and the base station distributes the selected channels in the channel set for each Internet of things terminal in the terminal set according to the updated channel distribution result.
Further, the base station performs initialization channel allocation on each internet of things terminal in the terminal set according to the selected channel in the channel set to obtain an initialization channel allocation result, including:
the base station calculates channel power gains of different channels corresponding to each Internet of things terminal in the terminal set, wherein the channel power gains corresponding to the different channels are power gains of the Internet of things terminals for sending local data sets to the edge server through the different channels in the channel set;
and the base station allocates the channel corresponding to the maximum power gain of the channel of each Internet of things terminal to the Internet of things terminal to obtain an initialized channel allocation result.
In the invention, through the initial channel allocation of the base station, each Internet of things terminal requesting channel allocation is firstly allocated to a channel with the best channel quality, namely, the channel with the largest channel power gain of the Internet of things terminal.
Further, the base station calculates data upload delay of each internet of things terminal in the terminal set on different allocation channels according to the initialization channel allocation result, and the method includes:
the base station adopts a formula Dm=Lm/Rm,nCalculating data uploading delay of each Internet of things terminal in the terminal set, wherein LmThe size R of a local data set of any one Internet of things terminal m in the channel allocation Internet of things terminal set is representedm,nRepresenting the data uploading rate of the terminal m of the Internet of things in the allocated channel n;
in the above formula, R
m,nCan be represented by formula
Determining that B represents the bandwidth of the allocation channel n, P
m,nRepresenting the transmitting power h of the terminal m of the Internet of things in the channel n
m,nRepresenting the channel power gain of the terminal m of the Internet of things on the channel n, the size Lm of a local data set of the terminal m of the Internet of things and the transmitting power P of the terminal m of the Internet of things on the channel n
m,nMay be included in the channel allocation request;
representing the inter-channel interference of the terminal m of the internet of things on the channel n,
can be represented by formula
Determination of γ
m,nRepresenting the intra-channel interference, gamma, of the terminal m of the Internet of things in the channel n
m,nThen again can pass through the formula
Determination of N
0Representing the Gaussian white noise interference of said channel, wherein N represents the assigned channel set, function
Representing a binary indicator function, when the variable X takes the value true,
if not, then,
collection
Representing the set of terminals of the Internet of things distributed to the channel n ', k representing any one terminal of the Internet of things distributed to the channel n', h
k,n′Representing the channel power gain, P, of the terminal k of the Internet of things in a channel n
k,nRepresenting the transmitting power of the terminal k of the Internet of things in the channel n', and collecting
Representing the set of terminals of the Internet of things distributed to the channel n, j representing any terminal of the Internet of things which is distributed to the channel n and is not equal to the terminal m of the Internet of things, h
j,nRepresenting the channel power gain, P, of the terminal j of the Internet of things in the channel n
j,nAnd representing the transmitting power of the terminal j of the Internet of things in the channel n.
Further, the updating, by the base station, the initialized channel allocation result according to the data upload delay to obtain an updated channel allocation result includes:
the base station selects the Internet of things terminal m' with the largest data uploading delay in the terminal set;
the base station searches a new channel n 'in the selected channel set for the terminal m' of the Internet of things;
the base station judges whether the new channel n' simultaneously satisfies a condition a and a condition b:
condition a: the new channel n ' is a channel with the smallest data uploading delay of the internet of things terminal m ' in the selected channel set except for an initialized distribution channel n ', and the initialized distribution channel n ' is a channel distributed by the internet of things terminal m ' in the initialized channel distribution result;
condition b: the data uploading delay of the internet of things terminal m 'on the new channel n' is lower than that of the internet of things terminal m 'on the initialized distribution channel n';
if so, updating the initialized distribution channel n 'to a new channel n', continuing to calculate the data uploading delay of each Internet of things terminal in the terminal set on different distribution channels, and if not, taking the initialized channel distribution result as the updated channel distribution result.
In the invention, the base station continuously adjusts and optimizes the channel allocation of the Internet of things terminal with the maximum data uploading delay, so that the maximum data uploading delay gradient of the Internet of things terminal is reduced and finally reaches an optimized value, thereby reducing the data acquisition delay of a data set required by machine learning training, enabling a machine learning training task to be started on an edge server quickly and improving the user experience of the Internet of things service corresponding to the machine learning training.
Further, the task information also comprises a task type, a machine learning algorithm adopted by the task and a task precision requirement;
the edge server receives the local data set, executes a machine learning training task according to the local data set, and returns a training result, wherein the training result comprises:
the edge server receiving the local data set;
the edge server converges the local data set;
the edge server takes the converged local data set as a data source and executes machine learning training according to the task type and a machine learning algorithm adopted by the task;
and the edge server judges whether the precision of the machine learning training is not lower than the precision requirement of the task, if so, stores the training result, ends the training, otherwise, continues to execute the step of performing the machine learning training by taking the gathered local data set as a data source according to the type of the task and the machine learning algorithm adopted by the task.
Further, the task information also comprises the maximum delay tolerable by the task;
after the edge server receives the machine learning training task and reads the task information of the machine learning training task, the method further comprises the following steps: the edge server starts a machine learning training task timer according to the maximum delay tolerable by the task, and the machine learning training task timer takes the maximum delay tolerable by the task as a threshold value;
after the edge server uses the aggregated local data set as a data source, and executes machine learning training according to the task type and a machine learning algorithm adopted by the task, and before judging whether the precision of model training is not lower than the precision requirement of the model training, the method further comprises the following steps:
and judging whether the machine learning training task timer is overtime, if so, storing a training result, ending the training, and if not, continuously judging whether the precision of the model training is not lower than the precision requirement of the model training.
Further, after the edge server sends a data acquisition request to the internet of things terminal corresponding to the confirmed data source set, the method further includes: the edge server starts a data acquisition timer, and the threshold value of the data acquisition timer is smaller than that of the machine learning training task timer;
after the edge server receives the local data set and before the edge server aggregates the local data set, the method includes:
the edge server judges whether local data sets of all corresponding Internet of things terminals in a data source set are received or not, if yes, the edge server uses the gathered local data sets as data sources and executes machine learning training according to the task type and a machine learning algorithm adopted by the task, if not, the edge server continuously judges whether the data acquisition timer is overtime or not, if yes, the edge server uses the gathered local data sets as data sources and executes machine learning training according to the task type and the machine learning algorithm adopted by the task, and if not, the edge server continuously executes the edge server to receive the local data sets.
In the invention, the machine learning training task timer and the threshold thereof can effectively control the delay of the whole training task to meet the low-delay requirement of the service of the Internet of things, and the data acquisition timer and the threshold thereof can effectively master the maximum delay of the data acquisition stage and reserve sufficient time for the execution of the subsequent machine learning training task process.
1. According to the invention, the terminal data of the Internet of things is transmitted to the edge server through the channel distributed by the base station, and machine learning training is directly carried out on the edge server, so that a machine learning training task sinks to the edge of the network from the cloud computing center, thus effectively reducing network transmission delay, improving the user experience of the business of the Internet of things, enabling the data not to leave the edge network area where the data source is located, and greatly improving the privacy and the safety of the data;
2. according to the invention, the base station updates and optimizes the channel allocation result of the terminal of the Internet of things through the data uploading delay, so that the data uploading delay and the data acquisition delay are effectively reduced, the machine learning training can be quickly started at the edge server, and the user experience is improved;
3. the invention sets the machine learning training task timer and the data acquisition timer, effectively controls the data acquisition delay and the total delay of the machine learning training task, and can meet the low-delay service requirement of the Internet of things service.
Detailed Description
The drawings are only for purposes of illustration and are not to be construed as limiting the invention. For a better understanding of the following embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The embodiments of the present invention are all applied to a multiple-input multiple-output-non-orthogonal multiple access (MIMO-NOMA) edge network, where the edge network includes a plurality of internet of things terminals, an edge server and a base station, as shown in fig. 6, the internet of things terminals are randomly distributed in the coverage area of the edge network, the edge server is located at the core of the edge network, that is, near the base station, a high-speed communication bandwidth is provided between the edge server and the base station, and the internet of things terminals and the edge server communicate with each other through the base station. The method comprises the following steps that an Internet of things terminal acquires specific data (such as temperature, environmental data, industrial data, automatic driving data and other industry application data) near the position of the Internet of things terminal, and the data is taken as a data source; the edge server has computational processing power and is loaded with a program for machine learning training. In order to sink machine learning training from a cloud computing center to the network edge, reduce network transmission delay and avoid privacy and safety hidden dangers of data transmission in a public network, data collected by an internet of things terminal are gathered to an edge server, and machine learning training is executed on the edge server side.
Example 1
As shown in fig. 1, the present embodiment provides a network edge machine learning training method, including the following steps:
s101: the edge server receives a machine learning training task, reads task information of the machine learning training task, wherein the task information comprises a task type T, a machine learning algorithm (such as a convolutional neural network, a long-short memory neural network and the like) adopted by the task, and a data type required by the task
(for example,
or other sensor data, etc.), task accuracy requirement a, maximum delay D tolerable for the task
MaxThe maximum delay D tolerable by the edge server according to the task
MaxStarting a machine learning training task timer, wherein the machine learning training task timer takes the maximum delay tolerable by the task as a threshold value;
s102: the edge server determines a data source set according to the task information, wherein one data source in the data source set corresponds to one Internet of things terminal in an edge network where the edge server is located;
further, the step S102 includes:
the edge server counts all internet of things terminals of an edge network where the edge server is located
And the type of data collected by each Internet of things terminal
The edge server selects the internet of things terminal with the same collection data type as the data type required by the task, and determines the data source set according to the selected internet of things terminal, namely, for the internet of things terminal
The corresponding terminal m of the Internet of things if the data type of the terminal m meets the requirement
It is put into the data source set
S103: the edge server sends a data acquisition request to the Internet of things terminal corresponding to the determined data source set, the edge server starts a data acquisition timer, and the threshold value of the data acquisition timer is smaller than that of the machine learning training task timer;
s104: the Internet of things terminal receives the data acquisition request and sends a channel allocation request to a base station of the edge network according to the data acquisition request;
s105: the base station receives the channel allocation request, and allocates channels to the terminals of the Internet of things according to the channel allocation request
Wherein the vector
Indicates the channel allocation result, N
1、N
2、...、N
MRepresenting channels allocated to the internet of
things terminals 1, 2,. and M, wherein 1, 2,. and M correspond to the internet of things terminals in the data source set M;
s106: the terminal of the Internet of things sends a local data set to the edge server through the distributed channel;
s107: and the edge server receives the local data set, executes a machine learning training task according to the local data set and returns a training result.
Further, as shown in fig. 2, the step S107 includes:
s171: the edge server receiving the local data set;
s172: the edge server judges whether local data sets of all corresponding internet of things terminals in the data source set are received or not, if yes, step S174 is executed, and if not, step S173 is executed;
s173: judging whether the data acquisition timer is overtime, if so, executing step S174, otherwise, returning to step S171;
s174: the edge server aggregates the local DATA sets, i.e., let DATA ═ { X, Y } represent the DATA fields of the machine learning training, DATA
m={X
m,Y
mRepresents a terminal from the Internet of things
Local DATA set of, DATA
mAfter DATA cleaning and DATA alignment, the DATA is put into a DATA field DATA, so that
S175: the edge server takes the converged local DATA set DATA as a DATA source and executes machine learning training according to the task type T and a machine learning algorithm adopted by the task;
s176: judging whether the machine learning training task timer is overtime, namely, ordering DtotRepresenting a time interval from the receipt of the machine learning training task from the edge server to the current time, and determining Dtot≥DMaxIf yes, go to step S178, otherwise go to step S177;
s177: the edge server judges whether the precision of the machine learning training is not lower than the task precision requirement, if so, the step S178 is executed, and if not, the step S175 is executed;
s178: and storing the training result and finishing the training.
Example 2
In the embodiment, on the basis of embodiment 1, a plurality of sub-steps are further expanded.
Further, the step S103 of sending, by the edge server, the data acquisition request to the internet of things terminal corresponding to the confirmed data source set includes:
the edge server generates a machine learning training task identification number ID according to the received machine learning training taskXX;
The edge server identifies the ID according to the machine learning training taskXXGenerating an ID including the machine learning training task identifierXXAnd sending the data acquisition request to the internet of things terminal corresponding to the confirmed data source set.
Further, the step S104 includes:
the Internet of things terminal receives the data acquisition request and generates the machine learning training task identification number ID according to the data acquisition requestXXSending the channel allocation request to a base station of the edge network;
further, as shown in fig. 3, the step S105 includes:
s201: the base station receives the channel allocation request, and the terminals of the Internet of things with the same machine learning training task identification number in the received channel allocation request form a terminal set;
s202: the base station selects a corresponding channel set according to the machine learning training task identification number in the channel allocation request, wherein different machine learning training task identification numbers correspond to different channel sets;
s203: and the base station distributes the selected channels in the channel set for each Internet of things terminal in the terminal set.
Example 3
In this embodiment, on the basis of embodiments 1 and 2, a plurality of sub-steps are further expanded.
Further, as shown in fig. 4, the step S203 includes:
s301: the base station performs initialization channel allocation on each Internet of things terminal in the terminal set according to the selected channel in the channel set to obtain an initialization channel allocation result;
specifically, the step S301 executes the following process:
the base station calculates channel power gains of different channels corresponding to each Internet of things terminal in the terminal set, wherein the channel power gains corresponding to the different channels are power gains of the Internet of things terminals for sending local data sets to the edge server through the different channels in the channel set;
the base station allocates the channel corresponding to the maximum power gain of the channel of each Internet of things terminal to the Internet of things terminal to obtain an initialized channel allocation result;
s302: the base station calculates data uploading delay of each Internet of things terminal in the terminal set on different distribution channels according to the initialized channel distribution result, wherein the data uploading delay of each Internet of things terminal on different distribution channels is the delay of each Internet of things terminal for sending a local data set to the edge server through different distribution channels;
specifically, the base station adopts a formula Dm=Lm/Rm,nCalculating data uploading delay of each Internet of things terminal in the terminal set, wherein LmThe size R of a local data set of any one Internet of things terminal m in the channel allocation Internet of things terminal set is representedm,nRepresenting the data uploading rate of the terminal m of the Internet of things in the allocated channel n;
in the above formula, R
m,nCan be represented by formula
Determining that B represents the bandwidth of the allocation channel n, P
m,nRepresenting the transmitting power h of the terminal m of the Internet of things in the channel n
m,nRepresenting the channel power gain of the terminal m of the Internet of things in the channel n and the size L of the local data set of the terminal m of the Internet of things
mAnd the transmitting power P of the terminal m of the Internet of things on the channel n
m,nCan be included inThe channel allocation request;
representing the inter-channel interference of the terminal m of the internet of things on the channel n,
can be represented by formula
Determination of γ
m,nRepresenting the intra-channel interference, gamma, of the terminal m of the Internet of things in the channel n
m,nThen again can pass through the formula
Determination of N
0Representing the Gaussian white noise interference of said channel, wherein N represents the assigned channel set, function
Representing a binary indicator function, when the variable X takes the value true,
if not, then,
collection
Representing the set of terminals of the Internet of things distributed to the channel n ', k representing any one terminal of the Internet of things distributed to the channel n', h
k,n′Representing the channel power gain, P, of the terminal k of the Internet of things in a channel n
k,nRepresenting the transmitting power of the terminal k of the Internet of things in the channel n', and collecting
Represents a set of terminals of the internet of things allocated to a channel n, and j represents any terminal m of the internet of things which is not equal to the terminal m of the internet of things and allocated to the channel nA terminal of Internet of things h
j,nRepresenting the channel power gain, P, of the terminal j of the Internet of things in the channel n
j,nRepresenting the transmitting power of the terminal j of the Internet of things in the channel n;
s303: the base station updates the initialized channel allocation result according to the data uploading delay to obtain an updated channel allocation result;
s304: and the base station distributes the selected channels in the channel set for each Internet of things terminal in the terminal set according to the updated channel distribution result.
Example 4
In this embodiment, on the basis of embodiments 1, 2 and 3, the step S303 is further expanded.
Further, as shown in fig. 5, the step S303 includes:
s401: the base station selects the Internet of things terminal m' with the largest data uploading delay in the terminal set;
s402: the base station searches a new channel n 'in the selected channel set for the terminal m' of the Internet of things;
s403: the base station judges whether the new channel n' simultaneously satisfies a condition a and a condition b:
condition a: the new channel n ' is a channel with the smallest data uploading delay of the internet of things terminal m ' in the selected channel set except for an initialized distribution channel n ', and the initialized distribution channel n ' is a channel distributed by the internet of things terminal m ' in the initialized channel distribution result;
condition b: the data uploading delay of the internet of things terminal m 'on the new channel n' is lower than that of the internet of things terminal m 'on the initialized distribution channel n';
if yes, executing step S404, otherwise executing step S405;
s404: updating the initialized distribution channel n 'to a new channel n';
s405: and taking the initialized channel allocation result as an updated channel allocation result.
It should be understood that the above-mentioned embodiments of the present invention are only examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific embodiments of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention claims should be included in the protection scope of the present invention claims.