Charging gun switch test method, system, device and storage medium

Through the automated fault analysis method based on the XGBoost decision tree model, the problems of low manual maintenance efficiency and difficult to find hidden faults in charging gun management are solved, and more efficient charging gun management and fault prevention are achieved.

CN117992789BActive Publication Date: 2024-09-13SHENZHEN YONGGUI TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410199038.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2024-09-13
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

The existing charging gun management is still in the manual maintenance stage. There are problems such as long maintenance time and difficult to find hidden faults, which affects the operating efficiency of charging stations and the interests of users.

Method used

An automated fault analysis method based on the XGBoost decision tree model is adopted. By obtaining historical and real-time data of the charging gun, the boxplot algorithm is used for preprocessing and feature label generation, and the decision tree model is trained to implement the charging gun switch test, improve maintenance efficiency and Hidden faults are found.

Benefits of technology

It improves the management efficiency of the charging gun, can detect hidden faults more deeply, prevent possible accidents during the charging process, and ensure the stable operation of the charging gun.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117992789B
    Figure CN117992789B
Patent Text Reader

Abstract

The present application relates to the field of big data technology and provides a switch test method for a charging gun, the method comprising: obtaining historical switch data of the charging gun, the historical switch data comprising: result data, multiple feature data and numerical data corresponding to each feature data; converting each numerical data into interval value data through a box plot algorithm; generating a result label according to the result data, generating a feature label according to the feature data, and generating a training set according to the result label, the feature label and the interval value data; inputting the training set into a decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition to obtain a trained switch test model; obtaining real-time switch data of the charging gun, preprocessing the real-time switch data through a box plot algorithm to obtain data to be evaluated, inputting the data to be evaluated into the switch test model, and obtaining a switch test result of the charging gun.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a switch testing method, system, device and storage medium for a charging gun. Background Art

[0002] At present, with the rapid development of electric vehicle technology, the growing demand for charging has put forward higher requirements for the management of charging stations. In order to ensure the provision of accurate services to users, information technology has been increasingly used in charging stations. Various types of abnormal problems with charging equipment affect the interests of charging station operators and users, especially charging guns. Monitor the operation and status of charging guns, detect abnormal functions of charging guns in time and take measures to deal with them, ensure the stable operation of charging guns, and achieve reliable and stable charging, which is not only beneficial to the economic benefits of charging stations and the vital interests of users, but also to the hard indicators of charging safety. At present, the management of charging guns is still in the stage of manual maintenance, with problems such as long maintenance time and hidden faults that are difficult to find. Summary of the invention

[0003] The present application provides a switch testing method, system, device and storage medium for a charging gun, which are used to perform automated fault analysis based on characteristic data of the charging gun to improve the maintenance efficiency of the charging gun.

[0004] In a first aspect, an embodiment of the present application provides a switch testing method for a charging gun, the method comprising:

[0005] Obtaining historical switch data of the charging gun, the historical switch data including: result data, multiple feature data and numerical data corresponding to each feature data;

[0006] Determine the classification interval of each type of numerical data by a box plot algorithm, and convert the numerical data into interval value data according to the classification interval;

[0007] Generate a result label according to the result data, generate a feature label according to the feature data, and generate a training set according to the result label, the feature label and the interval value data;

[0008] Input the training set into the decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model;

[0009] Real-time switch data of the charging gun is obtained, and the real-time switch data is preprocessed by a box plot algorithm to obtain data to be evaluated, and the data to be evaluated is input into the switch test model to obtain a switch test result of the charging gun.

[0010] In a second aspect, an embodiment of the present application provides a switch test system for a charging gun, the switch test system for the charging gun comprising: a data acquisition module, a data conversion module, a label generation module, a model training module and a data evaluation module;

[0011] A data acquisition module, used to acquire historical switch data of the charging gun, wherein the historical switch data includes: result data, multiple feature data and numerical data corresponding to each feature data;

