Traffic flow prediction model training method, device, electronic device and storage medium

Through federated transfer learning, the locally trained traffic flow prediction model gradient is transmitted and cloud gradient aggregation is performed, which solves the problems of privacy protection and high computing pressure in the existing technology, and improves the accuracy and efficiency of the model.

CN112446544BActive Publication Date: 2024-09-24PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011381851.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-01
Publication Date
2024-09-24
Estimated Expiration
2040-12-01

AI Technical Summary

Technical Problem

Existing traffic flow prediction models based on deep learning have difficulties in privacy protection, cannot make full use of big data, and have high computational pressure during the training process, resulting in low model accuracy and efficiency.

Method used

A method based on federated transfer learning is used to train the traffic flow prediction model through a local database, transmit the model gradient for federated learning, reduce computing pressure and improve model accuracy, and use the cloud to perform gradient aggregation to update the model.

Benefits of technology

Under the condition of protecting user data privacy, the accuracy of the model is improved and the computing pressure is reduced, achieving more efficient traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112446544B
    Figure CN112446544B
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses a method for training a traffic flow prediction model based on federated transfer learning, including: using a local database to train a traffic flow prediction model, and obtaining a local model gradient when the loss function converges; transmitting the local model gradient to other participants in the federated transfer learning through transfer learning to train their respective models; when the loss functions in the models of all participants converge, sending the local model gradient to the cloud; obtaining a standard traffic flow prediction model based on the model gradient after federated learning returned from the cloud; analyzing traffic data using the standard traffic flow prediction model to obtain traffic flow analysis results. The present invention also provides a traffic flow prediction model training device, equipment and storage medium based on federated transfer learning. The present invention improves model accuracy and reduces model calculation pressure while protecting user data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a traffic flow prediction model training method, device, electronic device and computer-readable storage medium based on federated transfer learning.

[0002] Background With the rise of machine learning and big data, existing deep learning-based model sharing methods have been successful in some public scenarios, such as traffic flow prediction, but there are still difficulties in the field of privacy protection. Due to the strictness of the current legal protection of user privacy, each system can only use the locally stored database to train the model, and cannot give full play to the advantages of big data. Similarly, in the process of training a high-quality model, the gradient of the model needs to be continuously updated, which adds a lot of computing pressure. Summary of the invention

[0003] The present invention provides a traffic flow prediction model training method, device, equipment and medium based on federated transfer learning, the main purpose of which is to improve the model accuracy and reduce the model calculation pressure under the condition of protecting user data privacy.

[0004] To achieve the above object, the present invention provides a traffic flow prediction model training method based on federated transfer learning, comprising:

[0005] Using the traffic data in the local database of one of the participants in the federated transfer learning to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges, thereby obtaining a local model gradient;

[0006] The local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;

[0007] When the loss functions in the models of all participants in the federated transfer learning converge, the local model gradients are sent to the cloud for federated learning;

[0008] Receiving the model gradient after federated learning returned from the cloud, and using the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model;

[0009] Traffic data transmitted by a user is received, and the traffic data is analyzed using the standard traffic flow prediction model to obtain a traffic flow analysis result.

[0010] Optionally, the using of traffic data in a local database of one of the participants in the federated transfer learning to train a pre-created traffic flow prediction model until a loss function of the traffic flow prediction model converges to obtain a local model gradient includes:

[0011] Create traffic flow prediction models;

[0012] Using the traffic data in the local database to train the traffic flow prediction model to obtain an output result of the traffic flow prediction model;

[0013] Calculating the loss function value between the output result and the preset standard result using a preset loss function;

[0014] When the loss function value tends to converge, a trained traffic flow prediction model is obtained, a gradient parameter of the trained traffic flow prediction model is acquired, and a local model gradient is obtained.

[0015] Optionally, the calculating the loss function value between the output result and a preset standard result by using a preset loss function includes:

[0016] The loss function value is calculated using the following formula;

[0017]

[0018] Among them, f(x i ) represents the model output result, y i It represents the preset standard result, MSE represents the model loss function value, and n represents the number of calculations.

[0019] Optionally, after calculating the loss function value between the output result and a preset standard result using a preset loss function, the method further includes:

[0020] When the loss function value has not yet converged, the model gradient of the traffic flow prediction model is updated using the following formula:

[0021]

[0022] θ j represents the updated model gradient, θ j-1 represents the model gradient before updating, θ0 and θ1 are the preset model gradient initial values, and α represents the step size of gradient descent. Indicates the direction of gradient descent.

