Agricultural product data interaction method and device based on federal learning and electronic equipment

文档序号:1963940 发布日期:2021-12-14 浏览:16次 中文

阅读说明:本技术 基于联邦学习的农产品数据交互方法、装置及电子设备 (Agricultural product data interaction method and device based on federal learning and electronic equipment ) 是由 韩军 王正平 黄小棠 张恒 张令瑄 吴恒乾 王利利 高岩 于 2021-11-16 设计创作,主要内容包括:本发明涉及人工智能领域,揭露一种基于联邦学习的农产品数据交互方法、装置及电子设备,所述方法包括:获取多个本地客户端的农产品,提取每个农产品的特征数据,得到多个农产品特征数据;将每个农产品特征数据输入至多个本地参数检测模型检测中,以输出每个农产品特征数据的生长参数,其中,每个参数检测模型与每个农产品特征数据为一一对应关系;将每个生长参数进行加密后传输至中心服务器,以通过中心服务器计算多个生长参数的均值参数;根据均值参数,更新每个本地客户端中农产品的生长参数,以实现多个本地客户端的农产品数据交互。本发明可以提高农产品的数据交互效率,同时又可以保障农产品的数据安全性。(The invention relates to the field of artificial intelligence, and discloses an agricultural product data interaction method, an agricultural product data interaction device and electronic equipment based on federal learning, wherein the method comprises the following steps: the method comprises the steps of obtaining agricultural products of a plurality of local clients, and extracting characteristic data of each agricultural product to obtain a plurality of agricultural product characteristic data; inputting each agricultural product characteristic data into a plurality of local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship; encrypting each growth parameter and transmitting the encrypted growth parameter to a central server so as to calculate a mean value parameter of a plurality of growth parameters through the central server; and updating the growth parameters of agricultural products in each local client according to the average value parameters so as to realize agricultural product data interaction of the plurality of local clients. The agricultural product data interaction method and the agricultural product data interaction system can improve the data interaction efficiency of the agricultural products and can guarantee the data security of the agricultural products.)

1. An agricultural product data interaction method based on federal learning, which is characterized by comprising the following steps:

the method comprises the steps of obtaining agricultural products of a plurality of local clients, and extracting characteristic data of each agricultural product to obtain a plurality of agricultural product characteristic data;

inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship;

encrypting each growth parameter and transmitting the encrypted growth parameters to a central server so as to calculate a mean value parameter of the growth parameters through the central server;

and updating the growth parameters of agricultural products in each local client according to the average parameter so as to realize agricultural product data interaction of the plurality of local clients.

2. The agricultural-product data interaction method based on federal learning of claim 1, wherein the extracting the feature data of each agricultural product to obtain a plurality of agricultural-product feature data comprises:

performing data cleaning on each agricultural product to obtain a plurality of cleaned agricultural product data;

calculating a data weight value of each cleaning data in each cleaning agricultural product data;

and taking the cleaning data with the data weight value larger than a preset weight value as the characteristic data of the cleaning agricultural product data to obtain the plurality of agricultural product characteristic data.

3. The agricultural product data interaction method based on federal learning of claim 2, wherein the data cleaning of each agricultural product to obtain a plurality of cleaned agricultural product data comprises:

deleting abnormal data in each agricultural product to obtain a plurality of initial agricultural product data;

detecting whether each initial agricultural product data has a data missing value or not;

if the initial agricultural product data does not have a data missing value, the initial agricultural product data is used as cleaning agricultural product data to obtain a plurality of cleaning agricultural product data;

and if the data missing value exists in the cleaning agricultural product data, performing data filling on the data missing value to obtain a plurality of cleaning agricultural product data.

4. The agricultural product data interaction method based on federal learning of claim 1, wherein before inputting each of the agricultural product characteristic data into a plurality of local parameter test model tests trained in advance, the method further comprises:

acquiring training agricultural product characteristic data and a corresponding label, and calculating a state value of the training agricultural product characteristic data by using an input gate in a pre-constructed local parameter detection model;

