Vehicle and road cloud cooperation system for model training and application
By introducing blockchain technology and federated learning mechanisms into the Internet of Vehicles system, the problems of data privacy and model efficiency in the AI model training of Internet of Vehicles are solved, and more efficient and real-time model training and application are achieved.
Patent Information
- Application Number
- CN202510252785.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-24
AI Technical Summary
The existing AI model training methods of Internet of Vehicles have problems such as data privacy protection restrictions, insufficient model effectiveness and generalization, and poor iteration efficiency and real-time performance.
The vehicle-road cloud collaboration system is adopted to train and trade models through the blockchain nodes of roadside units and on-board units, and the new version of the model is trained and released using the federated learning mechanism, and local model aggregation is performed through vehicle-to-vehicle communication.
On the premise of ensuring data privacy, the effectiveness and generalization of the model are improved, the iteration efficiency and real-time nature of the model are enhanced, and the workload of model aggregation on the server side is reduced.
Smart Images

Figure CN120200730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a vehicle-road-cloud collaborative system for model training and application. Background Art
[0002] A large number of artificial intelligence (AI) models are used in the application scenarios of the Internet of Vehicles (IoV). At present, the training process of these models is mostly completed on cloud servers. After the model training is completed, the cloud provides corresponding model application / transaction interfaces to roadside units (RSUs) and on-board units (OBUs). In actual applications, we found that there are some problems with this conventional training method: 1) Limited by data privacy protection, most of the datasets used by the cloud for model training can only be constructed through the data collected by roadside units, and the traffic data of all on-board units cannot be effectively utilized, which will, to a certain extent, cause problems such as insufficient model effectiveness and poor generalization; 2) Limited by factors such as communication bandwidth and communication quality, the cloud usually can only process model training tasks based on an offline training method, which will, to a certain extent, cause problems such as low model iteration efficiency and poor real-time performance. We know that in the field of AI technology, the federated learning (FL) mechanism combined with blockchain can not only protect data privacy, but also use numerous computing nodes to perform real-time training on the model, and can also reduce the communication pressure on cloud servers. If the federated learning mechanism can be introduced into the AI model application scenario of the Internet of Vehicles, it can not only improve the effectiveness and generalization of the model, but also improve the iteration efficiency and real-time performance of the model. And how to achieve this is the technical problem to be solved by the present invention. Summary of the Invention
[0003] The purpose of the present invention is to provide a vehicle-road-cloud collaborative system for model training and application in response to the defects of the prior art, the system comprising: a client, a server, a roadside unit set and a vehicle-mounted unit set; wherein the roadside unit set is composed of multiple roadside units, each roadside unit is a blockchain node of two blockchains (training blockchain and transaction blockchain); the vehicle-mounted unit set is composed of multiple vehicle-mounted units; the server and the roadside unit are used to publish the input model of the client according to the training blockchain; the server and the roadside unit are also used to process the three types of model transaction (training, application and evaluation) requirements of the vehicle-mounted unit according to the training and transaction blockchains, and during the transaction processing process, the vehicle-mounted unit that has participated in the training of a certain version of the model is given a free model reward when it needs to use the version of the model; the server, the roadside unit and the vehicle-mounted unit are also used to process the new version of the model training and release tasks of the on-chain model according to the training blockchain according to the federated learning mechanism, and during the training process, the local model aggregation is first completed based on the vehicle-to-vehicle communication, and then the server completes the global model aggregation based on the local aggregation results. The system of the present invention can, on the one hand, use the massive data on the vehicle-mounted unit side to train the model in real time under the premise of ensuring data privacy, so as to improve the effectiveness and generalization of the model; on the other hand, it can delegate the training tasks to the vehicle-mounted units of the entire network for synchronous training, so as to improve the efficiency and real-time performance of model iteration; on the other hand, it can achieve the purpose of reducing the server aggregation workload and improving the model aggregation efficiency through the local model aggregation method of vehicle-to-vehicle communication.
[0004] To achieve the above-mentioned purpose, an embodiment of the present invention provides a vehicle-road-cloud collaborative system for model training and application, the system comprising: a client, a server, a roadside unit set and a vehicle-mounted unit set;
[0005] The roadside unit set is composed of multiple roadside units, each of which is installed on the side of a corresponding road section; each of the roadside units is a blockchain node of two preset blockchains; the two blockchains include a training blockchain and a transaction blockchain; the on-board unit set is composed of multiple on-board units, each of which is installed on a corresponding vehicle; the client is connected to the server based on a preset first communication protocol; the server is connected to each of the roadside units and each of the on-board units respectively based on a preset second communication protocol; each of the roadside units is connected to any other roadside unit based on a preset third communication protocol, and is connected to any on-board unit in the current road section based on a preset fourth communication protocol; each of the on-board units is connected to other on-board units within its own vehicle-to-vehicle communication range based on a preset fifth communication protocol; the own vehicle-to-vehicle communication range is the effective communication range of the current on-board unit and other on-board units, and the range radius of the own vehicle-to-vehicle communication range is specified by the fifth communication protocol;
[0006] The client is used to receive the model data B input by the customer m,v and send it to the server; the server and the roadside unit are used to process the model data B according to the training blockchain m,v for the model publishing task; the server and the roadside unit are also used to process the model training, application and evaluation tasks of the on-vehicle unit according to the training blockchain and the transaction blockchain; the server, the roadside unit and the on-vehicle unit are also used to process the new version model training and publishing tasks of the on-chain model according to the federated learning mechanism based on the training blockchain
[0007] Preferably, the first communication protocol includes at least a first wired communication protocol and a first wireless communication protocol; the first wired communication protocol includes at least a serial communication protocol, a USB communication protocol, and a wired Ethernet communication protocol; the first wireless communication protocol includes at least a WiFi communication protocol and a 4G / 5G mobile communication protocol; the second communication protocol includes at least a 4G / 5G / LTE mobile communication protocol; the third communication protocol includes at least the Uu interface protocol of the 4G / 5G / LTE mobile communication protocol; the fourth communication protocol includes at least the PC5 interface protocol of the V2X communication protocol, the Uu interface protocol of the 4G / 5G / LTE mobile communication protocol, and the DSRC communication protocol; the fifth communication protocol includes at least the PC5 interface protocol of the V2X communication protocol
[0008] Preferably, the model data B m,v includes a model identifier m, a model version v, a model description, a model loader, a plaintext model parameter set W m,v , the model aggregation threshold TH m,v and a model accuracy AT m,v ; the model description includes at least a model name, a model use, a basic configuration of the model running environment, and a model transaction price; the basic configuration of the model running environment includes a hardware basic configuration and a software basic configuration; when the model version v is zero, the model transaction price is zero
[0009] The training blockchain is formed by sequentially linking multiple training blocks; the training block includes a training block header and a training block body; the block header data of the training block header at least includes a block version number, a previous block identifier, a previous block hash code, a current block timestamp, and a current block Merkle root; the block body data of the training block body at least includes a release type, a publisher identifier, a release model identifier, a release model version, a release parameter set, and a release model accuracy; the release type includes model release, training release, and aggregation release; when the release type is model release, the block header data of the training block header further includes a release model description, a release model program, a release model public key, and a release aggregation threshold; when the release type is aggregation release, the block header data of the training block header further includes a released vehicle identifier set.
[0010] The transaction blockchain is formed by sequentially linking multiple transaction blocks; the transaction block includes a transaction block header and a transaction block body; the block header data of the transaction block header at least includes a block version number, a previous block identifier, a previous block hash code, a current block timestamp, and a current block Merkle root; the block body data of the transaction block body at least includes a transaction type, transaction party identifiers, a transaction model identifier, and a transaction model version; the transaction type includes training, application, and evaluation; when the transaction type is application, the block header data of the transaction block header further includes a transaction amount and transaction party account identifiers; when the transaction type is evaluation, the block header data of the transaction block header further includes a model evaluation accuracy; the transaction party identifiers are composed of a roadside unit identifier and a vehicle unit identifier; the transaction party account identifiers are composed of a roadside unit account identifier and a vehicle unit account identifier.
[0011] Preferably, the server and the roadside unit are used to process the model data B according to the training blockchain. m,v The model release task specifically includes:
[0012] The server is used to send the model data B sent by the client m,v and allocate a pair of public and private keys for performing homomorphic encryption / decryption operations on the model parameter set, denoted as the corresponding homomorphic encryption public key PK m,v and homomorphic decryption private key SK m,v and save them; and allocate a pair of public and private keys for performing homomorphic encryption / decryption operations on the training data set for the model data B m,v denoted as the corresponding homomorphic encryption public key and homomorphic decryption private key and save them; and use the homomorphic encryption public key PK m,v to encrypt the plaintext W of the model parameter set of the model data B m,v m,v Perform homomorphic encryption operation to obtain the corresponding model parameter set ciphertext EW m,v ; and by the model data B m,v The corresponding homomorphic encryption public key The model identifier m, the model version v, the model description, the model loader, and the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v The first model publishing request corresponding to the model is sent to one of the roadside units; wherein the model parameter set ciphertext EW m,v The calculation method is: EW m,v =ENC(W m,v ,PK m,v ), ENC() is the homomorphic encryption function, ENC(W m,v ,PK m,v ) is based on the homomorphic encryption public key PK m,v The model parameter set plaintext W m,v Perform homomorphic encryption operation; the first model publishing request includes the homomorphic encryption public key The model identifier m, the model version v, the model description, the model loader, and the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v ;
[0013] The roadside unit is used to perform a first training block publishing process according to the first model publishing request sent by the server and the training blockchain.
[0014] Furthermore, the roadside unit is specifically used to extract the corresponding homomorphic encryption public key from the first model publishing request when performing the first training block publishing process according to the first model publishing request sent by the server and the training blockchain. The model identifier m, the model version v, the model description, the model loader, and the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v; and use the roadside unit identifier stored locally in the current roadside unit as the corresponding roadside identifier r; and set the corresponding release type to model release, set the corresponding publisher identifier to the roadside identifier r, set the corresponding release model identifier to the model identifier m, set the corresponding release model version to the model version v, set the corresponding release model description to the model description, set the corresponding release model program to the model loading program, and set the corresponding release model public key to the homomorphic encryption public key Set the corresponding release parameter set to the model parameter set ciphertext EW m,v ; set the corresponding release aggregation threshold to the model aggregation threshold TH m,v ; set the corresponding release model accuracy to the model accuracy AT m,v ; and construct a new training block based on a preset training block construction mechanism according to the release type, the publisher identifier, the release model identifier, the release model version, the release model description, the release model program, the release model public key, the release parameter set, the release aggregation threshold, and the release model accuracy set this time, and record it as the current training block; and add the current training block to the training blockchain based on a preset training block on-chain rule
[0015] Preferably, the server and the roadside unit are also used to process the model training, application, and evaluation tasks of the on-vehicle unit according to the training blockchain and the transaction blockchain, specifically including:
[0016] The on-vehicle unit is used to receive the model transaction demand input by the main control party of the current vehicle as the corresponding transaction demand R; and use the on-vehicle unit identifier, the software and hardware environment configuration, and the on-vehicle unit account identifier stored locally as the corresponding vehicle identifier c, vehicle configuration S c and vehicle account identifier CT c ; and send a model query request carrying the vehicle configuration S c to the roadside unit and receive the returned query model list; and form a corresponding model parameter P from the first model identifier, the first model version, and the first model transaction price of a first model selected by the main control party from the query model list m,v and save it, and set the parameter status of the currently saved model parameter P m,v to unaggregated; and send a request carrying the vehicle identifier c, the transaction demand R, the model parameter P m,v and the vehicle account identifier CT cSend the model transaction request to the roadside unit and receive the returned model transaction feedback; and when the model transaction feedback is successful, carry the vehicle identification c and the model parameter P m,v Send the model download request to the roadside unit and receive the returned model download data; and carry the model parameter P m,v Send the homomorphic decryption private key request to the server and extract the corresponding homomorphic decryption private key SK from the returned homomorphic decryption private key feedback m,v And save it; and identify the transaction requirement R; if the transaction requirement R is a training requirement, generate a pair of public and private key pairs for homomorphic encryption / decryption operations for the model download data, denoted as the corresponding homomorphic encryption public key PK m,v,c And the homomorphic decryption private key SK m,v,c And save it, and according to the homomorphic decryption private key SK m,v The homomorphic encryption public key PK m,v,c The model download data and the locally pre - set training data set D c Perform local model training processing to obtain the corresponding encrypted training parameter set EW m,v,c And the model accuracy AT m,v,c And save it, and carry the vehicle identification c, the model parameter P m,v The encrypted training parameter set EW m,v,c And the model accuracy AT m,v,c Send the training parameter release request carrying them to the roadside unit; if the transaction requirement R is an application requirement, then according to the homomorphic decryption private key SK m,v The model download data and the training data set D c Perform local model application and evaluation processing to obtain the corresponding evaluation accuracy AU m,v,c And send the model evaluation release request carrying the vehicle identification c, the model parameter P m,v And the evaluation accuracy AU m,v,c To the roadside unit; where the transaction requirement R includes a training requirement and an application requirement; the query model list includes multiple of the first model records; the first model record includes the first model identification, the first model version, the first model name, the first model use, the first model basic configuration and the first model transaction price; the model query request includes the vehicle configuration S c ; the model parameter P m,v Includes the first model identification, the first model version and the first model transaction price; the model transaction request includes the vehicle identification c, the transaction requirement R, the model parameter P m,v And the vehicle account identification CT c; The model download request includes the vehicle identification c and the model parameter P m,v ; The model download data includes the released model program, the released model public key, and the released parameter set; the homomorphic decryption private key request includes the model parameter P m,v ; The homomorphic decryption private key feedback includes the homomorphic decryption private key SK m,v ; The training parameter release request includes the vehicle identification c, the model parameter P m,v , the ciphertext EW of the training parameter set m,v,c and the model accuracy AT m,v,c ; The model evaluation release request includes the vehicle identification c, the model parameter P m,v and the evaluation accuracy AU m,v,c ;
[0017] The roadside unit is further configured to identify requests from the vehicle unit; if the current request is the model query request, perform a first training block query process according to the current request and the training blockchain to obtain the corresponding query model list and send it back; if the current request is the model transaction request, perform a first transaction block release process according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and send it back; if the current request is the model download request, perform a transaction and training block query process according to the current request and the training and transaction blockchains to obtain the corresponding model download data and send it back; if the current request is the training parameter release request, perform a second training block release process according to the current request and the training blockchain; if the current request is the model evaluation release request, perform a second transaction block release process according to the current request and the transaction blockchain;
[0018] The server is further configured to perform a request feedback preparation process according to the homomorphic decryption private key request sent by the vehicle unit to obtain the corresponding homomorphic decryption private key feedback and send it back.
[0019] Further, the vehicle unit is specifically configured to, when performing local model training processing according to the homomorphic decryption private key SK m,v , the homomorphic encryption public key PK m,v,c , the model download data, and the locally pre - installed training dataset D c to obtain the corresponding ciphertext EW of the training parameter set m,v,c and the model accuracy AT m,v,c and save them:
[0020] Step 71: Extract the corresponding released model program, released model public key, and release parameter set from the data downloaded from the model; perform program installation processing on the released model program, and when the installation processing is successful, perform corresponding program loading and running processing. When the loading and running processing is successful, use the currently running model program as the corresponding current model; and use the released model public key as the corresponding homomorphic encryption public key And use the release parameter set as the corresponding model parameter set ciphertext EW m,v ;
[0021] Step 72: Based on the homomorphic decryption private key SK m,v Perform homomorphic decryption operation on the model parameter set ciphertext EW m,v to obtain the corresponding model parameter set plaintext W m,v :
[0022] W m,v = DEC(EW m,v , SK m,v );
[0023] Where DEC() is the homomorphic decryption function, and DEC(EW m,v , SK m,v ) is to perform homomorphic decryption operation on the model parameter set ciphertext EW m,v based on the homomorphic decryption private key SK m,v ;
[0024] Step 73: Initialize the model parameters of the current model based on the model parameter set plaintext W m,v ;
[0025] Step 74: Divide the training data set D c into two sub-data sets, denoted as the corresponding first training set and first evaluation set, according to a preset first segmentation ratio; and perform one round of training on the current model based on the first training set and a preset first model optimizer in a supervised model training manner; and at the end of this round of training, evaluate the model accuracy of the current model based on the first evaluation set to obtain the corresponding first evaluation value;
[0026] Where the first model optimizer includes at least the SGD optimizer and the Adam optimizer;
[0027] Step 75: Identify whether the latest first evaluation value meets a preset first evaluation threshold range; if it meets, go to Step 76, if it does not meet, return to Step 74 to continue training;
[0028] Step 76: Use the latest model parameter set of the current model as the corresponding training parameter set plaintext W m,v,c; and based on the homomorphic encryption public key and the homomorphic encryption public key PK m,v,c perform two-layer encryption on the plaintext W of the training parameter set m,v,c to obtain the corresponding ciphertext EW of the training parameter set m,v,c and save it; and use the latest first evaluation value as the corresponding model accuracy AT m,v,c and save it;
[0029]
[0030] where ENC() is a homomorphic encryption function,
[0031] is the homomorphic encryption operation on the plaintext W of the training parameter set based on the homomorphic encryption public key and m,v,c is the homomorphic encryption operation on the ciphertext of the homomorphic encryption operation of again based on the homomorphic encryption public key PK m,v,c on .
[0032] Furthermore, the on-vehicle unit is specifically configured to, when performing local model application and evaluation processing on the model download data and the training data set D m,v according to the homomorphic decryption private key SK c to obtain the corresponding evaluation accuracy AU m,v,c :
[0033] Step 81, extract the corresponding released model program and the released parameter set from the model download data; perform program installation processing on the released model program, and perform corresponding program loading and running processing when the installation processing is successful, and use the currently running model program as the corresponding current model when the loading and running processing is successful; and use the released parameter set as the corresponding model parameter set ciphertext EW m,v ;
[0034] Step 82, perform homomorphic decryption operation on the model parameter set ciphertext EW m,v based on the homomorphic decryption private key SK m,v to obtain the corresponding plaintext W of the model parameter set m,v :
[0035] W m,v = DEC(EW m,v , SK m,v );
[0036] where DEC() is a homomorphic decryption function, DEC(EW m,v , SK m,v)Based on the homomorphic decryption private key SK m,v perform homomorphic decryption operation on the ciphertext EW of the model parameter set m,v ;
[0037] Step 83, based on the plaintext W of the model parameter set m,v solidify the model parameters of the current model; and after the model parameters are solidified, based on the training data set D c evaluate the model accuracy of the current model to obtain a corresponding second evaluation value; and use the second evaluation value as the corresponding evaluation accuracy AU m,v,c ;
[0038] Step 84, identify whether the obtained second evaluation value meets a preset second evaluation threshold range; if it meets, continuously run the current model and connect the input / output interface of the current model to the service processing flow of the current vehicle-mounted unit; if it does not meet, stop running the current model and perform model uninstallation processing on the current model.
[0039] Further, the roadside unit is specifically used for, when querying the first training block according to the current request and the training blockchain to obtain the corresponding query model list and sending it back, extracting the corresponding vehicle-mounted configuration S from the current request c ; and querying the training blocks on the training blockchain whose release type is model release and the basic configuration of the model running environment described in the released model meets the vehicle-mounted configuration S c to obtain a corresponding training block set; and identifying whether the training block set is; if so, set the corresponding query model list to be empty; if not, use each training block in the training block set as the corresponding current block, and use the release model identifier, the release model version, the model name described in the released model description, the model usage, the basic configuration of the model running environment, and the model transaction price in the block header data of the training block header of the current block as the corresponding first model identifier, the first model version, the first model name, the first model usage, the first model basic configuration, and the first model transaction price to form a corresponding first model record, and form the corresponding query model list from all the first model records obtained this time; and send the obtained query model list back to the current vehicle-mounted unit;
[0040] The roadside unit is specifically used for, when performing the first transaction block release processing according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and sending it back, extracting the corresponding vehicle-mounted identifier c, the transaction requirement R, and the model parameter P from the current requestm,v and the vehicle-mounted account identifier CT c ; and extract the corresponding first model identifier, the first model version, and the first model transaction price from the model parameters P m,v ; and use the roadside unit identifier and the roadside unit account identifier stored locally as the corresponding roadside identifier r and the roadside account identifier CT r ; and form a corresponding roadside-vehicle-mounted identifier pair from the roadside identifier r and the vehicle-mounted identifier c; and from the vehicle-mounted account identifier CT c and the roadside account identifier CT r form a corresponding roadside-vehicle-mounted account identifier pair; and set the corresponding trading party identifier as the roadside-vehicle-mounted identifier pair, set the corresponding trading model identifier as the first model identifier, set the corresponding trading model version as the first model version; and identify the trading demand R; if the trading demand R is a training demand, then set the corresponding trading type as training, and construct a new trading block denoted as the current trading block based on a preset trading block construction mechanism according to the trading type, the trading party identifier, the trading model identifier, and the trading model version set this time; if the trading demand R is an application demand, then confirm the previous version of the first model version based on a preset model version increment rule to obtain the corresponding previous model version, and query the training block on the training blockchain whose release type is training release, whose publisher identifier matches the vehicle-mounted identifier c, whose release model identifier matches the first model identifier, and whose release model version matches the previous model version to obtain the corresponding query block, and when the query block is not empty, set the first model transaction price to zero, and set the corresponding trading type as application, set the corresponding trading amount as the first model transaction price, set the corresponding trading party account identifiers as the roadside-vehicle-mounted account identifier pair, and when the first model transaction price is greater than zero, perform a transfer transaction process based on a preset account trading interface according to the first model transaction price and the roadside-vehicle-mounted account identifier pair, and construct a new trading block denoted as the current trading block based on the trading block construction mechanism according to the trading type, the trading party identifier, the trading model identifier, the trading model version, the trading amount, and the trading party account identifiers set this time; and when the obtained current trading block is not empty, add the current trading block to the trading blockchain based on a preset trading block on-chain rule, and send back the model trading feedback specifically set as successful to the current vehicle-mounted unit;
[0041] The roadside unit is specifically configured to extract the corresponding vehicle-mounted identifier c and model parameter P from the current request when performing transaction and training block query processing with the training and transaction blockchains according to the current request, and then send back the corresponding model download data m,v ; and extract the corresponding first model identifier and first model version from the model parameter P m,v ; query the transaction block on the transaction blockchain where the transaction type is model training or application, the transaction party identifiers include the vehicle-mounted identifier c, the transaction model identifier matches the first model identifier, and the transaction model version matches the first model version, to obtain the corresponding transaction query block; identify whether the transaction query block is empty; if the transaction query block is empty, set the corresponding model download data to be empty; if the transaction query block is not empty, query the training block on the training blockchain where the release type is model release, the release model identifier matches the first model identifier, and the release model version matches the first model version, to obtain the corresponding training query block, and identify whether the training query block is empty. If so, set the corresponding model download data to be empty; if not, extract the release model program, release model public key, and release parameter set of the training query block to form a corresponding model download data; and send the obtained model download data back to the current vehicle-mounted unit
[0042] The roadside unit is specifically configured to extract the corresponding vehicle-mounted identifier c, model parameter P m,v , ciphertext EW of the training parameter set m,v,c and model accuracy AT m,v,c from the current request when performing second training block release processing with the training blockchain m,v ; and extract the corresponding first model identifier and first model version from the model parameter P m,v,c ; set the corresponding release type to training release, set the corresponding publisher identifier to the vehicle-mounted identifier c, set the corresponding release model identifier to the first model identifier, set the corresponding release model version to the first model version, set the corresponding release parameter set to the ciphertext EW of the training parameter set m,v,c; and construct a new training block based on the training block construction mechanism according to the release type, the publisher identifier, the release model identifier, the release model version, the release parameter set, and the release model accuracy set this time, and denote it as the current training block; and add the current training block to the training blockchain based on the training block on-chain rule;
[0043] The roadside unit is specifically used for extracting the corresponding vehicle-mounted identifier c and the model parameter P from the current request when performing the second transaction block release process with the transaction blockchain according to the current request m,v and the evaluation accuracy AU m,v,c ; and extract the corresponding first model identifier and the first model version from the model parameter P m,v ; and use the roadside unit identifier stored locally in the current roadside unit as the corresponding roadside identifier r; and form a corresponding roadside-vehicle-mounted identifier pair from the roadside identifier r and the vehicle-mounted identifier c; and set the corresponding transaction type to evaluation, set the corresponding transaction party identifiers to the roadside-vehicle-mounted identifier pair, set the corresponding transaction model identifier to the first model identifier, set the corresponding transaction model version to the first model version, and set the corresponding model evaluation accuracy to the evaluation accuracy AU m,v,c ; and construct a new transaction block based on the transaction block construction mechanism according to the transaction type, the transaction party identifiers, the transaction model identifier, the transaction model version, and the model evaluation accuracy set this time, and denote it as the current transaction block; and add the current transaction block to the transaction blockchain based on the transaction block on-chain rule.
[0044] Further, the server is specifically used for extracting the corresponding model parameter P from the homomorphic decryption private key request when performing the request feedback preparation process to obtain the corresponding homomorphic decryption private key feedback and sending it back according to the homomorphic decryption private key request sent by the in-vehicle unit m,v ; and use the homomorphic decryption private key SK m,v corresponding to the model parameter P m,v as the corresponding current decryption private key; and send back the homomorphic decryption private key feedback carrying the current decryption private key to the current in-vehicle unit.
[0045] Preferably, the server, the roadside unit, and the in-vehicle unit are also used to process the new version model training and release tasks of the on-chain model according to the federated learning mechanism, specifically including:
[0046] The in-vehicle unit is also used to establish corresponding encrypted data transmission channels with other in-vehicle units within the vehicle-to-vehicle communication range of itself through a preset key negotiation mechanism; a unique channel negotiation key corresponds to the encrypted data transmission channel between every two in-vehicle units.
[0047] The in-vehicle unit is also used to regularly take the in-vehicle unit identifier stored locally as the corresponding current vehicle identifier at a preset first time frequency; and identify whether the parameter status of the model parameter P m,v has been switched to aggregated to obtain a corresponding current recognition result; if the current recognition result is no, then send a training times query request carrying the model parameter P m,v to the roadside unit, and extract the corresponding total training times and aggregation threshold parameters from the returned times query feedback; and when the total training times is greater than or equal to the aggregation threshold parameter, set the parameter status of the model parameter P m,v to aggregated, and perform aggregated unit positioning processing according to the model parameter P m,v to obtain a corresponding aggregated unit identifier; and identify whether the aggregated unit identifier matches the current vehicle identifier; if not, then take the in-vehicle unit corresponding to the aggregated unit identifier as the corresponding current aggregated unit, and send the corresponding homomorphic decryption private key SK m,v of the model parameter P m,v,c to the current aggregated unit; if it matches, then receive the homomorphic decryption private key SK m,v,c sent by other in-vehicle units, and form a corresponding first private key set from all the received homomorphic decryption private keys SK m,v,c and the homomorphic decryption private key SK m,v,c of the current in-vehicle unit itself, and form a corresponding first identifier set G{c} from all the vehicle identifiers c corresponding to the first private key set, and send a parameter set download request carrying the first identifier set G{c} and the model parameter P m,v to the roadside unit, and receive the returned parameter set download data, and perform local model aggregation processing based on the first private key set and the parameter set download data to obtain a corresponding aggregated parameter set ciphertext GEW m,v and an aggregated model accuracy GAT m,v ; and take the current vehicle identifier as the corresponding first vehicle identifier, and carry the first vehicle identifier, the first identifier set G{c}, the model parameter P m,v , the aggregated parameter set ciphertext GEW m,v and the aggregated model accuracy GAT m,vThe aggregation parameter release request is sent to the roadside unit; wherein, the training times query request includes the model parameter P m,v ; the times query feedback includes the total training times and the aggregation threshold parameter; the parameter set download request includes the first identification set G{c} and the model parameter P m,v , the first identification set G{c} includes a plurality of the vehicle-mounted identifications c; the parameter set download data consists of one or more vehicle-mounted training parameters; the vehicle-mounted training parameters include the release parameter set and the release model accuracy, and the vehicle-mounted training parameters of the parameter set download data correspond one-to-one to the vehicle-mounted identification c of the parameter set download request; the aggregation parameter release request includes the first vehicle-mounted identification, the first identification set G{c}, the model parameter P m,v , the encrypted aggregation parameter set GEW m,v and the aggregation model accuracy GAT m,v ;
[0048] The roadside unit is further configured to identify requests from the vehicle-mounted unit; if the current request is the training times query request, perform a second training block query process according to the current request and the training blockchain to obtain the corresponding times query feedback and send it back; if the current request is the parameter set download request, perform a third training block query process according to the current request and the training blockchain to obtain the corresponding parameter set download data and send it back; if the current request is the aggregation parameter release request, perform a third training block release process according to the current request and the training blockchain to obtain a corresponding model aggregation request and send it to the server; wherein, the model aggregation request includes a global aggregation model identification, a global aggregation model version, a local aggregation parameter set ciphertext, a local aggregation vehicle-mounted identification set, and a local model accuracy;
[0049] The server is further configured to perform a global model aggregation process according to the model aggregation request sent by the roadside unit to obtain the corresponding new version model data B m,v+1 ; wherein, the new version model data B m,v+1 includes the model identification m, the model version v+1, a new version model description, the model loader, the plaintext model parameter set W m,v+1 , the model aggregation threshold TH m,v+1 and the model accuracy AT m,v+1 ; the new version model description at least includes the model name, the model use, the basic configuration of the model running environment, and the new version model transaction price;
[0050] The server is further configured to... for the new version model data B m,v+1Allocate a public-private key pair for performing homomorphic encryption / decryption operations on the model parameter set, denoted as the corresponding homomorphic encryption public key PK m,v+1 and the homomorphic decryption private key SK m,v+1 and save them; and for the new version of model data B m,v+1 Allocate a public-private key pair for performing homomorphic encryption / decryption operations on the training data set, denoted as the corresponding homomorphic encryption public key and the homomorphic decryption private key and save them; and use the homomorphic encryption public key PK m,v+1 to perform homomorphic encryption operation on the plaintext W m,v+1 of the model parameter set of the new version of model data B m,v+1 to obtain the corresponding ciphertext EW m,v+1 of the model parameter set; and use the corresponding homomorphic encryption public key m,v+1 of the new version of model data B the model identifier m, the model version v + 1, the new version of model description, the model loader, the ciphertext EW m,v+1 of the model parameter set, the model aggregation threshold TH m,v+1 and the model accuracy AT m,v+1 to form the corresponding second model release request and send it to one of the roadside units; where, the calculation method of the ciphertext EW m,v+1 of the model parameter set is: EW m,v+1 = ENC(W m,v+1 , PK m,v+1 ), ENC(W m,v+1 , PK m,v+1 ) is to perform homomorphic encryption operation on the plaintext W m,v+1 of the model parameter set based on the homomorphic encryption public key PK m,v+1 ; the second model release request includes the homomorphic encryption public key the model identifier m, the model version v + 1, the new version of model description, the model loader, the ciphertext EW m,v+1 of the model parameter set, the model aggregation threshold TH m,v+1 and the model accuracy AT m,v+1 ;
[0051] The roadside unit is also used to perform fourth training block release processing according to the second model release request sent by the server and the training blockchain.
[0052] Furthermore, the on-vehicle unit is specifically used for when performing aggregation unit positioning processing according to the model parameter P m,v to obtain the corresponding aggregation unit identifier:
[0053] Step 121: Use the vehicle unit identifiers of each of the vehicle units connected to the current vehicle unit within the scope of the vehicle-to-vehicle communication of the vehicle itself as corresponding second vehicle identifiers; and also use the vehicle unit identifier of the current vehicle unit as a corresponding second vehicle identifier.
[0054] Step 122: By means of making requests and inquiries one by one, count the total number of unit connections between the vehicle units corresponding to each of the second vehicle identifiers and other vehicle units to obtain corresponding first connection totals; and sort the second vehicle identifiers in descending order according to the first connection totals to obtain a corresponding first sequence.
[0055] Step 123: Initialize the aggregation unit identifier as empty; start from the first second vehicle identifier in the first sequence, and perform a round of sequential traversal on all the second vehicle identifiers in the sequence; and in this round of sequential traversal, use the currently traversed second vehicle identifier as the corresponding current identifier; and use the vehicle unit corresponding to the current identifier as the corresponding current target unit; and identify whether the current target unit is the current vehicle unit; if the current target unit is the current vehicle unit, stop this round of polling and set the corresponding aggregation unit identifier as the vehicle unit identifier of the current vehicle unit; if the current target unit is not the current vehicle unit, identify whether the current target unit is willing to be an aggregation unit by making a request and inquiry to obtain a corresponding first identification result, and identify whether the first identification result is willing. If the first identification result is willing, stop this round of polling and set the corresponding aggregation unit identifier as the vehicle unit identifier of the current target unit. If the first identification result is not willing, go to the next second vehicle identifier and continue the traversal until the traversal of the last second vehicle identifier is completed.
[0056] Further, the vehicle unit is specifically configured to, when sending the corresponding homomorphic decryption private key SK m,v to the current aggregation unit, use the channel negotiation key of the encryption data transmission channel corresponding to the current aggregation unit as the corresponding channel encryption key; and encrypt the homomorphic decryption private key SK m,v,c based on the channel encryption key to obtain a corresponding first encrypted ciphertext; and send the first encrypted ciphertext to the current aggregation unit through the encryption data transmission channel corresponding to the current aggregation unit. m,v,c m,v,c
[0057] Further, the vehicle unit is specifically configured to, when receiving the homomorphic decryption private key SK sent by other vehicle unitsWhen, the channel negotiation key corresponding to each of the encrypted data transmission channels is used as the corresponding channel decryption key; and when a corresponding first encrypted ciphertext is received through one of the encrypted data transmission channels, the first encrypted ciphertext is decrypted based on the corresponding channel decryption key to obtain a corresponding first decrypted plaintext, and the first decrypted plaintext is used as the homomorphic decryption private key SK corresponding to the current encrypted data transmission channel m,v,c 。
[0058] Further, the in-vehicle unit is specifically configured to perform local model aggregation processing on the downloaded data based on the first private key set and the parameter set to obtain a corresponding aggregated parameter set ciphertext GEW m,v and an aggregated model accuracy GAT m,v When:
[0059] Step 151, count the total number of the vehicle-mounted training parameters of the parameter set downloaded data to obtain a corresponding second total number Q, where Q is a positive integer greater than zero; and record the published parameter set and the published model accuracy of each of the vehicle-mounted training parameters as corresponding training parameter set ciphertexts EW m,v,j and model accuracies AT m,v,j , 1 ≤ index j ≤ Q; and record the homomorphic decryption private key SK m,v,c corresponding to each of the vehicle-mounted training parameters in the first private key set as the corresponding homomorphic decryption private key SK m,v,j ;
[0060] Step 152, calculate a corresponding aggregated parameter set ciphertext GEW m,v,j and the aggregated model accuracy GAT m,v,j from all the homomorphic decryption private keys SK m,v,j , the training parameter set ciphertexts EW m,v and the model accuracies AT m,v ;
[0061] GEW m,v = add(DEC(EW m,v,j , SK m,v,j ) | j ∈ [1, Q]),
[0062]
[0063] where DEC() is a homomorphic decryption function, and DEC(EW m,v,j , SK m,v,j ) is a homomorphic decryption operation on the training parameter set ciphertext EW m,v,j based on the homomorphic decryption private key SK m,v,j ; add() is a homomorphic addition operation function; add(DEC(EWm,v,j , SK m,v,j ) | j ∈ [1, Q]) performs homomorphic addition operation on the homomorphic decryption result of the Q aggregated parameter set ciphertexts GEW m,v The homomorphic addition operation is performed on the homomorphic decryption result of the Q aggregated parameter set ciphertexts GEW
[0064] Furthermore, the roadside unit is specifically configured to, when querying the second training block of the training blockchain according to the current request and obtaining the corresponding query feedback of the number of times and sending it back, extract the corresponding model parameter P from the current request m,v ; and extract the corresponding first model identifier and the first model version from the model parameter P m,v ; and query the training blocks on the training blockchain whose release type is model release and whose release model identifier matches the first model identifier and whose release model version matches the first model version to obtain the corresponding query blocks; and identify whether the query blocks are empty. If so, set the corresponding aggregation threshold parameter to zero. Otherwise, extract the corresponding release aggregation threshold from the query blocks as the corresponding aggregation threshold parameter; and query the total number of the training blocks on the training blockchain whose release type is training release and whose release model identifier matches the first model identifier and whose release model version matches the first model version, and use the query result as the corresponding total number of training times; and form the corresponding query feedback of the number of times by the obtained total number of training times and the aggregation threshold parameter and send it back to the current vehicle-mounted unit
[0065] The roadside unit is specifically configured to, when querying the third training block of the training blockchain according to the current request and obtaining the corresponding parameter set download data and sending it back, extract the corresponding first identifier set G{c} and the model parameter P from the current request m,v ; and extract the corresponding first model identifier and the first model version from the model parameter P m,v ; and use each vehicle-mounted identifier c in the first identifier set G{c} as the corresponding current vehicle-mounted identifier, and query the training blocks on the training blockchain whose release type is training release and whose publisher identifier matches the current vehicle-mounted identifier and whose release model identifier matches the first model identifier and whose release model version matches the first model version to obtain the corresponding query blocks, and extract the release parameter set and the release model accuracy of the query blocks to form a corresponding vehicle-mounted training parameter; and form the corresponding parameter set download data by all the obtained vehicle-mounted training parameters and send it back to the current vehicle-mounted unit
[0066] The roadside unit is specifically configured to, when sending a corresponding model aggregation request to the server according to the current request and performing third training block publishing processing on the training blockchain, extract the corresponding first vehicle-mounted identifier, the first identifier set G{c}, and the model parameter P from the current request. m,v and the encrypted aggregation parameter set GEW m,v and the aggregation model accuracy GAT m,v ; and extract the corresponding first model identifier and the first model version from the model parameter P m,v ; and set the corresponding release type to aggregation release, set the corresponding publisher identifier to the first vehicle-mounted identifier, set the corresponding released model identifier to the first model identifier, set the corresponding released model version to the first model version, set the corresponding released parameter set to the encrypted aggregation parameter set GEW m,v ; set the corresponding released vehicle-mounted identifier set to the first identifier set G{c}, and set the corresponding released model accuracy to the aggregation model accuracy GAT m,v ; and construct a new training block denoted as the current training block based on the training block construction mechanism according to the release type, the publisher identifier, the released model identifier, the released model version, the released parameter set, the released vehicle-mounted identifier set, and the released model accuracy set this time; and add the current training block to the training blockchain based on the training block on-chain rule; and set the corresponding global aggregation model identifier to the first model identifier, set the corresponding global aggregation model version to the first model version, set the corresponding local encrypted aggregation parameter set to the encrypted aggregation parameter set GEW m,v ; set the corresponding local aggregated vehicle-mounted identifier set to the first identifier set G{c}, and set the corresponding local model accuracy to the aggregation model accuracy GAT m,v , and form a corresponding model aggregation request from the global aggregation model identifier, the global aggregation model version, the local encrypted aggregation parameter set, the local aggregated vehicle-mounted identifier set, and the local model accuracy set this time and send it to the server;
[0067] The roadside unit is specifically configured to, when performing fourth training block publishing processing on the second model release request sent by the server and the training blockchain, extract the corresponding homomorphic encryption public key from the second model release request. The model identifier m, the model version v + 1, the new model description, the model loader, the encrypted model parameter set EW m,v+1 and the model aggregation threshold TH m,v+1and the model accuracy AT m,v+1 ; and use the roadside unit identifier stored locally in the current roadside unit as the corresponding roadside identifier r; and set the corresponding release type to model release, set the corresponding publisher identifier to the roadside identifier r, set the corresponding released model identifier to the model identifier m, set the corresponding released model version to the model version v + 1, set the corresponding released model description to the new version model description, set the corresponding released model program to the model loading program, set the corresponding released model public key to the homomorphic encryption public key Set the corresponding release parameter set to the model parameter set ciphertext EW m,v+1 and set the corresponding release aggregation threshold to the model aggregation threshold TH m,v+1 and set the corresponding released model accuracy to the model accuracy AT m,v+1 ; and based on the training block construction mechanism, construct a new training block denoted as the current training block according to the release type, the publisher identifier, the released model identifier, the released model version, the released model description, the released model program, the released model public key, the release parameter set, the release aggregation threshold, and the released model accuracy set this time; and add the current training block to the training blockchain based on the training block on-chain rule.
[0068] Further, the server is specifically configured to, when performing global model aggregation processing on the model aggregation request sent by the roadside unit to obtain the corresponding new version model data B m,v+1 , preset a corresponding first cache queue for the model data B m,v ; and when receiving each model aggregation request corresponding to the model data B m,v , store the received model aggregation request of that time into the corresponding first cache queue; and when a new model aggregation request is added to the first cache queue each time, perform a count of the total number of in-vehicle units on the first cache queue; and when the latest total number of in-vehicle units exceeds a preset first total threshold, stop receiving the model aggregation request corresponding to the model data B m,v ; and perform new version model parameter set and new version model accuracy aggregation processing based on the latest first cache queue to obtain the corresponding model parameter set plaintext W m,v+1 and the model accuracy AT m,v+1 ; and set the corresponding new version model transaction price based on a preset pricing rule according to the model accuracy AT m,v+1 , and use the new version model transaction price and the model data B m,vThe model name, model usage, and basic configuration of the model running environment described by the model form a corresponding new version of the model description; and based on a preset model version increment rule, according to the model data B m,v increment the version of the model version v to obtain the corresponding model version v + 1; and set a corresponding model aggregation threshold TH based on a preset model aggregation threshold setting rule m,v+1 ; and from the obtained model version v + 1, the new version of the model description, the plaintext W of the model parameter set m,v+1 the model accuracy AT m,v+1 the model aggregation threshold TH m,v+1 and the model data B m,v the model identifier m and the model loader of the model form a corresponding new version of the model data B m,v+1 ;
[0069] Specifically, when the server performs a total count of the in - vehicle unit numbers on the first cache queue, it counts the total number of model aggregation requests in the first cache queue to obtain the corresponding total number of requests Na; and counts the total number of in - vehicle identifiers in the local aggregation in - vehicle identifier sets of each model aggregation request in the first cache queue to obtain the corresponding total number of in - vehicle identifiers N i , 1 ≤ request index i ≤ Na; and takes the sum of the Na total numbers of in - vehicle identifiers N i as the corresponding total number of in - vehicle units;
[0070] Specifically, when the server performs aggregation processing on the new version of the model parameter set and the new version of the model accuracy based on the latest first cache queue to obtain the corresponding plaintext W of the model parameter set m,v+1 and the model accuracy AT m,v+1 , it records the local aggregation parameter set ciphertext of each model aggregation request in the first cache queue as the corresponding parameter set ciphertext GEW i , records the local model accuracy as the corresponding model accuracy GAT i ; and records the total number of in - vehicle units as the corresponding total number of in - vehicle units Nc; and based on the total number of in - vehicle units Nc, the total number of requests Na, the homomorphic decryption private key and the total number of in - vehicle identifiers N corresponding to all request indices i i , the parameter set ciphertext GEW i and the model accuracy GAT i calculate the corresponding plaintext W of the model parameter set m,v+1 and the model accuracy AT m,v+1 ; where the plaintext W of the model parameter set m,v+1And the model accuracy AT m,v+1 The calculation method is:
[0071]
[0072] DEC() is the homomorphic decryption function, To decrypt the private key based on the homomorphic The parameter set ciphertext GEW i Perform homomorphic decryption operations.
[0073] The embodiment of the present invention provides a vehicle-road-cloud collaborative system for model training and application. As can be seen from the above content, the system includes: a client, a server, a roadside unit set and a vehicle-mounted unit set; wherein the roadside unit set is composed of multiple roadside units, each roadside unit is a blockchain node of two blockchains (training blockchain and transaction blockchain); the vehicle-mounted unit set is composed of multiple vehicle-mounted units; the server and the roadside unit are used to publish the input model of the client according to the training blockchain; the server and the roadside unit are also used to process the three types of model transaction (training, application and evaluation) requirements of the vehicle-mounted unit according to the training and transaction blockchains, and in the transaction processing process, the vehicle-mounted unit that has participated in the training of a certain version of the model is given a free model reward when it needs to use the version of the model; the server, the roadside unit and the vehicle-mounted unit are also used to process the new version of the model training and release tasks of the on-chain model according to the training blockchain according to the federated learning mechanism, and in the training process, the local model aggregation is first completed based on the vehicle-to-vehicle communication, and then the server completes the global model aggregation based on the local aggregation results. The embodiments of the present invention, on the one hand, can use the massive data on the vehicle-mounted unit side to train the model in real time under the premise of ensuring data privacy, thereby improving the effectiveness and generalization of the model; on the other hand, it can delegate the training tasks to the vehicle-mounted units of the entire network for synchronous training, thereby improving the iteration efficiency and real-time performance of the model; on the other hand, it can reduce the model aggregation workload on the server side through the local model aggregation method of vehicle-to-vehicle communication, thereby further improving the aggregation efficiency, iteration efficiency and real-time performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 A module structure diagram of a vehicle-road-cloud collaborative system for model training and application provided by an embodiment of the present invention;
[0075] Figure 2 A schematic diagram of block data of a training blockchain and a transaction blockchain provided in an embodiment of the present invention;
[0076] Figure 3 A schematic diagram of data interaction between a client, a server and a roadside unit during a task processing process provided by an embodiment of the present invention;
[0077] Figure 4This is a schematic diagram of data interaction among a server, an on-vehicle unit, and a roadside unit during another type of task processing provided by an embodiment of the present invention;
[0078] Figure 5 This is a schematic diagram of data interaction among a server, an on-vehicle unit, and a roadside unit during another type of task processing provided by an embodiment of the present invention. Detailed implementation manners
[0079] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Apparently, the described embodiments are only some of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0080] A vehicle-road-cloud collaborative system for model training and application provided by an embodiment of the present invention, as Figure 1 shown in the module structure diagram of a vehicle-road-cloud collaborative system for model training and application provided by an embodiment of the present invention, mainly includes: a client 1, a server 2, a roadside unit set 3, and an on-vehicle unit set 4.
[0081] The client 1 in the embodiment of the present invention is an application program, a web page, a module, a service interface, a device, a terminal, a computer, a server, a system, a platform, or a cloud. The server 2 in the embodiment of the present invention is a remote server / service interface / server, system, platform, or cloud. The roadside unit set 3 in the embodiment of the present invention is composed of multiple roadside units (Road-Side Unit, RSU) 31, and each roadside unit 31 is installed on the roadside of a corresponding road section; each roadside unit 31 is a blockchain node of two preset blockchains; the two blockchains here include a training blockchain and a transaction blockchain. The on-vehicle unit set 4 in the embodiment of the present invention is composed of multiple on-vehicle units (On-Board Unit, OBU) 41, and each on-vehicle unit 41 is installed on a corresponding vehicle.
[0082] The connection relationship of the system modules in the embodiments of the present invention is as follows: The client 1 is connected to the server 2 based on a preset first communication protocol; the server 2 is respectively connected to each roadside unit 31 and each on-vehicle unit 41 based on a preset second communication protocol; each roadside unit 31 is connected to any other roadside unit 31 based on a preset third communication protocol, and is connected to any on-vehicle unit 41 within the current road section based on a preset fourth communication protocol; each on-vehicle unit 41 is connected to other on-vehicle units 41 within its own vehicle-to-vehicle communication range. Here, the mentioned own vehicle-to-vehicle communication range is the effective communication range between the current on-vehicle unit 41 and other on-vehicle units 41, and the radius of this range is specified by the fifth communication protocol.
[0083] Here, the first communication protocol in the embodiments of the present invention includes at least a first wired communication protocol and a first wireless communication protocol; the first wired communication protocol includes at least a serial communication protocol, a USB communication protocol, and a wired Ethernet communication protocol; the first wireless communication protocol includes at least a WiFi communication protocol and a 4G / 5G mobile communication protocol. The second communication protocol in the embodiments of the present invention includes at least a 4G / 5G / LTE mobile communication protocol. The third communication protocol in the embodiments of the present invention includes at least the Uu interface protocol of the 4G / 5G / LTE mobile communication protocol. The fourth communication protocol in the embodiments of the present invention includes at least the PC5 interface protocol of the V2X communication protocol, the Uu interface protocol of the 4G / 5G / LTE mobile communication protocol, and the DSRC communication protocol. The fifth communication protocol in the embodiments of the present invention includes at least the PC5 interface protocol of the V2X communication protocol.
[0084] The client 1 in the embodiments of the present invention is used to receive the model data B input by the customer m,v and send it to the server 2. The server 2 and the roadside unit 31 in the embodiments of the present invention are used to process the model publishing task of the model data B according to the training blockchain. m,v The server 2 and the roadside unit 31 in the embodiments of the present invention are also used to process the model training, application, and evaluation tasks of the on-vehicle unit 41 according to the training blockchain and the transaction blockchain. The server 2, the roadside unit 31, and the on-vehicle unit 41 in the embodiments of the present invention are also used to process the new version model training and publishing tasks of the on-chain model according to the federated learning mechanism based on the training blockchain.
[0085] The model data B in the embodiments of the present invention m,v corresponds to an AI model; the model data B m,v includes a model identifier m, a model version v, a model description, a model loader, a plaintext model parameter set W m,v , a model aggregation threshold TH m,v and a model accuracy AT m,v; wherein, the model identifier m is the unique identifier of the current AI model; the model version v is the version number of the current AI model; the model description includes at least the model name, model usage, basic configuration of the model running environment, and model transaction price. The model name is the name of the current AI model, the model usage is the description of the usage of the current AI model, the basic configuration of the model running environment is the minimum environment configuration information required to run the current AI model, including the basic hardware configuration and software configuration, and the model transaction price is the transaction value of the current AI model in the current version v; the model loader is the running program of the current AI model; the plaintext model parameter set W m,v is the model parameter set of the current AI model in the current version v; the model aggregation threshold TH m,v is an integer; the model accuracy AT m,v is the model accuracy of the current AI model in the current version v; it should be noted that when the model version v is zero, the corresponding model transaction price is zero.
[0086] The training blockchain of the embodiment of the present invention is sequentially linked by a plurality of training blocks. The training block includes a training block header and a training block body. The block header data of the training block header includes at least a block version number, the identifier of the previous block, the hash code of the previous block, the timestamp of the current block, and the Merkle root of the current block; these are all standard block header data items and will not be further described here. It should be noted that as Figure 2 shown in the schematic diagram of the block body data of the training blockchain and the transaction blockchain provided by the embodiment of the present invention, the block body data of the training block body of the embodiment of the present invention includes at least a release type, a publisher identifier, a released model identifier, a released model version, a released parameter set, and a released model accuracy; wherein, the release type includes model release, training release, and aggregation release; when the release type is model release, the block header data of the training block header further includes a released model description, a released model program, a released model public key, and a released aggregation threshold; when the release type is aggregation release, the block header data of the training block header further includes a released vehicle-mounted identifier set.
[0087] The transaction blockchain of the embodiment of the present invention is sequentially linked by a plurality of transaction blocks. The transaction block includes a transaction block header and a transaction block body. The block header data of the transaction block header includes at least a block version number, the identifier of the previous block, the hash code of the previous block, the timestamp of the current block, and the Merkle root of the current block; these are all standard block header data items and will not be further described here. It should be noted that as Figure 2As shown in the figure, the block body data of the transaction block body in the embodiment of the present invention at least includes a transaction type, transaction party identifiers, a transaction model identifier, and a transaction model version; among them, the transaction type includes training, application, and evaluation; when the transaction type is application, the block header data of the transaction block header further includes a transaction amount and transaction party account identifiers; when the transaction type is evaluation, the block header data of the transaction block header further includes a model evaluation accuracy; the transaction party identifiers are composed of a roadside unit identifier and an on-vehicle unit identifier; the transaction party account identifiers are composed of a roadside unit account identifier and an on-vehicle unit account identifier.
[0088] It should be noted that the two blockchains (training blockchain, transaction blockchain) in the embodiment of the present invention are both implemented based on the same type of common blockchain architecture. The common blockchain architecture mentioned here at least includes Ethereum, Bitcoin, EOS, etc.; the block construction mechanism and block chain-up rules (broadcasting, consensus, etc.) of the two blockchains in the embodiment of the present invention are consistent with the block construction / chain-up rules of the common blockchain architecture.
[0089] (1) Model release task:
[0090] Here, the inter-module data interaction information related to the model release task in the embodiment of the present invention is as Figure 3 shown in the data interaction schematic diagram among the client, server, and roadside unit during a type of task processing provided by the embodiment of the present invention. The specific processing process of the model release task is as shown below.
[0091] The server 2 and the roadside unit 31 are used to process the model data B according to the training blockchain m,v for the model release task, specifically including:
[0092] Step A1, the server 2 is used to send the model data B sent by the client 1 m,v and allocate a pair of public and private keys for homomorphic encryption / decryption operations on the model parameter set, denoted as the corresponding homomorphic encryption public key PK m,v and the homomorphic decryption private key SK m,v and save them; and allocate a pair of public and private keys for homomorphic encryption / decryption operations on the training data set for the model data B m,v and denote them as the corresponding homomorphic encryption public key and the homomorphic decryption private key and save them; and use the homomorphic encryption public key PK m,v to perform a homomorphic encryption operation on the plaintext W m,v of the model parameter set of the model data B m,v to obtain the corresponding ciphertext EW m,v of the model parameter set; and use the homomorphic encryption public key m,v corresponding to the model data B Model identifier m, model version v, model description, model loader, encrypted model parameter set EW m,v , model aggregation threshold TH m,v and model accuracy AT m,v to form a corresponding first model release request and send it to a roadside unit 31;
[0093] Here, the encrypted model parameter set EW m,v in the embodiment of the present invention is calculated as follows:
[0094] EW m,v = ENC(W m,v , PK m,v ),
[0095] where ENC() is a homomorphic encryption function, and ENC(W m,v , PK m,v ) is a homomorphic encryption operation on the plaintext model parameter set W m,v based on the homomorphic encryption public key PK m,v ; it should be noted that the homomorphic encryption / decryption algorithms supported in the embodiments of the present invention can be a type of semi-homomorphic encryption / decryption algorithm or a type of fully homomorphic encryption / decryption algorithm; if it is a semi-homomorphic encryption / decryption algorithm, it must be a type of semi-homomorphic encryption / decryption algorithm that supports additive homomorphic encryption, such as the Paillier algorithm; the fully homomorphic encryption / decryption algorithm should at least include algorithms such as BGV, BFV, CKKS, etc.;
[0096] The first model release request includes the homomorphic encryption public key model identifier m, model version v, model description, model loader, encrypted model parameter set EW m,v , model aggregation threshold TH m,v and model accuracy AT m,v ;
[0097] Step A2, the roadside unit 31 is used to perform first training block release processing according to the first model release request sent by the server 2 and the training blockchain.
[0098] In a specific implementation manner of the embodiment of the present invention, when the roadside unit 31 is specifically used to perform first training block release processing according to the first model release request sent by the server 2 and the training blockchain:
[0099] Step A21, extract the corresponding homomorphic encryption public key model identifier m, model version v, model description, model loader, encrypted model parameter set EW m,v , model aggregation threshold TH m,v and model accuracy AT m,v from the first model release request;
[0100] Step A22, and use the roadside unit identifier stored locally in the current roadside unit 31 as the corresponding roadside identifier r;
[0101] Step A23, and set the corresponding release type as model release, set the corresponding publisher identifier as roadside identifier r, set the corresponding release model identifier as model identifier m, set the corresponding release model version as model version v, set the corresponding release model description as model description, set the corresponding release model program as model loader, and set the corresponding release model public key as the homomorphic encryption public key Set the corresponding release parameter set as the encrypted model parameter set EW m,v Set the corresponding release aggregation threshold as model aggregation threshold TH m,v Set the corresponding release model accuracy as model accuracy AT m,v ;
[0102] Step A24, and construct a new training block based on the preset training block construction mechanism according to the release type, publisher identifier, release model identifier, release model version, release model description, release model program, release model public key, release parameter set, release aggregation threshold, and release model accuracy set this time, denoted as the current training block; and add the current training block to the training blockchain based on the preset training block on-chain rule.
[0103] Here, as shown above, the training block construction mechanism and training block on-chain rule of the embodiments of the present invention are the same as the block construction / on-chain rules of common blockchain architectures (such as Ethereum, Bitcoin, EOS, etc.), and will not be further elaborated here.
[0104] (2) Model training, application, and evaluation tasks:
[0105] Here, the inter-module data interaction information related to the model training, application, and evaluation tasks in the embodiments of the present invention is as Figure 4 shown in the data interaction diagram between the server, in-vehicle unit, and roadside unit during another type of task processing provided by the embodiments of the present invention. The specific processing process of the model training, application, and evaluation tasks is as follows.
[0106] The server 2 and the roadside unit 31 are also used to process the model training, application, and evaluation tasks of the in-vehicle unit 41 according to the training blockchain and the transaction blockchain, specifically including:
[0107] Step B1, the in-vehicle unit 41 is used to receive the model transaction demand input by the main control party of the current vehicle as the corresponding transaction demand R; and use the in-vehicle unit identifier, software and hardware environment configuration, and in-vehicle unit account identifier stored locally as the corresponding in-vehicle identifier c and in-vehicle configuration S cand in-vehicle account identifier CT c ; and send the model query request carrying the in-vehicle configuration S c to the roadside unit 31, and receive the returned query model list; and form a corresponding model parameter P from the first model identifier, the first model version, and the first model transaction price of a first model selected by the master party from the query model list m,v and save it, and set the parameter status of the currently saved model parameter P m,v to unaggregated; and send the model transaction request carrying the in-vehicle identifier c, the transaction requirement R, the model parameter P m,v and the in-vehicle account identifier CT c to the roadside unit 31, and receive the returned model transaction feedback; and when the model transaction feedback is successful, send the model download request carrying the in-vehicle identifier c and the model parameter P m,v to the roadside unit 31, and receive the returned model download data; and send the homomorphic decryption private key request carrying the model parameter P m,v to the server 2, and extract the corresponding homomorphic decryption private key SK from the returned homomorphic decryption private key feedback m,v and save it; and identify the transaction requirement R; if the transaction requirement R is a training requirement, generate a public-private key pair for homomorphic encryption / decryption operations for the model download data and record it as the corresponding homomorphic encryption public key PK m,v,c and the homomorphic decryption private key SK m,v,c and save it, and perform local model training processing according to the homomorphic decryption private key SK m,v , the homomorphic encryption public key PK m,v,c , the model download data, and the locally pre-set training dataset D c to obtain the corresponding encrypted training parameter set EW m,v,c and the model accuracy AT m,v,c and save it, and send the training parameter release request carrying the in-vehicle identifier c, the model parameter P m,v , the encrypted training parameter set EW m,v,c and the model accuracy AT m,v,c to the roadside unit 31; if the transaction requirement R is an application requirement, perform local model application and evaluation processing according to the homomorphic decryption private key SK m,v , the model download data, and the training dataset D c to obtain the corresponding evaluation accuracy AU m,v,c , and send the model evaluation release request carrying the in-vehicle identifier c, the model parameter P m,v and the evaluation accuracy AU m,v,c to the roadside unit 31;
[0108] wherein, the transaction requirement R includes a training requirement and an application requirement;
[0109] The query model list includes multiple first model records; the first model record includes a first model identifier, a first model version, a first model name, a first model use, a first model basic configuration, and a first model transaction price;
[0110] The model query request includes vehicle configuration S c ; model parameter P m,v including the first model identifier, the first model version, and the first model transaction price; the model transaction request includes vehicle identifier c, transaction requirement R, model parameter P m,v and vehicle account identifier CT c ; the model download request includes vehicle identifier c and model parameter P m,v ; the model download data includes a released model program, a released model public key, and a released parameter set; the homomorphic decryption private key request includes model parameter P m,v ; the homomorphic decryption private key feedback includes homomorphic decryption private key SK m,v ; the training parameter release request includes vehicle identifier c, model parameter P m,v , ciphertext EW of the training parameter set m,v,c and model accuracy AT m,v,c ; the model evaluation release request includes vehicle identifier c, model parameter P m,v and evaluation accuracy AU m,v,c ;
[0111] The training dataset D in the embodiments of the present invention c is the private model training data on the vehicle unit 41 side; in the conventional training method, the server in the cloud cannot use this dataset for model training, while in the embodiments of the present invention, model training can be performed based on the training datasets D on all vehicle unit 41 sides c for model training;
[0112] Step B2, the roadside unit 31 is further configured to identify requests from the vehicle unit 41; if the current request is a model query request, perform a first training block query process according to the current request and the training blockchain to obtain the corresponding query model list and send it back; if the current request is a model transaction request, perform a first transaction block release process according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and send it back; if the current request is a model download request, perform a transaction and training block query process according to the current request and the training and transaction blockchains to obtain the corresponding model download data and send it back; if the current request is a training parameter release request, perform a second training block release process according to the current request and the training blockchain; if the current request is a model evaluation release request, perform a second transaction block release process according to the current request and the transaction blockchain;
[0113] Step B3, the server 2 is further configured to perform request feedback preparation processing according to the homomorphic decryption private key request sent by the in-vehicle unit 41 to obtain a corresponding homomorphic decryption private key feedback and send it back.
[0114] In another specific implementation manner of the embodiment of the present invention, the in-vehicle unit 41 is specifically configured to, according to the homomorphic decryption private key SK m,v , the homomorphic encryption public key PK m,v,c , the model download data, and the locally preset training data set D c perform local model training processing to obtain a corresponding ciphertext EW of the training parameter set m,v,c and the model accuracy AT m,v,c and save them:
[0115] Step B101, extract the corresponding released model program, released model public key, and released parameter set from the model download data; perform program installation processing on the released model program, and perform corresponding program loading and running processing when the installation processing is successful, and use the currently running model program as the corresponding current model when the loading and running processing is successful; and use the released model public key as the corresponding homomorphic encryption public key and use the released parameter set as the corresponding ciphertext EW of the model parameter set m,v ;
[0116] Step B102, perform homomorphic decryption operation on the ciphertext EW of the model parameter set based on the homomorphic decryption private key SK m,v to obtain the corresponding plaintext W of the model parameter set m,v ; m,v ;
[0117] Here, the calculation method of the plaintext W of the model parameter set m,v is:
[0118] W m,v = DEC(EW m,v , SK m,v );
[0119] where DEC() is a homomorphic decryption function, and DEC(EW m,v , SK m,v ) is to perform homomorphic decryption operation on the ciphertext EW of the model parameter set based on the homomorphic decryption private key SK m,v ; m,v
[0120] Step B103, initialize the model parameters of the current model based on the plaintext W of the model parameter set m,v ;
[0121] Step B104, based on a preset first segmentation ratio, divide the training data set D cIt is split into two sub-datasets, denoted as the corresponding first training set and the first evaluation set; and based on the first training set and a preset first model optimizer, the current model is trained for one round in the supervised model training manner; and at the end of this round of training, the model accuracy of the current model is evaluated based on the first evaluation set to obtain the corresponding first evaluation value;
[0122] Among them, the first splitting ratio is a preset ratio parameter, such as 8:2; the first model optimizer includes at least the SGD optimizer and the Adam optimizer;
[0123] Step B105, identify whether the latest first evaluation value meets the preset first evaluation threshold range; if it meets, go to step B106, if it does not meet, return to step B104 to continue training;
[0124] Here, the first evaluation threshold range is a preset numerical range;
[0125] Step B106, take the latest model parameter set of the current model as the corresponding training parameter set plaintext W m,v,c ; and based on the homomorphic encryption public key and the homomorphic encryption public key PK m,v,c encrypt the training parameter set plaintext W m,v,c twice to obtain the corresponding training parameter set ciphertext EW m,v,c and save it; and take the latest first evaluation value as the corresponding model accuracy AT m,v,c and save it;
[0126] Here, the two-layer encryption method of the training parameter set ciphertext EW m,v,c is as follows:
[0127]
[0128] Among them, ENC() is a homomorphic encryption function,
[0129] is the homomorphic encryption operation based on the homomorphic encryption public key on the training parameter set plaintext W m,v,c ; is the homomorphic encryption operation on the homomorphic encryption operation ciphertext based on the homomorphic encryption public key PK m,v,c for again.
[0130] In another specific implementation manner of the embodiment of the present invention, the on-vehicle unit 41 is specifically used for performing local model application and evaluation processing based on the homomorphic decryption private key SK m,v , the model download data, and the training data set D c to obtain the corresponding evaluation accuracy AU m,v,c when:
[0131] Step B111: Extract the corresponding released model program and released parameter set from the model download data; perform program installation processing on the released model program, and when the installation processing is successful, perform corresponding program loading and running processing. When the loading and running processing is successful, use the currently running model program as the corresponding current model; and use the released parameter set as the corresponding encrypted model parameter set EW m,v ;
[0132] Step B112: Based on the homomorphic decryption private key SK m,v perform homomorphic decryption operation on the encrypted model parameter set EW m,v to obtain the corresponding plaintext model parameter set W m,v :
[0133] Here, the calculation method of the plaintext model parameter set W m,v is:
[0134] W m,v = DEC(EW m,v , SK m,v );
[0135] where DEC() is the homomorphic decryption function, and DEC(EW m,v , SK m,v ) is to perform homomorphic decryption operation on the encrypted model parameter set EW m,v based on the homomorphic decryption private key SK m,v ;
[0136] Step B113: Solidify the model parameters of the current model based on the plaintext model parameter set W m,v ; after the model parameters are solidified, evaluate the model accuracy of the current model based on the training data set D c to obtain the corresponding second evaluation value; and use the second evaluation value as the corresponding evaluation accuracy AU m,v,c ;
[0137] Step B114: Identify whether the obtained second evaluation value meets the preset second evaluation threshold range; if it meets, continuously run the current model and connect the input / output interface of the current model to the service processing flow of the current vehicle-mounted unit 41; if it does not meet, stop running the current model and perform model unloading processing on the current model;
[0138] Here, the second evaluation threshold range is a preset numerical range.
[0139] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically used for when performing the first training block query processing according to the current request and the training blockchain to obtain the corresponding query model list and sending it back:
[0140] Step B201: Extract the corresponding vehicle configuration S from the current request c ;
[0141] Step B202: Query the training blocks on the training blockchain whose release type is model release and the basic configuration of the released model environment meets the vehicle configuration S c to obtain the corresponding set of training blocks;
[0142] Step B203: Identify whether the set of training blocks is recognized;
[0143] Step B204: If so, set the corresponding query model list to be empty;
[0144] Step B205: If not, take each training block in the set of training blocks as the corresponding current block, and use the release model identifier, release model version, model name, model usage, basic configuration of the model running environment, and model transaction price in the block header data of the training block header of the current block as the corresponding first model identifier, first model version, first model name, first model usage, first model basic configuration, and first model transaction price to form a corresponding first model record, and form the corresponding query model list from all the first model records obtained this time;
[0145] Step B206: Send the obtained query model list back to the current vehicle unit 41.
[0146] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically used for: when performing the first transaction block release process according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and sending it back
[0147] Step B211: Extract the corresponding vehicle identifier c, transaction requirement R, model parameter P m,v and vehicle account identifier CT c ;
[0148] Step B212: Extract the corresponding first model identifier, first model version, and first model transaction price from the model parameter P m,v ;
[0149] Step B213: Use the roadside unit identifier and roadside unit account identifier stored locally as the corresponding roadside identifier r and roadside account identifier CT r ;
[0150] Step B214: Form a corresponding roadside-vehicle identifier pair from the roadside identifier r and the vehicle identifier c; and use the vehicle account identifier CT c and the roadside account identifier CTr Form a corresponding roadside-vehicle account identification pair;
[0151] Step B215, and set the corresponding trading parties identification as the roadside-vehicle identification pair, set the corresponding trading model identification as the first model identification, and set the corresponding trading model version as the first model version;
[0152] Step B216, and identify the trading demand R;
[0153] Step B217, if the trading demand R is a training demand, then set the corresponding trading type as training, and construct a new trading block based on the preset trading block construction mechanism according to the trading type, trading parties identification, trading model identification, and trading model version set this time, and record it as the current trading block;
[0154] Step B218, if the trading demand R is an application demand, then confirm the previous version of the first model version based on the preset model version increment rule to obtain the corresponding previous model version, and query the training blocks on the training blockchain with the release type as training release, the publisher identification matching the vehicle identification c, the release model identification matching the first model identification, and the release model version matching the previous model version to obtain the corresponding query block. When the query block is not empty, set the first model trading price to zero, and set the corresponding trading type as application, set the corresponding trading amount as the first model trading price, set the corresponding trading parties account identification as the roadside-vehicle account identification pair, and when the first model trading price is greater than zero, perform a transfer transaction process based on the preset account trading interface according to the first model trading price and the roadside-vehicle account identification pair, and construct a new trading block based on the trading block construction mechanism according to the trading type, trading parties identification, trading model identification, trading model version, trading amount, and trading parties account identification set this time, and record it as the current trading block;
[0155] Here, the model version increment rule of the embodiment of the present invention can be customized according to the actual application requirements, and by default, it is implemented with a single-step increment of adding 1 each time; when confirming the previous version of the first model version according to this rule to obtain the corresponding previous model version, it is to perform a backward deduction on the previous version based on the current first model version; for example, assume that the model version increment rule is implemented with a single-step increment of adding 1 each time, and the first model version is 3, then the previous model version obtained by backward deduction on the previous version is 3 - 1 = 2;
[0156] The account trading interface of the embodiment of the present invention is a pre-set transfer processing interface, and this interface records the vehicle account identification CT in the roadside-vehicle account identification pair c as the payer account number, and records the roadside account identification CT rUse it as the payee's account number, take the first model transaction price as the transfer amount for this time, and initiate a transfer operation from the payer's account to the payee's account with the transfer amount being the transfer amount for this time;
[0157] It should be noted that in the embodiment of the present invention, by querying the training block on the training blockchain with the release type being training release, the publisher identifier matching the vehicle-mounted identifier c, the released model identifier matching the first model identifier, and the released model version matching the previous model version, it can be confirmed whether the vehicle-mounted unit 41 corresponding to the current vehicle-mounted identifier c participated in the model training of the current AI model in the current version. If the queried block is empty, it means not participating; on the contrary, if the queried block is not empty, it means participating. In the embodiment of the present invention, it is stipulated that the vehicle-mounted unit 41 that has participated in the model training of a certain version will be given a free model reward when it needs to use this version of the model. Therefore, when the queried block is not empty, the first model transaction price is set to zero;
[0158] In addition, it should be noted that the embodiment of the present invention can also provide further revenue rewards for the vehicle-mounted unit 41 that has participated in the model training of a certain version. That is, the server 2 obtains the total transaction amount of each version of the model in the most recent time period from the transaction blockchain through the roadside unit 31 every other time period, extracts a part from each total transaction amount according to a set ratio as the corresponding revenue reward, obtains the set of vehicle-mounted units participating in each version of the model from the training blockchain, and distributes the revenue rewards of each version of the model equally to all the vehicle-mounted units 41 in the corresponding set of vehicle-mounted units;
[0159] Step B219, and when the obtained current transaction block is not empty, add the current transaction block to the transaction blockchain based on the preset transaction block chain-up rule, and send back the model transaction feedback specifically set as successful to the current vehicle-mounted unit 41.
[0160] Here, as shown above, the transaction block construction mechanism and transaction block chain-up rule of the embodiment of the present invention are consistent with the block construction / chain-up rules of common blockchain architectures (such as Ethereum, Bitcoin, EOS, etc.), and will not be further elaborated here.
[0161] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically used for when obtaining the corresponding model download data according to the current request and performing transaction and training block query processing with the training and transaction blockchains and sending it back:
[0162] Step B221, extract the corresponding vehicle-mounted identifier c and model parameter P from the current request m,v ;
[0163] Step B222, and extract the corresponding first model identifier and first model version from the model parameter P m,v ;
[0164] Step B223, query the transaction blocks on the transaction blockchain where the transaction type is model training or application, the transaction party identifiers include the vehicle-mounted identifier c, the transaction model identifier matches the first model identifier, and the transaction model version matches the first model version, to obtain the corresponding transaction query blocks;
[0165] Step B224, identify whether the transaction query blocks are empty;
[0166] Step B225, if the transaction query blocks are empty, set the corresponding model download data to be empty;
[0167] Here, if the transaction query blocks are empty, it means that the current vehicle-mounted unit 41 has neither contributed to the model parameters P m,v corresponding to the model version nor purchased them. Therefore, the current vehicle-mounted unit 41 cannot obtain the model data stored on the chain, and the model download data is set to be empty;
[0168] Step B226, if the transaction query blocks are not empty, query the training blocks on the training blockchain where the release type is model release, the released model identifier matches the first model identifier, and the released model version matches the first model version, to obtain the corresponding training query blocks; and identify whether the training query blocks are empty; if so, set the corresponding model download data to be empty; if not, extract the released model program, released model public key, and release parameter set from the training query blocks to form a corresponding model download data;
[0169] Here, the transaction query blocks being empty means that the current vehicle-mounted unit 41 has either contributed to the model parameters P m,v corresponding to the model version or purchased it. At this time, further query the training blockchain to obtain the relevant model data, namely the released model program, released model public key, and release parameter set, and form the model download data from the obtained released model program, released model public key, and release parameter set;
[0170] Step B227, and send the obtained model download data back to the current vehicle-mounted unit 41.
[0171] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically used for performing second training block release processing with the training blockchain according to the current request:
[0172] Step B231, extract the corresponding vehicle-mounted identifier c, model parameters P m,v , ciphertext EW of the training parameter set m,v,c and model accuracy AT m,v,c from the current request;
[0173] Step B232, and from the model parameters Pm,v Extract the corresponding first model identifier and the first model version;
[0174] Step B233, and set the corresponding release type to training release, set the corresponding publisher identifier to vehicle-mounted identifier c, set the corresponding released model identifier to the first model identifier, set the corresponding released model version to the first model version, and set the corresponding release parameter set to the encrypted training parameter set EW m,v,c Set the corresponding released model accuracy to model accuracy AT m,v,c ;
[0175] Step B234, and construct a new training block denoted as the current training block based on the training block construction mechanism according to the release type, publisher identifier, released model identifier, released model version, release parameter set, and released model accuracy set this time; and add the current training block to the training blockchain based on the training block chain-adding rule.
[0176] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically configured to perform second transaction block release processing with the transaction blockchain according to the current request:
[0177] Step B241, extract the corresponding vehicle-mounted identifier c and model parameter P from the current request m,v and evaluation accuracy AU m,v,c ;
[0178] Step B242, and extract the corresponding first model identifier and the first model version from the model parameter P m,v ;
[0179] Step B243, and use the roadside unit identifier stored locally in the current roadside unit 31 as the corresponding roadside identifier r;
[0180] Step B244, and form a corresponding roadside-vehicle-mounted identifier pair from the roadside identifier r and the vehicle-mounted identifier c;
[0181] Step B245, and set the corresponding transaction type to evaluation, set the corresponding transaction party identifiers to the roadside-vehicle-mounted identifier pair, set the corresponding transaction model identifier to the first model identifier, set the corresponding transaction model version to the first model version, and set the corresponding model evaluation accuracy to evaluation accuracy AU m,v,c ;
[0182] Step B246, and construct a new transaction block denoted as the current transaction block based on the transaction block construction mechanism according to the transaction type, transaction party identifiers, transaction model identifier, transaction model version, and model evaluation accuracy set this time; and add the current transaction block to the transaction blockchain based on the transaction block chain-adding rule.
[0183] In another specific implementation manner of the embodiment of the present invention, the server 2 is specifically configured to, when preparing a request feedback according to the homomorphic decryption private key request sent by the vehicle-mounted unit 41 and obtaining the corresponding homomorphic decryption private key feedback and sending it back, extract the corresponding model parameter P from the homomorphic decryption private key request m,v ; and use the model parameter P m,v corresponding homomorphic decryption private key SK m,v as the corresponding current decryption private key; and send back the homomorphic decryption private key feedback carrying the current decryption private key to the current vehicle-mounted unit 41.
[0184] (III) New version model training and release task:
[0185] Here, the inter-module data interaction information related to the new version model training and release task in the embodiment of the present invention is as shown in the data interaction schematic diagram among the server, the vehicle-mounted unit, and the roadside unit during another type of task processing provided by the embodiment of the present invention. The specific processing process of the new version model training and release task is as follows. Figure 5 The server 2, the roadside unit 31, and the vehicle-mounted unit 41 are also used to perform the new version model training and release task of processing the on-chain model according to the federated learning mechanism, specifically including:
[0186] Step C1, the vehicle-mounted unit 41 is also used to establish a corresponding encrypted data transmission channel with other vehicle-mounted units 41 within its vehicle-to-vehicle communication range through a preset key negotiation mechanism;
[0187] Here, the key negotiation mechanism in the embodiment of the present invention is a conventional key negotiation mechanism for generating process keys / session keys, such as the key negotiation mechanism based on the DH algorithm and the key negotiation based on PSK; to improve the vehicle-to-vehicle communication efficiency, the embodiment of the present invention preferably selects a key negotiation mechanism that can output the key of the symmetric encryption / decryption algorithm. In this case, each encrypted data transmission channel between two vehicle-mounted units 41 in the embodiment of the present invention corresponds to a unique channel negotiation key; it should be noted that the embodiment of the present invention can also select a key negotiation mechanism that can output the key of the asymmetric encryption / decryption algorithm, such as the key negotiation mechanism based on the RSA algorithm. In this case, each encrypted data transmission channel between two vehicle-mounted units 41 in the embodiment of the present invention corresponds to two pairs of public and private key pairs, and both parties of the channel share each other's public keys, encrypt based on the other party's public key when processing data encryption, and decrypt based on its own private key when processing data decryption;
[0188] Here, the key negotiation mechanism in the embodiment of the present invention is a conventional key negotiation mechanism for generating process keys / session keys, such as the key negotiation mechanism based on the DH algorithm and the key negotiation based on PSK; to improve the vehicle-to-vehicle communication efficiency, the embodiment of the present invention preferably selects a key negotiation mechanism that can output the key of the symmetric encryption / decryption algorithm. In this case, each encrypted data transmission channel between two vehicle-mounted units 41 in the embodiment of the present invention corresponds to a unique channel negotiation key; it should be noted that the embodiment of the present invention can also select a key negotiation mechanism that can output the key of the asymmetric encryption / decryption algorithm, such as the key negotiation mechanism based on the RSA algorithm. In this case, each encrypted data transmission channel between two vehicle-mounted units 41 in the embodiment of the present invention corresponds to two pairs of public and private key pairs, and both parties of the channel share each other's public keys, encrypt based on the other party's public key when processing data encryption, and decrypt based on its own private key when processing data decryption;
[0189] Step C2, the vehicle-mounted unit 41 is also used to regularly use the vehicle-mounted unit identifier stored locally as the corresponding current vehicle identifier at a preset first time frequency; and for the model parameter P stored locallym,v Identify whether the parameter status of m,v has been switched to aggregated to obtain the corresponding current recognition result; if the current recognition result is no, send the training times query request carrying the model parameter P to the roadside unit 31, and extract the corresponding total training times and aggregation threshold parameter from the returned times query feedback; and when the total training times is greater than or equal to the aggregation threshold parameter, set the parameter status of the model parameter P to aggregated, and perform aggregated unit positioning processing according to the model parameter P to obtain the corresponding aggregated unit identifier; and identify whether the aggregated unit identifier matches the current vehicle-mounted identifier; if not, use the vehicle-mounted unit 41 corresponding to the aggregated unit identifier as the corresponding current aggregated unit, and send the corresponding homomorphic decryption private key SK of the model parameter P to the current aggregated unit; if it matches, receive the homomorphic decryption private key SK sent by other vehicle-mounted units 41, and form a corresponding first private key set by all the received homomorphic decryption private keys SK and the homomorphic decryption private key SK of the current vehicle-mounted unit 41 itself, and form a corresponding first identifier set G{c} by all the vehicle-mounted identifiers c corresponding to the first private key set, and send the parameter set download request carrying the first identifier set G{c} and the model parameter P to the roadside unit 31, and receive the returned parameter set download data, and perform local model aggregation processing based on the first private key set and the parameter set download data to obtain the corresponding aggregated parameter set ciphertext GEW and the aggregated model accuracy GAT, and use the current vehicle-mounted identifier as the corresponding first vehicle-mounted identifier, and send the aggregated parameter release request carrying the first vehicle-mounted identifier, the first identifier set G{c}, the model parameter P, the aggregated parameter set ciphertext GEW, and the aggregated model accuracy GAT to the roadside unit 31; m,v m,v m,v m,v,c m,v,c m,v,c m,v,c m,v m,v m,v m,v m,v m,v
[0190] Among them, the first time frequency is a preset time frequency number;
[0191] The training times query request includes the model parameter P; m,v The times query feedback includes the total training times and the aggregation threshold parameter; the parameter set download request includes the first identifier set G{c} and the model parameter P; m,v , the first identification set G{c} includes multiple vehicle-mounted identifications c; the parameter set download data consists of one or more vehicle-mounted training parameters; the vehicle-mounted training parameters include a release parameter set and a release model accuracy, and the vehicle-mounted training parameters of the parameter set download data correspond one-to-one with the vehicle-mounted identification c of the parameter set download request; the aggregated parameter release request includes a first vehicle-mounted identification, the first identification set G{c}, and model parameters P m,v , the encrypted aggregated parameter set GEW m,v and the aggregated model accuracy GAT m,v ;
[0192] Here, the principle of the current step can be understood as that a group of neighboring vehicle-mounted units 41, after discovering that the total training amount, i.e., the total number of training times, of the version model corresponding to a certain model parameter P m,v exceeds the corresponding aggregated threshold parameter, first select a vehicle-mounted unit 41 from this group of vehicle-mounted units 41 as the aggregation unit through pairwise vehicle-to-vehicle communication. Then, the remaining vehicle-mounted units 41 in this group of vehicle-mounted units 41 except this aggregation unit can be regarded as non-aggregation units; then each non-aggregation unit transfers its own homomorphic decryption private key SK m,v,c to this aggregation unit, so that this aggregation unit can obtain the private key set of this group of vehicle-mounted units 41 (including the aggregation unit itself), that is, the first private key set; then this aggregation unit can perform local model aggregation processing based on the first private key set and the parameter set download data; it should be noted that each vehicle-mounted unit 41 (aggregation unit, non-aggregation unit) in the embodiment of the present invention m,v will only participate in local model aggregation once for a certain model parameter P m,v , which is achieved by setting the parameter status of the model parameter P m,v . If the parameter status of the model parameter P is aggregated, it will no longer participate in other local model aggregations; through this local model aggregation, a large amount of aggregation workload can be decentralized to the vehicle-mounted unit 41 side, so that the model aggregation workload of the server 2 will be greatly reduced;
[0193] Step C3, the roadside unit 31 is further configured to identify requests from the vehicle-mounted unit 41; if the current request is a training times query request, perform a second training block query process according to the current request and the training blockchain to obtain a corresponding times query feedback and send it back; if the current request is a parameter set download request, perform a third training block query process according to the current request and the training blockchain to obtain corresponding parameter set download data and send it back; if the current request is an aggregated parameter release request, perform a third training block release process according to the current request and the training blockchain to obtain a corresponding model aggregation request and send it to the server 2;
[0194] Among them, the model aggregation request includes a global aggregation model identifier, a global aggregation model version, a ciphertext of a local aggregation parameter set, a set of local aggregation vehicle identifiers, and a local model accuracy;
[0195] Step C4, the server 2 is further configured to perform global model aggregation processing on the model aggregation request sent by the roadside unit 31 to obtain the corresponding new version model data B m,v+1 ;
[0196] Among them, the new version model data B m,v+1 includes a model identifier m, a model version v+1, a new version model description, a model loader, a plaintext of a model parameter set W m,v+1 , a model aggregation threshold TH m,v+1 and a model accuracy AT m,v+1 ; The new version model description includes at least a model name, a model usage, a basic configuration of a model running environment, and a new version model transaction price;
[0197] Step C5, the server 2 is further configured to allocate a pair of public and private keys for performing homomorphic encryption / decryption operations on the model parameter set for the new version model data B m,v+1 and record them as the corresponding homomorphic encryption public key PK m,v+1 and homomorphic decryption private key SK m,v+1 and save them; and allocate a pair of public and private keys for performing homomorphic encryption / decryption operations on the training data set for the new version model data B m,v+1 and record them as the corresponding homomorphic encryption public key and homomorphic decryption private key and save them; and perform homomorphic encryption operation on the plaintext W m,v+1 of the model parameter set of the new version model data B m,v+1 by the homomorphic encryption public key PK m,v+1 to obtain the corresponding ciphertext of the model parameter set EW m,v+1 ; and the new version model data B m,v+1 corresponding homomorphic encryption public key model identifier m, model version v+1, new version model description, model loader, ciphertext of model parameter set EW m,v+1 , model aggregation threshold TH m,v+1 and model accuracy AT m,v+1 are used to form a corresponding second model release request and send it to a roadside unit 31;
[0198] Here, the calculation method of the ciphertext EW m,v+1 of the model parameter set in the embodiment of the present invention is:
[0199] EW m,v+1 = ENC(W m,v+1 ,PK m,v+1 );
[0200] Among them, ENC(W m,v+1 , PK m,v+1 ) performs a homomorphic encryption operation on the plaintext W of the model parameter set based on the homomorphic encryption public key PK m,v+1 ; m,v+1 The second model release request includes the homomorphic encryption public key
[0201] model identifier m, model version v + 1, new model description, model loader, ciphertext EW of the model parameter set , model aggregation threshold TH m,v+1 and model accuracy AT m,v+1 ; m,v+1
[0202] Step C6, the roadside unit 31 is further configured to perform a fourth training block release process according to the second model release request sent by the server 2 and the training blockchain.
[0203] In another specific implementation manner of the embodiment of the present invention, the in-vehicle unit 41 is specifically configured to, when obtaining the corresponding aggregation unit identifier through the aggregation unit positioning process according to the model parameter P m,v :
[0204] Step C201, use the in-vehicle unit identifiers of the in-vehicle units 41 connected to the current in-vehicle unit 41 within its own vehicle-to-vehicle communication range as a corresponding second vehicle-mounted identifier; and also use the in-vehicle unit identifier of the current in-vehicle unit 41 as a corresponding second vehicle-mounted identifier;
[0205] Step C202, by means of individual request inquiries, count the total number of unit connections between the in-vehicle units 41 corresponding to each second vehicle-mounted identifier and other in-vehicle units 41 to obtain the corresponding first connection total; and sort the second vehicle-mounted identifiers in descending order of the first connection total to obtain the corresponding first sequence;
[0206] Step C203, initialize the aggregation unit identifier as empty; starting from the first second vehicle identifier in the first sequence, perform a sequential traversal of all second vehicle identifiers in the sequence; during this round of sequential traversal, use the currently traversed second vehicle identifier as the corresponding current identifier; use the vehicle unit 41 corresponding to the current identifier as the corresponding current target unit; identify whether the current target unit is the current vehicle unit 41; if the current target unit is the current vehicle unit 41, stop this round of polling and set the corresponding aggregation unit identifier as the vehicle unit identifier of the current vehicle unit 41; if the current target unit is not the current vehicle unit 41, identify whether the current target unit is willing to be an aggregation unit through a request inquiry to obtain the corresponding first identification result, and identify whether the first identification result is willing. If the first identification result is willing, stop this round of polling and set the corresponding aggregation unit identifier as the vehicle unit identifier of the current target unit. If the first identification result is not willing, move to the next second vehicle identifier and continue traversing until the traversal of the last second vehicle identifier ends.
[0207] In another specific implementation manner of the embodiment of the present invention, the vehicle unit 41 is specifically configured to, when sending the homomorphic decryption private key SK m,v corresponding to the model parameter P m,v,c to the current aggregation unit:
[0208] Step C211, use the channel negotiation key of the encryption data transmission channel corresponding to the current aggregation unit as the corresponding channel encryption key;
[0209] Step C212, and encrypt the homomorphic decryption private key SK m,v,c based on the channel encryption key to obtain the corresponding first encrypted ciphertext; and send the first encrypted ciphertext to the current aggregation unit through the encryption data transmission channel corresponding to the current aggregation unit.
[0210] In another specific implementation manner of the embodiment of the present invention, the vehicle unit 41 is specifically configured to, when receiving the homomorphic decryption private key SK m,v,c sent by other vehicle units 41:
[0211] Step C221, use the channel negotiation keys corresponding to each encryption data transmission channel as the corresponding channel decryption keys;
[0212] Step C222, and when receiving a corresponding first encrypted ciphertext through one of the encryption data transmission channels, decrypt the first encrypted ciphertext based on the corresponding channel decryption key to obtain the corresponding first decrypted plaintext, and use the first decrypted plaintext as the homomorphic decryption private key SK m,v,c .
[0213] In another specific implementation manner of the embodiment of the present invention, the vehicle-mounted unit 41 is specifically configured to perform local model aggregation processing on the downloaded data based on the first private key set and the parameter set to obtain the corresponding aggregated parameter set ciphertext GEW m,v and the aggregated model accuracy GAT m,v when:
[0214] Step C231, count the total number of vehicle-mounted training parameters in the parameter set downloaded data to obtain the corresponding second total number Q, where Q is a positive integer greater than zero; and record the release parameter set and the release model accuracy of each vehicle-mounted training parameter as the corresponding training parameter set ciphertext EW m,v,j and the model accuracy AT m,v,j , 1 ≤ index j ≤ Q; and record the homomorphic decryption private key SK m,v,c in the first private key set corresponding to each vehicle-mounted training parameter as the corresponding homomorphic decryption private key SK m,v,j ;
[0215] Step C232, calculate the corresponding aggregated parameter set ciphertext GEW m,v,j and the aggregated model accuracy GAT m,v,j and the model accuracy AT m,v,j from all the homomorphic decryption private keys SK m,v and the aggregated model accuracy GAT m,v ;
[0216] Here, the calculation method of the aggregated parameter set ciphertext GEW m,v and the aggregated model accuracy GAT m,v in the embodiment of the present invention is:
[0217] GEW m,v = add(DEC(EW m,v,j ,SK m,v,j )|j ∈ [1,Q]),
[0218]
[0219] where DEC() is a homomorphic decryption function, and DEC(EW m,v,j ,SK m,v,j ) is to perform a homomorphic decryption operation on the training parameter set ciphertext EW m,v,j based on the homomorphic decryption private key SK m,v,j ; add() is a homomorphic addition operation function; add(DEC(EW m,v,j ,SK m,v,j )|j ∈ [1,Q]) is to perform a homomorphic addition operation on the homomorphic decryption results of Q aggregated parameter set ciphertexts GEW m,v .
[0220] In another specific implementation manner of the embodiment of the present invention, when the roadside unit 31 is specifically used to perform a second training block query process on the training blockchain according to the current request to obtain the corresponding number query feedback and send it back:
[0221] Step C301, extract the corresponding model parameter P from the current request m,v ;
[0222] Step C302, and extract the corresponding first model identifier and first model version from the model parameter P m,v ;
[0223] Step C303, query the training blocks on the training blockchain with the release type of model release, the released model identifier matching the first model identifier, and the released model version matching the first model version to obtain the corresponding query block;
[0224] Step C304, identify whether the query block is empty. If so, set the corresponding aggregation threshold parameter to zero. If not, extract the corresponding release aggregation threshold from the query block as the corresponding aggregation threshold parameter;
[0225] Step C305, query the total number of training blocks on the training blockchain with the release type of training release, the released model identifier matching the first model identifier, and the released model version matching the first model version, and use the query result as the corresponding total number of training times;
[0226] Step C306, form the corresponding number query feedback from the obtained total number of training times and the aggregation threshold parameter and send it back to the current vehicle-mounted unit 41.
[0227] In another specific implementation manner of the embodiment of the present invention, when the roadside unit 31 is specifically used to perform a third training block query process on the training blockchain according to the current request to obtain the corresponding parameter set download data and send it back:
[0228] Step C311, extract the corresponding first identifier set G{c} and model parameter P from the current request m,v ;
[0229] Step C312, and extract the corresponding first model identifier and first model version from the model parameter P m,v ;
[0230] Step C313, and use each vehicle-mounted identifier c in the first identifier set G{c} as the corresponding current vehicle-mounted identifier, and query the training blocks on the training blockchain with the release type being training release, the publisher identifier matching the current vehicle-mounted identifier, the release model identifier matching the first model identifier, and the release model version matching the first model version, and extract the release parameter set and release model accuracy of the query block to form a corresponding vehicle-mounted training parameter;
[0231] Step C314, and form a corresponding parameter set from all the obtained vehicle-mounted training parameters, download the data, and send it back to the current vehicle unit 41.
[0232] In another specific implementation manner of the embodiment of the present invention, when the roadside unit 31 specifically sends a corresponding model aggregation request to the server 2 according to the current request and performs the third training block release process with the training blockchain:
[0233] Step C321, extract the corresponding first vehicle-mounted identifier, first identifier set G{c}, model parameter P m,v , ciphertext GEW of the aggregation parameter set m,v and aggregation model accuracy GAT m,v from the current request; and extract the corresponding first model identifier and first model version from the model parameter P m,v ;
[0234] Step C322, and set the corresponding release type to aggregation release, set the corresponding publisher identifier to the first vehicle-mounted identifier, set the corresponding release model identifier to the first model identifier, set the corresponding release model version to the first model version, set the corresponding release parameter set to the ciphertext GEW of the aggregation parameter set m,v , set the corresponding release vehicle-mounted identifier set to the first identifier set G{c}, and set the corresponding release model accuracy to the aggregation model accuracy GAT m,v ;
[0235] Step C323, and construct a new training block based on the training block construction mechanism according to the release type, publisher identifier, release model identifier, release model version, release parameter set, release vehicle-mounted identifier set, and release model accuracy set this time, and record it as the current training block; and add the current training block to the training blockchain based on the training block on-chain rule;
[0236] Step C324, and set the corresponding global aggregation model identifier to the first model identifier, set the corresponding global aggregation model version to the first model version, and set the corresponding local aggregation parameter set ciphertext to the ciphertext GEW of the aggregation parameter set m,v, set the corresponding local aggregated vehicle-mounted identification set as the first identification set G{c}, and set the corresponding local model accuracy as the aggregated model accuracy GAT m,v , and form a corresponding model aggregation request composed of the globally aggregated model identification, globally aggregated model version, local aggregation parameter set ciphertext, local aggregated vehicle-mounted identification set, and local model accuracy set this time, and send it to server 2.
[0237] In another specific implementation manner of the embodiment of the present invention, server 2 is specifically configured to perform global model aggregation processing on the model aggregation request sent by roadside unit 31 to obtain the corresponding new version model data B m,v+1 when:
[0238] Step C41, preset a corresponding first cache queue for model data B m,v ;
[0239] Step C42, and when receiving each model aggregation request corresponding to model data B m,v , store the received model aggregation request in the corresponding first cache queue;
[0240] Step C43, and when a new model aggregation request is added to the first cache queue each time, perform a count of the total number of vehicle-mounted units on the first cache queue;
[0241] Here, in another specific implementation manner of the embodiment of the present invention, server 2 is specifically configured to, when performing a count of the total number of vehicle-mounted units on the first cache queue, count the total number of model aggregation requests in the first cache queue to obtain the corresponding total number of requests Na; and count the total number of vehicle-mounted identifications in the local aggregated vehicle-mounted identification sets of each model aggregation request in the first cache queue to obtain the corresponding total number of vehicle-mounted identifications N i , 1 ≤ request index i ≤ Na; and take the sum of Na total numbers of vehicle-mounted identifications N i as the corresponding total number of vehicle-mounted units;
[0242] Step C44, and when the latest total number of vehicle-mounted units exceeds a preset first total number threshold, stop receiving model aggregation requests corresponding to model data B m,v ; and perform new version model parameter set and new version model accuracy aggregation processing based on the latest first cache queue to obtain the corresponding model parameter set plaintext W m,v+1 and model accuracy AT m,v+1 ;
[0243] Here, the first total number threshold is a preset threshold parameter;
[0244] In another specific implementation manner of the embodiment of the present invention, the server 2 is specifically configured to perform aggregation processing on the new version model parameter set and the new version model accuracy based on the latest first cache queue to obtain the corresponding model parameter set plaintext W m,v+1 and the model accuracy AT m,v+1 When:
[0245] Step C4401, record the local aggregation parameter set ciphertext of each model aggregation request in the first cache queue as the corresponding parameter set ciphertext GEW i and record the local model accuracy as the corresponding model accuracy GAT i ;
[0246] Step C4402, and record the total number of in-vehicle units as the corresponding total number of in-vehicle units Nc;
[0247] Step C4403, and based on the total number of in-vehicle units Nc, the total number of requests Na, the homomorphic decryption private key and the total number of vehicle identifiers N corresponding to all request indices i i , the parameter set ciphertext GEW i and the model accuracy GAT i calculate the corresponding model parameter set plaintext W m,v+1 and the model accuracy AT m,v+1 ;
[0248] Here, the model parameter set plaintext W m,v+1 and the model accuracy AT m,v+1 are calculated as follows:
[0249]
[0250] DEC() is a homomorphic decryption function, is to perform a homomorphic decryption operation on the parameter set ciphertext GEW based on the homomorphic decryption private key i ;
[0251] Step C45, and set the corresponding new version model transaction price based on a preset pricing rule according to the model accuracy AT m,v+1 , and the new version model transaction price and the model name, model use, and basic configuration of the model running environment described in the model data B m,v constitute a corresponding new version model description;
[0252] Here, the pricing rule of the embodiment of the present invention is a preset processing rule for pricing the model, which can be customized based on application requirements;
[0253] Step C46, and based on a preset model version increment rule according to the model data B m,vIncrement the model version v to obtain the corresponding model version v+1;
[0254] Step C47, and set a corresponding model aggregation threshold TH based on a preset model aggregation threshold setting rule m,v+1 ;
[0255] Here, the model aggregation threshold setting rule of the embodiment of the present invention is a preset processing rule, which can be customized based on application requirements; in general, the model aggregation threshold TH can be directly copied m,v As the new model aggregation threshold TH m,v+1 ;
[0256] Step C48, and from the obtained model version v+1, new model description, plaintext W of the model parameter set m,v+1 , model accuracy AT m,v+1 , model aggregation threshold TH m,v+1 And model data B m,v The model identifier m and the model loader of form a corresponding new version of model data B m,v+1 .
[0257] In another specific implementation manner of the embodiment of the present invention, the roadside unit 31 is specifically used for performing fourth training block publishing processing according to the second model publishing request sent by the server 2 and the training blockchain:
[0258] Step C61, extract the corresponding homomorphic encryption public key from the second model publishing request Model identifier m, model version v+1, new model description, model loader, ciphertext EW of the model parameter set m,v+1 , model aggregation threshold TH m,v+1 And model accuracy AT m,v+1 ;
[0259] Step C62, and use the roadside unit identifier stored locally in the current roadside unit 31 as the corresponding roadside identifier r;
[0260] Step C63, and set the corresponding release type to model release, set the corresponding publisher identifier to roadside identifier r, set the corresponding released model identifier to model identifier m, set the corresponding released model version to model version v+1, set the corresponding released model description to new model description, set the corresponding released model program to model loader, set the corresponding released model public key to homomorphic encryption public key Set the corresponding released parameter set to ciphertext EW of the model parameter set m,v+1 , set the corresponding release aggregation threshold to model aggregation threshold TH m,v+1 , set the corresponding released model accuracy to model accuracy AT m,v+1 ;
[0261] Step C64, based on the training block construction mechanism, a new training block is constructed according to the publishing type, publisher identifier, publishing model identifier, publishing model version, publishing model description, publishing model program, publishing model public key, publishing parameter set, publishing aggregation threshold and publishing model accuracy set this time, and recorded as the current training block; and the current training block is added to the training blockchain based on the training block chain rules.
[0262] The embodiment of the present invention provides a vehicle-road-cloud collaborative system for model training and application. As can be seen from the above content, the system includes: a client, a server, a roadside unit set and a vehicle-mounted unit set; wherein the roadside unit set is composed of multiple roadside units, each roadside unit is a blockchain node of two blockchains (training blockchain and transaction blockchain); the vehicle-mounted unit set is composed of multiple vehicle-mounted units; the server and the roadside unit are used to publish the input model of the client according to the training blockchain; the server and the roadside unit are also used to process the three types of model transaction (training, application and evaluation) requirements of the vehicle-mounted unit according to the training and transaction blockchains, and in the transaction processing process, the vehicle-mounted unit that has participated in the training of a certain version of the model is given a free model reward when it needs to use the version of the model; the server, the roadside unit and the vehicle-mounted unit are also used to process the new version of the model training and release tasks of the on-chain model according to the training blockchain according to the federated learning mechanism, and in the training process, the local model aggregation is first completed based on the vehicle-to-vehicle communication, and then the server completes the global model aggregation based on the local aggregation results. The embodiments of the present invention, on the one hand, can use the massive data on the vehicle-mounted unit side to train the model in real time under the premise of ensuring data privacy, thereby improving the effectiveness and generalization of the model; on the other hand, it can delegate the training tasks to the vehicle-mounted units of the entire network for synchronous training, thereby improving the iteration efficiency and real-time performance of the model; on the other hand, it can reduce the model aggregation workload on the server side through the local model aggregation method of vehicle-to-vehicle communication, thereby further improving the aggregation efficiency, iteration efficiency and real-time performance of the model.
[0263] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0264] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the art.
[0265] The specific embodiments described above have further elaborated on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A vehicle-road-cloud collaborative system for model training and application, characterized in that: The system comprises: a client, a server, a roadside unit set and a vehicle-mounted unit set; The roadside unit set is composed of multiple roadside units, each of which is installed on the side of a corresponding road section; each of the roadside units is a blockchain node of two preset blockchains; the two blockchains include a training blockchain and a transaction blockchain; the on-board unit set is composed of multiple on-board units, each of which is installed on a corresponding vehicle; the client is connected to the server based on a preset first communication protocol; the server is connected to each of the roadside units and each of the on-board units respectively based on a preset second communication protocol; each of the roadside units is connected to any other roadside unit based on a preset third communication protocol, and is connected to any on-board unit in the current road section based on a preset fourth communication protocol; each of the on-board units is connected to other on-board units within its own vehicle-to-vehicle communication range based on a preset fifth communication protocol; the own vehicle-to-vehicle communication range is the effective communication range of the current on-board unit and other on-board units, and the range radius of the own vehicle-to-vehicle communication range is specified by the fifth communication protocol; The client is used to receive model data B input by the customer m,v Send to the server; the server and the roadside unit are used to process the model data B according to the training blockchain m,v The server and the roadside unit are also used to process the model training, application and evaluation tasks of the vehicle-mounted unit according to the training blockchain and the transaction blockchain; the server, the roadside unit and the vehicle-mounted unit are also used to process the new version model training and release tasks of the on-chain model according to the training blockchain according to the federated learning mechanism.
2. The vehicle-road-cloud collaborative system for model training and application according to claim 1, characterized in that: The first communication protocol includes at least a first wired communication protocol and a first wireless communication protocol; the first wired communication protocol includes at least a serial communication protocol, a USB communication protocol, and a wired Ethernet communication protocol; The first wireless communication protocol includes at least a WiFi communication protocol and a 4G / 5G mobile communication protocol; the second communication protocol includes at least a 4G / 5G / LTE mobile communication protocol; the third communication protocol includes at least a Uu interface protocol of a 4G / 5G / LTE mobile communication protocol; the fourth communication protocol includes at least a PC5 interface protocol of a V2X communication protocol, a Uu interface protocol of a 4G / 5G / LTE mobile communication protocol, and a DSRC communication protocol; the fifth communication protocol includes at least a PC5 interface protocol of a V2X communication protocol.
3. The vehicle-road-cloud collaborative system for model training and application according to claim 1, characterized in that: The model data B m,v Including model identifier m, model version v, model description, model loader, model parameter set plain text W m,v , the model aggregation threshold TH m,v and model accuracy AT m,v ; The model description at least includes the model name, model purpose, model operating environment basic configuration and model transaction price; the model operating environment basic configuration includes hardware basic configuration and software basic configuration; when the model version v is zero, the model transaction price is zero; The training blockchain is composed of a plurality of training blocks linked in sequence; the training block includes a training block header and a training block body; the block header data of the training block header includes at least a block version number, a previous block identifier, a previous block hash code, a current block timestamp, and a current block Merkle root; the block body data of the training block body includes at least a release type, a publisher identifier, a release model identifier, a release model version, a release parameter set, and a release model accuracy; the release types include model release, training release, and aggregate release; when the release type is model release, the block header data of the training block header also includes a release model description, a release model program, a release model public key, and a release aggregation threshold; when the release type is aggregate release, the block header data of the training block header also includes a release vehicle identification set; The transaction blockchain is composed of multiple transaction blocks linked in sequence; the transaction block includes a transaction block header and a transaction block body; the block header data of the transaction block header at least includes a block version number, a previous block identifier, a previous block hash code, a current block timestamp, and a current block Merkle root; the block body data of the transaction block body at least includes a transaction type, an identifier of both transaction parties, a transaction model identifier, and a transaction model version; the transaction types include training, application, and evaluation; when the transaction type is application, the block header data of the transaction block header also includes a transaction amount and an account identifier of both transaction parties; when the transaction type is evaluation, the block header data of the transaction block header also includes a model evaluation accuracy; the identifiers of both transaction parties consist of a roadside unit identifier and a vehicle-mounted unit identifier; the account identifiers of both transaction parties consist of a roadside unit account identifier and a vehicle-mounted unit account identifier.
4. The vehicle-road-cloud collaborative system for model training and application according to claim 3, characterized in that: The server and the roadside unit are used to process the model data B according to the training blockchain m,v The model publishing tasks include: The server is used to send the model data B to the client. m,v Assign a set of public-private key pairs for homomorphic encryption / decryption operations on the model parameter set, denoted as the corresponding homomorphic encryption public key PK m,v and homomorphic decryption private key SK m,v and save; and for the model data B m,v Assign a set of public and private key pairs for homomorphic encryption / decryption operations on the training data set, denoted as the corresponding homomorphic encryption public key and homomorphic decryption private key and save; and the homomorphic encryption public key PK m,v For the model data B m,v The model parameter set plaintext W m,v Perform homomorphic encryption operation to obtain the corresponding model parameter set ciphertext EW m,v ; and by the model data B m,v The corresponding homomorphic encryption public key The model identifier m, the model version v, the model description, the model loader, the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v The first model publishing request corresponding to the model is sent to one of the roadside units; wherein the model parameter set ciphertext EW m,v The calculation method is: EW m,v =ENC(W m,v ,PK m,v ), ENC() is the homomorphic encryption function, ENC(W m,v ,PK m,v ) is based on the homomorphic encryption public key PK m,v The model parameter set plaintext W m,v Perform homomorphic encryption operation; the first model publishing request includes the homomorphic encryption public key The model identifier m, the model version v, the model description, the model loader, and the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v ; The roadside unit is used to perform a first training block publishing process according to the first model publishing request sent by the server and the training blockchain.
5. The vehicle-road-cloud collaborative system for model training and application according to claim 4, characterized in that: The roadside unit is specifically configured to extract the corresponding homomorphic encryption public key from the first model publishing request when performing the first training block publishing process according to the first model publishing request sent by the server and the training blockchain. The model identifier m, the model version v, the model description, the model loader, the model parameter set ciphertext EW m,v , the model aggregation threshold TH m,v And the model accuracy AT m,v ; And the roadside unit identifier stored locally in the current roadside unit is used as the corresponding roadside identifier r; and the corresponding publishing type is set to model publishing, the corresponding publisher identifier is set to the roadside identifier r, the corresponding publishing model identifier is set to the model identifier m, the corresponding publishing model version is set to the model version v, the corresponding publishing model description is set to the model description, the corresponding publishing model program is set to the model loader program, and the corresponding publishing model public key is set to the homomorphic encryption public key Set the corresponding release parameter set to the model parameter set ciphertext EW m,v , set the corresponding release aggregation threshold to the model aggregation threshold TH m,v , set the corresponding published model accuracy to the model accuracy AT m,v ; and based on the preset training block construction mechanism, a new training block is constructed according to the publishing type, the publisher identifier, the publishing model identifier, the publishing model version, the publishing model description, the publishing model program, the publishing model public key, the publishing parameter set, the publishing aggregation threshold and the publishing model accuracy set this time, and recorded as the current training block; And based on the preset training block chain rules, the current training block is added to the training blockchain.
6. The vehicle-road-cloud collaborative system for model training and application according to claim 4, characterized in that: The server and the roadside unit are further used to process the model training, application and evaluation tasks of the vehicle-mounted unit according to the training blockchain and the transaction blockchain, specifically including: The vehicle-mounted unit is used to receive the model transaction demand input by the master controller of the current vehicle as the corresponding transaction demand R; and the vehicle-mounted unit identification, software and hardware environment configuration, and vehicle-mounted unit account identification stored locally as the corresponding vehicle-mounted identification c, vehicle-mounted configuration S c and the vehicle account ID CT c ; and will carry the vehicle configuration S c The model query request is sent to the roadside unit, and the query model list sent back is received; and the first model identifier, the first model version and the first model transaction price of a first model record selected by the main control party from the query model list are combined into a corresponding model parameter P m,v and save it, and the currently saved model parameter P m,v The parameter state is set to unaggregated; and the vehicle identification c, the transaction demand R, the model parameter P m,v and the vehicle account identifier CT c The model transaction request is sent to the roadside unit, and the model transaction feedback is received; and when the model transaction feedback is successful, the vehicle identifier c and the model parameter P are carried m,v The model download request is sent to the roadside unit, and the model download data sent back is received; and the model parameters P are carried m,v The homomorphic decryption private key request is sent to the server, and the corresponding homomorphic decryption private key SK is extracted from the homomorphic decryption private key feedback sent back. m,v and save; and identify the transaction demand R; if the transaction demand R is a training demand, generate a pair of public and private key pairs for homomorphic encryption / decryption operations for the model download data and record them as the corresponding homomorphic encryption public key PK m,v,c and homomorphic decryption private key SK m,v,c And save, and decrypt the private key SK according to the homomorphic m,v 、The homomorphic encryption public key PK m,v,c , the model download data and the locally preset training data set D c Perform local model training to obtain the corresponding training parameter set ciphertext EW m,v,c and model accuracy AT m,v,c and save it, and carry the vehicle identification c, the model parameter P m,v 、The training parameter set ciphertext EW m,v,c And the model accuracy AT m,v,c The training parameter publishing request is sent to the roadside unit; if the transaction requirement R is an application requirement, then the homomorphic decryption private key SK m,v , the model download data and the training data set D c Perform local model application and evaluation processing to obtain the corresponding evaluation accuracy AU m,v,c , and carries the vehicle identification c, the model parameter P m,v And the evaluation accuracy AU m,v,c The model evaluation release request is sent to the roadside unit; wherein the transaction requirement R includes training requirements and application requirements; the query model list includes multiple first model records; the first model record includes the first model identifier, the first model version, the first model name, the first model purpose, the first model basic configuration and the first model transaction price; the model query request includes the vehicle configuration S c ; The model parameter P m,v The model transaction request includes the vehicle identification c, the transaction requirement R, the model parameter P, and the first model identification. m,v and the vehicle account identifier CT c The model download request includes the vehicle identification c and the model parameter P m,v ; The model download data includes the release model program, the release model public key and the release parameter set; the homomorphic decryption private key request includes the model parameter P m,v ; The homomorphic decryption private key feedback includes the homomorphic decryption private key SK m,v The training parameter release request includes the vehicle identification c, the model parameter P m,v 、The training parameter set ciphertext EW m,v,c And the model accuracy AT m,v,c The model evaluation release request includes the vehicle identification c, the model parameter P m,v And the evaluation accuracy AU m,v,c ; The roadside unit is also used to identify the request from the vehicle-mounted unit; if the current request is the model query request, a first training block query process is performed according to the current request and the training blockchain to obtain the corresponding query model list and send it back; if the current request is the model transaction request, a first transaction block release process is performed according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and send it back; if the current request is the model download request, a transaction and training block query process is performed according to the current request and the training and transaction blockchain to obtain the corresponding model download data and send it back; if the current request is the training parameter release request, a second training block release process is performed according to the current request and the training blockchain; if the current request is the model evaluation release request, a second transaction block release process is performed according to the current request and the transaction blockchain; The server is also used to perform request feedback preparation processing according to the homomorphic decryption private key request sent by the vehicle-mounted unit to obtain the corresponding homomorphic decryption private key feedback and send it back.
7. The vehicle-road-cloud collaborative system for model training and application according to claim 6, characterized in that: The on-board unit is specifically used for decrypting the private key SK according to the homomorphic m,v 、The homomorphic encryption public key PK m,v,c , the model download data and the locally preset training data set D c Perform local model training to obtain the corresponding training parameter set ciphertext EW m,v,c and model accuracy AT m,v,c And when saving: Step 71, extract the corresponding published model program, the published model public key and the published parameter set from the model download data; perform program installation processing on the published model program, and perform corresponding program loading and running processing when the installation processing is successful, and use the currently running model program as the corresponding current model when the loading and running processing is successful; and use the published model public key as the corresponding homomorphic encryption public key And the published parameter set is used as the corresponding model parameter set ciphertext EW m,v ; Step 72, based on the homomorphic decryption private key SK m,v The model parameter set ciphertext EW m,v Perform homomorphic decryption operation to obtain the corresponding model parameter set plaintext W m,v : W m,v =DEC(EW m,v ,SK m,v ); Among them, DEC() is the homomorphic decryption function, DEC(EW m,v ,SK m,v ) is based on the homomorphic decryption private key SK m,v The model parameter set ciphertext EW m,v Perform homomorphic decryption operations; Step 73, based on the model parameter set plaintext W m,v Initializing model parameters of the current model; Step 74: based on a preset first segmentation ratio, the training data set D c The model is divided into two sub-data sets recorded as a corresponding first training set and a first evaluation set; and a round of training is performed on the current model based on the first training set and a preset first model optimizer in a supervised model training manner; and at the end of this round of training, the model accuracy of the current model is evaluated based on the first evaluation set to obtain a corresponding first evaluation value; Wherein, the first model optimizer includes at least an SGD optimizer and an Adam optimizer; Step 75, identifying whether the latest first evaluation value meets the preset first evaluation threshold range; if so, go to step 76, if not, return to step 74 to continue training; Step 76: Use the latest model parameter set of the current model as the corresponding training parameter set plaintext W m,v,c ; and based on the homomorphic encryption public key and the homomorphic encryption public key PK m,v,c The training parameter set plaintext W m,v,c Perform two layers of encryption to obtain the corresponding training parameter set ciphertext EW m,v,c and save; and use the latest first evaluation value as the corresponding model accuracy AT m,v,c and save; Among them, ENC() is the homomorphic encryption function, Based on the homomorphic encryption public key The training parameter set plaintext W m,v,c Perform homomorphic encryption operations. Based on the homomorphic encryption public key PK m,v,c right The homomorphic encryption operation ciphertext is subjected to homomorphic encryption operation again.
8. The vehicle-road-cloud collaborative system for model training and application according to claim 6, characterized in that: The on-board unit is specifically used for decrypting the private key SK according to the homomorphic m,v , the model download data and the training data set D c Perform local model application and evaluation processing to obtain the corresponding evaluation accuracy AU m,v,c hour: Step 81, extract the corresponding published model program and the published parameter set from the model download data; perform program installation processing on the published model program, and perform corresponding program loading and running processing when the installation processing is successful, and use the currently running model program as the corresponding current model when the loading and running processing is successful; and use the published parameter set as the corresponding model parameter set ciphertext EW m,v ; Step 82, based on the homomorphic decryption private key SK m,v The model parameter set ciphertext EW m,v Perform homomorphic decryption operation to obtain the corresponding model parameter set plaintext W m,v : W m,v =DEC(EW m,v ,SK m,v ); Among them, DEC() is the homomorphic decryption function, DEC(EW m,v ,SK m,v ) is based on the homomorphic decryption private key SK m,v The model parameter set ciphertext EW m,v Perform homomorphic decryption operations; Step 83, based on the model parameter set plaintext W m,v Solidify the model parameters of the current model; and after the model parameters are solidified, based on the training data set D c Evaluate the model accuracy of the current model to obtain a corresponding second evaluation value; and use the second evaluation value as the corresponding evaluation accuracy AU m,v,c ; Step 84, identifying whether the obtained second evaluation value satisfies a preset second evaluation threshold range; if so, continuing to run the current model and connecting the input / output interface of the current model to the business processing flow of the current on-board unit; if not, stopping running the current model and performing model uninstallation processing on the current model.
9. The vehicle-road-cloud collaborative system for model training and application according to claim 6, characterized in that: The roadside unit is specifically used to extract the corresponding vehicle configuration S from the current request when performing the first training block query processing according to the current request and the training blockchain to obtain the corresponding query model list and send it back. c ; and the release type on the training blockchain is model release and the basic configuration of the model operating environment described by the release model meets the vehicle configuration S c The training blocks are queried to obtain a corresponding training block set; and whether the training block set is identified; if so, setting the corresponding query model list to empty; If not, each of the training blocks in the training block set is used as the corresponding current block, and the published model identifier, the published model version, the model name described by the published model, the model purpose, the basic configuration of the model operating environment and the model transaction price of the block header data of the training block header of the current block are used as the corresponding first model identifier, the first model version, the first model name, the first model purpose, the first model basic configuration and the first model transaction price to form a corresponding first model record, and all the first model records obtained this time form the corresponding query model list; and the obtained query model list is sent back to the current on-board unit; The roadside unit is specifically used to extract the corresponding vehicle identification c, the transaction requirement R, and the model parameter P from the current request when the first transaction block is released according to the current request and the transaction blockchain to obtain the corresponding model transaction feedback and send it back. m,v and the vehicle account identifier CT c ; And from the model parameter P m,v extract the corresponding first model identifier, the first model version and the first model transaction price; and use the locally stored roadside unit identifier and roadside unit account identifier as the corresponding roadside identifier r and roadside account identifier CT r ; and the roadside identification r and the vehicle identification c form a corresponding roadside-vehicle identification pair; and the vehicle account identification CT c and the roadside account identifier CT r Form a corresponding roadside-vehicle account identification pair; and set the corresponding transaction party identification as the roadside-vehicle identification pair, set the corresponding transaction model identification as the first model identification, and set the corresponding transaction model version as the first model version; and identify the transaction requirement R; if the transaction requirement R is a training requirement, set the corresponding transaction type to training, and based on the preset transaction block construction mechanism, build a new transaction block according to the transaction type, the transaction party identification, the transaction model identification and the transaction model version set this time, and record it as the current transaction block; if the transaction requirement R is an application requirement, then based on the preset model version increment rule, confirm the previous version of the first model version to obtain the corresponding previous model version, and the publication type on the training blockchain is training publication and the publisher identification matches the vehicle identification c and the The training block whose release model identifier matches the first model identifier and whose release model version matches the previous model version is queried to obtain a corresponding query block, and when the query block is not empty, the first model transaction price is set to zero, and the corresponding transaction type is set to application, the corresponding transaction amount is set to the first model transaction price, and the corresponding transaction party account identifier is set to the roadside-vehicle account identifier pair, and when the first model transaction price is greater than zero, a transfer transaction is performed based on the first model transaction price and the roadside-vehicle account identifier pair based on a preset account transaction interface, and a new transaction block is constructed based on the transaction block construction mechanism according to the transaction type, the transaction party identifier, the transaction model identifier, the transaction model version, the transaction amount and the transaction party account identifier set this time, and recorded as the current transaction block; When the obtained current transaction block is not empty, the current transaction block is added to the transaction blockchain based on the preset transaction block chain rule, and the model transaction feedback specifically set as successful is sent back to the current on-board unit; The roadside unit is specifically used to extract the corresponding vehicle identification c and the model parameter P from the current request when the corresponding model download data is obtained and sent back after the transaction and training block query processing are performed according to the current request and the training and transaction blockchain. m,v ; And from the model parameter P m,v extract the corresponding first model identifier and the first model version; and query the transaction block on the transaction blockchain where the transaction type is model training or application, the transaction party identifiers include the carrier identifier c, the transaction model identifier matches the first model identifier, and the transaction model version matches the first model version to obtain the corresponding transaction query block; and identify whether the transaction query block is empty; If the transaction query block is empty, the corresponding model download data is set to be empty; If the transaction query block is not empty, the training block whose release type is model release and whose release model identifier matches the first model identifier and whose release model version matches the first model version on the training blockchain is queried to obtain the corresponding training query block, and whether the training query block is empty is identified. If so, the corresponding model download data is set to be empty. Otherwise, the release model program, the release model public key and the release parameter set of the training query block are extracted to form a corresponding model download data; and the obtained model download data is sent back to the current on-board unit; The roadside unit is specifically used to extract the corresponding vehicle identification c and the model parameter P from the current request when performing the second training block release processing with the training blockchain according to the current request. m,v 、The training parameter set ciphertext EW m,v,c And the model accuracy AT m,v,c ; And from the model parameter P m,v extract the corresponding first model identifier and the first model version; and set the corresponding release type to training release, set the corresponding publisher identifier to the vehicle identifier c, set the corresponding release model identifier to the first model identifier, set the corresponding release model version to the first model version, and set the corresponding release parameter set to the training parameter set ciphertext EW m,v,c , set the corresponding published model accuracy to the model accuracy AT m,v,c ; Based on the training block construction mechanism, a new training block is constructed according to the publishing type, publisher identifier, publishing model identifier, publishing model version, publishing parameter set and publishing model accuracy set this time, and recorded as the current training block; and based on the training block chaining rule, the current training block is added to the training blockchain; The roadside unit is specifically used to extract the corresponding vehicle identification c and the model parameter P from the current request when performing the second transaction block publishing process with the transaction blockchain according to the current request. m,v And the evaluation accuracy AU m,v,c ; And from the model parameter P m,v extract the corresponding first model identifier and the first model version; and use the roadside unit identifier stored locally in the current roadside unit as the corresponding roadside identifier r; and form a corresponding roadside-vehicle identifier pair by the roadside identifier r and the vehicle identifier c; and set the corresponding transaction type to evaluation, set the corresponding transaction party identifier to the roadside-vehicle identifier pair, set the corresponding transaction model identifier to the first model identifier, set the corresponding transaction model version to the first model version, and set the corresponding model evaluation accuracy to the evaluation accuracy AU m,v,c ; and based on the transaction block construction mechanism, a new transaction block is constructed according to the transaction type, the transaction party identifiers, the transaction model identifier, the transaction model version and the model evaluation accuracy set this time, and recorded as the current transaction block; and based on the transaction block chain rules, the current transaction block is added to the transaction blockchain.
10. The vehicle-road-cloud collaborative system for model training and application according to claim 6, characterized in that: The server is specifically configured to extract the corresponding model parameter P from the homomorphic decryption private key request when performing request feedback preparation processing according to the homomorphic decryption private key request sent by the vehicle-mounted unit to obtain the corresponding homomorphic decryption private key feedback and send it back. m,v ; and the model parameter P m,v The corresponding homomorphic decryption private key SK m,v as the corresponding current decryption private key; and feedback the homomorphic decryption private key carrying the current decryption private key to the current on-board unit.
11. The vehicle-road-cloud collaborative system for model training and application according to claim 6, characterized in that: The server, the roadside unit and the vehicle-mounted unit are also used to train and publish new versions of the model on the training blockchain according to the federated learning mechanism, specifically including: The on-board unit is also used to establish corresponding encrypted data transmission channels with other on-board units within the vehicle-to-vehicle communication range through a preset key negotiation mechanism; the encrypted data transmission channel between each two on-board units corresponds to a unique channel negotiation key; The vehicle-mounted unit is also used to periodically use the locally stored vehicle-mounted unit identifier as the corresponding current vehicle-mounted identifier according to a preset first time frequency; and to adjust the locally stored model parameter P m,v Whether the parameter state of has been switched to aggregated for recognition to obtain the corresponding current recognition result; if the current recognition result is no, the model parameter P is carried m,v The training number query request is sent to the roadside unit, and the corresponding total training number and aggregation threshold parameter are extracted from the query feedback sent back; and when the total training number is greater than or equal to the aggregation threshold parameter, the model parameter P is m,v The parameter state is set to aggregated, and according to the model parameter P m,v Perform aggregation unit positioning processing to obtain the corresponding aggregation unit identifier; and identify whether the aggregation unit identifier matches the current vehicle identifier; if not, the vehicle-mounted unit corresponding to the aggregation unit identifier is used as the corresponding current aggregation unit, and the model parameter P m,v The corresponding homomorphic decryption private key SK m,v,c Send to the current aggregation unit; if it matches, receive the homomorphic decryption private key SK sent by other on-board units m,v,c , and received all the homomorphic decryption private keys SK m,v,c And the homomorphic decryption private key SK of the current on-board unit itself m,v,c A corresponding first private key set is formed, and all the vehicle identifiers c corresponding to the first private key set form a corresponding first identifier set G{c}, and the first identifier set G{c} and the model parameter P are carried. m,v The parameter set download request is sent to the roadside unit, and the parameter set download data sent back is received, and local model aggregation processing is performed based on the first private key set and the parameter set download data to obtain the corresponding aggregated parameter set ciphertext GEW m,v and aggregate model accuracy GAT m,v , and takes the current vehicle identification as the corresponding first vehicle identification, and carries the first vehicle identification, the first identification set G{c}, the model parameter P m,v , the aggregation parameter set ciphertext GEW m,v and the aggregate model accuracy GAT m,v The aggregation parameter publishing request is sent to the roadside unit; wherein the training number query request includes the model parameter P m,v ; The query feedback includes the total number of training times and the aggregation threshold parameter; the parameter set download request includes the first identification set G{c} and the model parameter P m,v , the first identification set G{c} includes multiple vehicle identifications c; the parameter set download data consists of one or more vehicle training parameters; the vehicle training parameters include the published parameter set and the published model accuracy, and the vehicle training parameters of the parameter set download data correspond one-to-one to the vehicle identification c of the parameter set download request; the aggregate parameter publishing request includes the first vehicle identification, the first identification set G{c}, the model parameter P m,v , the aggregation parameter set ciphertext GEW m,v and the aggregate model accuracy GAT m,v ; The roadside unit is also used to identify the request from the vehicle-mounted unit; if the current request is the training number query request, a second training block query process is performed on the current request and the training blockchain to obtain the corresponding number query feedback and send it back; if the current request is the parameter set download request, a third training block query process is performed on the current request and the training blockchain to obtain the corresponding parameter set download data and send it back; if the current request is the aggregation parameter release request, a third training block release process is performed on the current request and the training blockchain to obtain the corresponding model aggregation request and send it to the server; wherein the model aggregation request includes a global aggregation model identifier, a global aggregation model version, a local aggregation parameter set ciphertext, a local aggregation vehicle-mounted identifier set, and a local model accuracy; The server is also used to perform global model aggregation processing according to the model aggregation request sent by the roadside unit to obtain the corresponding new version model data B m,v+1 ; Wherein, the new version model data B m,v+1 Including the model identifier m, model version v+1, new version model description, the model loader, model parameter set plain text W m,v+1 , model aggregation threshold TH m,v+1 and model accuracy AT m,v+1 ; The new version model description at least includes the model name, the model purpose, the basic configuration of the model operating environment and the new version model transaction price; The server is also used to provide the new version of the model data B m,v+1 Assign a set of public-private key pairs for homomorphic encryption / decryption operations on the model parameter set, denoted as the corresponding homomorphic encryption public key PK m,v+1 and homomorphic decryption private key SK m,v+1 and save; and for the new version of the model data B m,v+1 Assign a set of public and private key pairs for homomorphic encryption / decryption operations on the training data set as the corresponding homomorphic encryption public key and homomorphic decryption private key and save; and the homomorphic encryption public key PK m,v+1 For the new version of model data B m,v+1 The model parameter set plaintext W m,v+1 Perform homomorphic encryption operation to obtain the corresponding model parameter set ciphertext EW m,v+1 ; and by the new version model data B m,v+1 The corresponding homomorphic encryption public key The model identifier m, the model version v+1, the new version model description, the model loader, and the model parameter set ciphertext EW m,v+1 , the model aggregation threshold TH m,v+1 And the model accuracy AT m,v+1 The corresponding second model publishing request is sent to one of the roadside units; wherein the model parameter set ciphertext EW m,v+1 The calculation method is: EW m,v+1 =ENC(W m,v+1 ,PK m,v+1 ), ENC(W m,v+1 ,PK m,v+1 ) is based on the homomorphic encryption public key PK m,v+1 The model parameter set plaintext W m,v+1 Perform homomorphic encryption operation; the second model publishing request includes the homomorphic encryption public key The model identifier m, the model version v+1, the new version model description, the model loader, and the model parameter set ciphertext EW m,v+1 , the model aggregation threshold TH m,v+1 And the model accuracy AT m,v+1 ; The roadside unit is also used to perform fourth training block publishing processing according to the second model publishing request sent by the server and the training blockchain.
12. The vehicle-road-cloud collaborative system for model training and application according to claim 11, characterized in that: The on-board unit is specifically used for m,v When performing aggregation unit location processing to obtain the corresponding aggregation unit identifier: Step 121, taking the onboard unit identifiers of the onboard units connected to the current onboard unit within the vehicle-to-vehicle communication range as a corresponding second onboard identifier; and taking the onboard unit identifier of the current onboard unit as a corresponding second onboard identifier; Step 122, by requesting and querying one by one, counting the total number of unit connections between the vehicle-mounted unit corresponding to each second vehicle-mounted identification and other vehicle-mounted units to obtain a corresponding first total number of connections; and sorting the second vehicle-mounted identifications in descending order of the first total number of connections to obtain a corresponding first sequence; Step 123, initializing the aggregation unit identifier to null; and starting from the first second vehicle-mounted identification in the first sequence, performing a round of sequential traversal on all the second vehicle-mounted identifications in the sequence; In this round of sequential traversal, the second vehicle-mounted identification currently traversed is used as the corresponding current identification; the vehicle-mounted unit corresponding to the current identification is used as the corresponding current target unit; and whether the current target unit is the current vehicle-mounted unit is identified; If the current target unit is the current onboard unit, stop the current round of polling and set the corresponding aggregation unit identifier to the onboard unit identifier of the current onboard unit; If the current target unit is not the current vehicle-mounted unit, the current target unit is asked to identify whether it is willing to be identified as an aggregation unit to obtain the corresponding first identification result, and identify whether the first identification result is willing. If the first identification result is willing, stop this round of polling and set the corresponding aggregation unit identifier as the vehicle-mounted unit identifier of the current target unit. If the first identification result is unwilling, go to the next second vehicle-mounted identifier and continue traversing until the traversal of the last second vehicle-mounted identifier is completed.
13. The vehicle-road-cloud collaborative system for model training and application according to claim 11, characterized in that: The vehicle-mounted unit is specifically used to set the model parameter P m,v The corresponding homomorphic decryption private key SK m,v,c When sending to the current aggregation unit, the channel negotiation key of the encrypted data transmission channel corresponding to the current aggregation unit is used as the corresponding channel encryption key; and the homomorphic decryption private key SK is encrypted based on the channel encryption key. m,v,c Perform encryption processing to obtain a corresponding first encrypted ciphertext; and send the first encrypted ciphertext to the current aggregation unit through the encrypted data transmission channel corresponding to the current aggregation unit.
14. The vehicle-road-cloud collaborative system for model training and application according to claim 13, characterized in that: The on-board unit is specifically used to receive the homomorphic decryption private key SK sent by other on-board units. m,v,c When receiving a corresponding first encrypted ciphertext through one of the encrypted data transmission channels, the first encrypted ciphertext is decrypted based on the corresponding channel decryption key to obtain a corresponding first decrypted plaintext, and the first decrypted plaintext is used as the homomorphic decryption private key SK corresponding to the current encrypted data transmission channel. m,v,c .
15. The vehicle-road-cloud collaborative system for model training and application according to claim 11, characterized in that: The on-board unit is specifically used to perform local model aggregation processing on the downloaded data based on the first private key set and the parameter set to obtain a corresponding aggregated parameter set ciphertext GEW m,v and aggregate model accuracy GAT m,v hour: Step 151, counting the total number of the vehicle training parameters of the parameter set download data to obtain a corresponding second total number Q, where Q is a positive integer greater than zero; The published parameter set and the published model accuracy of each vehicle training parameter are recorded as the corresponding training parameter set ciphertext EW m,v,j and model accuracy AT m,v,j , 1≤index j≤Q; and the homomorphic decryption private key SK corresponding to each of the vehicle training parameters in the first private key set m,v,c Denoted as the corresponding homomorphic decryption private key SK m,v,j ; Step 152, all the homomorphic decryption private keys SK m,v,j 、The training parameter set ciphertext EW m,v,j And the model accuracy AT m,v,j Calculate the corresponding aggregation parameter set ciphertext GEW m,v and the aggregate model accuracy GAT m,v ; GEW m,v =add(DEC(EW m,v,j ,SK m,v,j )|j∈[1,Q]), Among them, DEC() is the homomorphic decryption function, DEC(EW m,v,j ,SK m,v,j ) is based on the homomorphic decryption private key SK m,v,j The training parameter set ciphertext EW m,v,j Perform homomorphic decryption operation; add() is a homomorphic addition operation function; add(DEC(EW m,v,j ,SK m,v,j )|j∈[1,Q]) is the ciphertext GEW for the Q aggregation parameter sets m,v The homomorphic decryption result is homomorphically added.
16. The vehicle-road-cloud collaborative system for model training and application according to claim 11, characterized in that: The roadside unit is specifically used to extract the corresponding model parameter P from the current request when performing a second training block query process with the training blockchain according to the current request to obtain the corresponding number of query feedback and send it back. m,v ; And from the model parameter P m,v extract the corresponding first model identifier and the first model version; and query the training block on the training blockchain whose release type is model release and whose release model identifier matches the first model identifier and whose release model version matches the first model version to obtain the corresponding query block; and identify whether the query block is empty, and if so, set the corresponding aggregation threshold parameter to zero; otherwise, extract the corresponding release aggregation threshold from the query block as the corresponding aggregation threshold parameter; and query the total number of the training blocks on the training blockchain whose release type is training release and whose release model identifier matches the first model identifier and whose release model version matches the first model version, and use the query result as the corresponding total number of training times; The query feedback corresponding to the total number of training times and the aggregation threshold parameter is sent back to the current on-board unit; The roadside unit is specifically used to extract the corresponding first identification set G{c} and the model parameter P from the current request when the third training block query processing is performed according to the current request and the training blockchain to obtain the corresponding parameter set download data and send it back. m,v ; And from the model parameter P m,v Extract the corresponding first model identifier and the first model version; and use each of the vehicle identifiers c in the first identifier set G{c} as the corresponding current vehicle identifier, and query the training block on the training blockchain whose publishing type is training publishing and whose publisher identifier matches the current vehicle identifier and whose publishing model identifier matches the first model identifier and whose publishing model version matches the first model version to obtain the corresponding query block, and extract the publishing parameter set and the publishing model accuracy of the query block to form a corresponding vehicle training parameter; and download data composed of all the obtained vehicle training parameters to send back to the current vehicle unit; The roadside unit is specifically used to extract the corresponding first vehicle identification, the first identification set G{c}, the model parameter P from the current request when the corresponding model aggregation request is obtained by performing the third training block publishing process on the training blockchain according to the current request and sending it to the server. m,v , the aggregation parameter set ciphertext GEW m,v and the aggregate model accuracy GAT m,v ; And from the model parameter P m,v extract the corresponding first model identifier and the first model version; and set the corresponding release type to aggregate release, set the corresponding publisher identifier to the first vehicle identifier, set the corresponding release model identifier to the first model identifier, set the corresponding release model version to the first model version, and set the corresponding release parameter set to the aggregate parameter set ciphertext GEW m,v , set the corresponding published vehicle identification set to the first identification set G{c}, set the corresponding published model accuracy to the aggregate model accuracy GAT m,v ; and based on the training block construction mechanism, a new training block is constructed according to the publishing type, the publisher identifier, the publishing model identifier, the publishing model version, the publishing parameter set, the publishing vehicle identifier set and the publishing model accuracy set this time, and recorded as the current training block; And based on the training block chain rules, the current training block is added to the training blockchain; And set the corresponding global aggregation model identifier as the first model identifier, set the corresponding global aggregation model version as the first model version, and set the corresponding local aggregation parameter set ciphertext as the aggregation parameter set ciphertext GEW m,v , set the corresponding local aggregated vehicle identification set to the first identification set G{c}, set the corresponding local model accuracy to the aggregated model accuracy GAT m,v , and the global aggregation model identifier, the global aggregation model version, the local aggregation parameter set ciphertext, the local aggregation vehicle identifier set and the local model accuracy set this time form a corresponding model aggregation request and send it to the server; The roadside unit is specifically configured to extract the corresponding homomorphic encryption public key from the second model publishing request when performing the fourth training block publishing process according to the second model publishing request sent by the server and the training blockchain. The model identifier m, the model version v+1, the new version model description, the model loader, and the model parameter set ciphertext EW m,v+1 , the model aggregation threshold TH m,v+1 And the model accuracy AT m,v+1 ; And the roadside unit identifier stored locally in the current roadside unit is used as the corresponding roadside identifier r; and the corresponding publishing type is set to model publishing, the corresponding publisher identifier is set to the roadside identifier r, the corresponding publishing model identifier is set to the model identifier m, the corresponding publishing model version is set to the model version v+1, the corresponding publishing model description is set to the new version model description, the corresponding publishing model program is set to the model loader program, and the corresponding publishing model public key is set to the homomorphic encryption public key Set the corresponding release parameter set to the model parameter set ciphertext EW m,v+1 , set the corresponding release aggregation threshold to the model aggregation threshold TH m,v+1 , set the corresponding published model accuracy to the model accuracy AT m,v+1 ; and based on the training block construction mechanism, according to the publishing type, the publisher identifier, the publishing model identifier, the publishing model version, the publishing model description, the publishing model program, the publishing model public key, the publishing parameter set, the publishing aggregation threshold and the publishing model accuracy set this time, a new training block is constructed and recorded as the current training block; and based on the training block chain rule, the current training block is added to the training blockchain.
17. The vehicle-road-cloud collaborative system for model training and application according to claim 11, characterized in that: The server is specifically configured to perform global model aggregation processing according to the model aggregation request sent by the roadside unit to obtain the corresponding new version model data B m,v+1 When the model data B m,v Preset a corresponding first cache queue; and each time a corresponding model data B is received m,v When a corresponding model aggregation request is received, the model aggregation request received at that time is stored in the corresponding first cache queue; and each time a new model aggregation request is added to the first cache queue, the total number of on-board units in the first cache queue is counted; When the latest total number of the on-board units exceeds a preset first total number threshold, the receiving of the model data B is stopped. m,v The corresponding model aggregation request; Based on the latest first cache queue, the new version model parameter set and the new version model accuracy aggregation processing are performed to obtain the corresponding model parameter set plaintext W m,v+1 And the model accuracy AT m,v+1 ; and based on the preset pricing rules according to the model accuracy AT m,v+1 Set the corresponding transaction price of the new version model, and compare the transaction price of the new version model with the model data B m,v The model name, the model purpose and the basic configuration of the model operating environment of the model description constitute a corresponding new version of the model description; and based on the preset model version increment rule according to the model data B m,v The model version v is incremented to obtain the corresponding model version v+1; and a corresponding model aggregation threshold TH is set based on a preset model aggregation threshold setting rule. m,v+1 ; and the obtained model version v+1, the new version model description, and the model parameter set plain text W m,v+1 , the model accuracy AT m,v+1 , the model aggregation threshold TH m,v+1 And the model data B m,v The model identifier m and the model loading program form a corresponding new version of the model data B m,v+1 ; The server is specifically used to count the total number of the model aggregation requests in the first cache queue to obtain the corresponding total number of requests Na when counting the total number of vehicle-mounted units in the first cache queue; and to count the total number of vehicle-mounted identifications of the local aggregated vehicle-mounted identification set of each model aggregation request in the first cache queue to obtain the corresponding total number of vehicle-mounted identifications N i , 1≤request index i≤Na; and the total number of the vehicle identifications N i The sum of is taken as the corresponding total number of the on-board units; The server is specifically used to perform a new version model parameter set and a new version model accuracy aggregation process based on the latest first cache queue to obtain the corresponding model parameter set plaintext W m,v+1 And the model accuracy AT m,v+1 When the local aggregation parameter set ciphertext of each model aggregation request in the first cache queue is recorded as the corresponding parameter set ciphertext GEW i , the local model accuracy is recorded as the corresponding model accuracy GAT i ; and the total number of on-board units is recorded as the corresponding total number of on-board units Nc; and based on the total number of on-board units Nc, the total number of requests Na, the homomorphic decryption private key And the total number N of the vehicle identifications corresponding to all the request indexes i i , the parameter set ciphertext GEW i and the model accuracy GAT i Calculate the corresponding model parameter set plaintext W m,v+1 And the model accuracy AT m,v+1 ; Wherein, the model parameter set plain text W m,v+1 And the model accuracy AT m,v+1 The calculation method is: DEC() is the homomorphic decryption function, To decrypt the private key based on the homomorphic The parameter set ciphertext GEW i Perform homomorphic decryption operations.