[0023] Optionally, the transmitting the local model gradient to other participants in the federated learning through transfer learning to perform respective model training includes:

[0024] Determine the local model D s =k i {x i ,y i} and other participants in federated transfer learning t =K j {x j ,y j} Whether the data types and user ranges in are the same;

[0025] When the data type and user scope are the same, the local model gradient k i Transmit to other participants in federated transfer learning to perform model D in the other participants t =k j {x j ,y j}.

[0026] Optionally, sending the local model gradient to the cloud for federated learning includes:

[0027] Perform gradient aggregation on the local model gradients of each participant in federated transfer learning to obtain the joint model gradient;

[0028] The federated model gradient is sent to each participant participating in the federated transfer learning.

[0029] Optionally, after sending the joint model gradient to each participant participating in the federated transfer learning, the method further includes:

[0030] Loading the federated model gradient into the traffic flow prediction model;

[0031] The variables in the traffic flow prediction model are modified according to the federated model gradient to obtain the standard traffic flow prediction model.

[0032] In addition, to achieve the above-mentioned purpose, the present invention also provides a model training device for federated transfer learning, which includes:

[0033] A local model training module, used to train a pre-created traffic flow prediction model using traffic data in a local database of one of the participants participating in the federated transfer learning, until a loss function of the traffic flow prediction model converges, thereby obtaining a local model gradient;

[0034] A data migration module, used for transmitting the local model gradient to other participants participating in the federated transfer learning through transfer learning to train their respective models;

[0035] A federated learning module, configured to send the local model gradient to the cloud for federated learning when the loss functions in the models of all participants in the federated transfer learning converge;

[0036] A model updating module, used for receiving the model gradient after federated learning returned from the cloud, and using the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model;

[0037] The data analysis module is used to receive the traffic flow data transmitted by the user, and analyze the traffic flow data using the standard traffic flow prediction model to obtain the traffic flow analysis result.

[0038] In addition, to achieve the above object, the present invention further provides an electronic device, the electronic device comprising:

[0039] at least one processor; and,

[0040] a memory communicatively connected to the at least one processor; wherein,

[0041] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned traffic flow prediction model training method based on federated transfer learning.

[0042] In order to solve the above problems, the present invention also provides a computer-readable storage medium, including a data storage area and a program storage area, the data storage area stores created data, and the program storage area stores a computer program; wherein, when the computer program is executed by a processor, the above-mentioned traffic flow prediction model training method based on federated transfer learning is implemented.

[0043] The embodiment of the present invention transmits the model gradient in a converged state after local training to other participants for training through transfer learning, so that other participants can reduce the number of model iterations. In addition, the model gradient is updated according to the model gradient completed by multiple clients using local data training through the server through federated learning, thereby achieving the effect of expanding the training data and improving the effect of the model. Therefore, the traffic flow prediction model training method, device, electronic device and computer-readable storage medium based on federated transfer learning proposed in the present invention improve the model accuracy and reduce the model calculation pressure under the condition of protecting user data privacy through federated transfer learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a flow chart of a traffic flow prediction model training method based on federated transfer learning provided in one embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a module of a traffic flow prediction model training device based on federated transfer learning provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing a traffic flow prediction model training method based on federated transfer learning provided by an embodiment of the present invention;

[0047] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0049] The embodiment of the present application provides a method for training a traffic flow prediction model based on federated transfer learning. The execution subject of the model training method based on federated learning includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the traffic flow prediction model training method based on federated transfer learning can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0050] Reference Figure 1 FIG. 1 is a flow chart of a method for training a traffic flow prediction model based on federated transfer learning provided by an embodiment of the present invention. In an embodiment of the present invention, the method for training a traffic flow prediction model based on federated transfer learning includes:

[0051] S1. Use the traffic data in the local database of one of the participants in the federated transfer learning to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges to obtain the local model gradient.

[0052] In the embodiment of the present invention, the data in the local database may be traffic data. In the embodiment of the present invention, the traffic data may be acquired from various traffic scenes using a data acquisition device.

[0053] In detail, the traffic data includes vehicle information, personnel information, violation record information, etc., the data acquisition equipment includes various cameras, various sensors, etc., and the traffic scenes include highways, country roads, roads during rush hours, bus stops, etc.

[0054] In detail, the S1 includes:

[0055] Create traffic flow prediction models;

[0056] Using the traffic data in the local database to train the traffic flow prediction model to obtain an output result of the traffic flow prediction model;

