Training method, system, device and storage medium for battery swap prediction model

Through the neural network model combined with multiple matching degree calculation methods, the user and battery characteristics are extracted, and the problem of unreasonable battery matching in the existing technology is solved, more personalized and efficient battery recommendations are achieved, and user experience and battery swap services are improved. efficiency.

CN118626868BActive Publication Date: 2024-12-17NANTONG TAIPING TONGREN ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411110219.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-17
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The existing electric vehicle battery swap model is simply based on the remaining battery power, ignoring the actual use of the battery and the personalized needs of users, resulting in the inadequate utilization of resources and the low user experience and efficiency.

Method used

The neural network model extracts the feature vectors of user behavior and environment data and the battery attribute feature vectors, and combines the matching degree calculation method of Mahayana distance and weighted similarity, similarity and difference, and generates a battery set with matching order to perform personality Chemical battery recommendation.

Benefits of technology

It realizes more accurate battery recommendations, meets the personalized needs of different users, improves battery swap experience and service efficiency, and avoids inconvenience caused by battery mismatch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626868B_ABST
    Figure CN118626868B_ABST
Patent Text Reader

Abstract

The present application relates to the field of new energy technology, and in particular to a training method, system, device and storage medium for a battery swap prediction model. The method includes obtaining environmental data and behavioral data, inputting into a feature extraction network, extracting feature vectors and fusing them to obtain user feature vectors; obtaining battery attribute data and inputting into a feature extraction network, extracting battery attribute feature vectors; inputting user feature vectors and battery attribute feature vectors into a battery matching network, calculating the degree of match between the battery attribute feature vector and the user feature vector, selecting several batteries of the same number and with the highest degree of match, and generating a target battery set with a matching order. Using environmental data and behavioral data as model inputs and a target battery set with a matching order as model outputs, the model is trained to obtain a battery swap prediction model. The present application can comprehensively consider battery characteristics and user behavior characteristics, recommend batteries more accurately, and thus enhance the user's battery swap experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of new energy technology, and in particular to a training method, system, device and storage medium for a battery replacement prediction model. Background Art

[0002] With the popularity of electric vehicles, battery swapping has gradually become an efficient way to replenish batteries. As the core equipment of the battery swapping model, the battery swapping cabinet greatly shortens the recharging time of electric vehicle users and improves the efficiency of vehicle use by providing battery replacement services. With the development of intelligent technology and big data analysis, how to use these advanced technologies to optimize battery swapping services and provide more personalized and efficient battery recommendations has become an important direction for the development of the industry.

[0003] At present, the main working method of electric vehicle battery swap cabinets is to provide batteries to users based on the principle of the largest remaining power when the user arrives at the battery swap cabinet. The above method simplifies the battery selection process and quickly allocates batteries to users through the most direct power sorting, ensuring that users can obtain relatively long battery life to a certain extent.

[0004] However, the existing battery replacement model is obviously irrational in that it simply judges whether a battery is suitable for a rider based on the remaining battery power. The above method ignores the actual usage of the battery and the personalized needs of the user, which easily leads to the battery resources not being fully utilized. For example, although some batteries have a lot of remaining power, they may not be suitable for long-term driving due to their small capacity or high degree of aging. In addition, users' driving habits and specific needs vary. Some users may need higher-capacity batteries, while others pay more attention to the health of the battery. Therefore, a battery replacement model that can comprehensively consider battery characteristics and user behavior characteristics is needed to recommend batteries more accurately and improve users' battery replacement experience and the overall efficiency of battery replacement services. Summary of the invention

[0005] This application provides a training method, system, device and storage medium for a battery swap prediction model. This application can comprehensively consider battery characteristics and user behavior characteristics to more accurately recommend batteries, thereby improving the user's battery swap experience. This application provides the following technical solutions:

[0006] In a first aspect, the present application provides a method for training a battery swap prediction model, the method comprising:

[0007] Acquire environmental data and user behavior data, input the environmental data and the behavior data into a feature extraction network of a preset neural network model, the feature extraction network extracts a feature vector of the environmental data and a feature vector of the behavior data, and performs feature fusion to obtain a user feature vector;

[0008] Acquire attribute data of all batteries in the battery swap cabinet, input the attribute data into a feature extraction network of a preset neural network model, and the feature extraction network extracts attribute feature vectors of all batteries based on the attribute data;

[0009] The user feature vector and the attribute feature vectors of all batteries are input into a battery matching network of a preset neural network model, and the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, and selects a plurality of batteries with the same number and the highest matching degree to generate a first matching result and a second matching result;

[0010] Determine whether there is an intersection between the first matching result and the second matching result. If there is an intersection, use the battery in the intersection as the target battery, and sort all the target batteries based on the matching degree ranking values ​​of the target battery in the first matching result and the second matching result to generate a target battery set with a matching order; if there is no intersection, use the battery in the union of the two as the target battery, normalize the matching degrees of all the target batteries and sort them to generate a target battery set with a matching order;

[0011] The environmental data and the user's behavior data are used as model inputs, and the target battery set with a matching order is used as model output. The preset neural network model is trained to obtain a battery replacement prediction model.

