A method and system for detecting the charging state of a vehicle

By monitoring video streams and target detection models to detect the location information of the charging gun and parking space, the problem of charging status detection for electric vehicles is solved, and efficient charging station management and usage efficiency is achieved.

CN114495012BActive Publication Date: 2025-05-27BEIJING HENGHUA LONGXIN DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210142445.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-05-27
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently detect and manage the charging status of electric vehicles in charging stations, resulting in a reduction in the efficiency of charging equipment.

Method used

By monitoring the video stream, the target image of the current frame is intercepted, and the target detection is performed using a pre-trained object detection model (such as YOLO v5), the position information of the charging gun and the parking space is obtained, and the charging status of the vehicle is judged, and the detection results are compared to determine the charging status.

Benefits of technology

Accurate detection and management of vehicle charging status is realized, the efficiency of the charging station is improved, and the charging status information of the vehicle is promptly pushed to the management terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114495012B_ABST
    Figure CN114495012B_ABST
Patent Text Reader

Abstract

The present application provides a method and system for detecting the charging state of a vehicle. The monitoring video stream is intercepted at preset time intervals, and the monitoring video stream includes the target image of the current frame. Target detection is performed on the target image according to a pre-trained target detection model to obtain the target detection result of the current frame. The target detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun. The target detection result of the current frame is compared with the target detection result of the previous frame to obtain the charging state of the vehicle, and the charging state of the vehicle is pushed to the management terminal. Thus, by identifying and comparing the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun in the monitoring video stream, the detection of the vehicle charging state is realized, and the charging state information of the vehicle is timely pushed to the charging station management terminal, which is convenient for the efficient management of the charging station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automotive charging state detection, and particularly to a method and system for detecting the charging state of a vehicle. Background Art

[0002] With the change of the human environment and the increasing call for energy conservation and emission reduction, the popularity of electric vehicles is getting higher and higher. Correspondingly, the number of electric vehicle charging stations has also increased.

[0003] The behavior that a vehicle occupies a charging space without charging greatly reduces the utilization efficiency of charging piles. In order to make full use of charging equipment, it becomes increasingly necessary to detect the charging state of vehicles entering the charging spaces. Detecting the charging state can help managers better manage the charging of charging stations and make the use of charging piles more efficient. Summary of the Invention

[0004] In view of this, the present invention provides a method and system for detecting the charging state of a vehicle. By detecting the positions of the charging gun, the parking space, and the vehicle, and judging the charging state of the vehicle based on the position relationship, the detection of the vehicle charging state is realized, which is convenient for the charging station administrator to effectively manage the charging piles.

[0005] The technical solution is as follows:

[0006] A method for detecting the charging state of a vehicle, the method comprising:

[0007] Intercepting a monitoring video stream at a preset time interval, the monitoring video stream including a target image of the current frame;

[0008] Performing target detection on the target image according to a pre-trained target detection model to obtain a target detection result of the current frame, the target detection result including the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun;

[0009] Comparing the target detection result of the current frame with the target detection result of the previous frame to obtain the charging state of the vehicle.

[0010] Preferably, before intercepting the monitoring video stream at a preset time interval, the method further comprises:

[0011] Obtaining training sample images;

[0012] Using the training sample images to train an initial target detection model to obtain a trained target detection model. Among them, the activation function of the target detection model includes the Mish activation function, the loss function of the target detection model includes the DioU loss function, and the target detection model is the YOLO v5 model.

[0013] Preferably, the obtaining of the training sample images includes:

[0014] Obtaining an initial image;

[0015] Improving the image resolution of the charging gun area in the initial image through image super-resolution technology to obtain an initial training image;

[0016] Generating a charging gun image through a generative adversarial network and randomly adding at least one generated charging gun image to the initial training image to obtain a training sample image.

[0017] Preferably, the comparing the object detection result of the current frame with the object detection result of the previous frame to obtain the charging state of the vehicle includes:

[0018] If the object detection result of the previous frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the state of occupying the space without charging;

[0019] When the vehicle is in the state of occupying the space without charging, record the duration of the vehicle being in the state of occupying the space without charging. If the duration of the state of occupying the space without charging exceeds the first preset time threshold, it is determined that the vehicle is in the state of abnormal space occupation;

