Vehicle diagnosis method and system, vehicle and product
Model training in vehicle diagnosis through distributed federated learning architecture is solved, and data silos and data leakage problems in traditional methods are achieved, more efficient and accurate vehicle diagnosis is achieved, ensuring data security.
Patent Information
- Application Number
- CN202411599917.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-05-13
AI Technical Summary
Traditional vehicle diagnostic methods have data silos problems, resulting in limited efficiency and accuracy of model training. Due to the centralized storage of data, there are hidden dangers of data leakage and privacy protection.
Using distributed federated learning model training architecture, each client independently trains the global model currently issued by the central server based on vehicle state data samples locally, updates the model parameters, and uploads them to the central server for aggregation to update the global model.
It effectively avoids the data island problem in the traditional centralized training mode, realizes effective aggregation of data resources, improves the efficiency and accuracy of model training, and ensures the privacy of data and prevents data leakage.
Smart Images

Figure CN119987323A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a vehicle diagnosis method, system, vehicle and product. Background Art
[0002] With the development of intelligent transportation systems and autonomous driving technology, higher requirements are placed on real-time monitoring and fault diagnosis of vehicle health status. Traditional vehicle diagnostic methods rely on centralized data processing and suffer from data island problems, that is, it is difficult to effectively aggregate data from each node in a centralized training mode, resulting in insufficient training data and limiting the efficiency and accuracy of model training. At the same time, due to the centralized storage of data, there are risks of data leakage and privacy protection. Therefore, the accuracy and efficiency of existing vehicle diagnostic methods are limited, and data leakage is likely to occur. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a vehicle diagnostic method, system, vehicle and product, aiming to improve the accuracy and efficiency of the vehicle diagnostic method and effectively prevent data leakage.
[0004] In a first aspect, the present application provides a vehicle diagnostic method for at least one client, the method comprising:
[0005] Acquire vehicle status data samples, each of the vehicle status data samples being identified with a status type;
[0006] Iteratively train the global model currently sent by the central server according to the vehicle state data sample, and return the model parameters corresponding to the locally trained global model to the central server, so that the central server aggregates the model parameters returned by each of the clients and updates the global model, and sends the updated global model to the client until a preset iteration stop condition is reached to obtain a state classification model;
[0007] Obtain vehicle status data of the target vehicle;
[0008] The vehicle status data is classified using the status classification model to obtain a status classification result of the target vehicle.
[0009] In a possible implementation, the global model currently sent by the central server is trained according to the vehicle status data sample through the following steps, including:
[0010] Obtaining the sample quantity of the vehicle status data sample and the loss prediction of the vehicle status data sample by the current model parameters, wherein the loss prediction is obtained by the central server after performing loss calculation based on the sample features of the vehicle status data sample, the sample data label and the current model parameters;
[0011] Determining loss data and corresponding loss gradients during training according to the sample quantity and the loss prediction;
[0012] Update the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples obtained by each of the clients, and the loss gradient;
[0013] Based on the updated model parameters, a global model after local training is obtained.
[0014] In a possible implementation, determining the loss data and the corresponding loss gradient in the training process according to the sample quantity and the loss prediction includes:
[0015] The loss data is calculated by the following formula (1), including:
[0016]
[0017] Among them, ω leb are model parameters, is the loss data of the kth client for the model parameters, is the number of vehicle status data samples obtained by the kth client, is the loss prediction of the model parameters for the jth vehicle status data sample, is the data distribution of the kth client;
[0018] The updating of the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples acquired by each of the clients and the loss gradient includes:
[0019] The model parameters are updated by the following formula (2), including:
[0020]
[0021] in, are the model parameters updated by the client in the tth iteration, is the model parameter in the tth iteration, R nod is the learning rate, N leb is the number of nodes related to the client, D leb is the total number of vehicle status data samples obtained by all clients, is the loss gradient.
[0022] In a possible implementation, the method further includes calculating, by the central server, the loss prediction:
[0023] The loss prediction is calculated by the following formula (3), including:
[0024]
[0025] in, represents the loss prediction of the model parameters for the jth vehicle status data sample, is the sample feature of the jth vehicle status data sample, is the sample data label of the jth vehicle status data sample, L tra (*) indicates the loss function.
[0026] In a possible implementation, the method further includes updating the global model by the central server:
[0027] The model parameters of the global model updated by the central server are calculated by the following formula (4), including:
[0028]
[0029] in, represents the model parameters of the global model updated by the central server in the tth iteration, represents the model parameters updated by the kth client in the tth iteration.
[0030] In a possible implementation, the global model currently sent by the central server is trained according to the vehicle state data sample through the following steps, which also includes:
[0031] Initializing quantum bits and quantum states of vehicle state data samples of any of the state types, each quantum bit representing a characteristic dimension of the vehicle state data sample;
[0032] Establishing a quantum kernel function for any two quantum states, wherein the quantum kernel function is used to indicate the similarity between the quantum states;
[0033] According to the quantum kernel function, optimizing the hyperparameters of the current global model to obtain an optimized global model;
[0034] The optimized global model is evaluated and adjusted based on the preset test set to obtain the state classification model.
[0035] In a possible implementation, the initialization quantum bit, and the quantum state of the vehicle state data sample of any state type, include:
[0036] The quantum state is determined by the following formula (5), including:
[0037]
[0038] Among them, ψ u is the quantum state of the vehicle state data sample, n u is the number of features, θ iu is the quantum bit in quantum state ψ u The polar angle on the Bloch sphere on iu is the quantum bit in quantum state ψ u The azimuth on the Bloch sphere on ;
[0039] The step of establishing a quantum kernel function for any two quantum states comprises:
[0040] The quantum kernel function is determined by the following formula (6), including:
[0041] K u (ψ u ,ψ′ u )=|<ψ u |ψ′ u >| 2 (6)
[0042] Among them, K u (ψ u ,ψ′ u ) represents two quantum states ψ u and ψ′ u The quantum kernel function between u |ψ′ u > represents two quantum states ψ u and ψ′ u The inner product between
[0043] Among them, the inner product of the two quantum states is determined by the following formula (7), including:
[0044]
[0045] In the formula, θ i ′ u is the quantum state of the ith quantum bit in ψ′ u The polar angle on the Bloch sphere on i ′ u is the quantum state of the ith quantum bit in ψ′ u The azimuth on the Bloch sphere on ;
[0046] The step of optimizing the hyperparameters of the current global model according to the quantum kernel function to obtain an optimized global model includes:
[0047] The hyperparameters of the current global model are optimized by the following formula (8), including:
[0048]
[0049] Among them, λ u is the weight in the hyperparameter, σ u is the bias in the hyperparameter, m u is the total number of the first sample, y i is the label of the i-th vehicle status data sample, n u is the total number of the second sample, ψ iu is the quantum state of the i-th vehicle state data sample, ψ ju is the quantum state of the jth vehicle state data sample, K u (ψ iu ,ψ ju ) represents two quantum states ψ iu and ψ ju The quantum kernel function between ju is the weight of the jth vehicle state data sample, Ω u (*) represents the optimization objective function, [*] + represents the hinge loss function;
[0050] The optimized global model is evaluated and adjusted based on a preset test set to obtain a state classification model, including:
[0051] The evaluation result is determined by the following formula (9), including:
[0052]
[0053] in, For the evaluation results containing the predicted labels, is the quantum state of the i-th vehicle state data sample in the test set.
[0054] In a second aspect, the present application provides a vehicle diagnostic system, including at least one client and a central server:
[0055] The client is used to obtain vehicle status data samples, each of which is identified by a status type; iteratively train the global model currently issued by the central server according to the vehicle status data samples, and return the model parameters corresponding to the locally trained global model to the central server;
[0056] The central server is used to iteratively aggregate the model parameters returned by each of the clients to update the global model, and send the updated global model to the clients until a preset iteration stop condition is reached to obtain a state classification model;
[0057] The client is also used to obtain vehicle status data of the target vehicle; and classify the vehicle status data using the status classification model to obtain a status classification result of the target vehicle.
[0058] In a third aspect, the present application provides a vehicle, comprising the vehicle diagnostic system described in the second aspect above.
[0059] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the vehicle diagnostic method described in the above-mentioned first aspect or any possible implementation method of the first aspect.
[0060] The vehicle diagnosis method, system, vehicle and product proposed in this application ensure the privacy of data, effectively prevent data leakage and ensure data security by having each client independently train the global model currently issued by the central server based on the vehicle status data sample locally, and then upload the model parameters updated by each client to the central server for aggregation, so as to update the global model and then issue the updated global model to obtain a state classification model, which can effectively avoid the data island problem in the traditional centralized training mode, realize the effective aggregation of data resources, and improve the efficiency and accuracy of model training. Therefore, the vehicle status data is classified using the state classification model, which improves the accuracy and reliability of vehicle fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of a vehicle diagnostic method provided in an embodiment of the present application;
[0062] Figure 2 A schematic diagram of a flow chart of model parameter updating provided in an embodiment of the present application;
[0063] Figure 3 A schematic diagram of the process of training a state classification model provided in an embodiment of the present application;
[0064] Figure 4 A schematic diagram of the structure of a vehicle diagnostic system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0066] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0068] First, some nouns involved in this application are analyzed:
[0069] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0070] Distributed federated learning algorithm (or federated learning algorithm): is a machine learning technology that uses distributed local data to train global models. Distributed federated learning algorithm protects data privacy and improves model training efficiency by distributing the model training process to multiple data sources without centralizing the data to a central server.
[0071] Based on this, the embodiments of the present application provide a vehicle diagnostic method, system, vehicle and product, which aim to improve the accuracy and efficiency of the vehicle diagnostic method and effectively prevent data leakage.
[0072] The vehicle diagnostic method, system, vehicle and product provided in the embodiments of the present application are specifically described through the following embodiments. First, the recommended method in the embodiments of the present application is described.
[0073] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0074] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0075] The vehicle diagnostic method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The vehicle diagnostic method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the vehicle diagnostic method, etc., but is not limited to the above forms.
[0076] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0077] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0078] Figure 1 A flow chart of a vehicle diagnostic method provided in an embodiment of the present application, for at least one client, Figure 1 The method may include but is not limited to steps S101 to S104.
[0079] S101. Acquire vehicle status data samples, each of which is identified by a status type.
[0080] In this application, the vehicle status data samples include vehicle speed, engine temperature, tire pressure, fuel consumption rate, braking efficiency, steering system status, battery power, engine oil quality, emission level, and ride comfort, but are not limited to these. Among them, vehicle speed indicates the real-time speed of the vehicle; engine temperature reflects the operating status of the engine; tire pressure indicates an important safety indicator; fuel consumption rate affects economy and environmental protection; braking efficiency measures the performance of the braking system; steering system status is related to driving safety; battery power is a health indicator of the power system; engine oil quality affects engine life; emission level is an environmental protection indicator; ride comfort is evaluated by in-vehicle sensors.
[0081] Exemplarily, the state type is annotated for each vehicle state data sample by a labeling method, and the labeling method may be manual labeling. Exemplarily, the state type may include "normal", "tire wear", "engine overheating" and "low battery power", etc.
[0082] It should be noted that this embodiment is only used to illustrate one data format and type of the present invention. In actual applications, the attributes of data are usually more than 10 attributes, and the number of attributes of data may reach dozens or even hundreds.
[0083] S102. Iteratively train the global model currently sent by the central server according to the vehicle status data sample, and return the model parameters corresponding to the locally trained global model to the central server, so that the central server aggregates the model parameters returned by each of the clients to update the global model, and sends the updated global model to the client until the preset iteration stop condition is reached to obtain a state classification model.
[0084] In the present application, the central server broadcasts the current global model, and each client trains the current global model based on the acquired vehicle status data samples, and the client uploads the model parameters corresponding to the trained global model (i.e., the model parameters updated by the client) to the central server. The central server receives the updated model parameters from each client for aggregation, and updates the current global model with the aggregated model parameters, so that the central server broadcasts the updated global model and / or the model parameters corresponding to the updated global model (i.e., the model parameters updated by the central server). Repeat the above steps until the preset iteration stop condition is reached to obtain the state classification model.
[0085] The iteration stop condition is used to characterize the iteration stop condition for updating the autoencoder (i.e., updating the model parameters of the autoencoder), which means that the training of the autoencoder is completed. Optionally, the iteration stop condition can be reaching a preset maximum number of iterations. For example, the maximum number of iterations is set to 1000 times.
[0086] Therefore, this application uses a distributed federated learning model training architecture to achieve distributed model training and data mining of multi-node joint models, so as to break the data resource island problem of the traditional centralized training model, aggregate and obtain more effective data, and effectively improve the accuracy and efficiency of model training. At the same time, it can prevent the leakage of local data of each node, the data is used on the client, and the model is trained on the client, which effectively ensures data security.
[0087] S103: Acquire vehicle status data of the target vehicle.
[0088] S104: Classify the vehicle status data using the status classification model to obtain a status classification result of the target vehicle.
[0089] In this application, vehicle status data may include vehicle speed, engine temperature, tire pressure, fuel consumption rate, braking efficiency, steering system status, battery power, engine oil quality, emission level, and ride comfort. The status classification result may be status types such as "normal", "tire wear", "engine overheating", and "low battery".
[0090] The vehicle diagnosis method proposed in this embodiment ensures data privacy, effectively prevents data leakage, and ensures data security by having each client independently train the global model currently issued by the central server based on the vehicle status data sample locally, and then uploads the model parameters updated by each client to the central server for aggregation, so as to update the global model and then issue the updated global model, thereby obtaining a state classification model, which can effectively avoid the data island problem in the traditional centralized training mode, realize the effective aggregation of data resources, and improve the efficiency and accuracy of model training. Therefore, the vehicle status data is classified using the state classification model, which improves the accuracy and reliability of vehicle fault diagnosis.
[0091] In some embodiments, Figure 2 This is a flow chart of model parameter updating provided in an embodiment of the present application. This embodiment provides a method for model parameter updating, that is, step S102 may include but is not limited to steps S201 to S204.
[0092] S201. Obtain the sample quantity of the vehicle status data samples and the loss prediction of the vehicle status data samples by the current model parameters, wherein the loss prediction is obtained by the central server after performing loss calculation based on the sample characteristics of the vehicle status data samples, the sample data labels and the current model parameters.
[0093] In this embodiment, optionally, the method further includes calculating the loss prediction by the central server:
[0094] The loss prediction is calculated by the following formula (3), including:
[0095]
[0096] in, represents the loss prediction of the model parameters for the jth vehicle status data sample, is the sample feature of the jth vehicle status data sample, is the sample data label of the jth vehicle status data sample, L tra(*) indicates the loss function.
[0097] S202. Determine loss data and corresponding loss gradients during training according to the sample quantity and the loss prediction.
[0098] Optionally, the loss data is calculated by the following formula (1), including:
[0099]
[0100] Among them, ω leb are model parameters, is the loss data of the kth client for the model parameters, is the number of vehicle status data samples obtained by the kth client, is the loss prediction of the model parameters for the jth vehicle status data sample, is the data distribution of the kth client. represents the objective function of the kth client.
[0101] S203, updating the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples obtained by each of the clients, and the loss gradient.
[0102] Optionally, taking the model parameter update method of the kth client in the tth iteration as an example, the model parameters are updated by the following formula (2), including:
[0103]
[0104] in, is the model parameter updated by the client in the t-th iteration, that is, the model parameter in the t+1-th iteration; is the model parameter in the tth iteration; R nod The model parameters Updated learning rate, N leb is the number of nodes related to the client, D leb is the total number of vehicle status data samples obtained by all clients, is the loss gradient.
[0105] S204: Obtain a global model after local training based on the updated model parameters.
[0106] Therefore, in this embodiment, the client calculates the loss data and corresponding loss gradient of local training during the model training process, and updates the model parameters according to the loss gradient to obtain a global model trained locally, which can effectively avoid the data island problem in the traditional centralized training mode and improve the efficiency and accuracy of model training. At the same time, it ensures the privacy of data, effectively prevents data leakage, and ensures data security.
[0107] It should be noted that in the model training architecture of distributed federated learning, the federated average algorithm is used as the model aggregation algorithm, and the federated average algorithm realizes the collaborative training of local models through multiple global iterations. Specifically, for each global iteration, the objective function of federated learning (i.e., the objective function of central server learning) is defined as:
[0108]
[0109] In the formula, f leb (ω leb ) is the loss prediction data of the model parameters, f leb (*) represents the objective function of federated learning.
[0110] In some embodiments, the central server receives model parameters updated from each client and aggregates the model parameters updated by each client according to a preset aggregation strategy (such as a weighted average algorithm) to update the global model and / or the model parameters of the global model according to the aggregated model parameters.
[0111] The model parameters of the global model updated by the central server are calculated by the following formula (4), including:
[0112]
[0113] in, represents the model parameters of the global model updated by the central server in the tth iteration, represents the model parameters updated by the kth client in the tth iteration.
[0114] Therefore, this embodiment can perform model training without sharing original data, realize effective aggregation and utilization of multi-node data, thereby protecting data privacy and security. At the same time, it can use more sample data to update the global model, improving the accuracy and generalization performance of the model.
[0115] In some embodiments, a support vector machine algorithm based on quantum hyperplane separation is used as a classification algorithm, that is, by adopting a multi-scale kernel mapping strategy of quantum states, the algorithm is allowed to find the optimal segmentation hyperplane in a higher dimension, thereby improving the classification accuracy and realizing the optimization of the classification performance of the support vector machine using quantum computing technology. Specifically, Figure 3 This is a flow chart of state classification model training provided in an embodiment of the present application. This embodiment provides an encoder processing method, that is, step S103 may include but is not limited to steps S301 to S304.
[0116] S301, initializing quantum bits and the quantum state of a vehicle state data sample of any state type, wherein each quantum bit represents a characteristic dimension of the vehicle state data sample.
[0117] Optionally, the quantum state is determined by the following formula (5), including:
[0118]
[0119] Among them, ψ u is the quantum state of the vehicle state data sample (i.e., the quantum state of the entire system), n u is the number of features, θ iu is the quantum bit in quantum state ψ u The polar angle on the Bloch sphere on iu is the quantum bit in quantum state ψ u The azimuth angle on the Bloch sphere on the π-th quantum bit is u The polar angle θ on the Bloch sphere iu ,φ iu Azimuth, used to adjust the state of the quantum bit.
[0120] S302: Establish a quantum kernel function for any two quantum states, where the quantum kernel function is used to indicate the similarity between the quantum states.
[0121] It should be noted that quantum kernel functions can utilize the superposition and entanglement of quantum states to achieve complex nonlinear mapping, and can effectively capture the subtle differences between different state modes of samples.
[0122] Optionally, the quantum kernel function is determined by the following formula (6), including:
[0123] K u (ψ u ,ψ′ u )=|<ψ u |ψ′ u >| 2 (6)
[0124] Among them, K u (ψ u ,ψ′ u ) represents two quantum states ψ u and ψ′ u The quantum kernel function between u |ψ′ u > represents two quantum states ψ u and ψ′ u The inner product between them reflects the similarity of the quantum states.
[0125] Among them, the inner product of the two quantum states is determined by the following formula (7), including:
[0126]
[0127] In the formula, θ i ′ u is the quantum state of the ith quantum bit in ψ′ u The polar angle on the Bloch sphere on i ′ u is the quantum state of the ith quantum bit in ψ′ u The azimuth on the Bloch sphere
[0128] S303: Optimize the hyperparameters of the current global model according to the quantum kernel function to obtain an optimized global model.
[0129] In this embodiment, quantum optimization technology is used to adjust and optimize the hyperparameters of the support vector machine, such as regularization parameters and kernel function parameters. Specifically, quantum annealing or quantum approximate optimization algorithm is used to ensure that the optimal hyperplane is found in the high-dimensional feature space, and the quantum annealing algorithm is used to optimize the hyperparameter λ of the support vector machine. u and σ u The way is expressed as:
[0130]
[0131] Among them, λ u is the weight in the hyperparameter, σ u is the bias in the hyperparameter, m u is the total number of the first sample, y i is the label of the i-th vehicle status data sample, n u is the total number of the second sample, ψ iu is the quantum state of the i-th vehicle state data sample, ψ ju is the quantum state of the jth vehicle state data sample, K u (ψ iu ,ψ ju) represents two quantum states ψ iu and ψ ju The quantum kernel function between ju is the weight of the jth vehicle state data sample, Ω u (*) represents the optimization objective function; [*] + Represents the hinge loss function, which is used for support vector machine optimization.
[0132] S304: Evaluate and adjust the optimized global model based on a preset test set to obtain a state classification model.
[0133] In this embodiment, the performance of the model is evaluated through quantum measurements, which can provide information about the quantum state, which in turn is used to evaluate the effect of the classification boundary and adjust the model according to the actual classification effect.
[0134] Optionally, the evaluation result is determined by the following formula (9), including:
[0135]
[0136] in, For the evaluation results containing the predicted labels, is the quantum state of the i-th vehicle state data sample in the test set.
[0137] Therefore, this embodiment utilizes the multi-scale kernel mapping strategy of quantum states and quantum optimization technology to significantly improve the classification accuracy and model performance when processing large-scale high-dimensional data, making vehicle fault diagnosis more accurate and reliable.
[0138] Figure 4 This is a schematic diagram of the structure of a vehicle diagnostic system provided in an embodiment of the present application. The vehicle diagnostic system 400 includes at least one client 401 and a central server 402:
[0139] The client 401 is used to obtain vehicle status data samples, each of which is identified by a status type; iteratively train the global model currently issued by the central server according to the vehicle status data samples, and return the model parameters corresponding to the locally trained global model to the central server;
[0140] The central server 402 is used to iteratively aggregate the model parameters returned by each of the clients to update the global model, and send the updated global model to the clients until a preset iteration stop condition is reached to obtain a state classification model;
[0141] The client 401 is also used to obtain vehicle status data of the target vehicle; classify the vehicle status data using the status classification model to obtain a status classification result of the target vehicle.
[0142] In some embodiments, the central server 402 is used to perform loss calculation based on the sample characteristics of the vehicle status data sample, the sample data label and the current model parameters to obtain the loss prediction of the vehicle status data sample with respect to the current model parameters;
[0143] The client 401 is used to obtain the sample quantity of the vehicle status data sample and the loss prediction;
[0144] Determining loss data and corresponding loss gradients during training according to the sample quantity and the loss prediction;
[0145] Update the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples obtained by each of the clients, and the loss gradient;
[0146] Based on the updated model parameters, a global model after local training is obtained.
[0147] In some embodiments, the client 401 is used to calculate the loss data using the following formula (1), including:
[0148]
[0149] Among them, ω leb are model parameters, is the loss data of the kth client for the model parameters, is the number of vehicle status data samples obtained by the kth client, is the loss prediction of the model parameters for the jth vehicle status data sample, is the data distribution of the kth client;
[0150] The updating of the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples acquired by each of the clients and the loss gradient includes:
[0151] The model parameters are updated by the following formula (2), including:
[0152]
[0153] in, are the model parameters updated by the client in the tth iteration, is the model parameter in the tth iteration, R nod is the learning rate, N leb is the number of nodes related to the client, D leb is the total number of vehicle status data samples obtained by all clients, is the loss gradient.
[0154] In some embodiments, the central server 402 is used to calculate the loss prediction using the following formula (3), including:
[0155]
[0156] in, represents the loss prediction of the model parameters for the jth vehicle status data sample, is the sample feature of the jth vehicle status data sample, is the sample data label of the jth vehicle status data sample, L tra (*) indicates the loss function.
[0157] In some embodiments, the central server 402 is used to calculate the model parameters of the global model updated by the central server using the following formula (4), including:
[0158]
[0159] in, represents the model parameters of the global model updated by the central server in the tth iteration, represents the model parameters updated by the kth client in the tth iteration.
[0160] In some embodiments, the client 401 is used to initialize quantum bits and quantum states of vehicle state data samples of any state type, each quantum bit representing a characteristic dimension of the vehicle state data sample;
[0161] Establishing a quantum kernel function for any two quantum states, wherein the quantum kernel function is used to indicate the similarity between the quantum states;
[0162] According to the quantum kernel function, optimizing the hyperparameters of the current global model to obtain an optimized global model;
[0163] The optimized global model is evaluated and adjusted based on the preset test set to obtain the state classification model.
[0164] In some embodiments, the client 401 is used to determine the quantum state by the following formula (5), including:
[0165]
[0166] Among them, ψ u is the quantum state of the vehicle state data sample, n u is the number of features, θ iu is the quantum bit in quantum state ψ u The polar angle on the Bloch sphere on iu is the quantum bit in quantum state ψ u The azimuth on the Bloch sphere on ;
[0167] The step of establishing a quantum kernel function for any two quantum states comprises:
[0168] The quantum kernel function is determined by the following formula (6), including:
[0169] K u (ψ u ,ψ′ u )=|<ψ u |ψ′ u >| 2 (6)
[0170] Among them, K u (ψ u ,ψ′ u ) represents two quantum states ψ u and ψ′ u The quantum kernel function between u |ψ′ u > represents two quantum states ψ u and ψ′ u The inner product between
[0171] Among them, the inner product of the two quantum states is determined by the following formula (7), including:
[0172]
[0173] In the formula, θ′ iu is the quantum state of the ith quantum bit in ψ′ u The polar angle on the Bloch sphere on iu is the quantum state of the ith quantum bit in ψ′ u The azimuth on the Bloch sphere on ;
[0174] The step of optimizing the hyperparameters of the current global model according to the quantum kernel function to obtain an optimized global model includes:
[0175] The hyperparameters of the current global model are optimized by the following formula (8), including:
[0176]
[0177] Among them, λ u is the weight in the hyperparameter, σ u is the bias in the hyperparameter, m u is the total number of the first sample, y i is the label of the i-th vehicle status data sample, n u is the total number of the second sample, ψ iu is the quantum state of the i-th vehicle state data sample, ψ ju is the quantum state of the jth vehicle state data sample, K u (ψ iu ,ψ ju ) represents two quantum states ψ iu and ψ ju The quantum kernel function between ju is the weight of the jth vehicle state data sample, Ω u (*) represents the optimization objective function, [*] + represents the hinge loss function;
[0178] The optimized global model is evaluated and adjusted based on a preset test set to obtain a state classification model, including:
[0179] The evaluation result is determined by the following formula (9), including:
[0180]
[0181] in, For the evaluation results containing the predicted labels, is the quantum state of the i-th vehicle state data sample in the test set.
[0182] The system of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the system of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the system, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0183] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0184] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0185] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0187] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0188] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0189] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0190] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0191] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0192] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0193] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A vehicle diagnostic method, characterized in that: For at least one client, the method comprises: Acquire vehicle status data samples, each of the vehicle status data samples being identified with a status type; Iteratively train the global model currently sent by the central server according to the vehicle state data sample, and return the model parameters corresponding to the locally trained global model to the central server, so that the central server aggregates the model parameters returned by each of the clients and updates the global model, and sends the updated global model to the client until a preset iteration stop condition is reached to obtain a state classification model; Obtain vehicle status data of the target vehicle; The vehicle status data is classified using the status classification model to obtain a status classification result of the target vehicle.
2. The vehicle diagnostic method according to claim 1, characterized in that: The global model currently sent by the central server is trained according to the vehicle status data sample through the following steps, including: Obtaining the sample quantity of the vehicle status data sample and the loss prediction of the vehicle status data sample by the current model parameters, wherein the loss prediction is obtained by the central server after performing loss calculation based on the sample features of the vehicle status data sample, the sample data label and the current model parameters; Determining loss data and corresponding loss gradients during training according to the sample quantity and the loss prediction; Update the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples obtained by each of the clients, and the loss gradient; Based on the updated model parameters, a global model after local training is obtained.
3. The vehicle diagnostic method according to claim 2, characterized in that: Determining the loss data and the corresponding loss gradient during the training process according to the sample quantity and the loss prediction includes: The loss data is calculated by the following formula (1), including: Among them, ω leb are model parameters, is the loss data of the kth client for the model parameters, is the number of vehicle status data samples obtained by the kth client, is the loss prediction of the model parameters for the jth vehicle status data sample, is the data distribution of the kth client; The updating of the model parameters according to the current model parameters, the learning rate updated by the current model parameters, the number of nodes of the client, the vehicle state data samples acquired by each of the clients and the loss gradient includes: The model parameters are updated by the following formula (2), including: in, are the model parameters updated by the client in the tth iteration, is the model parameter in the tth iteration, R nod is the learning rate, N leb is the number of nodes related to the client, D leb is the total number of vehicle status data samples obtained by all clients, is the loss gradient.
4. The vehicle diagnostic method according to claim 3, characterized in that: The method further includes calculating, by the central server, the loss prediction: The loss prediction is calculated by the following formula (3): include: in, represents the loss prediction of the model parameters for the jth vehicle status data sample, is the sample feature of the jth vehicle status data sample, is the sample data label of the jth vehicle status data sample, L tra (*) indicates the loss function.
5. The vehicle diagnostic method according to claim 4, characterized in that: The method further comprises updating the global model by the central server: The model parameters of the global model updated by the central server are calculated by the following formula (4), including: in, represents the model parameters of the global model updated by the central server in the tth iteration, represents the model parameters updated by the kth client in the tth iteration.
6. The vehicle diagnostic method according to claim 5, characterized in that: The global model currently sent by the central server is trained according to the vehicle status data sample through the following steps, and also includes: Initializing quantum bits and quantum states of vehicle state data samples of any of the state types, each quantum bit representing a characteristic dimension of the vehicle state data sample; Establishing a quantum kernel function for any two quantum states, wherein the quantum kernel function is used to indicate the similarity between the quantum states; According to the quantum kernel function, optimizing the hyperparameters of the current global model to obtain an optimized global model; The optimized global model is evaluated and adjusted based on the preset test set to obtain the state classification model.
7. The vehicle diagnostic method according to claim 6, characterized in that: The initialization quantum bit, and the quantum state of the vehicle state data sample of any state type, include: The quantum state is determined by the following formula (5), including: Among them, ψ u is the quantum state of the vehicle state data sample, n u is the number of features, θ iu is the quantum bit in quantum state ψ u The polar angle on the Bloch sphere on iu is the quantum bit in quantum state ψ u The azimuth on the Bloch sphere on ; The step of establishing a quantum kernel function for any two quantum states includes: The quantum kernel function is determined by the following formula (6), including: K u (ψ u ,ψ′ u )=|<ψ u |ψ′ u >| 2 (6) Among them, K u (ψ u ,ψ′ u ) represents two quantum states ψ u and ψ′ u The quantum kernel function between u |ψ′ u > represents two quantum states ψ u and ψ′ u The inner product between Among them, the inner product of the two quantum states is determined by the following formula (7), including: In the formula, θ′ iu is the quantum state of the ith quantum bit in ψ′ u The polar angle on the Bloch sphere on iu is the quantum state of the ith quantum bit in ψ′ u The azimuth on the Bloch sphere on ; The step of optimizing the hyperparameters of the current global model according to the quantum kernel function to obtain an optimized global model includes: The hyperparameters of the current global model are optimized by the following formula (8), including: Among them, λ u is the weight in the hyperparameter, σ u is the bias in the hyperparameter, m u is the total number of the first sample, y i is the label of the i-th vehicle status data sample, n u is the total number of the second sample, ψ iu is the quantum state of the i-th vehicle state data sample, ψ ju is the quantum state of the jth vehicle state data sample, K u (ψ iu , ψ ju ) represents two quantum states ψ iu and ψ ju The quantum kernel function between ju is the weight of the jth vehicle status data sample, Ω u (*) represents the optimization objective function, [*] + represents the hinge loss function; The optimized global model is evaluated and adjusted based on a preset test set to obtain a state classification model, including: The evaluation result is determined by the following formula (9), including: in, For the evaluation results containing the predicted labels, is the quantum state of the i-th vehicle state data sample in the test set.
8. A vehicle diagnostic system, characterized in that: Includes at least one client and a central server: The client is used to obtain vehicle status data samples, each of which is identified by a status type; iteratively train the global model currently issued by the central server according to the vehicle status data samples, and return the model parameters corresponding to the locally trained global model to the central server; The central server is used to iteratively aggregate the model parameters returned by each of the clients to update the global model, and send the updated global model to the clients until a preset iteration stop condition is reached to obtain a state classification model; The client is also used to obtain vehicle status data of the target vehicle; and classify the vehicle status data using the status classification model to obtain a status classification result of the target vehicle.
9. A vehicle, characterized in that: Comprising the vehicle diagnostic system of claim 8.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the vehicle diagnosis method according to any one of claims 1 to 7 is implemented.