[0012] In a specific implementation scheme, the feature extraction network extracts feature vectors of behavior data including:

[0013] The behavior data includes the user's driving data, battery replacement data, battery usage data, and preference data;

[0014] The feature extraction network performs statistical analysis on each type of data contained in the behavior data to extract the corresponding feature vector, determines the weight of the feature vector of each type of data according to the actual application scenario and importance, multiplies each type of feature vector by the corresponding weight, and then adds the weighted feature vectors to obtain the feature vector of the behavior data. The calculation formula of the feature vector of the behavior data is as follows:

[0015] in, is the feature vector of behavioral data, are the feature vectors of driving data, battery replacement data, battery usage data, and preference data, respectively. are the weights corresponding to the feature vectors of driving data, battery replacement data, battery usage data, and preference data, and are limited to .

[0016] In a specific implementation scheme, the step of fusing features to obtain a user feature vector includes:

[0017] The feature vector of the environment data and the feature vector of the behavior data are concatenated to form the final user feature vector, as shown in the following formula:

[0018] in, is the user feature vector, Represents a vector concatenation operation.

[0019] In a specific implementation scheme, the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including:

[0020] The Mahalanobis distance calculation formula is defined to measure the distance between the user feature vector and the attribute feature vector of each battery. The Mahalanobis distance calculation formula is as follows:

[0021] in is the covariance matrix of the eigenvectors, is the inverse of the covariance matrix;

[0022] A weighted similarity calculation formula is defined to measure the similarity between the user feature vector and the attribute feature vector of each battery. The weighted similarity calculation formula is as follows:

[0023] in, is the weight of each dimension, and are the user feature vector and the battery attribute feature vector in the The values ​​in the dimensions;

[0024] The matching degree calculation formula obtained by the above two calculation formulas is as follows:

[0025] in It is an adjustment parameter that controls the weight of Mahalanobis distance and similarity in the matching calculation. It is the maximum value of the Mahalanobis distance and is used for normalization.

[0026] In a specific implementation scheme, the battery matching network uses a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including:

[0027] Define the similarity measure function , used to measure the similarity between the user feature vector and the attribute feature vector of each battery, the similarity measurement function As shown below:

[0028] in, Represents the user feature vector A feature vector with the attributes of each battery The norm between them, that is, the distance or size between two vectors, is an adjustment parameter used to control the decay rate of similarity;

[0029] Redefine the difference measure function , used to measure the difference between the user feature vector and the attribute feature vector of each battery, the difference measurement function As shown below:

[0030] Comprehensive similarity measurement function and the difference measure function , define the matching degree measurement function , as shown below:

[0031] For each battery attribute feature vector, use the above matching metric function Calculate the matching degree between it and the user feature vector respectively.

[0032] In a specific implementation scheme, after training the preset neural network model to obtain the battery swap prediction model, the method further includes:

[0033] Collect user satisfaction based on the recommendation results of the target battery set;

[0034] A loss function is designed based on the user satisfaction, and based on the loss function, the model parameters are updated using the gradient descent method until the loss function is minimized.

[0035] In a specific implementation scheme, the designing of a loss function based on the user satisfaction comprises:

[0036] The loss function designed based on user satisfaction is as follows:

[0037] in is the actual user satisfaction, is the expected user satisfaction, is the variance of expected user satisfaction.

[0038] In a second aspect, the present application provides a training system for a battery swap prediction model, which adopts the following technical solutions:

[0039] A training system for a battery swap prediction model, comprising:

[0040] A user feature extraction module, used to obtain environmental data and user behavior data, input the environmental data and the behavior data into a feature extraction network of a preset neural network model, the feature extraction network extracts a feature vector of the environmental data and a feature vector of the behavior data, and performs feature fusion to obtain a user feature vector;

[0041] A battery feature extraction module is used to obtain the attribute data of all batteries in the battery swap cabinet, input the attribute data into a feature extraction network of a preset neural network model, and the feature extraction network extracts attribute feature vectors of all batteries based on the attribute data;

[0042] A matching degree calculation module, used for inputting the user feature vector and the attribute feature vectors of all batteries into a battery matching network of a preset neural network model, wherein the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, and selects a plurality of batteries with the same number and the highest matching degree to generate a first matching result and a second matching result;

[0043] a matching result judgment module, used to judge whether there is an intersection between the first matching result and the second matching result; if there is an intersection, the battery in the intersection is used as the target battery, and all the target batteries are sorted based on the matching degree ranking values ​​of the target batteries in the first matching result and the second matching result to generate a target battery set with a matching order; if there is no intersection, the battery in the union of the two is used as the target battery, the matching degrees of all the target batteries are normalized and sorted, and a target battery set with a matching order is generated;

[0044] The battery replacement model training module is used to use the environmental data and the user's behavior data as model inputs and the target battery set with a matching order as model outputs to train the preset neural network model to obtain a battery replacement prediction model.

[0045] In a third aspect, the present application provides an electronic device, comprising a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a training method for a battery replacement prediction model as described in the first aspect.