calculating an activation value of the training agricultural product characteristic data by utilizing a forgetting gate in the pre-constructed local parameter detection model;

calculating a state updating value of the training agricultural product characteristic data according to the state value and the activation value, and calculating a state sequence of the state updating value by using an output gate in the pre-constructed local parameter detection model;

calculating the parameter class probability of the state sequence by utilizing a classification layer in the pre-constructed local parameter detection model to obtain a predicted growth parameter of the training agricultural product characteristic data;

calculating a loss value of the predicted growth parameter and the label;

if the loss value is larger than a preset threshold value, adjusting parameters of the pre-constructed local parameter detection model, and returning to the step of calculating the state value of the characteristic data of the training agricultural products by using an input gate in the pre-constructed local parameter detection model;

and if the loss value is not greater than the preset threshold value, obtaining the local parameter detection model trained in advance.

5. The federal learning-based agricultural product data interaction method of claim 1, wherein the calculating the activation value of the training agricultural product feature data by using a forgetting gate in the pre-constructed local parameter detection model comprises:

calculating an activation value of the training agricultural product characteristic data using the following formula:

wherein the content of the first and second substances,the value of the activation is represented by,indicating the bias of the cell unit in the forgetting gate,an activation factor that indicates that the door was forgotten,representing the peak value of the training agricultural product characteristic data at the moment of forgetting gate t-1,representing training agricultural product characteristic data input at time t,representing the weight of the cell unit in the forgetting gate.

6. The federal learning based agricultural product data interaction method of claim 1, wherein said encrypting each of said growth parameters comprises:

encrypting each of the growth parameters using the following equation:

wherein the content of the first and second substances,the growth parameter after encryption is represented, m represents the mth plaintext in the growth parameter, t represents the number of the plaintext in the growth parameter, e represents the wireless acyclic fractional number, mod represents a plaintext encryption function, and N represents the encryption frequency.

7. The federal learning based agricultural product data interaction method of claim 1, wherein said calculating, by the central server, a mean parameter of the plurality of growth parameters comprises:

decrypting each growth parameter by using a decryption algorithm of the central server to obtain a plurality of decryption parameters;

clustering parameters with the same category in the plurality of decryption parameters to obtain one or more clustering center points;

and calculating the mean value of all parameters in the cluster central point to obtain the mean value parameters of the plurality of growth parameters.

8. An agricultural product data interaction device based on federal learning, which is characterized by comprising:

the characteristic data extraction module is used for acquiring agricultural products of a plurality of local clients and extracting the characteristic data of each agricultural product to obtain a plurality of agricultural product characteristic data;

the growth parameter detection module is used for inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship;

the mean parameter acquisition module is used for encrypting each growth parameter and transmitting the encrypted growth parameter to a central server so as to calculate the mean parameter of the plurality of growth parameters through the central server;

and the growth parameter updating module is used for updating the growth parameters of the agricultural products in each local client according to the mean parameter so as to realize agricultural product data interaction of the local clients.

9. An electronic device, characterized in that the electronic device comprises:

at least one processor; and the number of the first and second groups,

a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,

the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of interacting agricultural product data based on federal learning of any of claims 1 to 7.

Technical Field

The invention relates to the field of artificial intelligence, in particular to an agricultural product data interaction method and device based on federal learning and an electronic device.

Background

With the continuous development of agricultural technology, the planting technology of agricultural products is greatly improved, and with the rapid development of agricultural product planting technology, the technology for planting the same variety of agricultural products in different areas is different, so that how to effectively interact the agricultural product planting technology in different areas is more and more important.

At present, agricultural product growers based on different regions usually identify corresponding growth characteristic data and send the identified growth characteristic data to users with corresponding requirements so as to achieve the effect of data interaction of agricultural products.

Disclosure of Invention

In order to solve the technical problems, the invention provides an agricultural product data interaction method and device based on federal learning, an electronic device and a computer readable storage medium, which can improve the data interaction efficiency of agricultural products and guarantee the data security of the agricultural products.