[0020] If the object detection result of the previous frame determines that the vehicle is in the state of occupying the space without charging, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun leaves the initial position, it is determined that the vehicle is in the charging state, and record the charging start time of the vehicle;

[0021] When the vehicle is in the charging state, record the duration of the vehicle being in the charging state. If the duration of the charging state exceeds the second preset time threshold, it is determined that the vehicle is in the state of charging timeout.

[0022] Preferably, the comparing the object detection result of the current frame with the object detection result of the previous frame to obtain the charging state of the vehicle further includes:

[0023] If the object detection result of the previous frame determines that the vehicle is in the charging state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun returns to the initial position, it is determined that the vehicle is in the state of charging completion;

[0024] When the vehicle is in the state of charging completion, record the duration of the vehicle being in the state of charging completion. If the duration of the state of charging completion exceeds the third preset time threshold, it is determined that the vehicle is in the state of occupying the space after charging completion;

[0025] If the target detection result of the previous frame determines that the vehicle is in the charging completed state, and the target detection result of the current frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the charging ended state, and the charging end time of the vehicle is recorded;

[0026] The total charging time of the vehicle is obtained according to the charging start time and the charging end time of the vehicle.

[0027] Preferably, the method further includes: pushing the charging state of the vehicle to the charging station management terminal.

[0028] Preferably, the method further includes: when the target detection result includes that there is no vehicle in the parking space and the charging gun leaves the initial position, it is determined that the charging gun state is abnormal, an abnormal message is generated, and the abnormal message is pushed to the charging station management terminal.

[0029] Another embodiment of the present application further provides a charging state detection system for a vehicle, and the system includes:

[0030] An interception unit, configured to intercept a monitoring video stream at a preset time interval, where the monitoring video stream includes a target image of the current frame;

[0031] A detection unit, configured to perform target detection on the target image according to a pre-trained target detection model to obtain a target detection result of the current frame, where the target detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun;

[0032] A comparison unit, configured to compare the target detection result of the current frame with the target detection result of the previous frame to obtain the charging state of the vehicle.

[0033] Preferably, the system further includes:

[0034] An image acquisition unit, configured to acquire training sample images;

[0035] A model training unit, configured to use the training sample images to train an initial target detection model to obtain a trained target detection model, where the activation function of the target detection model includes a Mish activation function, the loss function of the target detection model includes a DioU loss function, and the target detection model is a YOLO v5 model.

[0036] Preferably, the image acquisition unit is specifically configured to: acquire an initial image; improve the image resolution of the charging gun area in the initial image through an image super-resolution technique to obtain an initial training image; generate a charging gun image through a generative adversarial network, and randomly add at least one generated charging gun image to the initial training image to obtain a training sample image.

[0037] The above technical solution has the following beneficial effects:

[0038] A method and system for detecting the charging state of a vehicle provided by an embodiment of the present application intercepts a monitoring video stream at a preset time interval, and the monitoring video stream includes a target image of a current frame; performs target detection on the target image according to a pre-trained target detection model to obtain a target detection result of the current frame, where the target detection result includes the position information of a charging gun and the vehicle occupancy information of a parking space corresponding to the charging gun; compares the target detection result of the current frame with the target detection result of the previous frame to obtain the charging state of the vehicle, and pushes the charging state of the vehicle to a management terminal. Thus, by identifying and comparing the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun in the monitoring video stream, the detection of the vehicle charging state is realized, and the charging state information of the vehicle is pushed to the charging station management terminal in a timely manner, which is convenient for the efficient management of the charging station. Description of the Drawings

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to the provided drawings.

[0040] Figure 1 It is a flowchart of a method for detecting the charging state of a vehicle provided by an embodiment of the present invention;

[0041] Figure 2 It is a training flowchart of a target detection algorithm used in an embodiment of the present invention;

[0042] Figure 3 It is a training flowchart of a target detection algorithm used in an embodiment of the present invention;

[0043] Figure 4 It is a schematic diagram of a system for detecting the charging state of a vehicle provided by an embodiment of the present invention. Detailed Embodiments

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0045] To detect the charging status of vehicles at a charging station and facilitate the effective management of charging piles by the charging station administrator, an embodiment of the present application provides a method for detecting the charging status of a vehicle. Please refer to Figure 1 , the method may include:

[0046] Step S100: Intercept the monitoring video stream at a preset time interval. The monitoring video stream includes the target image of the current frame;

[0047] The monitoring video stream is obtained by a monitoring camera installed at the charging station. Intercepting the monitoring video stream at a preset time interval to obtain the target image corresponding to the current frame. It can be understood that the monitoring range corresponding to the monitoring video stream includes the charging pile and the parking space. Correspondingly, the target image of the current frame intercepted contains the charging pile image and the parking space image.

[0048] Step S200: Perform target detection on the target image according to a pre-trained target detection model to obtain the target detection result of the current frame. The target detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun.

[0049] The position information of the charging gun includes that the charging gun is in the initial position or the charging gun leaves the initial position. The vehicle occupancy information of the parking space includes that there is a vehicle in the parking space or there is no vehicle in the parking space.

[0050] Optionally, the target detection model can be implemented using the fifth-generation algorithm YOLO v5 of the target detection algorithm YOLO (You Only Look Once).

[0051] Step S300: Compare the target detection result of the current frame with the target detection result of the previous frame to obtain the charging status of the vehicle.

[0052] It can be understood that the target detection result of the previous frame is the previous detection result compared to the target detection result of the current frame.

[0053] Preferably, in this embodiment, comparing the target detection result of the current frame with the target detection result of the previous frame to obtain the charging status of the vehicle includes:

[0054] If the target detection result of the previous frame includes no vehicle in the parking space and the charging gun is in the initial position, and the target detection result of the current frame includes a vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the state of occupying the space without charging;

[0055] When the vehicle is in the state of occupying the space without charging, record the duration of the vehicle being in the state of occupying the space without charging. If the duration of the state of occupying the space without charging exceeds the first preset time threshold, it is determined that the vehicle is in the state of abnormal occupancy;

[0056] If the object detection result of the previous frame determines that the vehicle is in the occupied but uncharged state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun has left the initial position, it is determined that the vehicle is in the charging state, and the charging start time of the vehicle is recorded;

[0057] When the vehicle is in the charging state, record the duration of the vehicle being in the charging state. If the duration of the charging state exceeds the second preset time threshold, it is determined that the vehicle is in the overcharging state;

[0058] If the object detection result of the previous frame determines that the vehicle is in the charging state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun returns to the initial position, it is determined that the vehicle is in the charging completed state;

[0059] When the vehicle is in the charging completed state, record the duration of the vehicle being in the charging completed state. If the duration of the charging completed state exceeds the third preset time threshold, it is determined that the vehicle is in the occupied state after charging completion;

[0060] If the object detection result of the previous frame determines that the vehicle is in the charging completed state, and the object detection result of the current frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the charging ended state, and record the charging end time of the vehicle;

[0061] Obtain the total charging time of the vehicle based on the charging start time and the charging end time of the vehicle.

[0062] It can be understood that the above first preset time threshold, second preset time threshold, and third preset time threshold can be set according to actual needs.

[0063] Preferably, when the object detection result includes that there is no vehicle in the parking space and the charging gun has left the initial position, it is determined that the charging gun state is abnormal, and an abnormal message is pushed to the charging station management terminal to facilitate the charging station management personnel to maintain the charging pile in a timely manner.

[0064] Preferably, push the obtained charging state of the vehicle to the charging station management terminal to facilitate the charging station management personnel to know the usage situation of each charging pile in the charging station and manage the charging piles efficiently.

[0065] There is no restriction on the form of pushing the abnormal message and the form of pushing the vehicle charging state here. It can be message pushing on the APP side, SMS message pushing, email information pushing, etc.

[0066] Preferably, when it is determined that the vehicle is in the abnormal occupancy state or the overcharging state, use the Baidu PaddlePaddle framework to detect and identify the vehicle information, obtain the vehicle information, and push the vehicle information to the power station management terminal to facilitate the charging station management personnel to manage;

[0067] In summary, the vehicle charging status detection method provided by the embodiments of the present application uses a trained model to detect vehicles, charging piles, charging guns, and parking spaces in the monitoring video frames of the charging station, obtains the position coordinates of each object in the image, and then obtains the current charging status of the vehicle according to the position relationship of these objects. Thus, by identifying and comparing the position information of the charging gun and the occupancy information of the parking space in the monitoring video stream, the detection of the vehicle charging status is realized, and the charging status information of the vehicle is timely pushed to the charging station management terminal, which is convenient for the administrator to efficiently manage the charging station.