[0046] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the storage medium stores a program, and when the program is executed by a processor, the program is used to implement a training method for a battery swap prediction model as described in the first aspect.

[0047] In summary, the beneficial effects of this application include at least:

[0048] 1) The Mahalanobis distance takes into account the correlation between the dimensions of the feature vector and is suitable for distance calculation between multidimensional data. The calculation of the Mahalanobis distance takes into account the correlation between the dimensions in the feature vector, which is reflected by the covariance matrix. When there is correlation between features, the Mahalanobis distance can more accurately measure the actual difference.

[0049] 2) Combining the similarity measurement function and the difference measurement function, the similarity and difference between the user feature vector and each battery attribute feature vector can be comprehensively considered. The similarity measurement function measures the similarity between them, while the difference measurement function measures the difference between them. By comprehensively considering the similarity and difference, the matching degree can be evaluated more comprehensively.

[0050] 3) The loss function can ensure that the model's prediction is close to the preset expected satisfaction, so that the model focuses more on the preset goal and ensures that the model moves in the expected direction during the training process. By introducing the variance of the expected satisfaction, the loss function can take into account the range of variation of the expected satisfaction, which helps to balance the accuracy and stability of the prediction during the model optimization process and prevent the model from overfitting or underfitting. At the same time, the differentiability of the loss function makes it possible to use optimization algorithms such as gradient descent to update the model parameters to minimize the loss function, which helps the model to be gradually optimized during the training process so that it better meets the setting of the expected satisfaction.

[0051] By comprehensively considering user behavior data, environmental data and battery attribute data, and matching using a preset neural network model, the irrationality existing in the existing electric vehicle battery replacement service, that is, the problem of simple matching based on the remaining battery power, is solved. Through the feature extraction network, the user's behavior and environmental factors are converted into feature vectors, and combined with a variety of matching degree calculation methods, a more personalized and efficient battery recommendation is achieved. This solution effectively considers the actual use of the battery and the personalized needs of the user, and improves the user's battery replacement experience and the overall efficiency of the service. By comprehensively considering the user's driving habits, battery replacement behavior, battery usage and preferences, a more accurate battery recommendation is achieved to meet the personalized needs of different users. Combined with the environmental data obtained in real time, the battery recommendation model can be adjusted according to different environmental factors, which improves the adaptability and accuracy of the model. Matching through a preset neural network model and comprehensively considering a variety of matching degree calculation methods improves the accuracy and stability of matching, thereby improving the efficiency of battery recommendation. Users can obtain batteries that meet their needs more quickly, avoiding the inconvenience caused by battery mismatch, thereby improving the user's battery replacement experience.

[0052] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flow chart of the training method of the battery swap prediction model in the embodiment of the present application. Figure 1 .

[0054] Figure 2 It is an overall schematic diagram of the training method of the battery swap prediction model in the embodiment of the present application.

[0055] Figure 3 This is a flow chart of the training method of the battery swap prediction model in the embodiment of the present application. Figure 2 .

[0056] Figure 4 It is a structural block diagram of the training system of the battery swap prediction model in the embodiment of the present application.

[0057] Figure 5 It is a block diagram of an electronic device for training the battery replacement prediction model in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.

[0059] Optionally, the present application uses the training method of the battery replacement prediction model provided in each embodiment as an example for use in an electronic device, where the electronic device is a terminal or a server. The terminal may be a computer, a tablet computer, etc. This embodiment does not limit the type of electronic device.

[0060] Reference Figure 1 , is a flow chart of a method for training a battery swap prediction model provided by an embodiment of the present application, the method comprising at least the following steps:

[0061] Step S101, obtain environmental data and user behavior data, input the environmental data and behavior data into a feature extraction network of a preset neural network model, the feature extraction network extracts feature vectors of the environmental data and feature vectors of the behavior data, and performs feature fusion to obtain a user feature vector.

[0062] Step S102: Obtain attribute data of all batteries in the battery swap cabinet, input the attribute data into a feature extraction network of a preset neural network model, and the feature extraction network extracts attribute feature vectors of all batteries based on the attribute data.

[0063] Step S103: input the user feature vector and the attribute feature vectors of all batteries into the battery matching network of the preset neural network model. The battery matching network calculates the matching degree between the attribute feature vector of each battery and the user feature vector using a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference, and selects the same number of batteries with the highest matching degree to generate a first matching result and a second matching result.

[0064] Step S104: determine whether there is an intersection between the first matching result and the second matching result. If there is an intersection, use the battery in the intersection as the target battery, and sort all the target batteries based on the matching ranking values ​​of the target batteries in the first matching result and the second matching result to generate a target battery set with a matching order. If there is no intersection, use the battery in the union of the two as the target battery, normalize the matching degrees of all the target batteries and sort them to generate a target battery set with a matching order.

[0065] Step S105: Use environmental data and user behavior data as model input, and a target battery set with a matching order as model output, train the preset neural network model, and obtain a battery replacement prediction model.