In a first aspect, the invention provides an agricultural product data interaction method based on federal learning, which comprises the following steps:

the method comprises the steps of obtaining agricultural products of a plurality of local clients, and extracting characteristic data of each agricultural product to obtain a plurality of agricultural product characteristic data;

inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship;

encrypting each growth parameter and transmitting the encrypted growth parameters to a central server so as to calculate a mean value parameter of the growth parameters through the central server;

and updating the growth parameters of agricultural products in each local client according to the average parameter so as to realize agricultural product data interaction of the plurality of local clients.

According to the embodiment of the invention, firstly, the characteristic data of the agricultural products of each local client is extracted to obtain the characteristic data of a plurality of agricultural products, so that some useless data in each agricultural product can be screened out, the data processing amount of each agricultural product is reduced, and the detection speed of each subsequent agricultural product is improved; secondly, inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, so that the growth characteristic of each agricultural product characteristic data can be intelligently analyzed, excessive human-caused recognition actions are avoided, the recognition efficiency of the growth parameters of the agricultural products is improved, and the precondition of agricultural product data interaction of a plurality of subsequent local clients can be ensured; furthermore, in the embodiment of the present invention, each growth parameter is encrypted and then transmitted to the central server, so that the central server calculates the mean parameter of the plurality of growth parameters, which can ensure that the growth parameters are not leaked during the transmission process, improve the safety of the growth parameters, and update the growth parameters of the agricultural products in each local client in combination with the mean parameter, so as to implement agricultural product data interaction of the plurality of local clients. Therefore, the agricultural product data interaction method based on federal learning provided by the embodiment of the invention can improve the data interaction efficiency of agricultural products and can guarantee the data security of the agricultural products.

In a possible implementation manner of the first aspect, the extracting feature data of each agricultural product to obtain a plurality of agricultural product feature data includes:

performing data cleaning on each agricultural product to obtain a plurality of cleaned agricultural product data;

calculating a data weight value of each cleaning data in each cleaning agricultural product data;

and taking the cleaning data with the data weight value larger than a preset weight value as the characteristic data of the cleaning agricultural product data to obtain the plurality of agricultural product characteristic data.

In one possible implementation manner of the first aspect, the performing data cleansing on each agricultural product to obtain a plurality of cleansed agricultural product data includes:

deleting abnormal data in each agricultural product to obtain a plurality of initial agricultural product data;

detecting whether each initial agricultural product data has a data missing value or not;

if the initial agricultural product data does not have a data missing value, the initial agricultural product data is used as cleaning agricultural product data to obtain a plurality of cleaning agricultural product data;

and if the data missing value exists in the cleaning agricultural product data, performing data filling on the data missing value to obtain a plurality of cleaning agricultural product data.

In a possible implementation manner of the first aspect, before the inputting each agricultural product feature data into a plurality of local parameter detection models trained in advance, the method further includes:

acquiring training agricultural product characteristic data and a corresponding label, and calculating a state value of the training agricultural product characteristic data by using an input gate in a pre-constructed local parameter detection model;

calculating an activation value of the training agricultural product characteristic data by utilizing a forgetting gate in the pre-constructed local parameter detection model;

calculating a state updating value of the training agricultural product characteristic data according to the state value and the activation value, and calculating a state sequence of the state updating value by using an output gate in the pre-constructed local parameter detection model;

calculating the parameter class probability of the state sequence by utilizing a classification layer in the pre-constructed local parameter detection model to obtain a predicted growth parameter of the training agricultural product characteristic data;

calculating a loss value of the predicted growth parameter and the label;

if the loss value is larger than a preset threshold value, adjusting parameters of the pre-constructed local parameter detection model, and returning to the step of calculating the state value of the characteristic data of the training agricultural products by using an input gate in the pre-constructed local parameter detection model;

and if the loss value is not greater than the preset threshold value, obtaining the local parameter detection model trained in advance.

In one possible implementation manner of the first aspect, the calculating an activation value of the training agricultural product feature data by using a forgetting gate in the pre-constructed local parameter detection model includes:

calculating an activation value of the training agricultural product characteristic data using the following formula:

wherein the content of the first and second substances,the value of the activation is represented by,indicating the bias of the cell unit in the forgetting gate,an activation factor that indicates that the door was forgotten,representing the peak value of the training agricultural product characteristic data at the moment of forgetting gate t-1,representing training agricultural product characteristic data input at time t,representing the weight of the cell unit in the forgetting gate.

In a possible implementation manner of the first aspect, the encrypting each growth parameter includes:

encrypting each of the growth parameters using the following equation:

wherein the content of the first and second substances,the growth parameter after encryption is represented, m represents the mth plaintext in the growth parameter, t represents the number of the plaintext in the growth parameter, e represents the wireless acyclic fractional number, mod represents a plaintext encryption function, and N represents the encryption frequency.

In one possible implementation manner of the first aspect, the calculating, by the central server, a mean parameter of the plurality of growth parameters includes:

decrypting each growth parameter by using a decryption algorithm of the central server to obtain a plurality of decryption parameters;

clustering parameters with the same category in the plurality of decryption parameters to obtain one or more clustering center points;

and calculating the mean value of all parameters in the cluster central point to obtain the mean value parameters of the plurality of growth parameters.

In a second aspect, the invention provides an agricultural product data interaction device based on federal learning, which comprises:

the characteristic data extraction module is used for acquiring agricultural products of a plurality of local clients and extracting the characteristic data of each agricultural product to obtain a plurality of agricultural product characteristic data;

the growth parameter detection module is used for inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship;

the mean parameter acquisition module is used for encrypting each growth parameter and transmitting the encrypted growth parameter to a central server so as to calculate the mean parameter of the plurality of growth parameters through the central server;

and the growth parameter updating module is used for updating the growth parameters of the agricultural products in each local client according to the mean parameter so as to realize agricultural product data interaction of the local clients.

In a third aspect, the present invention provides an electronic device comprising:

at least one processor; and a memory communicatively coupled to the at least one processor;

wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of agricultural product data interaction based on federated learning as described in any one of the above-mentioned first aspects.

It is to be understood that, the beneficial effects of the second to third aspects may be referred to the related description of the first aspect, and are not described herein again.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.

Fig. 1 is a schematic diagram of a system structure of an agricultural product data interaction method based on federal learning according to an embodiment of the present invention;

fig. 2 is a detailed flowchart of an agricultural product data interaction method based on federal learning according to an embodiment of the present invention;

FIG. 3 is a schematic flow chart illustrating one step of the agricultural product data interaction method based on federal learning provided in FIG. 2 according to an embodiment of the present invention;

fig. 4 is a schematic block diagram of an agricultural product data interaction device based on federal learning according to an embodiment of the present invention;

fig. 5 is a schematic internal structural diagram of an electronic device for implementing an agricultural product data interaction method based on federal learning according to an embodiment of the present invention.

In the figure: 1. a central server; 2. a local client; 50. a processor; 51. a memory; 52. a communication bus; 53. a communication interface; 400. agricultural product data interaction device based on federal learning; 401. a feature data extraction module; 402. a growth parameter detection module; 403. a mean parameter obtaining module; 404. and a growth parameter updating module.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.

Fig. 1 is a schematic diagram of a system structure of an agricultural product data interaction method based on federal learning according to an embodiment of the present invention, where the system structure includes a central server 1 and a plurality of local clients 2.

In the embodiment of the present invention, the central server 1 is a computer that provides computing or application services for other clients (such as a PC, a smart phone, an ATM, and other terminals) in a network, in the embodiment of the present invention, the central server 1 may be understood as a computer that manages and computes data transmitted by the plurality of local clients 2, and the local clients 2, also referred to as clients, are programs that correspond to the server and provide local services for the clients, in the embodiment of the present invention, the local clients 2 may be understood as programs that manage and compute data of local agricultural products.