[0012] A data conversion module, used to determine the classification interval of each type of numerical data through a box plot algorithm, and convert the numerical data into interval value data according to the classification interval;

[0013] A label generation module, used to generate a result label according to the result data, generate a feature label according to the feature data, and generate a training set according to the result label, the feature label and the interval value data;

[0014] A model training module, used for inputting the training set into a decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model;

[0015] The data evaluation module is used to obtain real-time switch data of the charging gun, pre-process the real-time switch data through a box plot algorithm to obtain data to be evaluated, input the data to be evaluated into the switch test model, and obtain the switch test result of the charging gun.

[0016] In a third aspect, an embodiment of the present application provides a computer device, the computer device comprising a memory and a processor;

[0017] The memory is used to store computer programs;

[0018] The processor is used to execute the computer program and implement any one of the above-mentioned switch testing methods for a charging gun when executing the computer program.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to implement a switch testing method for a charging gun as described in any one of the above.

[0020] An embodiment of the present application provides a switch test method for a charging gun, the method comprising: obtaining historical switch data of the charging gun, the historical switch data comprising: result data, multiple feature data and numerical data corresponding to each feature data; determining a classification interval of each numerical data through a box plot algorithm, and converting the numerical data into interval value data according to the classification interval; generating a result label according to the result data, generating a feature label according to the feature data, and generating a training set according to the result label, the feature label and the interval value data; inputting the training set into a decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model; obtaining real-time switch data of the charging gun, preprocessing the real-time switch data through a box plot algorithm, obtaining data to be evaluated, inputting the data to be evaluated into the switch test model, and obtaining a switch test result of the charging gun. Through the above method, the decision tree model constructed by XGBoost is trained with various feature data and result data of the charging gun to obtain a trained switch test model. The switch test model can obtain the switch test result of the charging gun according to the numerical data corresponding to the various feature data in the real-time switch data, thereby improving the management efficiency of the charging gun and being able to more deeply discover hidden faults to prevent accidents that may occur during the charging process of the charging gun. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0022] Figure 1 A schematic flow chart of a switch testing method for a charging gun provided in an embodiment of the present application;

[0023] Figure 2 A schematic flow chart of a decision tree model training method provided in an embodiment of the present application;

[0024] Figure 3 A schematic block diagram of a switch testing system for a charging gun provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0027] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0028] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0029] See also Figure 1 , Figure 1 The following is a schematic flow chart showing a method for testing a switch of a charging gun provided in an embodiment of the present application. Figure 1 As shown, the specific steps of the switch testing method of the charging gun include: S101-S105.

[0030] S101. Obtain historical switch data of the charging gun, where the historical switch data includes: result data, multiple feature data, and numerical data corresponding to each feature data.

[0031] In some embodiments, the characteristic data includes: switch response time, contact resistance, load current value, voltage fluctuation value, switch temperature, ambient temperature and ambient humidity. The numerical data corresponding to each characteristic data is a specific measurement value, for example, the switch response time is 0.1s, and the switch temperature is 30°C. The result data includes: switch good and switch fault.

[0032] After obtaining the historical switch data, it is sorted according to the time series and divided into sample sets according to the preset time intervals, thereby improving the richness of the data.

[0033] S102 , determining the classification interval of each type of numerical data by a box plot algorithm, and converting the numerical data into interval value data according to the classification interval.

[0034] Exemplarily, the box plot algorithm uses five statistics to simply divide the intervals of a set of numerical data to show the overall distribution characteristics of the data. The five statistics include the minimum value, the lower quartile (Q1), the median (Q2, also known as the second quartile), the upper quartile (Q3), and the maximum value. The demarcation ratio corresponding to the lower quartile (Q1) is 25%, the demarcation ratio corresponding to the median (Q2) is 50%, and the demarcation ratio corresponding to the upper quartile (Q3) is 75%. The demarcation ratio is the proportion of data sorted in a preset order in the sorting, for example, the demarcation ratio of the first 25% of the data is 25%.