[0066] In step S101, the user's behavior data includes the user's driving data, battery replacement data, battery usage data and preference data, wherein the driving data includes the user's driving distance, driving time and driving speed, etc., the battery replacement data includes the user's battery replacement frequency, battery replacement time and battery replacement location, etc., the battery usage data includes the remaining battery power, battery usage time and battery consumption, etc., and the preference data includes the user's preference for battery capacity or health status.

[0067] Optionally, some of the user's behavior data can be obtained from the battery swap application used by the user, or from the user's interactive behavior on the battery swap service platform, with the user's authorization. This application does not restrict the method of obtaining behavior data. It should be noted that since the above-mentioned behavior data of the user may not be fully obtained, the embodiment of this application allows for the situation where some of the user's behavior data is missing.

[0068] In a specific embodiment, the behavior data is input into a feature extraction network of a preset neural network model, and the feature extraction network performs statistical analysis on each type of data contained in the behavior data to extract the corresponding feature vector. For example, for driving data, features such as average driving distance, maximum driving distance, minimum driving distance, and standard deviation of driving distance are extracted. For battery swapping data, features such as battery swapping frequency, average battery swapping time, and commonly used battery swapping locations are extracted. For battery usage data, features such as average remaining power, average usage time, and battery consumption rate are extracted. For preference data, features such as the frequency of user preferences for battery capacity and health status are extracted. Subsequently, a weighted average is used to calculate the feature vector of the final behavior data. Specifically, the weight of the feature vector of each type of data is determined according to the actual application scenario and importance, and each type of feature vector is multiplied by the corresponding weight, and then the weighted feature vectors are added to obtain the feature vector of the behavior data. The calculation formula for the feature vector of the behavior data is as follows:

[0069] in, is the feature vector of behavioral data, are the feature vectors of driving data, battery replacement data, battery usage data, and preference data, respectively. are the weights corresponding to the feature vectors of driving data, battery replacement data, battery usage data, and preference data, and are limited to If some of the user's behavior data is missing, the data and its corresponding weights can be ignored directly, and the weights corresponding to the remaining data can be dynamically adjusted. For example, if the user lacks battery replacement data and battery usage data, the following formula is used to calculate the characteristic vector of the behavior data:

[0070] It should be noted that the weights at this time also need to be adjusted dynamically so that .

[0071] In addition, as a preferred embodiment, in this embodiment, while obtaining the user's behavior data, the environmental data is also obtained in real time, wherein the environmental data includes the weather conditions at the location of the battery swap cabinet, and the environmental data is input into the feature extraction network of the preset neural network model. The feature extraction network extracts the feature vector of the environmental data through the same statistical analysis method as described above, which is recorded as Then the feature vector of the environment data and the feature vector of the behavior data are concatenated to form the final user feature vector, as shown in the following formula:

[0072] in, is the user feature vector, Represents a vector concatenation operation. The above steps comprehensively consider the user's behavior data and environmental data, convert them into feature vectors through the feature extraction network, and perform feature fusion to generate a more comprehensive and personalized user feature vector. This operation helps to improve the accuracy and personalization of subsequent model recommendations, enhance the model's adaptability to different environments, reduce information loss, and improve the model's generalization ability, thereby improving user experience and the overall performance of the model.

[0073] In addition, as a preference, in the present embodiment, the user's behavior data obtained each time will be stored in a pre-built database, and the database will be updated in real time at preset intervals. The database adopts distributed storage, and the behavior data of the same user will be stored in one place and correspond to a user identifier, which can be a user name or user ID. With this setting, when the user performs a battery replacement service, the user's behavior data in the database can be directly called by simply entering the user name or user ID, thereby saving time for model prediction and further improving the user's experience.

[0074] In step S102, the attribute data of all batteries in the battery swap cabinet are obtained, including but not limited to the battery model, capacity, remaining power and health status, and then these attribute data are input into the feature extraction network of the preset neural network model. The feature extraction network performs statistical analysis on each type of data contained in the attribute data to extract the corresponding feature vector, and then uses the weighted average calculation method in step S101 to obtain the attribute feature vectors of all batteries, where the attribute feature vector set of all batteries is ,in The specific method is basically the same as that in step S101, and will not be described here. Optionally, the feature vector of the attribute data of the battery can also be extracted using existing technology, such as dimensionality reduction technology or hash technology.

[0075] In addition, as a preference, in this embodiment, the feature extraction network periodically receives the attribute data of all batteries in the battery swap cabinet and updates the attribute feature vector of each battery. Since the batteries in the battery swap cabinet are existing, there is no need to wait until the user's behavior data and environmental data are obtained before extracting the attribute feature vectors of all batteries. Therefore, the attribute data of all batteries in the battery swap cabinet can be input into the feature extraction network in advance and updated periodically, thereby saving the prediction time of the model as much as possible and improving the user experience.