[0057] Calculating the loss function value between the output result and the preset standard result using a preset loss function;

[0058] When the loss function value tends to converge, a trained traffic flow prediction model is obtained, a gradient parameter of the trained traffic flow prediction model is acquired, and a local model gradient is obtained.

[0059] In detail, in the embodiment of the present invention, the traffic flow prediction model can be created by a convolutional neural network, and includes a convolutional layer, a pooling layer, a fully connected layer, etc. Among them, the convolutional layer uses a pre-built function to extract features from the data; the pooling layer compresses the extracted feature data to extract the main feature data and simplify the calculation complexity; the fully connected layer connects all feature data and outputs the data.

[0060] In detail, the training of the pre-created traffic flow prediction model is to adjust the parameters of the algorithm in the traffic flow prediction model through the traffic data in the local database, so that the trained traffic flow prediction model is a better mapping or reflection of the traffic data in the entire local database.

[0061] The embodiment of the present invention may use the following mean difference method (MSE) to calculate the loss function value between the output result and the preset standard result;

[0062]

[0063] Among them, f(x i ) represents the model output result, y i It represents the preset standard result, MSE represents the model loss function value, and n represents the number of calculations.

[0064] In one of the embodiments of the present invention, when the loss function value is less than or equal to a preset threshold, it is determined that the loss function value tends to converge, and the model gradient of the traffic flow prediction model at this time is obtained as the local model gradient.

[0065] In another embodiment of the present invention, when the loss function value is greater than a preset threshold, the loss function value has not yet converged, and the model gradient of the traffic flow prediction model needs to be further updated.

[0066] In the embodiment of the present invention, the model gradient of the traffic flow prediction model is updated using the following formula:

[0067]

[0068] θ j represents the updated model gradient, θ j-1 represents the model gradient before the update, θ0 and θ1 represent the preset initial values ​​of the function in the model, and represent the size of the gradient descent step. Indicates the direction of gradient descent.

[0069] S2. The local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models.

[0070] The transfer learning is a machine learning method that transfers the knowledge of one field (i.e., the source field) to another field (i.e., the target field) so that the target field can achieve better learning results.

[0071] In detail, the transfer learning mentioned above is to use transfer learning to overcome the situation of insufficient data or labels when there is little overlap between the data and data features of the model, and choose not to split the data. For example, there are two different institutions, one is a bank located in China, and the other is an e-commerce company located in the United States. Due to geographical restrictions, the user groups of these two institutions have little overlap. At the same time, due to the different types of institutions, the data features of the two institutions only overlap to a small extent. In this case, in order to carry out effective federated learning, transfer learning must be introduced to solve the problems of small unilateral data size and few labeled samples, thereby improving the effect of the model.

[0072] In the embodiment of the present invention, the local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models, including:

[0073] Determine the local model D s =k i {x i ,y i} and other participants in federated transfer learning t =k j {x j ,y j} Whether the data types and user ranges in are the same;

[0074] When the data type and user scope are the same, the local model gradient k i Transmit to other participants in federated transfer learning to perform model D in the other participants t =k j {x j ,yj}.

[0075] The embodiment of the present invention transmits the local model gradient to other participants in federated transfer learning through transfer learning to train their respective models, which can save the number of model iterations of other participants in federated transfer learning, thereby saving training time and improving model training effects.

[0076] S3. When the loss functions in the models of all participants in the federated transfer learning converge, the local model gradients are sent to the cloud for federated learning.

[0077] In an embodiment of the present invention, the federated learning includes: performing gradient aggregation operation on the local model gradients of each participant participating in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant participating in the federated transfer learning.

[0078] In an embodiment of the present invention, the gradient aggregation is an operation to calculate a single value from a set of values. For example, calculating the daily average temperature value from the daily temperature accumulated for a month is an aggregation operation. In one embodiment of the present invention, the joint model gradient can be obtained by weighted averaging the local gradient models of each participant participating in federated transfer learning.

[0079] S4. Receive the model gradient after federated learning returned from the cloud, and use the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model.

[0080] In detail, the method of updating the traffic flow prediction model using the model gradient after the federated learning includes: loading the federated model gradient into the traffic flow prediction model, and modifying the variables in the traffic flow prediction model according to the federated model gradient to obtain the standard traffic flow prediction model.

[0081] S5. Receive traffic data transmitted by the user, and analyze the traffic data using the standard traffic flow prediction model to obtain traffic flow analysis results.