[0035] Sort the numerical data in ascending order, starting from the smallest value of the numerical data, divide the numerical data in the top 25% into the first interval, divide the data between 25%-50% into the second interval, divide the data between 50%-75% into the third interval, and divide the numerical data in the bottom 25% into the fourth interval.

[0036] In some embodiments, the classification interval of each type of numerical data is determined by a box plot algorithm, and the numerical data is converted into interval value data according to the classification interval. The specific steps include: sorting the numerical data in order from small to large, and obtaining the minimum and maximum values ​​of the numerical data. According to the sorting of the numerical data, the numerical interval in the numerical data corresponding to the minimum value and the first demarcation ratio is determined as the first classification interval. The numerical interval in the numerical data corresponding to the first demarcation ratio and the numerical data corresponding to the second demarcation ratio is determined as the second classification interval. The numerical interval in the numerical data corresponding to the second demarcation ratio and the numerical data corresponding to the third demarcation ratio is determined as the third classification interval. The numerical interval in the numerical data corresponding to the third demarcation ratio and the numerical data corresponding to the fourth demarcation ratio is determined as the fourth classification interval. The first demarcation ratio, the second demarcation ratio, the third demarcation ratio and the fourth demarcation ratio are obtained by arithmetic increment according to the preset difference, and the preset difference includes 25%. The numerical data corresponding to the medians of the first classification interval, the second classification interval, the third classification interval and the fourth classification interval are respectively used as their respective interval value data; the numerical data are converted into interval value data corresponding to the target classification interval, and the target classification interval is one of the first classification interval, the second classification interval, the third classification interval and the fourth classification interval that includes the numerical data.

[0037] By classifying discrete numerical data into corresponding classification intervals and converting the numerical data into interval value data corresponding to the classification interval, the data distribution is simplified while retaining the data characteristics, reducing the complexity of using numerical data to train the decision tree model in the subsequent process, and avoiding overfitting of the decision tree model.

[0038] S103, generating result labels according to the result data, generating feature labels according to the feature data, and generating a training set according to the result labels, feature labels and interval value data.

[0039] Before inputting data into the decision tree model, the data needs to be preprocessed. The preprocessing includes labeling non-numeric data and vectorizing labeled data and numerical data so that the preprocessed data can be read and used by the decision tree model.

[0040] S104, inputting the training set into the decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model.

[0041] Exemplarily, the decision tree model used in the embodiment of the present application is constructed based on XGBoost. After training, the decision tree model constructed based on XGBoost will output k base models to obtain a trained switch test model. The switch test model is used to evaluate and predict the input data according to the k base models and output the prediction results.

[0042] In some embodiments, see Figure 2 , Figure 2 The following is a schematic flow chart of a decision tree model training method provided in an embodiment of the present application. Figure 2 As shown, the decision tree model training method is used to input the training set into the decision tree model built based on XGBoost for training until the decision tree model reaches a preset convergence condition to obtain a trained switch test model. The specific steps of the decision tree model training method include: S201-S208.

[0043] S201. Obtain a preset loss function and a preset regularization term function, and determine an objective function according to the loss function and the regularization term function, wherein the regularization term function includes a regularization term parameter and a penalty parameter.

[0044] Exemplarily, the specific formula of the preset loss function is:

[0045] ;

[0046] in, is the loss estimate, n is the number of samples, is the convergence coefficient, is the true value of the i-th sample, is the predicted value of the i-th sample.

[0047] The specific formula of the preset regular term function is:

[0048] ;

[0049] in, is the regularization term, is the regularization parameter, T is the number of leaves, is the penalty parameter, is the weight of the jth leaf. The regularization function is used to control the complexity of the model.

[0050] After optimizing the preset loss function and combining it with the preset regularization function, we get the objective function. The specific formula of the objective function is:

[0051] ;

[0052] in, is the convergence coefficient, is the first-order derivative of the loss function, The second derivative of the loss function.

[0053] S202: Select target feature data for constructing a base model from the feature data, and sort the interval value data corresponding to the target feature data in ascending order.

[0054] Exemplarily, some feature data of the charging gun switch is key data for evaluating the charging gun switch. When training the decision tree model, only this part of the data is selected for training. In this way, the complexity of the training process can be reduced and the training efficiency can be improved.

[0055] In addition, the interval value data corresponding to the target feature data needs to be sorted in ascending order to facilitate the model to determine the split point during the training process.

[0056] S203. Segment the sorted interval value data according to a preset segmentation point to obtain first segmentation data and second segmentation data, obtain a first sum of first-order derivatives and a first sum of second-order derivatives according to the loss function and the first segmentation data; and obtain a second sum of first-order derivatives and a second sum of second-order derivatives according to the loss function and the second segmentation data.

[0057] Exemplarily, in order to evaluate the splitting effect, it is necessary to evaluate all possible splitting items, therefore, a preset splitting point is set for each sorted interval value data, and the splitting effect of each splitting point is calculated according to the objective function.

[0058] After setting the preset split point, the sorted interval value data is split into the first split data on the left and the second split data on the right. The first first-order derivative and , and the first and second order derivatives and According to the second segmentation data and loss function, the second first-order derivative and , and the second second-order derivative and .

[0059] S204, generating a linear function according to the first first-order derivative sum, the first second-order derivative sum, the second first-order derivative sum, the second second-order derivative sum, the regularization term parameter and the penalty parameter, and determining the segmentation benefit value of each segmentation point according to the linear function.

[0060] Exemplarily, the specific formula of the linear function is:

[0061] ;

[0062] Among them, Gain is the split gain value.

[0063] S205 , taking the segmentation point corresponding to the maximum segmentation benefit value as the target segmentation point, and when the maximum segmentation benefit value is greater than a preset threshold, segmenting the sorted interval value data according to the target segmentation point to obtain a newly added leaf node.

[0064] For example, due to the penalty parameter The existence of , data segmentation does not necessarily lead to better results. When the decision tree model selects split points and feature data to build a tree, each new leaf node will cause the objective function to increase the penalty parameter Therefore, when the maximum segmentation benefit value is greater than the preset threshold, it is considered that the newly added leaf node is beneficial to building the tree and can be retained.

[0065] S206. Continue to segment the newly added leaf nodes until a preset stop condition is reached to obtain a base model.

[0066] Exemplarily, the newly added leaf nodes may be able to further perform feature segmentation, so the above segmentation steps are continued to be performed on the newly added leaf nodes until a preset stopping condition is reached, for example, a preset depth or other stopping segmentation condition is reached, to obtain a base model.

[0067] S207: If the maximum segmentation benefit value is less than a preset threshold, the newly added leaf nodes are pruned.

[0068] For example, due to the penalty parameter The existence of , data segmentation does not necessarily lead to better results. When the decision tree model selects split points and feature data to build a tree, each new leaf node will cause the objective function to increase the penalty parameter A larger penalty parameter The value will tend to generate a simpler tree, that is, fewer leaf nodes, thus limiting the complexity of the model. Therefore, when the maximum split benefit value is less than or equal to the preset threshold, it can be considered that the split has a negative impact on tree construction, and the split is cut off to obtain additional leaf nodes to reduce the risk of overfitting.

[0069] S208, adding the base model to the decision tree model, selecting feature data other than the target feature data from the feature data, continuing to construct the base model, determining the convergence coefficient of the objective function according to the base model, until the convergence coefficient reaches a preset convergence condition, and obtaining a trained switch test model.