[0076] In step S103, the user feature vector and the attribute feature vectors of all batteries are input into the battery matching network of the preset neural network model. The battery matching network uses the matching degree calculation method based on Mahalanobis distance and weighted similarity and the matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector. After the matching degree is calculated using the two methods, the matching degrees are sorted from large to small, and the same number of batteries are selected from the maximum value of the matching degree to generate the first matching result and the second matching result. Among them, the matching degree calculation method based on Mahalanobis distance and weighted similarity takes into account the correlation and similarity of the feature vectors, performs superiorly in multidimensional space, and can handle complex user behaviors and battery attribute data. The matching degree calculation method combining similarity and difference provides a more balanced and detailed matching degree calculation by combining the measurement of similarity and difference, which can effectively distinguish subtle differences. Different methods have different sensitivities to data. Combining the two algorithms can enhance the robustness and stability of the model and reduce the deviation or error that may be caused by a single algorithm.

[0077] In a specific embodiment, a matching degree calculation method based on Mahalanobis distance and weighted similarity is first used to calculate the matching degree between the attribute feature vector of each battery and the user feature vector. First, a Mahalanobis distance calculation formula is defined to measure the distance between the user feature vector and the attribute feature vector of each battery, while taking into account the correlation between the dimensions. The Mahalanobis distance calculation formula is as follows:

[0078] in is the covariance matrix of the eigenvectors, is the inverse matrix of the covariance matrix. Then, a weighted similarity calculation formula is defined to measure the similarity between the user feature vector and the attribute feature vector of each battery. The weighted similarity calculation formula is as follows:

[0079] in, is the weight of each dimension, and are the user feature vector and the battery attribute feature vector in the Finally, the matching degree calculation formula is obtained through the above two calculation formulas as follows:

[0080] in It is an adjustment parameter that controls the weight of Mahalanobis distance and similarity in the matching calculation. is the maximum value of the Mahalanobis distance and is used for normalization. After calculating the matching degree between the attribute feature vector of each battery and the user feature vector through the above formula, the matching degrees are sorted in descending order, and several batteries with the highest matching degrees are selected as the first matching results.

[0081] In practice, the Mahalanobis distance takes into account the correlation of each dimension of the feature vector and is suitable for distance calculation between multidimensional data. The calculation of the Mahalanobis distance takes into account the correlation between each dimension in the feature vector, which is reflected by the covariance matrix. When there is correlation between features, the Mahalanobis distance can more accurately measure the actual difference. For example, in the battery and user behavior feature vectors, some features may be correlated, and the Mahalanobis distance can capture these correlations, thereby providing a more accurate distance measurement. The Mahalanobis distance is scale-independent, that is, it is not affected by the difference in the dimensions of different feature dimensions. The ordinary Euclidean distance is affected by the dimension of the feature when calculating, while the Mahalanobis distance eliminates this problem through the standardization process, so that features of different dimensions can be compared under the same metric. Weighted similarity can reflect the relative similarity of feature vectors in each dimension, and the weights of different dimensions can be set according to actual conditions. Combining the dual measurement of distance and similarity improves the accuracy and flexibility of matching calculation. The Mahalanobis distance takes into account the correlation between features, which can reduce the redundancy between features, thereby better reflecting the actual structure of the data. Weighted similarity adjusts the contribution of features through weights, which can further reduce the redundancy between features. Combining these two methods can better handle the correlation and redundancy between features and obtain a more accurate matching measure.

[0082] In a specific embodiment, a matching degree calculation method combining similarity and difference is then used to calculate the matching degree between the attribute feature vector of each battery and the user feature vector. First, a similarity measurement function is defined: , used to measure the similarity between the user feature vector and the attribute feature vector of each battery, the similarity measurement function As shown below:

[0083] in, Represents the user feature vector A feature vector with the attributes of each battery The norm between them, that is, the distance or size between two vectors, It is an adjustment parameter used to control the decay rate of similarity. Then the difference measurement function is defined , used to measure the difference between the user feature vector and the attribute feature vector of each battery, the difference measurement function As shown below:

[0084] The final comprehensive similarity measurement function and the difference measure function , define the matching degree measurement function , as shown below:

[0085] For each battery attribute feature vector, use the above matching metric function After calculating the matching degree between the attribute feature vector of each battery and the user feature vector through the above formula, sort the matching degrees from large to small, and select several batteries with the highest matching degrees as the second matching results. The number of batteries selected in the first matching result and the second matching result is the same.

[0086] In implementation, by combining the similarity metric function and the difference metric function, the similarity and difference between the user feature vector and each battery attribute feature vector can be comprehensively considered. The similarity metric function measures the similarity between them, while the difference metric function measures the difference between them. By comprehensively considering the similarity and the difference, the matching degree can be evaluated more comprehensively. Combining the similarity and the difference at the same time can balance the trade-off between similarity and difference. In some cases, similarity may be more important and need to emphasize similarity more, while in other cases, difference may be more important and need to emphasize difference more. By comprehensively considering the similarity and the difference, the two aspects can be better balanced to obtain a more reasonable matching degree metric. In addition, combining the similarity and the difference can enhance the robustness of the matching degree calculation. The similarity metric function and the difference metric function can complement each other and make up for each other's limitations, thereby improving the stability and reliability of the matching degree calculation method.