Further, in the embodiment of the present invention, the plurality of local clients 2 detect the growth parameters of the local agricultural products thereof and transmit the detected growth parameters to the central server 1, so that the central server 1 calculates the mean parameter of the growth parameters and then updates the growth parameters detected by each local client 2, thereby implementing the local agricultural product data interaction of the plurality of local clients 2. It should be understood that, since each local client 2 uploads the growth parameters of the local agricultural product detected by the local client to the central server 1 for sharing, in the embodiment of the present invention, the variety of the local agricultural product detected by each local client 2 is the same, and the deployment location of each local client is different.

Fig. 2 is a schematic flow chart of an agricultural product data interaction method based on federal learning according to an embodiment of the present invention. The agricultural product data interaction method based on federal learning and described in FIG. 2 comprises the following steps:

s1, agricultural products of a plurality of local clients are obtained, and the characteristic data of each agricultural product is extracted to obtain a plurality of agricultural product characteristic data.

As mentioned above, the local client refers to an agricultural product program for managing and computing the local, and the agricultural product refers to products such as vegetables, fruits and the like, in detail, such as green vegetables, apples, and hami melons. It should be understood that the growth attributes of agricultural products of the same variety in different regions are different, and the growth attributes can be understood as product characteristics of the agricultural products in the growth process, such as growth environment, color, taste and the like, for example, the growth environment and the growth shape of the hami melons growing in the northwest region and the hami melons growing in the southeast region are different, so that the agricultural product growth characteristics of each client are extracted by obtaining the agricultural products of a plurality of local clients, the agricultural product data interaction of different regions is realized, and the planting efficiency of the agricultural products is improved.

It should be noted that, in the embodiment of the present invention, the agricultural products of the multiple local clients refer to products with the same variety, so as to ensure a precondition of data interaction of the agricultural products of the subsequent multiple local clients, if there are local clients in the southwest region, the northwest region, and the southeast region, the agricultural products in the three regions may be products with the same variety, and for example, the agricultural products in the three regions may all be apples.

Furthermore, the embodiment of the invention screens out some useless data in each agricultural product by extracting the characteristic data of each agricultural product, reduces the data processing amount of each agricultural product and improves the detection speed of each subsequent agricultural product.

As an embodiment of the present invention, refer to fig. 3. The extracting of the feature data of each agricultural product to obtain a plurality of agricultural product feature data comprises:

s301, performing data cleaning on each agricultural product to obtain a plurality of cleaned agricultural product data;

s302, calculating a data weight value of each cleaning data in each cleaning agricultural product data;

s303, using the cleaning data with the data weight value larger than a preset weight value as the characteristic data of the cleaning agricultural product data to obtain the plurality of agricultural product characteristic data.

Further, in an optional embodiment of the present invention, the performing data cleaning on each agricultural product to obtain a plurality of cleaned agricultural product data includes: deleting abnormal data in each agricultural product to obtain a plurality of initial agricultural product data, and detecting whether each initial agricultural product data has a data missing value; if the initial agricultural product data does not have a data missing value, the initial agricultural product data is used as cleaning agricultural product data to obtain a plurality of cleaning agricultural product data; and if the data missing value exists in the cleaning agricultural product data, performing data filling on the data missing value to obtain a plurality of cleaning agricultural product data.

Further, in another optional embodiment of the present invention, the abnormal data is deleted by a normal distribution algorithm, and the detection of the data missing value may be implemented by a detection function in a currently known data missing value detection tool, such as a mismap function detection function in an Amelia package tool.

Further, in an optional embodiment of the present invention, the following formula is used to calculate a data weight value of each cleaning data in each cleaning agricultural product data:

wherein the content of the first and second substances,a data weight value representing the cleansing data,indicating the ith cleaning data in the cleaning agricultural product data,representing the feature vector covariance of the ith cleaning data in the cleaning agricultural product data, wherein trace () represents a spatial filtering function, and the preset weight value is set to be 0.88, and can also be set according to an actual service scene.

S2, inputting each agricultural product characteristic data into a plurality of local parameter detection model detections trained in advance to output a growth parameter of each agricultural product characteristic data, wherein each parameter detection model and each agricultural product characteristic data are in a one-to-one correspondence relationship.