[0068] Since the position information of the charging gun is obtained by detecting with a target detection model, and the clarity of the monitoring video is limited, and the charging gun has the characteristics of small volume, far distance from the monitoring camera, low resolution, and being easily affected by light in the monitoring video. Although the existing target detection algorithm, the fifth-generation YOLO algorithm YOLO v5, has added adaptive anchor boxes to improve the detection effect on objects of different sizes, it still cannot well complete the detection task of the charging gun. Therefore, referring to Figure 2 In a specific implementation, before intercepting the monitoring video stream at a preset time interval, the method further includes the following steps:

[0069] S201. Obtain training sample images.

[0070] Obtain training sample images for training the target detection model.

[0071] The data augmentation method used by YOLO v5 is the Mosaic data augmentation method, which randomly crops four pictures and then splices them into one picture in a 2×2 manner as training data. Thus, the background of the image is enriched, and the sample size (Batch Size) used for training at one time is also increased by splicing four images. When performing batch normalization (BatchNormalization, BN) operations, four pictures are also calculated, so the influence of Batch Size on training is relatively small.

[0072] In the embodiments of the present application, on the basis of YOLO v5, referring to Figure 3 Step S201 for obtaining training sample images specifically includes:

[0073] S2011. Improve the resolution of the charging gun area in the initial image through super-resolution technology (Super-Resolution, SR) to obtain an initial training image.

[0074] Use the super-resolution technology based on convolutional neural network (Super-Resolution) to improve the image resolution of the charging gun area in the initial image, and obtain the initial training image, which helps to extract the features of the charging gun. Specifically, the bicubic interpolation algorithm (Bicubic Interpolation) is used to magnify the input initial image, and the end-to-end three-layer fully convolutional network is trained.

[0075] It should be noted that in the embodiments of the present application, the initial image can be obtained from the historical monitoring video of the charging station, and the initial image is obtained by intercepting the historical monitoring video.

[0076] S2012. Generate a charging gun image through a generative adversarial network (Generative Adversarial Network, GAN), and randomly add at least one generated charging gun image to the initial training image to obtain a training sample image.

[0077] The method of the generative adversarial network can map a low-resolution charging gun image to a high-resolution charging gun image, so as to achieve a higher detection rate for larger objects. Generate a charging gun image with stronger feature expression through the generative adversarial network, and randomly add several generated charging gun images to the initial training image. The entire obtained image is used as a training sample image. By repeating the operation of randomly adding charging gun images to the initial training image, the requirement for the training sample size of the model can be met.

[0078] Thus, by adding an operation to enhance the charging gun image data, the expression ability of the charging gun image features is enhanced, making the information extracted by the trained object detection model more valuable, and the extracted information is more accurate and effective.

[0079] S202. Use the training sample image to train the initial object detection model to obtain a trained object detection model. Among them, the activation function of the object detection model includes the Mish activation function, the loss function of the object detection model includes the DioU loss function, and the object detection model is the YOLO v5 model.

[0080] The activation function selected in YOLO v5 is the Leaky Relu activation function, while the Mish activation function is selected in the embodiments of the present application.

[0081] The Mish activation function is specifically Mish(x) = x * tanh(ln(1 + e^x)). Compared with the Leaky Relu activation function, the Mish activation function is generally smoother and differentiable everywhere. Selecting the Mish activation function makes the network easier to optimize, improves the generalization ability, and also avoids the problem of network saturation.

[0082] The loss function selected in YOLO v5 is GIoU (Generalized Intersection over Union). In the embodiments of this application, DIoU with better convergence effect is selected. The specific formula of the DIoU loss function is as follows:

[0083]

[0084] where \(b\) represents the anchor box, \(\hat{b}\) gt represents the center point of the target box, \(\rho\) represents the distance between the center points of the two boxes, and \(c\) represents the diagonal distance of the smallest rectangle that can cover both the anchor box and the target box. Therefore, the DIoU loss function optimizes the distance between two target boxes, while the GIoU loss function optimizes the area between two target boxes. Thus, the DIoU function converges much faster.