[0087] Optionally, in addition to using the matching degree calculation method based on Mahalanobis distance and weighted similarity and the matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, the cosine similarity calculation method can also be used in combination with any of the above methods to calculate the matching degree, which can also achieve the technical effect of this solution to a certain extent.

[0088] In step S104, after the battery matching network generates the first matching result and the second matching result, it is first determined whether there is an intersection between the first matching result and the second matching result. If there is an intersection, the battery in the intersection is used as the target battery, and then the matching degree ranking value of each target battery in the first matching result and the second matching result is obtained respectively, that is, the first ranking value and the second ranking value are obtained, and then the first ranking value and the second ranking value obtained for each target battery are added and averaged to obtain the average ranking value, and finally all target batteries are sorted in order from small to large according to the average ranking value of each target battery, so as to generate a target battery set with a matching order. Optionally, if there are target batteries with the same average ranking value, the target batteries are selected in order of better battery health and more battery power. If there is no intersection, all batteries in the union of the two are selected as target batteries, and then the matching degrees calculated in step S103 for all target batteries are normalized and sorted, so as to generate a target battery set with a matching order. Specifically, the matching degrees in the first matching result and the second matching result are normalized and mapped to the same range of 0-1. The normalization process can eliminate the absolute differences in the matching degrees in different results and make them on the same order of magnitude. A linear normalization method is used in the embodiment of the present application, and other commonly used normalization methods can also be used. The present application does not limit the specific normalization method. If there are target batteries with the same matching degree after normalization, the target batteries are selected in order of better battery health and more battery power.

[0089] In step S105, the environment data and the user's behavior data are used as model inputs, and the target battery set with matching order is used as model output, and the preset neural network model is trained to obtain a battery replacement prediction model. Optionally, in the embodiment of the present application, a convolutional neural network is selected as the neural network model, and other types of neural network models can also be selected. The present application does not limit the specific type of the neural network model.

[0090] In summary, refer to Figure 2, this application solves the irrationality existing in the existing electric vehicle battery replacement service, that is, the problem of simple matching based on the remaining battery power, by comprehensively considering user behavior data, environmental data and battery attribute data, and matching using a preset neural network model. Through the feature extraction network, the user's behavior and environmental factors are converted into feature vectors, and combined with a variety of matching degree calculation methods, a more personalized and efficient battery recommendation is achieved. Such a scheme effectively considers the actual use of the battery and the personalized needs of the user, and improves the user's battery replacement experience and the overall efficiency of the service. By comprehensively considering the user's driving habits, battery replacement behavior, battery usage and preferences, a more accurate battery recommendation is achieved to meet the personalized needs of different users. Combined with the environmental data obtained in real time, the battery recommendation model can be adjusted according to different environmental factors, which improves the adaptability and accuracy of the model. Matching is performed through a preset neural network model, and a variety of matching degree calculation methods are comprehensively considered to improve the accuracy and stability of the matching, thereby improving the efficiency of battery recommendation. Users can obtain batteries that meet their needs more quickly, avoiding the inconvenience caused by battery mismatch, thereby improving the user's battery replacement experience.

[0091] In addition, as a preference, in this embodiment, referring to Figure 3 In addition to the aforementioned steps S101 to S105, the training method of the battery swap prediction model further includes:

[0092] Step S106: Collect user satisfaction based on the recommendation results of the target battery set.

[0093] In step S106, after the battery replacement prediction model outputs the target battery set with a matching order, in the actual application scenario, the user will select the target battery set with a matching order. After the user's selection, he will make a satisfaction selection, that is, satisfied or dissatisfied. Finally, all users' selections are collected and the actual user satisfaction is calculated.

[0094] Step S107: Design a loss function based on user satisfaction, and based on the loss function, use the gradient descent method to update the model parameters until the loss function is minimized.

[0095] In step S107, the loss function designed based on user satisfaction is as follows:

[0096] in is the actual user satisfaction, is the expected user satisfaction, is the variance of expected user satisfaction. The first term in the loss function can ensure that the model's prediction is close to the preset expected satisfaction to a certain extent. This design can make the model focus more on the preset goal and ensure that the model moves in the expected direction during the training process. By introducing the variance of the expected satisfaction, the second term of the loss function can take into account the range of variation of the expected satisfaction, which helps to balance the accuracy and stability of the prediction during the model optimization process and prevent the model from overfitting or underfitting. Similarly, the differentiability of the loss function makes it possible to use optimization algorithms such as gradient descent to update the model parameters to minimize the loss function, which helps the model to be gradually optimized during the training process so that it better meets the setting of the expected satisfaction. In summary, the loss function designed based on satisfaction can introduce considerations of the expected goal during the training process and take into account the stability of the expected goal, which helps the model to better achieve the preset goal.

[0097] Figure 4 This is a structural block diagram of a training system for a battery swap prediction model provided by an embodiment of the present application. The device includes at least the following modules:

[0098] The user feature extraction module is used to obtain environmental data and user behavior data, input the environmental data and behavior data into the feature extraction network of the preset neural network model, the feature extraction network extracts the feature vector of the environmental data and the feature vector of the behavior data, and performs feature fusion to obtain the user feature vector.

