Generation method of electric vehicle charging behavior data set, medium and equipment
By iteratively training the weight matrix of a large language model and employing retrieval enhancement generation techniques, the problem of obtaining electric vehicle charging behavior data is solved, generating an efficient and low-cost electric vehicle charging behavior dataset to support charging load prediction and demand response research.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EAST CHINA BRANCH OF STATE GRID CORP
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies struggle to acquire large-scale electric vehicle charging behavior data, and traditional methods are costly, have poor data quality, and are not timely enough, while also being limited by the protection of electric vehicle user privacy.
By acquiring electric vehicle charging and driving datasets, we use the weight matrix of a large language model for iterative training to generate an electric vehicle charging behavior dataset, and perform semantic consistency and numerical rationality verification. We then use low-rank matrix fine-tuning and retrieval enhancement generation techniques to construct an efficient and low-cost data acquisition solution.
The generated electric vehicle charging behavior dataset is timely and of high quality, effectively reducing hardware and storage resource requirements, overcoming data duplication issues, reducing acquisition costs, and providing multi-dimensional data support.
Smart Images

Figure CN121980147A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of new energy technology, and in particular to a method, medium, and device for generating electric vehicle charging behavior datasets. Background Technology
[0002] Currently, research on charging load forecasting and electric vehicle demand response requires large-scale electric vehicle charging behavior data as a foundation. The more complete the data, the more accurate the characterization of electric vehicle users' charging behavior. However, due to limitations such as the protection of electric vehicle user privacy, large-scale electric vehicle charging behavior data is difficult to collect completely, making acquisition challenging. Furthermore, acquiring electric vehicle charging behavior data through traditional onboard data acquisition systems requires high equipment and user authorization costs. Obtaining electric vehicle charging behavior data samples through traditional probabilistic models relies on the quality of the original data, which is subject to long update times and poor timeliness.
[0003] Therefore, a technical solution is needed that can obtain large-scale electric vehicle charging behavior data. Summary of the Invention
[0004] One objective of this application is to provide a method, medium, and device for generating electric vehicle charging behavior datasets, in order to solve the problems of difficulty in obtaining electric vehicle charging behavior data and low data quality caused by the privacy of electric vehicle users in the prior art.
[0005] To achieve the above objectives, some embodiments of this application provide a method for generating an electric vehicle charging behavior dataset, the method comprising:
[0006] Obtain electric vehicle charging and driving datasets;
[0007] Based on the weight matrix of the first language model, the first low-rank matrix and the second low-rank matrix are iteratively trained to obtain the trained first low-rank matrix and the second low-rank matrix.
[0008] Based on the first and second low-rank matrices after training, the weight matrix of the second language model is determined. The weight matrix of the second language model is different from that of the first language model.
[0009] Based on the electric vehicle charging and driving dataset, determine the retrieval dataset;
[0010] Using the retrieved dataset as the real data source, an electric vehicle charging behavior dataset was generated through the second largest language model.
[0011] Semantic consistency verification and numerical reasonableness verification are performed on the electric vehicle charging behavior dataset.
[0012] Furthermore, based on the weight matrix of the first large language model, the first low-rank matrix and the second low-rank matrix are iteratively trained, including:
[0013] The incremental weight matrix is determined by the product of the second low-rank matrix and the first low-rank matrix.
[0014] The weight matrix of the first language model is updated by summing the incremental weight matrix and the weight matrix of the first language model.
[0015] The output vector is determined based on the input vector and the updated first language model. The input vector is determined based on the electric vehicle charging and driving dataset.
[0016] The loss value of the output vector is calculated based on the preset loss function;
[0017] The first and second low-rank matrices are adjusted with the goal of minimizing the loss value of the output vector.
[0018] The updated incremental weight matrix is determined based on the adjusted first and second low-rank matrices, and the iterative process of adjusting the first and second low-rank matrices based on the updated incremental weight matrix continues until the iteration stop condition is met.
[0019] Furthermore, the loss function is the negative log-likelihood loss function, expressed by the following formula:
[0020] ;
[0021] Where L is the loss function, For the output of the first t Each Token For located Previous Tokens P This is the probability distribution of Token based on model parameters, where Token is a single character.
[0022] Furthermore, the first and second low-rank matrices are adjusted, as expressed by the following formula:
[0023] ;
[0024] ;
[0025] Where A is the first low-rank matrix and B is the second low-rank matrix. This is the learning rate.
[0026] Furthermore, based on the electric vehicle charging and driving dataset, the retrieval dataset is determined, including:
[0027] The electric vehicle charging and driving dataset is divided into multiple data blocks;
[0028] Vectorize multiple data blocks to obtain the retrieval set vector;
[0029] The retrieval set vector is divided into multiple subclasses based on the data category, and the center vector of each subclass is calculated;
[0030] Calculate the cosine similarity between the original query vector and the center vector of each subclass;
[0031] Multiple data points are uniformly extracted from the subclasses with the highest similarity to form a retrieval dataset.
[0032] Furthermore, the method also includes:
[0033] The data dimensions of the electric vehicle charging behavior dataset are determined based on the electric vehicle charging and driving dataset. The data dimensions include vehicle model, battery type, battery capacity, battery range, access time, charging amount, remaining amount, charging end amount, charging end time, driving distance, driving duration, vehicle energy consumption, parking time, charging time, charging power, driving amount, average vehicle speed, initial SOC, and off-grid SOC.
[0034] Furthermore, semantic consistency verification is performed on the electric vehicle charging behavior dataset, including:
[0035] Obtain the dataset related to the validation dimensions of the electric vehicle charging behavior dataset. The validation dimensions include: initial SOC, driving distance, average vehicle speed, parking time and vehicle energy consumption.
[0036] Randomly sample the dataset related to the validation dimensions to obtain a sampled dataset;
[0037] Input the sampled dataset into the second largest language model to obtain the validation dataset;
[0038] The semantic consistency index between the validation dataset and the retrieval dataset is calculated and expressed by the following formula:
[0039] ;
[0040] ;
[0041] in, ESC As a semantic consistency indicator, To validate the validation vectors in the dataset, To retrieve data vectors from a dataset, To be compatible with the verification vector The semantically closest retrieval dataset contains data vectors. Euclidean distance, For verification vectors With subclass center vector The Euclidean distance.
[0042] Furthermore, the numerical validity of the electric vehicle charging behavior dataset is verified, including:
[0043] Obtain multiple vector pairs consisting of validation vectors from the validation dataset and data vectors from the retrieval dataset, where the Euclidean distance between the validation vectors and data vectors in the vector pairs is minimized.
[0044] Based on the verification vector and data vector in the vector pair, determine whether the verification vector meets the reasonableness condition;
[0045] The data reasonableness index is calculated based on the number of valid vectors in multiple vector pairs, expressed by the following formula:
[0046] ;
[0047] in, DRI As an indicator of data rationality, N The number of vector pairs. To verify the number of valid vectors.
[0048] Some embodiments of this application also provide a computer-readable medium having computer-readable instructions stored thereon, which can be executed by a processor to implement the aforementioned method for generating electric vehicle charging behavior datasets.
[0049] Some embodiments of this application also provide an electronic device, which includes a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the electronic device performs the aforementioned method for generating an electric vehicle charging behavior dataset.
[0050] Compared with existing technologies, the solution provided in this application can acquire electric vehicle charging and driving datasets. Based on the weight matrix of the first large language model, iterative training is performed on the first and second low-rank matrices to obtain trained first and second low-rank matrices. The weight matrix of the second large language model is then determined based on the trained first and second low-rank matrices. A retrieval dataset is then determined based on the electric vehicle charging and driving dataset, and this retrieval dataset is used as the real data source. An electric vehicle charging behavior dataset is generated through the second large language model. Finally, semantic consistency and numerical reasonableness verification are performed on the electric vehicle charging behavior dataset. This allows for the acquisition of large-scale electric vehicle charging behavior data, unaffected by the privacy concerns of electric vehicle users. The method of fine-tuning the weight matrix of the large language model effectively reduces the hardware and storage resources required for fine-tuning. By improving the traditional retrieval enhancement generation architecture, the retrieval dataset overcomes the problem of excessive data duplication caused by nearest neighbor search. The generated electric vehicle charging behavior data has high timeliness and effectively reduces the cost of acquiring electric vehicle charging behavior data. Attached Figure Description
[0051] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0052] Figure 1 A flowchart illustrating a method for generating an electric vehicle charging behavior dataset, provided for some embodiments of this application.
[0053] Figure 2 A flowchart for constructing a second major language model provided for some embodiments of this application.
[0054] Figure 3 A flowchart for generating electric vehicle charging behavior data using a second major language model, provided for some embodiments of this application. Detailed Implementation
[0055] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0056] Here, the method for generating electric vehicle charging behavior datasets in this application embodiment is suitable for scenarios that require obtaining large-scale electric vehicle charging behavior data for technical research such as charging load prediction and electric vehicle demand response.
[0057] In this scenario, it is difficult to obtain large-scale electric vehicle charging behavior data due to factors such as electric vehicle user privacy, data acquisition costs, and data quality. Without large-scale electric vehicle charging behavior data as a foundation, subsequent research and optimization work cannot be carried out.
[0058] The method for generating electric vehicle charging behavior dataset provided in this application can acquire electric vehicle charging and driving datasets, and iteratively train a first low-rank matrix and a second low-rank matrix based on the weight matrix of a first large language model to obtain trained first and second low-rank matrices. The weight matrix of a second large language model is then determined based on the trained first and second low-rank matrices. A retrieval dataset is then determined based on the electric vehicle charging and driving dataset, and this retrieval dataset is used as the real data source. The electric vehicle charging behavior dataset is generated through the second large language model. Finally, semantic consistency and numerical reasonableness verification are performed on the electric vehicle charging behavior dataset. This method can obtain large-scale electric vehicle charging behavior data without being restricted by electric vehicle user privacy factors. The method of fine-tuning the weight matrix of the large language model effectively reduces the hardware and storage resources used for fine-tuning. By improving the traditional retrieval enhancement generation architecture, the retrieval dataset can overcome the problem of excessive data duplication caused by nearest neighbor search. The generated electric vehicle charging behavior data has high timeliness and can also effectively reduce the acquisition cost of electric vehicle charging behavior data.
[0059] Figure 1 The following illustrates the flowchart of a method for generating an electric vehicle charging behavior dataset using an electronic device in some embodiments of this application. The electronic device is the executing entity of this method, such as... Figure 1 As shown, the method may include the following steps: Step S101: Obtain the electric vehicle charging and driving dataset.
[0060] Here, electric vehicle charging and driving data sets can be obtained through third-party platforms. These third-party platforms can be any online platform that provides electric vehicle charging and driving data, such as New Mobility Community and Autohome.
[0061] Charging and driving data from third-party platforms can be obtained manually or automatically. Automated methods include using web crawler software to scrape electric vehicle charging and driving data from third-party platforms. The scraped data is usually in text format.
[0062] In some embodiments of this application, the crawled charging and driving data are preprocessed before use. Due to the openness of third-party network platforms, user-generated content for electric vehicles often exhibits subjectivity and exaggeration. To improve data quality and reduce subjective bias, the crawled raw text data is preprocessed.
[0063] In some embodiments of this application, preprocessing charging data and driving data may include the following steps:
[0064] 1) Data cleaning
[0065] Used to remove stray characters and ensure consistent formatting;
[0066] 2) Invalid information filtering.
[0067] Used to remove blank, advertising information, and invalid entries with fewer than 5 characters;
[0068] 3) Subjective content recognition
[0069] This is used to identify and remove highly subjective text data. For example, large language models such as DeepSeek can be used to analyze charging and driving data texts and score them on a 100-point scale from four dimensions: exaggeration, common sense, boastfulness, and subjectivity. Highly subjective text data with an average score exceeding a preset threshold, such as 60, can be removed.
[0070] After preprocessing the charging and driving data from third-party platforms, the final dataset is used as the electric vehicle charging and driving dataset. Table 1 below shows the sources and preprocessing results of the electric vehicle charging and driving dataset.
[0071] Table 1
[0072] In some embodiments of this application, the data dimensions of the electric vehicle charging behavior dataset can also be determined based on the electric vehicle charging and driving dataset. The data dimensions of the electric vehicle charging behavior dataset may include, but are not limited to: vehicle model, battery type, battery capacity, battery range, access time, charging capacity, remaining capacity, charging completion capacity, charging completion time, driving distance, driving duration, vehicle energy consumption, parking time, charging time, charging power, driving capacity, average vehicle speed, initial SOC, off-grid SOC, etc. Table 2 below shows the data dimensions of the electric vehicle charging behavior dataset.
[0073] Table 2
[0074] Step S102: Based on the weight matrix of the first large language model, iteratively train the first low-rank matrix and the second low-rank matrix to obtain the trained first low-rank matrix and the second low-rank matrix.
[0075] Here, we use a large language model to generate electric vehicle charging behavior data. However, since third-party large language models (LLMs) are general-purpose models, directly using them to generate electric vehicle charging behavior data suffers from a lack of professionalism.
[0076] In some embodiments of this application, by adjusting the weight matrix of the large language model, the role of the large language model is transformed to the electric vehicle user side, thereby enabling the large language model to have professional question-answering capabilities in the field of electric vehicle charging behavior data generation.
[0077] In some embodiments of this application, the weight matrix of a large language model is fine-tuned using a low-rank adaptive (LoRA) fine-tuning method. The fine-tuning input is an electric vehicle charging and driving dataset, and the output is the weight matrix after fine-tuning training. Here, two low-rank matrices are introduced: a first low-rank matrix and a second low-rank matrix, to fine-tune the weight model.
[0078] In some embodiments of this application, iterative training of the first low-rank matrix and the second low-rank matrix based on the weight matrix of the first large language model may include the following steps:
[0079] 1) Determine the incremental weight matrix based on the matrix product of the second low-rank matrix and the first low-rank matrix.
[0080] Here, the first major language model can be any major language model, such as DeepSeek, Qwen, etc. In the embodiments of this application, Qwen2.5-7B can be used as the first major language model.
[0081] In some embodiments of this application, the first low-rank matrix A is initialized as a Gaussian random matrix. The second low-rank matrix B is initialized as a zero matrix.
[0082] The weight matrix W of the first major language model is A 3D matrix, denoted as The input vector is a k-dimensional vector, represented as .
[0083] Construct the incremental weight matrix using the first low-rank matrix A and the second low-rank matrix B. W is expressed by the following formula:
[0084] ;
[0085] in, This is an adaptive scaling factor used to control the weight update rate. ;
[0086] 2) Update the weight matrix of the first language model by using the sum of the incremental weight matrix and the weight matrix of the first language model.
[0087] The updated weight matrix of the first major language model The formula is expressed as follows:
[0088]
[0089] 3) Determine the output vector based on the input vector and the updated first language model. The input vector is determined based on the electric vehicle charging and driving dataset.
[0090] Here is the raw output of the first language model. Expressed as a formula: The forward propagation output after updating the weight matrix of the first large language model h The formula is expressed as follows:
[0091] ;
[0092] ;
[0093] in, y To transform the input vector.
[0094] 4) Calculate the loss value of the output vector according to the preset loss function.
[0095] In some embodiments of this application, the preset loss function for backpropagation updates is the negative log-likelihood (NLL) loss function, which is expressed by the following formula:
[0096]
[0097] Where L is the loss function, For the output of the first t Each Token For located Previous Tokens P This is the probability distribution of Token based on model parameters, where Token is a single character.
[0098] 5) Adjust the first and second low-rank matrices with the goal of minimizing the loss value of the output vector.
[0099] In some embodiments of this application, the first low-rank matrix A and the second low-rank matrix B are adjusted, as expressed by the following formula:
[0100] ;
[0101] ;
[0102] Where A is the first low-rank matrix and B is the second low-rank matrix. This is the learning rate.
[0103] 6) Determine the updated incremental weight matrix based on the adjusted first low-rank matrix and second low-rank matrix, and continue the iterative process of adjusting the first low-rank matrix and second low-rank matrix based on the updated incremental weight matrix until the iteration stop condition is met.
[0104] Here, after adjusting the first low-rank matrix A and the second low-rank matrix B, we obtain a new first low-rank matrix A and a new second low-rank matrix B. Then, we use the new first low-rank matrix A and the second low-rank matrix B to obtain a new incremental weight matrix. Then, we obtain the current iteration value of the first low-rank matrix A and the second low-rank matrix B through the aforementioned steps 2) to 5). We check whether the iteration stopping condition is met. If it is not met, we continue the iteration process. If it is met, we stop the iteration. The training of the first low-rank matrix A and the second low-rank matrix B is completed.
[0105] The iteration stopping condition can be set according to the iteration requirements, such as stopping after a certain number of iterations.
[0106] In some embodiments of this application, the parameters for LoRA fine-tuning of Qwen2.5-7B are set as follows: scaling factor is 32, AdamW optimizer is used, learning rate is 1e-4, maximum sequence length is 2000, training cycle is 2, and the memory usage remains stable at 17.2GB throughout the training process. The low-rank matrix parameters account for only 1% of the total parameters. Therefore, it can significantly reduce the training resource requirements and the overall construction cost of the electric vehicle charging behavior dataset. The main construction cost is the hardware facility cost.
[0107] Step S103: Determine the weight matrix of the second large language model based on the first and second low-rank matrices after training.
[0108] Here, after the first low-rank matrix A and the second low-rank matrix B are trained, the final incremental weight matrix is calculated based on the final obtained first low-rank matrix A and second low-rank matrix B. The final incremental weight matrix is then added to the original weight matrix of the first large language model, and the resulting matrix is used as the weight matrix of the second large language model. The second large language model is the same as the first large language model, for example, both are Qwen2.5-7B, the difference being that they use different weight matrices.
[0109] When the second language model outputs, the goal of generating electric vehicle charging behavior data is expressed as a conditional language generation task, which generates the next character (i.e., token) sequentially based on the previously generated characters. Specifically, greedy decoding is used to generate the answer; that is, after determining the generation of the previous character, the next most likely character is selected as the answer and the output is completed. The second language model, after fine-tuning the weight matrix, possesses expertise in the electric vehicle field and can be used as the main model for generating electric vehicle charging behavior data.
[0110] Step S104: Determine the retrieval dataset based on the electric vehicle charging and driving dataset.
[0111] In some embodiments of this application, determining the retrieval dataset based on an electric vehicle charging and driving dataset may include the following steps:
[0112] 1) Divide the electric vehicle charging and driving dataset into multiple data blocks.
[0113] The formula is expressed as follows:
[0114] ;
[0115] in, For electric vehicle charging and driving datasets, The data is divided into blocks.
[0116] 2) Vectorize multiple data blocks to obtain the retrieval set vector.
[0117] The formula is expressed as follows:
[0118] ;
[0119] ;
[0120] in, For retrieving set vectors, For the retrieval vector, EThis is a vectorization method, such as embedding models for BERT (Bidirectional Encoder Representations from Transformers).
[0121] 3) Divide the retrieval set vector into multiple subclasses according to the data category, and calculate the center vector of each subclass.
[0122] The formula is expressed as follows:
[0123] ;
[0124] in, For subclass S The center vector, For the first subclass i A retrieval vector.
[0125] 4) Calculate the cosine similarity between the original query vector and the center vector of each subclass.
[0126] The cosine similarity is calculated using the following formula:
[0127] ;
[0128] in, q This is the original query vector. The subclass center vector, Let be the cosine similarity.
[0129] 5) Extract multiple data entries evenly from the subclass with the highest similarity to form the retrieval dataset.
[0130] In the subclass with the highest cosine similarity S Uniform extraction k The data points form a retrieval dataset, which is then added to the prompt template of the second largest language model.
[0131] Figure 2 This application illustrates the process of constructing a second major language model in some embodiments, such as... Figure 2 As shown, the ChatEV.Data model is the second largest language model. The original query vector q is "How much range does your electric car usually have left before you go to recharge?". The core text retrieval library for electric vehicles is the electric vehicle charging and driving dataset, and the electric vehicle user response vector library is the retrieval set vector.
[0132] Step S105: Using the retrieved dataset as the real data source, generate an electric vehicle charging behavior dataset through the second language model.
[0133] In this context, if the large language model lacks real numerical data support during data generation, it may overgeneralize on low-frequency or untrained data, potentially generating false data and polluting the dataset. Therefore, Retrieval Augmented Generation (RAG) technology is adopted to construct a retrieval dataset. By calling the algorithm, the required data categories are selected, data is extracted evenly, and added to the prompt template of the large language model, providing real data support for the large language model.
[0134] In some embodiments of this application, the retrieved dataset is used as the basis for real data and integrated into the calling process of the second language model, so that the second language model can accurately output multiple required electric vehicle charging behavior data based on the content of the retrieved dataset.
[0135] Figure 3 This application illustrates the process of generating electric vehicle charging behavior data through a second major language model in some embodiments, such as... Figure 3 As shown, the ChatEV.Data model is the second largest language model. The process includes two stages: the ChatEV.Data data generation stage and the ChatEV.Data data processing stage. In the ChatEV.Data data generation stage, based on the statistical results of the electric vehicle charging and driving dataset, vehicle models with a high number of electric vehicle users are selected to determine the corresponding battery capacity, battery range, and battery type for each model, and the data proportion of each vehicle model sample is set. That is, vehicle information-related data such as battery capacity, vehicle model, battery range, and battery type are obtained through statistical generation. Then, the starting SOC, driving distance, average vehicle speed, parking time, and energy consumption are obtained through the direct generation method of the ChatEV.Data model. Then, these generated data are combined with charging power, access time, and charging amount to obtain the remaining power, charging end power, driving time, driving power, off-grid SOC, charging time, and off-grid time through calculation. Finally, the basic data and extended data are matched and integrated to complete the construction of the electric vehicle charging behavior dataset.
[0136] The formula for obtaining the corresponding data through calculation is as follows: (See Table 2 for the data dimensions corresponding to the data symbols)
[0137] ;
[0138] ;
[0139] ;
[0140] ;
[0141] ;
[0142] ;
[0143] ;
[0144] During the ChatEV.Data data processing phase, data interpolation, outlier correction, and data matching constraints are performed to ultimately complete the construction of the comprehensive electric vehicle database, namely the electric vehicle charging behavior dataset.
[0145] For example, based on the analysis results of the electric vehicle charging and driving dataset from the second largest language model, and considering the current development status of China's new energy electric vehicle market, we set 37.5% of electric vehicle users to be BYD Song PLUS hybrid models, and the user percentages for BYD Tang EV, Tesla Model Y, Tesla Model 3, and XPeng P7i Pro to be 12.5%, 25%, 15%, and 10%, respectively. We also determined data such as battery capacity and driving range, as shown in Table 3 below, and generated 500 electric vehicle charging behavior data based on these models.
[0146] Table 3
[0147] Then, the ChatEV.Data model is used to directly generate data on the initial state of charge, driving distance, average vehicle speed, parking time, and vehicle energy consumption. Then, based on the above formula, seven data items are calculated: remaining battery power, charging end battery power, driving time, driving battery power, charging end state of charge, charging time, and off-grid time. Finally, all data are integrated to construct an electric vehicle charging behavior dataset. The sample of the obtained electric vehicle charging behavior data is shown in Table 4 below.
[0148] Table 4
[0149] Step S106: Perform semantic consistency verification and numerical reasonableness verification on the electric vehicle charging behavior dataset.
[0150] Here, after constructing the electric vehicle charging behavior dataset, it is necessary to evaluate the effectiveness of RAG technology on the second largest language model and verify the authenticity of the electric vehicle charging behavior data generated by the second largest language model. In some embodiments of this application, the Euclidean Semantic Consistency (ESC) and Data Rationality Indicator (DRI) are used to verify the electric vehicle charging behavior dataset.
[0151] In some embodiments of this application, semantic consistency verification of electric vehicle charging behavior datasets may include the following steps:
[0152] 1) Obtain the dataset related to the validation dimensions of the electric vehicle charging behavior dataset. The validation dimensions include: initial SOC, driving distance, average vehicle speed, parking time and vehicle energy consumption.
[0153] 2) Randomly sample the datasets related to the validation dimensions to obtain the sampled datasets.
[0154] 3) Input the sampled dataset into the second largest language model to obtain the validation dataset.
[0155] Here, since the ESC metric is calculated using the semantic distance of vectors, and numerical data lacks specific context, it is necessary to construct a vector space for validation data. By inputting sampled data into the second large language model, multiple data sets, such as 50 charging scenarios, can be generated, which are defined as validation data for the validation dataset. After vectorization, the validation vectors of the validation dataset are obtained. Then, use Euclidean distance to construct the ESC metric.
[0156] 4) Calculate the semantic consistency index between the validation dataset and the retrieval dataset, expressed by the following formula:
[0157] ;
[0158] ;
[0159] in, ESC As a semantic consistency indicator, To validate the validation vectors in the dataset, To retrieve data vectors from a dataset, To be compatible with the verification vector The semantically closest retrieval dataset contains data vectors. Euclidean distance, For verification vectors With subclass center vector The Euclidean distance.
[0160] In some embodiments of this application, verifying the numerical reasonableness of an electric vehicle charging behavior dataset may include the following steps:
[0161] 1) Obtain multiple vector pairs consisting of the validation vector in the validation dataset and the data vector in the retrieval dataset, where the Euclidean distance between the validation vector and the data vector in the vector pair is the smallest.
[0162] 2) Based on the verification vector and data vector in the vector pair, determine whether the verification vector meets the rationality condition.
[0163] 3) Calculate the data reasonableness index based on the number of valid vectors in multiple vector pairs, expressed by the following formula:
[0164] ;
[0165] in, DRI As an indicator of data rationality, N The number of vector pairs. To verify the number of valid vectors.
[0166] In the embodiments of this application, a second large language model is constructed by employing RAG technology combined with LoRA fine-tuning. The retrieved dataset is used as the basis for the data generation process of the second large language model, effectively solving the problem of overgeneralization of the large language model on low-frequency data. This significantly improves the authenticity and reliability of the generated electric vehicle charging behavior data and reduces the cost of constructing the electric vehicle charging behavior dataset. In addition, the ESC and DRI index verification system quantifies the semantic consistency and numerical rationality of the generated electric vehicle charging behavior dataset. The constructed electric vehicle charging behavior dataset provides multi-dimensional data support for research such as electric vehicle charging load prediction, charging facility planning, and user behavior profiling.
[0167] Table 5 shows the consistency and numerical reasonableness indices of the verification dimension data in some embodiments of this application. As shown in Table 5, the ESC and DRI indices of the ChatEV.Data large language model both exceed 95%, demonstrating excellent performance in semantic consistency verification and numerical reasonableness verification, verifying the effectiveness of the LoRA fine-tuning and retrieval enhancement generation method. Among them, the DRI of the driving distance data reaches 99.2%, indicating that the ChatEV.Data large language model has excellent data generation capabilities within the allowable deviation range. The higher ESC value indicates that the similarity between the verification vector and the data vector is higher, thus verifying that the ChatEV.Data large language model has strong contextual understanding capabilities and multi-context generalization performance.
[0168] Table 5
[0169] Therefore, the method in this application can efficiently construct a charging behavior dataset covering multi-dimensional charging and driving characteristics, significantly alleviating the high cost and strong privacy constraints of traditional data collection methods. Example results show that the ChatEV.Data large language model performs excellently in both semantic consistency (ESC > 95%) and numerical reasonableness (DRI > 97%), verifying its reliability and authenticity in generating high-quality, compliant simulated data. This provides a scalable, low-cost, and privacy-secure new data acquisition path for electric vehicle big data analysis, possessing significant theoretical and engineering application value.
[0170] In summary, the solution provided in this application can acquire electric vehicle charging and driving datasets. Based on the weight matrix of the first large language model, iterative training is performed on the first and second low-rank matrices to obtain the trained first and second low-rank matrices. The weight matrix of the second large language model is then determined based on the trained first and second low-rank matrices. Furthermore, a retrieval dataset is determined based on the electric vehicle charging and driving dataset, and this retrieval dataset serves as the real data source. An electric vehicle charging behavior dataset is generated through the second large language model. Finally, semantic consistency and numerical reasonableness verification are performed on the electric vehicle charging behavior dataset. This approach enables the acquisition of large-scale electric vehicle charging behavior data, unaffected by the privacy concerns of electric vehicle users. The method of fine-tuning the weight matrix of the large language model effectively reduces the hardware and storage resources required for fine-tuning. By improving the traditional retrieval enhancement generation architecture, the retrieval dataset overcomes the problem of excessive data duplication caused by nearest neighbor search. The generated electric vehicle charging behavior data has high timeliness and effectively reduces the cost of acquiring such data.
[0171] It should be noted that this application can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In one embodiment, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, a magnetic or optical drive, a floppy disk, or similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0172] In a typical configuration of this application, both the terminal and the network device include one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0173] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0174] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0175] Furthermore, a portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. The program instructions invoking the methods of this application may be stored in a fixed or removable recording medium, and / or transmitted via a data stream in a broadcast or other signal carrying medium, and / or stored in the working memory of a computer device operating according to the program instructions. Here, one embodiment of this application includes a device comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to run methods and / or technical solutions based on the foregoing embodiments of this application.
[0176] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
Claims
1. A method for generating a dataset of electric vehicle charging behavior, characterized in that, The method includes: Obtain electric vehicle charging and driving datasets; Based on the weight matrix of the first language model, the first low-rank matrix and the second low-rank matrix are iteratively trained to obtain the trained first low-rank matrix and the second low-rank matrix. Based on the first and second low-rank matrices obtained after training, the weight matrix of the second large language model is determined, wherein the weight matrix of the second large language model is different from the weight matrix of the first large language model. Based on the electric vehicle charging and driving dataset, determine the retrieval dataset; Using the retrieved dataset as the real data source, the electric vehicle charging behavior dataset is generated through the second major language model; The dataset of electric vehicle charging behavior is subjected to semantic consistency verification and numerical reasonableness verification.
2. The method according to claim 1, characterized in that, Based on the weight matrix of the first large language model, iterative training is performed on the first low-rank matrix and the second low-rank matrix, including: The incremental weight matrix is determined by the product of the second low-rank matrix and the first low-rank matrix. The weight matrix of the first large language model is updated using the sum of the incremental weight matrix and the weight matrix of the first large language model. The output vector is determined based on the input vector and the updated first large language model, wherein the input vector is determined based on the electric vehicle charging and driving dataset; The loss value of the output vector is calculated according to a preset loss function; With the goal of minimizing the loss value of the output vector, the first low-rank matrix and the second low-rank matrix are adjusted; The updated incremental weight matrix is determined based on the adjusted first low-rank matrix and second low-rank matrix, and the iterative process of adjusting the first low-rank matrix and the second low-rank matrix based on the updated incremental weight matrix continues until the iteration stop condition is met.
3. The method according to claim 2, characterized in that, The loss function is the negative log-likelihood loss function, expressed by the following formula: Where L is the loss function, For the output of the first t Each Token For located Previous Tokens P This is the probability distribution of Token based on model parameters, where Token is a single character.
4. The method according to claim 2, characterized in that, The first low-rank matrix and the second low-rank matrix are adjusted, as expressed by the following formula: Where A is the first low-rank matrix and B is the second low-rank matrix. This is the learning rate.
5. The method according to claim 1, characterized in that, Based on the electric vehicle charging and driving dataset, the retrieval dataset is determined, including: The electric vehicle charging and driving dataset is divided into multiple data blocks; Vectorize the multiple data blocks to obtain the retrieval set vector; The retrieval set vector is divided into multiple subclasses according to the data category, and the center vector of each subclass is calculated; Calculate the cosine similarity between the original query vector and the center vector of each subclass; Multiple data points are uniformly extracted from the subclasses with the highest similarity to form a retrieval dataset.
6. The method according to claim 1, characterized in that, The method also includes: The data dimensions of the electric vehicle charging behavior dataset are determined based on the electric vehicle charging and driving dataset. The data dimensions include vehicle model, battery type, battery capacity, battery range, access time, charging power, remaining power, charging end power, charging end time, driving distance, driving duration, vehicle energy consumption, parking time, charging time, charging power, driving power, average vehicle speed, initial SOC, and off-grid SOC.
7. The method according to claim 6, characterized in that, Perform semantic consistency verification on the electric vehicle charging behavior dataset, including: Obtain the dataset related to the verification dimensions in the electric vehicle charging behavior dataset, wherein the verification dimensions include: initial SOC, driving distance, average vehicle speed, parking time and vehicle energy consumption; Randomly sample the dataset related to the verification dimension to obtain a sampled dataset; Input the sampled dataset into the second largest language model to obtain the validation dataset; The semantic consistency index between the validation dataset and the retrieval dataset is calculated and expressed by the following formula: in, ESC As a semantic consistency indicator, To validate the validation vectors in the dataset, To retrieve data vectors from a dataset, To be compatible with the verification vector The semantically closest retrieval dataset contains data vectors. Euclidean distance, For verification vectors With subclass center vector The Euclidean distance.
8. The method according to claim 7, characterized in that, The numerical validity of the electric vehicle charging behavior dataset is verified, including: Obtain multiple vector pairs consisting of a verification vector in the verification dataset and a data vector in the retrieval dataset, wherein the Euclidean distance between the verification vector and the data vector in the vector pair is minimized; Based on the verification vector and the data vector in the vector pair, determine whether the verification vector satisfies the rationality condition; The data reasonableness index is calculated based on the number of valid verification vectors in the multiple vector pairs, and is expressed by the following formula: in, DRI As an indicator of data rationality, N The number of vector pairs. To verify the number of valid vectors.
9. A computer-readable medium having stored thereon computer-readable instructions that can be executed by a processor to implement the method as described in any one of claims 1 to 8.
10. An electronic device comprising a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein, When the computer program instructions are executed by the processor, the electronic device performs the method as described in any one of claims 1 to 8.