[0085] By training the algorithms before and after the improvement respectively with the same settings, the recognition accuracies of the two models for the charging gun are obtained, as shown in Table 1. The detection accuracy and recall rate of the algorithm after improvement are both improved to a certain extent compared with the algorithm before improvement.

[0086]

[0087]

[0088] Table 1 Comparison table of charging gun detection effects

[0089] In summary, in the technical solution provided by the embodiments of this application, by partially improving the YOLO v5 algorithm, the enhancement operation of the initial image is added, the Mish activation function is used to replace the Leaky Relu activation function, and the loss function is improved by replacing the GIoU loss function with the DIoU loss function, which improves the recognition accuracy of the target detection model for the charging gun, and further improves the recognition accuracy of the vehicle charging state, facilitating the effective management of charging piles by the charging station administrator.

[0090] As Figure 4 shown, the structural schematic diagram of a vehicle charging state detection system is disclosed in the embodiments of the present invention. The system may include: an interception unit, a detection unit, and a comparison unit;

[0091] The interception unit is used to intercept the monitoring video stream at a preset time interval, and the monitoring video stream includes the target image of the current frame;

[0092] The detection unit is used to perform target detection on the target image according to the pre-trained target detection model to obtain the target detection result of the current frame. The target detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun;

[0093] A comparison unit for comparing the object detection result of the current frame with that of the previous frame to obtain the charging state of the vehicle.

[0094] The position information of the charging gun includes that the charging gun is in the initial position or the charging gun leaves the initial position, and the vehicle occupancy information of the parking space includes that there is a vehicle in the parking space or there is no vehicle in the parking space.

[0095] Optionally, the object detection model can be implemented by the fifth-generation algorithm YOLO v5 of the object detection algorithm YOLO (You Only Look Once).

[0096] A comparison unit for comparing the current object detection result with the previous object detection result to obtain the charging state of the vehicle.

[0097] It can be understood that the previous object detection result is the previous detection result compared with the current object detection result.

[0098] Preferably, in this embodiment, the comparison unit compares the object detection result of the current frame with that of the previous frame to obtain the charging state of the vehicle, including:

[0099] If the object detection result of the previous frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the state of occupying the space without charging;

[0100] When the vehicle is in the state of occupying the space without charging, record the duration of the vehicle in the state of occupying the space without charging. If the duration of the state of occupying the space without charging exceeds the first preset time threshold, it is determined that the vehicle is in the state of abnormal occupancy;

[0101] If the object detection result of the previous frame determines that the vehicle is in the state of occupying the space without charging, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun leaves the initial position, it is determined that the vehicle is in the charging state, and record the charging start time of the vehicle;

[0102] When the vehicle is in the charging state, record the duration of the vehicle in the charging state. If the duration of the charging state exceeds the second preset time threshold, it is determined that the vehicle is in the state of charging timeout;

[0103] If the object detection result of the previous frame determines that the vehicle is in the charging state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun returns to the initial position, it is determined that the vehicle is in the charging completed state;

[0104] When the vehicle is in the charging completed state, record the duration of the vehicle in the charging completed state. If the duration of the charging completed state exceeds the third preset time threshold, determine that the vehicle is in the charging completed occupancy state;

[0105] If the target detection result of the previous frame determines that the vehicle is in the charging completed state, and the target detection result of the current frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, determine that the vehicle is in the charging ended state, and record the charging end time of the vehicle;

[0106] Obtain the total charging time of the vehicle according to the charging start time and the charging end time of the vehicle.

[0107] It can be understood that the above first preset time threshold, second preset time threshold, and third preset time threshold can be set according to actual needs.

[0108] Preferably, the system may further include a notification unit;

[0109] The comparison unit is further configured to determine that the charging gun state is abnormal when the target detection result includes that there is no vehicle in the parking space and the charging gun leaves the initial position. At this time, the notification unit is configured to generate an abnormal message and push the abnormal message to the charging station management terminal, facilitating the management personnel to maintain the charging pile in a timely manner.

[0110] Preferably, the notification unit is further configured to push the obtained charging state of the vehicle to the charging station management terminal, facilitating the management personnel to know the usage conditions of each charging pile in the charging station and manage the charging piles efficiently.