[0099] The battery feature extraction module is used to obtain the attribute data of all batteries in the battery swap cabinet, and input the attribute data into the feature extraction network of the preset neural network model. The feature extraction network extracts the attribute feature vectors of all batteries based on the attribute data.

[0100] A matching degree calculation module is used to input the user feature vector and the attribute feature vectors of all batteries into a battery matching network of a preset neural network model. The battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, and selects several batteries of the same number and with the highest matching degree to generate a first matching result and a second matching result.

[0101] The matching result judgment module is used to judge whether there is an intersection between the first matching result and the second matching result. If there is an intersection, the battery in the intersection is used as the target battery, and all target batteries are sorted based on the matching ranking values ​​of the target battery in the first matching result and the second matching result to generate a target battery set with a matching order. If there is no intersection, the battery in the union of the two is used as the target battery, and the matching degrees of all target batteries are normalized and sorted to generate a target battery set with a matching order.

[0102] The battery swap model training module is used to use environmental data and user behavior data as model input and a target battery set with a matching order as model output to train the preset neural network model and obtain a battery swap prediction model.

[0103] For relevant details, refer to the above method embodiment.

[0104] Figure 5 4 is a block diagram of an electronic device provided by an embodiment of the present application. The device at least includes a processor 401 and a memory 402.

[0105] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0106] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the training method of the battery swap prediction model provided in the method embodiment of the present application.

[0107] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.

[0108] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.

[0109] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the training method of the battery replacement prediction model of the above method embodiment.

[0110] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the training method of the battery replacement prediction model of the above method embodiment.

[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0112] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A training method for a battery swap prediction model, characterized in that: The method comprises: Acquire environmental data and user behavior data, input the environmental data and the behavior data into a feature extraction network of a preset neural network model, the feature extraction network extracts feature vectors of the environmental data and feature vectors of the behavior data, and performs feature fusion to obtain a user feature vector; the behavior data includes the user's driving data, battery replacement data, battery usage data, and preference data; Acquire attribute data of all batteries in the battery swap cabinet, input the attribute data into a feature extraction network of a preset neural network model, and the feature extraction network extracts attribute feature vectors of all batteries based on the attribute data; The user feature vector and the attribute feature vectors of all batteries are input into a battery matching network of a preset neural network model, and the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, and selects a plurality of batteries with the same number and the highest matching degree to generate a first matching result and a second matching result; The battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including: defining a Mahalanobis distance calculation formula for measuring the distance between the user feature vector and the attribute feature vector of each battery, and the Mahalanobis distance calculation formula is as follows: in is the covariance matrix of the eigenvectors, is the inverse of the covariance matrix, is the user feature vector, is the attribute feature vector of the battery; and then define a weighted similarity calculation formula to measure the similarity between the user feature vector and the attribute feature vector of each battery. The weighted similarity calculation formula is as follows: in, is the weight of each dimension, are the user feature vector and the battery attribute feature vector in the The values ​​on the dimensions; the matching degree calculation formula of the first matching result obtained by the above two calculation formulas is as follows: in It is an adjustment parameter that controls the weight of Mahalanobis distance and similarity in the matching calculation. is the maximum value of the Mahalanobis distance, which is used for normalization; The battery matching network uses a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including: defining a similarity measurement function , used to measure the similarity between the user feature vector and the attribute feature vector of each battery, the similarity measurement function As shown below: in, Represents the user feature vector A feature vector with the attributes of each battery The norm between them, that is, the distance or size between two vectors, is an adjustment parameter used to control the decay rate of similarity; and then define the difference measurement function , used to measure the difference between the user feature vector and the attribute feature vector of each battery, the difference measurement function As shown below: Comprehensive similarity measurement function and the difference measure function , define the matching degree measurement function , as shown below: For each battery attribute feature vector, use the above matching metric function Calculate the matching degree between it and the user feature vector respectively as the second matching result; Determine whether there is an intersection between the first matching result and the second matching result. If there is an intersection, use the battery in the intersection as the target battery, obtain the matching degree ranking value of each target battery in the first matching result and the second matching result, that is, obtain the first ranking value and the second ranking value, add and average the first ranking value and the second ranking value obtained for each target battery to obtain the average ranking value, and sort all target batteries in ascending order according to the average ranking value of each target battery, so as to generate a target battery set with a matching order; if there is no intersection, use the battery in the union of the two as the target battery, normalize the matching degrees of all target batteries and then sort them, so as to generate a target battery set with a matching order; The environmental data and the user's behavior data are used as model inputs, and the target battery set with a matching order is used as model output. The preset neural network model is trained to obtain a battery replacement prediction model.