As can be seen from S1, each agricultural product feature data is extracted based on its corresponding local client, so that in the embodiment of the present invention, each agricultural product feature data is input into a plurality of local parameter detection model detections trained in advance to output a growth parameter of each agricultural product feature data, a growth feature of each agricultural product feature data can be intelligently analyzed, an excessive number of actions of human participation in recognition are avoided, recognition efficiency of the growth parameter of an agricultural product is improved, and a precondition of agricultural product data interaction of a plurality of subsequent local clients can be ensured. It should be noted that the plurality of local parameter detection models trained in advance are generated by being loaded to the plurality of local clients, and therefore, each local parameter detection model corresponds to each agricultural product feature data in a one-to-one correspondence relationship, for example, the local parameter detection model a corresponds to the agricultural product feature data a, and the local parameter detection model B corresponds to the agricultural product feature data B.

Further, in the embodiment of the present invention, the pre-trained local parameter detection model may be constructed by a Long Short-Term Memory network (LSTM) for solving the problem of Long-Term dependence of the recurrent neural network, and in the present invention, the LSTM network is used to detect the growth parameters of the characteristic data of the agricultural products.

Further, in the embodiment of the present invention, the pre-trained local parameter detection model includes an input gate, a forgetting gate, an output gate, and a classification layer, where the input gate is used to receive and store input agricultural product feature data, the forgetting gate is used to record and update agricultural product feature data, the output gate is used to calculate state information of the agricultural product feature data, and the classification layer is used to calculate a parameter category probability of each data in the agricultural product feature data to output a growth parameter of the agricultural product feature data.

Further, before inputting each agricultural product feature data into a plurality of local parameter detection models trained in advance, the embodiment of the present invention further includes: acquiring training agricultural product characteristic data and a corresponding label, and calculating a state value of the training agricultural product characteristic data by using an input gate in a pre-constructed local parameter detection model; calculating an activation value of the training agricultural product characteristic data by utilizing a forgetting gate in the pre-constructed local parameter detection model; calculating a state updating value of the training agricultural product characteristic data according to the state value and the activation value, and calculating a state sequence of the state updating value by using an output gate in the pre-constructed local parameter detection model; calculating the parameter class probability of the state sequence by utilizing a classification layer in the pre-constructed local parameter detection model to obtain a predicted growth parameter of the training agricultural product characteristic data; calculating a loss value of the predicted growth parameter and the label; if the loss value is larger than a preset threshold value, adjusting parameters of the pre-constructed local parameter detection model, returning to the step of calculating the state value of the characteristic data of the training agricultural product by using an input gate in the pre-constructed local parameter detection model, and if the loss value is not larger than the preset threshold value, obtaining the pre-trained local parameter detection model.

In an alternative embodiment, the state values of the training agricultural product characteristic data are calculated using the following formula:

wherein the content of the first and second substances,the value of the state is represented by,indicating the offset of the cell units in the input gates,indicating the activation factor of the input gate,representing the peak value of the training agricultural product characteristic data at the time t-1 of the input gate,representing training agricultural product characteristic data at time t,representing the weight of the cell units in the input gate.

In an alternative embodiment, the activation value of the training agricultural product characteristic data is calculated using the following formula:

wherein the content of the first and second substances,the value of the activation is represented by,indicating the bias of the cell unit in the forgetting gate,an activation factor that indicates that the door was forgotten,representing the peak value of the training agricultural product characteristic data at the moment of forgetting gate t-1,representing training agricultural product features input at time tThe data of the data is transmitted to the data receiver,representing the weight of the cell unit in the forgetting gate.

In an alternative embodiment, the state update value of the training agricultural product characteristic data is calculated using the following formula:

wherein the content of the first and second substances,the value of the state update is represented,representing the peak value of the training agricultural product characteristic data at the time t-1 of the input gate,and the peak value of the training agricultural product characteristic data at the moment of forgetting the gate t-1 is shown.