[0070] Exemplarily, when constructing each decision tree corresponding to a base model, the decision tree model pays attention to the combination of different feature data. Each tree is trained on the basis of the previous tree to reduce the residual error, and finally a series of weighted base models are obtained, and a strong learning switch test model is synthesized.

[0071] S105, obtaining real-time switch data of the charging gun, preprocessing the real-time switch data through a box plot algorithm to obtain data to be evaluated, inputting the data to be evaluated into a switch test model, and obtaining a switch test result of the charging gun.

[0072] For example, the real-time switch data is processed according to the box plot algorithm, and each numerical data in the real-time switch data is converted into interval value data to generate the data to be evaluated. The data to be evaluated is input into the switch test model, and the data to be evaluated will be converted into vector data to facilitate the switch test model to calculate, and the switch test results are output based on these vector data to predict possible faults of the charging gun.

[0073] Through the above method, the decision tree model constructed by XGBoost is trained with various feature data and result data of the charging gun to obtain a trained switch test model. The switch test model can obtain the switch test result of the charging gun according to the numerical data corresponding to the various feature data in the real-time switch data, thereby improving the management efficiency of the charging gun and being able to more deeply discover hidden faults to prevent accidents that may occur during the charging process of the charging gun.

[0074] See also Figure 3 , Figure 3 The embodiment of the present application also provides a schematic block diagram of a switch test system for a charging gun, wherein the switch test system 300 for a charging gun is used to execute the aforementioned switch test method for a charging gun. The switch test system for a charging gun can be configured in a server or a terminal device.

[0075] The server may be an independent server or a server cluster, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device may be an electronic device such as a mobile phone, tablet computer, laptop computer, desktop computer, user digital assistant, and wearable device.

[0076] like Figure 3 As shown, the switch testing system 300 of the charging gun includes: a data acquisition module 301 , a data conversion module 302 , a label generation module 303 , a model training module 304 and a data evaluation module 305 .

[0077] The data acquisition module 301 is used to acquire the historical switch data of the charging gun, wherein the historical switch data includes: result data, multiple characteristic data and numerical data corresponding to each characteristic data.

[0078] The data conversion module 302 is used to determine the classification interval of each type of numerical data through a box plot algorithm, and convert the numerical data into interval value data according to the classification interval.

[0079] The data conversion module 302 is used to determine the classification interval of each type of numerical data through the box plot algorithm, and convert the numerical data into interval value data according to the classification interval, and is specifically used to implement the following: sorting the numerical data in ascending order to obtain the minimum and maximum values ​​of the numerical data; according to the sorting of the numerical data, determining the numerical interval in the numerical data corresponding to the minimum value and the first demarcation ratio as the first classification interval, determining the numerical interval in the numerical data corresponding to the first demarcation ratio and the numerical data corresponding to the second demarcation ratio as the second classification interval, and determining the numerical interval in the numerical data corresponding to the second demarcation ratio and the numerical data corresponding to the third demarcation ratio as the second classification interval. The third classification interval is determined as the third classification interval, and the numerical interval located in the numerical data corresponding to the third demarcation ratio and the numerical data corresponding to the fourth demarcation ratio is determined as the fourth classification interval, the first demarcation ratio, the second demarcation ratio, the third demarcation ratio and the fourth demarcation ratio are obtained by arithmetic increase according to the preset difference, and the preset difference includes 25%; the numerical data corresponding to the median of the first classification interval, the second classification interval, the third classification interval and the fourth classification interval are respectively used as the respective interval value data; the numerical data are converted into interval value data corresponding to the target classification interval, and the target classification interval is one of the first classification interval, the second classification interval, the third classification interval and the fourth classification interval that includes the numerical data.

[0080] The label generation module 303 is used to generate result labels according to the result data, generate feature labels according to the feature data, and generate a training set according to the result labels, feature labels and interval value data.

[0081] The model training module 304 is used to input the training set into the decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model.