2. The training method of the battery swap prediction model according to claim 1, characterized in that: The feature extraction network extracts the feature vector of the behavior data including: The feature extraction network performs statistical analysis on each type of data contained in the behavior data to extract the corresponding feature vector, determines the weight of the feature vector of each type of data according to the actual application scenario and importance, multiplies each type of feature vector by the corresponding weight, and then adds the weighted feature vectors to obtain the feature vector of the behavior data. The calculation formula of the feature vector of the behavior data is as follows: in, is the feature vector of behavioral data, are the feature vectors of driving data, battery replacement data, battery usage data, and preference data, respectively. are the weights corresponding to the feature vectors of driving data, battery replacement data, battery usage data, and preference data, and are limited to .

3. The training method of the battery swap prediction model according to claim 2, characterized in that: The step of fusing features to obtain a user feature vector comprises: The feature vector of the environment data and the feature vector of the behavior data are concatenated to form the final user feature vector, as shown in the following formula: in, is the user feature vector, Represents a vector concatenation operation.

4. The training method of the battery swap prediction model according to claim 1, characterized in that: After training the preset neural network model to obtain the battery swap prediction model, the following further includes: Collect user satisfaction based on the recommendation results of the target battery set; A loss function is designed based on the user satisfaction, and based on the loss function, the model parameters are updated using the gradient descent method until the loss function is minimized.

5. The training method of the battery swap prediction model according to claim 4, characterized in that: The loss function designed based on the user satisfaction comprises: The loss function designed based on user satisfaction is as follows: in is the actual user satisfaction, is the expected user satisfaction, is the variance of expected user satisfaction.

6. A training system for a battery swap prediction model, characterized in that: include: A user feature extraction module, used to obtain environmental data and user behavior data, input the environmental data and the behavior data into a feature extraction network of a preset neural network model, the feature extraction network extracts feature vectors of the environmental data and feature vectors of the behavior data, and performs feature fusion to obtain a user feature vector; the behavior data includes the user's driving data, battery replacement data, battery usage data, and preference data; A battery feature extraction module is used to obtain the attribute data of all batteries in the battery swap cabinet, input the attribute data into a feature extraction network of a preset neural network model, and the feature extraction network extracts attribute feature vectors of all batteries based on the attribute data; A matching degree calculation module is used to input the user feature vector and the attribute feature vectors of all batteries into a battery matching network of a preset neural network model, wherein the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity and a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, and selects a plurality of batteries with the same number and the highest matching degree to generate a first matching result and a second matching result; the battery matching network uses a matching degree calculation method based on Mahalanobis distance and weighted similarity to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including: defining a Mahalanobis distance calculation formula, which is used to measure the distance between the user feature vector and the attribute feature vector of each battery, and the Mahalanobis distance calculation formula is as follows: in is the covariance matrix of the eigenvectors, is the inverse of the covariance matrix, is the user feature vector, is the attribute feature vector of the battery; and then define a weighted similarity calculation formula to measure the similarity between the user feature vector and the attribute feature vector of each battery. The weighted similarity calculation formula is as follows: in, is the weight of each dimension, are the user feature vector and the battery attribute feature vector in the The values ​​on the dimensions; the matching degree calculation formula of the first matching result obtained by the above two calculation formulas is as follows: in It is an adjustment parameter that controls the weight of Mahalanobis distance and similarity in the matching calculation. is the maximum value of the Mahalanobis distance, which is used for normalization; The battery matching network uses a matching degree calculation method combining similarity and difference to calculate the matching degree between the attribute feature vector of each battery and the user feature vector, including: defining a similarity measurement function , used to measure the similarity between the user feature vector and the attribute feature vector of each battery, the similarity measurement function As shown below: in, Represents the user feature vector A feature vector with the attributes of each battery The norm between them, that is, the distance or size between two vectors, is an adjustment parameter used to control the decay rate of similarity; and then define the difference measurement function , used to measure the difference between the user feature vector and the attribute feature vector of each battery, the difference measurement function As shown below: Comprehensive similarity measurement function and the difference measure function , define the matching degree measurement function , as shown below: For each battery attribute feature vector, use the above matching metric function Calculate the matching degree between it and the user feature vector respectively as the second matching result; A matching result judgment module, used to judge whether there is an intersection between the first matching result and the second matching result. If there is an intersection, the battery in the intersection is used as the target battery, and the matching degree ranking value of each target battery in the first matching result and the second matching result is obtained respectively, that is, the first ranking value and the second ranking value are obtained, and the first ranking value and the second ranking value obtained for each target battery are added and averaged to obtain an average ranking value, and all target batteries are sorted in ascending order according to the average ranking value of each target battery, so as to generate a target battery set with a matching order; if there is no intersection, the battery in the union of the two is used as the target battery, and the matching degrees of all target batteries are normalized and sorted to generate a target battery set with a matching order; The battery replacement model training module is used to use the environmental data and the user's behavior data as model inputs and the target battery set with a matching order as model outputs to train the preset neural network model to obtain a battery replacement prediction model.

7. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a training method for a battery replacement prediction model as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The storage medium stores a program, which, when executed by a processor, is used to implement a training method for a battery replacement prediction model as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Energy supplement resource recommendation method, electronic equipment and storage medium

    CN115905332A

  • Charging cabinet battery management method and device, electronic equipment and medium

    CN116788092A