In an alternative embodiment, the state sequence of state update values is calculated using the following formula:

wherein the content of the first and second substances,a sequence of states is represented which is,the activation function of the output gate is represented,representing the state update value.

In an alternative embodiment, the calculation of the parameter class probability of the state sequence may be implemented by an activation function in the classification layer, such as a softmax function.

In an alternative embodiment, the loss value of the predicted growth parameter and the label is calculated using the following formula:

where LC represents loss values, represents predicted growth parameters, and represents labels. Optionally, the preset threshold is 0.1, and may also be set according to an actual service scenario.

S3, encrypting each growth parameter and transmitting the encrypted growth parameters to a central server so as to calculate the average parameter of the growth parameters through the central server.

In the embodiment of the invention, each growth parameter is encrypted and then transmitted to the central server, so that the growth parameters are shared, and the growth parameters of agricultural products in the corresponding local client can be updated, wherein the encryption of the growth parameters is used for ensuring that the growth parameters are not leaked in the transmission process, and the safety of the growth parameters is improved.

In an alternative embodiment of the invention, each of the growth parameters is encrypted using the following formula:

wherein the content of the first and second substances,the growth parameter after encryption is represented, m represents the mth plaintext in the growth parameter, t represents the number of the plaintext in the growth parameter, e represents the wireless acyclic fractional number, mod represents a plaintext encryption function, and N represents the encryption frequency.

Further, in the embodiment of the present invention, the central server calculates the mean parameter of the plurality of growth parameters to serve as a standard for updating the growth parameters of the agricultural products in each subsequent local client, so as to achieve the effect of sharing the growth parameters while ensuring that the growth parameters of the agricultural products in each local client are not leaked.

As an embodiment of the present invention, the calculating, by the central server, a mean parameter of the plurality of growth parameters includes: decrypting each growth parameter by using a decryption algorithm of the central server to obtain a plurality of decryption parameters, clustering the parameters with the same category in the plurality of decryption parameters to obtain one or more clustering center points, and calculating the mean value of all the parameters in the clustering center points to obtain the mean value parameters of the plurality of growth parameters.

The decryption algorithm corresponds to the encryption algorithm, and the clustering of the parameters of the same category can be realized by a clustering algorithm, such as a k-means algorithm.

And S4, updating the growth parameters of the agricultural products in each local client according to the mean parameter so as to realize agricultural product data interaction of the local clients.

In the embodiment of the present invention, the growth parameter of the agricultural product in each local client is updated according to the mean parameter, that is, the mean parameter is used as a standard parameter of the growth parameter of the agricultural product in each local client, so that agricultural product data interaction of the plurality of local clients can be achieved, and meanwhile, the mean parameter can be used as a reference range of the agricultural product in each subsequent local client in the planting process, thereby improving the planting efficiency of the agricultural product in each local client.

According to the embodiment of the invention, firstly, the characteristic data of the agricultural products of each local client is extracted to obtain the characteristic data of a plurality of agricultural products, so that some useless data in each agricultural product can be screened out, the data processing amount of each agricultural product is reduced, and the detection speed of each subsequent agricultural product is improved; secondly, inputting each agricultural product characteristic data into a plurality of pre-trained local parameter detection model detections to output a growth parameter of each agricultural product characteristic data, so that the growth characteristic of each agricultural product characteristic data can be intelligently analyzed, excessive human-caused recognition actions are avoided, the recognition efficiency of the growth parameters of the agricultural products is improved, and the precondition of agricultural product data interaction of a plurality of subsequent local clients can be ensured; furthermore, in the embodiment of the present invention, each growth parameter is encrypted and then transmitted to the central server, so that the central server calculates the mean parameter of the plurality of growth parameters, which can ensure that the growth parameters are not leaked during the transmission process, improve the safety of the growth parameters, and update the growth parameters of the agricultural products in each local client in combination with the mean parameter, so as to implement agricultural product data interaction of the plurality of local clients. Therefore, the agricultural product data interaction method based on federal learning provided by the embodiment of the invention can improve the data interaction efficiency of agricultural products and can guarantee the data security of the agricultural products.