[0082] In the embodiment of the present invention, the traffic flow data is analyzed according to the standard traffic flow prediction model to predict the road traffic conditions. In the embodiment of the present invention, the model gradients in a converged state completed by local training are transmitted to other participants for training through transfer learning, so that other participants can reduce the number of model iterations. In addition, the model gradients are updated according to the model gradients completed by training using local data by multiple clients through federated learning on the server, thereby achieving the effect of expanding the training data and improving the effect of the model. Therefore, the embodiment of the present invention achieves the improvement of model accuracy and the reduction of model calculation pressure while protecting user data privacy through federated transfer learning.

[0083] like Figure 3 , which is a module schematic diagram of the traffic flow prediction model training device based on federated transfer learning of the present invention.

[0084] The traffic flow prediction model training device 100 based on federated transfer learning of the present invention can be installed in an electronic device. According to the functions implemented, the traffic flow prediction model training device based on federated transfer learning can include a local model training module 101, a data migration module 102, a federated learning module 103, a model update module 104 and a data analysis module 105. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0085] In this embodiment, the functions of each module / unit are as follows:

[0086] The local model training module 101 is used to train a pre-created traffic flow prediction model using traffic data in a local database of one of the participants in the federated transfer learning until the loss function of the traffic flow prediction model converges to obtain a local model gradient.

[0087] The data migration module 102 is used to transmit the local model gradient to other participants participating in the federated transfer learning through transfer learning to train their respective models.

[0088] The federated learning module 103 is used to send the local model gradient to the cloud for federated learning when the loss functions in the models of all participants participating in the federated transfer learning converge;

[0089] The model updating module 104 is used to receive the model gradient after federated learning returned from the cloud, and use the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model;

[0090] The data analysis module 105 is used to receive traffic data transmitted by the user, and analyze the traffic data using the standard traffic flow prediction model to obtain traffic flow analysis results.

[0091] In detail, each module in the traffic flow prediction model training device based on federated transfer learning 100 can execute the traffic flow prediction model training method based on federated transfer learning including the following steps when running:

[0092] Step 1: The local model training module 101 in one of the participants in the federated transfer learning uses the traffic data in the local database to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges to obtain the local model gradient.

[0093] In the embodiment of the present invention, the data in the local database may be traffic data. In the embodiment of the present invention, the local model training module 101 may acquire the traffic data from various traffic scenes using a data acquisition device.

[0094] In detail, the traffic data includes vehicle information, personnel information, violation record information, etc., the data acquisition equipment includes various cameras, various sensors, etc., and the traffic scenes include highways, country roads, roads during rush hours, bus stops, etc.

[0095] In detail, the local model training module 101 is specifically used to: create a traffic flow prediction model; use the data in the local database to train the traffic flow prediction model to obtain the output result of the traffic flow prediction model; use a preset loss function to calculate the loss function value between the output result and the preset standard result; when the loss function value tends to converge, obtain the trained traffic flow prediction model and obtain the gradient parameters of the trained traffic flow prediction model to obtain the local model gradient.

[0096] In detail, in the embodiment of the present invention, the traffic flow prediction model can be created by a convolutional neural network, and includes a convolutional layer, a pooling layer, a fully connected layer, etc. Among them, the convolutional layer uses a pre-built function to extract features from the data; the pooling layer compresses the extracted feature data to extract the main feature data and simplify the calculation complexity; the fully connected layer connects all feature data and outputs the data.

[0097] In detail, the local model training module 101 trains the pre-created traffic flow prediction model by adjusting the parameters of the algorithm in the traffic flow prediction model through the traffic data in the local database, so that the trained traffic flow prediction model is a better mapping or reflection of the traffic data in the entire local database.

[0098] The local model training module 101 of the embodiment of the present invention may use the following mean difference method (MSE) to calculate the loss function value between the output result and the preset standard result;

[0099]

[0100] Among them, f(x i ) represents the model output result, y i It represents the preset standard result, MSE represents the model loss function value, and n represents the number of calculations.

[0101] In one embodiment of the present invention, when the loss function value is less than or equal to a preset threshold, the local model training module 101 determines that the loss function value tends to converge, and obtains the model gradient of the traffic flow prediction model at this time as the local model gradient.

[0102] In another embodiment of the present invention, when the loss function value is greater than a preset threshold, the local model training module 101 determines that the loss function value has not yet converged and the model gradient of the traffic flow prediction model needs to be further updated.

[0103] In the embodiment of the present invention, the local model training module 101 updates the model gradient of the traffic flow prediction model using the following formula:

[0104]

[0105] θ j represents the updated model gradient, θ j-1 represents the model gradient before the update, θ0 and θ1 represent the preset initial values ​​of the function in the model, and represent the size of the gradient descent step. Indicates the direction of gradient descent.

[0106] Step 2: The data migration module 102 transmits the local model gradient to other participants in the federated transfer learning through transfer learning to train their respective models.

[0107] The transfer learning is a machine learning method that transfers the knowledge of one field (i.e., the source field) to another field (i.e., the target field) so that the target field can achieve better learning results.

[0108] In detail, the transfer learning mentioned above is to use transfer learning to overcome the situation of insufficient data or labels when there is little overlap between the data and data features of the model, and choose not to split the data. For example, there are two different institutions, one is a bank located in China, and the other is an e-commerce company located in the United States. Due to geographical restrictions, the user groups of these two institutions have little overlap. At the same time, due to the different types of institutions, the data features of the two institutions only overlap to a small extent. In this case, in order to carry out effective federated learning, transfer learning must be introduced to solve the problems of small unilateral data size and few labeled samples, thereby improving the effect of the model.

[0109] In the embodiment of the present invention, when the data migration module 102 transmits the local model gradient to other participants participating in the federated transfer learning to train their respective models, the data migration module 102 executes:

[0110] Determine the local model D s =k i {x i ,y i} and other participants in federated transfer learning t =k j {x j ,y j} Whether the data types and user ranges in are the same;

[0111] When the data type and user scope are the same, the local model gradient k i Transmit to other participants in federated transfer learning to perform model D in the other participants t =k j {x j ,y j}.

[0112] The data migration module 102 described in the embodiment of the present invention transmits the local model gradient to other participants participating in federated transfer learning through transfer learning to train their respective models, which can save the number of model iterations of other participants in federated transfer learning, thereby saving training time and improving model training effects.

[0113] Step 3: When the loss functions in the models of all participants in the federated transfer learning converge, the federated learning module 103 sends the local model gradient to the cloud for federated learning.

[0114] In an embodiment of the present invention, the federated learning includes: performing gradient aggregation operation on the local model gradients of each participant participating in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant participating in the federated transfer learning.

[0115] In an embodiment of the present invention, the gradient aggregation is an operation to calculate a single value from a set of values. For example, calculating the daily average temperature value from the daily temperature accumulated for a month is an aggregation operation. In one embodiment of the present invention, the joint model gradient can be obtained by weighted averaging the local gradient models of each participant participating in federated transfer learning.

[0116] Step 4: The model updating module 104 receives the model gradient after federated learning returned from the cloud, and uses the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model.

[0117] In detail, the model updating module 104 updates the traffic flow prediction model using the model gradient after the federated learning, including: loading the federated model gradient into the traffic flow prediction model, and modifying the variables in the traffic flow prediction model according to the federated model gradient to obtain the standard traffic flow prediction model.

[0118] Step 5: The data analysis module 105 receives the traffic flow data transmitted by the user, and uses the standard traffic flow prediction model to analyze the traffic flow data to obtain a traffic flow analysis result.

[0119] The embodiment of the present invention can predict road traffic conditions by analyzing the traffic flow data according to the standard traffic flow prediction model.

[0120] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a traffic flow prediction model training method based on federated transfer learning according to the present invention.

[0121] The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a traffic flow prediction model training program 12 based on federated transfer learning.

[0122] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the traffic flow prediction model training program 12 based on federated transfer learning, but also can be used to temporarily store data that has been output or is to be output.

[0123] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a training program for a traffic flow prediction model based on federated transfer learning, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0124] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0125] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0126] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0127] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0128] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0129] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0130] The traffic flow prediction model training program 12 based on federated transfer learning stored in the memory 11 of the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can achieve:

[0131] Using the traffic data in the local database of one of the participants in the federated transfer learning to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges, thereby obtaining a local model gradient;

[0132] The local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning to train their respective models;

[0133] When the loss functions in the models of all participants in the federated transfer learning converge, the local model gradients are sent to the cloud for federated learning;

[0134] Receiving the model gradient after federated learning returned from the cloud, and using the model gradient after federated learning to modify the model gradient of the traffic flow prediction model to obtain a standard traffic flow prediction model;

[0135] Traffic data transmitted by a user is received, and the traffic data is analyzed using the standard traffic flow prediction model to obtain a traffic flow analysis result.