[0082] The model training module 304 is used to implement inputting the training set into the decision tree model constructed based on XGBoost for training until the decision tree model reaches the preset convergence condition and obtains the trained switch test model. Specifically, it is used to implement: obtaining a preset loss function and a preset regular term function, determining the target function according to the loss function and the regular term function, and the regular term function includes a regular term parameter and a penalty parameter; selecting target feature data for constructing a base model from the feature data, and sorting the interval value data corresponding to the target feature data in ascending order; segmenting the sorted interval value data according to a preset segmentation point to obtain first segmentation data and second segmentation data, obtaining a first first-order derivative and a first second-order derivative and a second first-order derivative and a second ... ; Generate a linear function according to the first sum of first-order derivatives, the first sum of second-order derivatives, the second sum of first-order derivatives, the second sum of second-order derivatives, the regularization term parameter and the penalty parameter, and determine the segmentation benefit value of each segmentation point according to the linear function; take the segmentation point corresponding to the maximum segmentation benefit value as the target segmentation point, and when the maximum segmentation benefit value is greater than the preset threshold, segment the sorted interval value data according to the target segmentation point to obtain a newly added leaf node; continue to segment the newly added leaf nodes until the preset stop condition is reached to obtain the base model; if the maximum segmentation benefit value is less than the preset threshold, then trim the newly added leaf nodes; add the base model to the decision tree model, select feature data other than the target feature data from the feature data, continue to build the base model, and determine the convergence coefficient of the objective function according to the base model until the convergence coefficient reaches the preset convergence condition to obtain a trained switch test model.

[0083] The data evaluation module 305 is used to obtain the real-time switch data of the charging gun, pre-process the real-time switch data through the box plot algorithm to obtain the data to be evaluated, input the data to be evaluated into the switch test model, and obtain the switch test result of the charging gun.

[0084] An embodiment of the present application provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the switch testing method of the charging gun as described in any one of the embodiments of the present application when executing the computer program.

[0085] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor implements a switch testing method for a charging gun as described in any one of the embodiments of the present application.

[0086] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for testing a switch of a charging gun, characterized in that: The method comprises: Obtain historical switch data of the charging gun, the historical switch data including: result data, multiple feature data and numerical data corresponding to each feature data, the feature data including: switch response time, contact resistance, load current value, voltage fluctuation value, switch temperature, ambient temperature and ambient humidity; the result data including: switch good and switch failure; Determine the classification interval of each type of numerical data by a box plot algorithm, and convert the numerical data into interval value data according to the classification interval; Generate a result label according to the result data, generate a feature label according to the feature data, and generate a training set according to the result label, the feature label and the interval value data; before inputting the data into the decision tree model, the data needs to be preprocessed, and the preprocessing includes labeling the non-numeric data and vectorizing the labeled data and the numeric data; Input the training set into the decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model; Real-time switch data of the charging gun is obtained, and the real-time switch data is preprocessed by a box plot algorithm to obtain data to be evaluated, and the data to be evaluated is input into the switch test model to obtain a switch test result of the charging gun.

2. The switch testing method according to claim 1, characterized in that: The training set is input into the decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition to obtain a trained switch test model, including: Obtaining a preset loss function and a preset regularization term function, and determining an objective function according to the loss function and the regularization term function, wherein the regularization term function includes a regularization term parameter and a penalty parameter; Selecting target feature data for constructing a base model from the feature data, and sorting the interval value data corresponding to the target feature data in ascending order; The sorted interval value data is segmented according to a preset segmentation point to obtain first segmentation data and second segmentation data, a first first-order derivative sum and a first second-order derivative sum are obtained according to the loss function and the first segmentation data; and a second first-order derivative sum and a second second-order derivative sum are obtained according to the loss function and the second segmentation data; Generate a linear function according to the first first-order derivative sum, the first second-order derivative sum, the second first-order derivative sum, the second second-order derivative sum, the regularization term parameter and the penalty parameter, and determine a segmentation benefit value of each segmentation point according to the linear function; The segmentation point corresponding to the maximum segmentation benefit value is used as the target segmentation point, and when the maximum segmentation benefit value is greater than a preset threshold, the sorted interval value data is segmented according to the target segmentation point to obtain a newly added leaf node; Continue to segment the newly added leaf nodes until a preset stop condition is reached to obtain a base model; If the maximum segmentation benefit value is less than a preset threshold, the newly added leaf node is pruned; The base model is added to the decision tree model, feature data other than the target feature data is selected from the feature data, the base model is continued to be constructed, and the convergence coefficient of the objective function is determined according to the base model until the convergence coefficient reaches a preset convergence condition, thereby obtaining a trained switch test model.