Fig. 4 is a functional block diagram of the agricultural product data interaction device based on federal learning according to the present invention.

The agricultural product data interaction device 400 based on federal learning can be installed in electronic equipment. According to the realized functions, the agricultural product data interaction device based on federal learning can comprise a feature data extraction module 401, a growth parameter detection module 402, a mean parameter acquisition module 403 and a growth parameter update module 404. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.

In the present embodiment, the functions regarding the respective modules/units are as follows:

the characteristic data extraction module 401 is configured to obtain agricultural products of multiple local clients, and extract characteristic data of each agricultural product to obtain multiple agricultural product characteristic data;

the growth parameter detection module 402 is configured to input each agricultural product feature data into a plurality of local parameter detection model detections trained in advance, so as to output a growth parameter of each agricultural product feature data, where each parameter detection model and each agricultural product feature data are in a one-to-one correspondence relationship;

the mean parameter obtaining module 403 is configured to encrypt each growth parameter and transmit the encrypted growth parameter to a central server, so as to calculate a mean parameter of the plurality of growth parameters through the central server;

the growth parameter updating module 404 is configured to update the growth parameters of the agricultural products in each local client according to the mean parameter, so as to implement agricultural product data interaction of the multiple local clients.

In detail, when in use, each module in the agricultural product data interaction device 400 based on federal learning in the embodiment of the present invention adopts the same technical means as the agricultural product data interaction method based on federal learning described in fig. 2 and fig. 3, and can produce the same technical effect, which is not described herein again.

Fig. 5 is a schematic structural diagram of an electronic device for implementing the agricultural product data interaction method based on federal learning according to the present invention.

The electronic device may include a processor 50, a memory 51, a communication bus 52, and a communication interface 53, and may further include a computer program, such as a federally learned agricultural product data interaction program, stored in the memory 51 and executable on the processor 50.

In some embodiments, the processor 50 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 50 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules stored in the memory 51 (for example, executing an agricultural product data interaction program based on federal learning, etc.), and calling data stored in the memory 51.

The memory 51 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 51 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the electronic device. Further, the memory 51 may also include both an internal storage unit and an external storage device of the electronic device. The memory 51 may be used to store not only application software installed in the electronic device and various types of data, such as codes of agricultural product data interaction programs based on federal learning, etc., but also temporarily store data that has been output or will be output.

The communication bus 52 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 51 and at least one processor 50 or the like.

The communication interface 53 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.

Fig. 5 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 5 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.

For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 50 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.

It is to be understood that the embodiments described are for illustrative purposes only and that the scope of the claimed invention is not limited to this configuration.

The agricultural product data interaction program stored in the memory 51 of the electronic device based on federal learning is a combination of a plurality of computer programs, which when executed in the processor 50, can realize:

with the continuous development of agricultural technology, the planting technology of agricultural products is greatly improved, and with the rapid development of agricultural product planting technology, the technology for planting the same variety of agricultural products in different areas is different, so that how to effectively interact the agricultural product planting technology in different areas is more and more important.

At present, agricultural product growers based on different regions usually identify corresponding growth characteristic data and send the identified growth characteristic data to users with corresponding requirements so as to achieve the effect of data interaction of agricultural products.

Specifically, the processor 50 may refer to the description of the relevant steps in the embodiment corresponding to fig. 2 for a specific implementation method of the computer program, which is not described herein again.

Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a non-volatile computer-readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).

With the continuous development of agricultural technology, the planting technology of agricultural products is greatly improved, and with the rapid development of agricultural product planting technology, the technology for planting the same variety of agricultural products in different areas is different, so that how to effectively interact the agricultural product planting technology in different areas is more and more important.

At present, agricultural product growers based on different regions usually identify corresponding growth characteristic data and send the identified growth characteristic data to users with corresponding requirements so as to achieve the effect of data interaction of agricultural products.

In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.

The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.

In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.

It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.

The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.

It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于区块链的物联网中心平台的自主管理方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类