[0111] Preferably, the system may further include an acquisition unit. When the comparison unit determines that the vehicle is in the abnormal occupancy state or the charging timeout state, the acquisition unit is configured to detect and identify the vehicle information using the Baidu PaddlePaddle framework, obtain the vehicle information, and push the vehicle information to the charging station management terminal, facilitating the management of the charging station by the management personnel;

[0112] In summary, the vehicle charging state detection system provided by the embodiment of the present application realizes the detection of the vehicle charging state by identifying and comparing the charging gun position information and the occupancy information of the parking space in the monitoring video stream, and timely pushes the vehicle charging state information to the charging station management terminal, facilitating the administrator to manage the charging station efficiently.

[0113] Due to the limited clarity of the monitoring video, the charging gun has characteristics such as small volume, far distance from the monitoring camera, low resolution, and being easily affected by light in the monitoring video. In the specific implementation, for the vehicle charging state detection system provided in this embodiment, the system further includes:

[0114] An image acquisition unit for acquiring training sample images;

[0115] A model training unit for training an initial object detection model using the training sample images to obtain a trained object detection model. The activation function of the object detection model includes the Mish activation function, the loss function of the object detection model includes the DIoU loss function, and the object detection model is the YOLO v5 model.

[0116] The image acquisition unit is specifically configured to: acquire an initial image; improve the image resolution of the charging gun area in the initial image through image super-resolution technology to obtain an initial training image; generate a charging gun image through a generative adversarial network and randomly add at least one generated charging gun image to the initial training image to obtain a training sample image.

[0117] The actions and principles executed by the image acquisition unit and the model training unit correspond to those of the foregoing method and will not be elaborated here.

[0118] In summary, the charging state detection system for vehicles provided in the embodiments of the present application improves the YOLO v5 algorithm in part, adds an enhancement operation for the initial image, replaces the Leaky Relu activation function with the Mish activation function, and improves the loss function by replacing the original DIoU loss function with the GIoU loss function, thereby improving the recognition accuracy of the object detection model for the charging gun and further improving the recognition accuracy of the vehicle charging state, which is convenient for the charging station administrator to effectively manage the charging piles.

[0119] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other.

[0120] Those skilled in the art can understand that the flowchart shown in the figure is only an example in which the embodiments of the present application can be implemented, and the scope of application of the embodiments of the present application is not limited by any aspect of this flowchart.

[0121] In several embodiments provided in the present application, it should be understood that the disclosed methods, systems, and devices can be implemented in other ways. For example, the system embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0122] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0123] If the above function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or this part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0124] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather should be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting the charging state of a vehicle, characterized in that, the method includes: Obtaining training sample images; wherein, the obtaining of the training sample images includes: obtaining an initial image; improving the image resolution of the charging gun area in the initial image through image super-resolution technology to obtain an initial training image; generating a charging gun image through a generative adversarial network, and randomly adding at least one generated charging gun image to the initial training image to obtain a training sample image; Using the training sample images to train an initial object detection model to obtain a trained object detection model, wherein the activation function of the object detection model includes the Mish activation function, the loss function of the object detection model includes the DioU loss function, and the object detection model is the YOLO v5 model; the DioU loss function is used to optimize the area between two object bounding boxes; Intercepting a monitoring video stream at a preset time interval, where the monitoring video stream includes a target image of the current frame; Performing object detection on the target image according to a pre-trained object detection model to obtain an object detection result of the current frame, where the object detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun; Comparing the object detection result of the current frame with the object detection result of the previous frame to obtain the charging state of the vehicle; Among them, the comparing the object detection result of the current frame with the object detection result of the previous frame to obtain the charging state of the vehicle includes: If the object detection result of the previous frame includes no vehicle in the parking space and the charging gun is in the initial position, and the object detection result of the current frame includes a vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the state of occupying the space without charging; When the vehicle is in the state of occupying the space without charging, record the duration of the vehicle being in the state of occupying the space without charging. If the duration of the state of occupying the space without charging exceeds a first preset time threshold, it is determined that the vehicle is in an abnormal occupancy state; If the object detection result of the previous frame determines that the vehicle is in the state of occupying the space without charging, and the object detection result of the current frame includes a vehicle in the parking space and the charging gun leaves the initial position, it is determined that the vehicle is in the charging state, and record the charging start time of the vehicle; When the vehicle is in the charging state, record the duration of the vehicle being in the charging state. If the duration of the charging state exceeds a second preset time threshold, it is determined that the vehicle is in the state of charging timeout; Among them, comparing the object detection result of the current frame with the object detection result of the previous frame to obtain the charging state of the vehicle further includes: If the object detection result of the previous frame determines that the vehicle is in the charging state, and the object detection result of the current frame includes a vehicle in the parking space and the charging gun returns to the initial position, it is determined that the vehicle is in the charging completed state; When the vehicle is in the charging completed state, record the duration of the vehicle being in the charging completed state. If the duration of the charging completed state exceeds a third preset time threshold, it is determined that the vehicle is in the state of occupying the space after charging completion; If the target detection result of the previous frame determines that the vehicle is in a fully charged state, and the target detection result of the current frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, then it is determined that the vehicle is in a charging end state, and the charging end time of the vehicle is recorded; Obtain the total charging time of the vehicle according to the charging start time and the charging end time of the vehicle.