[0136] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0137] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0138] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0139] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0140] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0141] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0142] Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any associated diagram mark in the claims should not be regarded as limiting the claims involved.

[0143] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0144] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A traffic flow prediction model training method based on federated transfer learning, characterized in that: The method is applied to one of the parties involved in federated transfer learning, including: Using the traffic data in the local database of one of the participants in the federated transfer learning to train the pre-created traffic flow prediction model until the loss function of the traffic flow prediction model converges, thereby obtaining a local model gradient; The local model gradient is transmitted to other participants participating in the federated transfer learning through transfer learning, so that the respective models of the other participants train the traffic data in the local database of the other participants according to the local model gradient, so as to reduce the number of iterations of the respective models; When the loss functions in the models of all the participants in the federated transfer learning converge, the local model gradients of each participant in the federated transfer learning are sent to the cloud for federated learning, so that the cloud performs a gradient aggregation operation on the local model gradients of each participant in the federated transfer learning, including: performing a gradient aggregation operation on the local model gradients of each participant in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant in the federated transfer learning; Receiving the joint model gradient returned by the cloud, loading the joint model gradient into the traffic flow prediction model, modifying the variables in the traffic flow prediction model according to the joint model gradient, and obtaining a standard traffic flow prediction model; Traffic data transmitted by a user is received, and the traffic data is analyzed using the standard traffic flow prediction model to obtain a traffic flow analysis result.

2. The traffic flow prediction model training method based on federated transfer learning according to claim 1, characterized in that: The method of training a pre-created traffic flow prediction model using traffic data in a local database of one of the participants in the federated transfer learning until the loss function of the traffic flow prediction model converges to obtain a local model gradient includes: Create traffic flow prediction models; Using the traffic data in the local database to train the traffic flow prediction model to obtain an output result of the traffic flow prediction model; Calculating the loss function value between the output result and the preset standard result using a preset loss function; When the loss function value tends to converge, a trained traffic flow prediction model is obtained, a gradient parameter of the trained traffic flow prediction model is acquired, and a local model gradient is obtained.

3. The traffic flow prediction model training method based on federated transfer learning according to claim 2, characterized in that: The using a preset loss function to calculate the loss function value between the output result and a preset standard result includes: The loss function value is calculated using the following formula: in, Represents the model output results, Indicates the preset standard result, represents the model loss function value, Indicates the number of calculations.

4. The traffic flow prediction model training method based on federated transfer learning according to claim 3 is characterized in that: After calculating the loss function value between the output result and the preset standard result using the preset loss function, the method further includes: When the loss function value has not yet converged, the model gradient of the traffic flow prediction model is updated using the following formula: represents the updated model gradient, represents the model gradient before updating, , is the preset model gradient initial value, represents the step size of gradient descent, Indicates the direction of gradient descent.

5. A traffic flow prediction model training device based on federated transfer learning, characterized in that: The device comprises: A local model training module, used to train a pre-created traffic flow prediction model using traffic data in a local database of one of the participants participating in the federated transfer learning until a loss function of the traffic flow prediction model converges, thereby obtaining a local model gradient; A data migration module, used for transmitting the local model gradient to other participants participating in the federated transfer learning through transfer learning, so that the respective models of the other participants train the traffic data in the local database of the other participants according to the local model gradient, so as to reduce the number of iterations of the respective models; A federated learning module, for sending the local model gradients of each participant in the federated transfer learning to the cloud for federated learning when the loss functions in the models of all participants in the federated transfer learning converge, so that the cloud performs a gradient aggregation operation on the local model gradients of each participant in the federated transfer learning, including: performing a gradient aggregation operation on the local model gradients of each participant in the federated transfer learning to obtain a joint model gradient, and sending the joint model gradient to each participant in the federated transfer learning; A model updating module, configured to receive the joint model gradient returned from the cloud, load the joint model gradient into the traffic flow prediction model, modify the variables in the traffic flow prediction model according to the joint model gradient, and obtain a standard traffic flow prediction model; The data analysis module is used to receive the traffic data transmitted by the user, and analyze the traffic data using the standard traffic flow prediction model to obtain traffic flow analysis results.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the traffic flow prediction model training method based on federated transfer learning as described in any one of claims 1 to 4.

7. A computer-readable storage medium, comprising a data storage area and a program storage area, wherein the data storage area stores created data and the program storage area stores a computer program, characterized in that: When the computer program is executed by a processor, the traffic flow prediction model training method based on federated transfer learning as described in any one of claims 1 to 4 is implemented.