3. The switch testing method according to claim 1, characterized in that: Determining the classification interval of each type of the numerical data by a box plot algorithm, and converting the numerical data into interval value data according to the classification interval, includes: Sort the numerical data in ascending order to obtain the minimum and maximum values ​​of the numerical data; According to the sorting of the numerical data, a numerical interval in the numerical data corresponding to the minimum value and the first demarcation ratio is determined as a first classification interval, a numerical interval in the numerical data corresponding to the first demarcation ratio and the numerical data corresponding to the second demarcation ratio is determined as a second classification interval, a numerical interval in the numerical data corresponding to the second demarcation ratio and the numerical data corresponding to the third demarcation ratio is determined as a third classification interval, and a numerical interval in the numerical data corresponding to the third demarcation ratio and the numerical data corresponding to the fourth demarcation ratio is determined as a fourth classification interval, the first demarcation ratio, the second demarcation ratio, the third demarcation ratio and the fourth demarcation ratio are obtained by increasing arithmetic steps according to a preset difference, and the preset difference includes 25%; respectively taking the numerical data corresponding to the medians of the first classification interval, the second classification interval, the third classification interval and the fourth classification interval as the respective interval value data; The numerical data is converted into interval value data corresponding to a target classification interval, where the target classification interval is one of the first classification interval, the second classification interval, the third classification interval, and the fourth classification interval that includes the numerical data.

4. A switch test system for a charging gun, characterized in that: The switch test system of the charging gun includes: A data acquisition module is used to acquire historical switch data of the charging gun, wherein the historical switch data includes: result data, multiple feature data and numerical data corresponding to each feature data, wherein the feature data includes: switch response time, contact resistance, load current value, voltage fluctuation value, switch temperature, ambient temperature and ambient humidity; the result data includes: switch good and switch fault; A data conversion module, used to determine the classification interval of each type of numerical data through a box plot algorithm, and convert the numerical data into interval value data according to the classification interval; A label generation module is used to generate a result label according to the result data, generate a feature label according to the feature data, and generate a training set according to the result label, the feature label and the interval value data; before inputting the data into the decision tree model, the data needs to be preprocessed, and the preprocessing includes labeling the non-numeric data and vectorizing the labeled data and the numeric data; A model training module, used for inputting the training set into a decision tree model constructed based on XGBoost for training until the decision tree model reaches a preset convergence condition, thereby obtaining a trained switch test model; The data evaluation module is used to obtain real-time switch data of the charging gun, pre-process the real-time switch data through a box plot algorithm to obtain data to be evaluated, input the data to be evaluated into the switch test model, and obtain the switch test result of the charging gun.

5. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the switch testing method of the charging gun as claimed in any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the switch testing method of the charging gun according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • A charging pile fault prediction method based on an expandable lifting tree

    CN109190670A

  • Heart disease prediction method based on dual feature selection and XGBoost algorithm

    CN111243751A

  • Universal fault early warning system based on sample distribution and early warning method thereof

    CN111325410A

  • Electricity stealing user identification method and device combining cloud end and side end

    CN113408676A

  • Analysis method and system for quantifying influence of characteristic indexes on labels, medium and terminal

    CN113569970A