2. The method according to claim 1, wherein, the method further includes: pushing the charging state of the vehicle to the charging station management terminal.

3. The method according to claim 1, wherein, the method further includes: when the target detection result includes that there is no vehicle in the parking space and the charging gun leaves the initial position, it is determined that the charging gun state is abnormal, an abnormal message is generated, and the abnormal message is pushed to the charging station management terminal.

4. A charging state detection system for a vehicle, wherein, the system includes: an image acquisition unit for acquiring training sample images; wherein, the image acquisition unit is specifically configured to: acquire an initial image; improve the image resolution of the charging gun area in the initial image through image super-resolution technology to obtain an initial training image; generate a charging gun image through a generative adversarial network, and randomly add at least one generated charging gun image to the initial training image to obtain a training sample image; a model training unit for using the training sample images to train an initial target detection model to obtain a trained target detection model, wherein the activation function of the target detection model includes a Mish activation function, the loss function of the target detection model includes a DioU loss function, and the target detection model is a YOLO v5 model; a truncation unit for truncating the monitoring video stream at a preset time interval, where the monitoring video stream includes the target image of the current frame; a detection unit for performing target detection on the target image according to the pre-trained target detection model to obtain the target detection result of the current frame, where the target detection result includes the position information of the charging gun and the vehicle occupancy information of the parking space corresponding to the charging gun; a comparison unit for comparing the target detection result of the current frame with the target detection result of the previous frame to obtain the charging state of the vehicle; wherein, the comparison unit compares the target detection result of the current frame with the target detection result of the previous frame to obtain the charging state of the vehicle, including: if the target detection result of the previous frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, and the target detection result of the current frame includes that there is a vehicle in the parking space and the charging gun is in the initial position, then it is determined that the vehicle is in an occupied but not charging state; when the vehicle is in an occupied but not charging state, record the duration of the vehicle being in an occupied but not charging state, and if the duration of the occupied but not charging state exceeds a first preset time threshold, determine that the vehicle is in an abnormal occupancy state; If the object detection result of the previous frame determines that the vehicle is in the occupied but uncharged state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun has left the initial position, it is determined that the vehicle is in the charging state, and the charging start time of the vehicle is recorded; When the vehicle is in the charging state, record the duration of the vehicle being in the charging state. If the duration of the charging state exceeds the second preset time threshold, it is determined that the vehicle is in the charging timeout state; If the object detection result of the previous frame determines that the vehicle is in the charging state, and the object detection result of the current frame includes that there is a vehicle in the parking space and the charging gun returns to the initial position, it is determined that the vehicle is in the charging completed state; When the vehicle is in the charging completed state, record the duration of the vehicle being in the charging completed state. If the duration of the charging completed state exceeds the third preset time threshold, it is determined that the vehicle is in the charging completed and occupied state; If the object detection result of the previous frame determines that the vehicle is in the charging completed state, and the object detection result of the current frame includes that there is no vehicle in the parking space and the charging gun is in the initial position, it is determined that the vehicle is in the charging ended state, and the charging end time of the vehicle is recorded; Obtain the total charging time of the vehicle according to the charging start time and the charging end time of the vehicle.

Citation Information

Patent Citations

  • Parking space management method and system

    CN111882916A

  • Charging station intelligent operation and maintenance algorithm, and charging station intelligent operation and maintenance system

    CN113963293A