Battery box positioning method, device and system based on target detection and medium

Through the target detection method, the 2D camera and pre-trained model are used to identify the position and angle of the battery box, the limitations of the traditional positioning method are solved, and the rapid and accurate positioning and replacement of the battery box is achieved, reducing costs and improving the operating efficiency of the battery swap station.

CN120451256APending Publication Date: 2025-08-08HUNAN XINGBIDA NETLINK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510593948.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The traditional battery box positioning method relies on mechanical positioning devices, with complex structures, high cost and difficult to adapt to different models and specifications of battery boxes. In addition, the existing visual positioning system is difficult to identify the position and posture of the rotating battery box in complex environments, resulting in inaccurate positioning and affecting the operation and battery life of the battery swap station.

Method used

Using a method based on object detection, the 2D camera is used to collect image data and identify the position and deflection angle of the battery box through the pre-trained object detection model, and the vehicle position is adjusted in combination with position information and angle to adjust the battery box to the preset battery replaceable position.

Benefits of technology

It improves the accuracy, reliability and compatibility of battery box positioning, ensures the fast and accurate battery box replacement, reduces hardware and maintenance costs, and improves the operating efficiency and stability of the battery swap station.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451256A_ABST
    Figure CN120451256A_ABST
Patent Text Reader

Abstract

The invention provides a battery box positioning method, device and system based on target detection and a medium, and relates to the technical field of new energy. The method comprises the steps of obtaining image data collected by a 2D camera, wherein the image data comprises a battery box of a vehicle; inputting the image data into a pre-trained target detection model to obtain position information of the battery box; determining the deflection angle of the battery box according to the position information of the battery box; and the position of the vehicle is adjusted according to the position information and the deflection angle, so that a battery box of the vehicle is adjusted to a preset battery replaceable position. According to the method, the accuracy, reliability and compatibility of battery box positioning are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of new energy technology, and in particular to a battery box positioning method, device, system and medium based on target detection. Background Art

[0002] With the widespread adoption of new energy vehicles, battery swap stations are gaining increasing attention as a quick way to replenish energy. Accurately picking up and replacing battery boxes is a key step in the battery swap station workflow, making accurate positioning of the battery boxes particularly important.

[0003] Traditional battery box positioning methods mainly rely on mechanical positioning devices, which are usually complex in structure, high in cost, and lack flexibility, making it difficult to adapt to battery boxes of different models and specifications. In addition, mechanical positioning is prone to wear and loss of accuracy during long-term use, affecting the accuracy and efficiency of battery replacement. Therefore, vision-based positioning systems have become popular. In related technologies, the parking position of the vehicle can be preset in the battery swap station, and a camera that can capture the battery box can be installed near the position. When the vehicle enters the battery swap station and reaches the parking position, the camera can capture an image including the battery box, and the positioning system can locate the battery box based on the image, so that the battery swap car can accurately grab and replace the battery box according to the position of the battery box.

[0004] However, this positioning method can only handle horizontally or vertically positioned targets. It is difficult to accurately identify the position and posture of battery boxes, which may rotate during handling and storage during actual battery swap station operations. This makes it easy for errors to occur during battery handling and replacement, potentially leading to improper installation and collision damage, seriously affecting the normal operation of the battery swap station and the battery life. Summary of the Invention

[0005] The embodiments of the present application provide a battery box positioning method, device, system and medium based on target detection, which can effectively improve the accuracy, reliability and compatibility of battery box positioning.

[0006] In a first aspect, an embodiment of the present application provides a battery box positioning method based on target detection, comprising:

[0007] Acquiring image data captured by a 2D camera, wherein the image data includes a battery box of a vehicle;

[0008] Inputting the image data into a pre-trained object detection model to obtain the location information of the battery box;

[0009] determining a deflection angle of the battery box according to the position information of the battery box;

[0010] The position of the vehicle is adjusted according to the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

[0011] In a possible implementation, the position information of the battery box includes a pixel detection width and a pixel detection height of the battery box, and determining the deflection angle of the battery box according to the position information of the battery box includes:

[0012] determining an actual pixel width and an actual pixel height of the battery box in the image data;

[0013] The deflection angle of the battery box is determined according to the actual pixel width and the actual pixel height, and the detected pixel width and the detected pixel height.

[0014] In a possible implementation, the position information of the battery box further includes the center detection coordinates of the battery box, and adjusting the position of the vehicle according to the position information and the deflection angle includes:

[0015] Performing coordinate transformation on the center detection coordinates to obtain the actual coordinates of the battery box in a physical coordinate system with the battery swapping vehicle as the origin;

[0016] The position of the vehicle is adjusted according to the actual coordinates of the battery box and a preset battery box coordinate threshold range, as well as the deflection angle of the battery box and a preset deflection angle threshold range.

[0017] In a possible implementation, performing coordinate transformation on the center detection coordinates to obtain the actual coordinates of the battery box in a physical coordinate system with the battery swapping vehicle as the origin includes:

[0018] Communicating with the vehicle to obtain model information of a battery box in the vehicle, and determining an actual width of the battery box according to the model information of the battery box;

[0019] Determining a scaling ratio of the physical coordinates according to the actual width of the battery box and the actual width of the pixel;

[0020] determining, according to the scaling ratio of the physical coordinates and the center detection coordinates, a first battery box coordinate of the battery box in a physical coordinate system with the 2D camera as an origin;

[0021] Based on the pre-calibrated external parameters of the 2D camera and the coordinates of the first battery box, the actual coordinates of the battery box in the physical coordinate system with the battery-exchange vehicle as the origin are determined.

[0022] In one possible implementation, the target detection model is trained in the following manner:

[0023] Using the 2D camera to capture sample images of vehicles of different models at preset positions under different scene conditions, the sample images including battery compartments of the vehicles, the different scene conditions including different lighting conditions and / or different weather conditions, the battery compartments including battery compartments of different sizes and specifications, and the battery compartments being at different rotation angles and postures;

[0024] Annotating the sample images to obtain annotation data of each sample image, wherein the annotation data includes pixel width, pixel height, and center coordinates of the battery box;

[0025] generating a data set based on the sample images and the annotation data of each sample image;

[0026] The initial neural network model is iteratively trained according to the data set, the preset loss function and optimizer, and the deep learning framework to obtain the target detection model.

[0027] In one possible implementation, inputting the image data into a pre-trained object detection model to obtain the location information of the battery box includes:

[0028] Inputting the image data into a pre-trained object detection model to obtain first position information output by the model and a confidence level corresponding to each piece of first position information;

[0029] Filtering the first location information according to a preset confidence threshold to obtain second location information having a confidence level greater than the confidence threshold;

[0030] The second location information is deduplicated using a non-maximum suppression algorithm to obtain the location information of the battery box.

[0031] In a possible implementation, before acquiring the image data collected by the 2D camera, the method further includes:

[0032] Obtaining a photo-taking prompt message sent by the PLC, wherein the photo-taking prompt message is sent by the PLC when the PLC detects that the vehicle enters and reaches a preset position;

[0033] A photo taking instruction is sent to the 2D camera so that the 2D camera collects image data including the battery box of the vehicle.

[0034] In a second aspect, an embodiment of the present application provides a computing device, including:

[0035] An acquisition module is used to obtain image data collected by a 2D camera;

[0036] A processing module is used to input the image data into a pre-trained target detection model to obtain the position information of the battery box; determine the deflection angle of the battery box based on the position information of the battery box; and adjust the position of the vehicle based on the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

[0037] In a third aspect, an embodiment of the present application provides another computing device, including:

[0038] a processor, and a memory communicatively coupled to the processor;

[0039] Memory is used to store computer-executable instructions;

[0040] The processor is used to execute the computer-executable instructions stored in the memory, so that the processor executes the above-mentioned first aspect and / or various possible implementations of the first aspect.

[0041] In a fourth aspect, an embodiment of the present application provides a battery box positioning system based on target detection, comprising: a 2D camera, a PLC, and a computing device as described in the third aspect; the computing device is communicatively connected to the 2D camera and the PLC via a switch;

[0042] The PLC is configured to send a photo-taking prompt message to the computing device when detecting that a vehicle enters and reaches a preset position;

[0043] The computing device is configured to send a photo taking instruction to the 2D camera after receiving the photo taking prompt information;

[0044] The 2D camera is configured to capture image data including the battery box of the vehicle after receiving the photographing instruction;

[0045] The computing device is also used to obtain image data collected by a 2D camera; input the image data into a pre-trained target detection model to obtain position information of the battery box; determine the deflection angle of the battery box based on the position information of the battery box; and adjust the position of the vehicle based on the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

[0046] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect and / or various possible implementations of the first aspect described above.

[0047] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the above-mentioned first aspect and / or various possible implementation methods of the first aspect.

[0048] The embodiments of the present application provide a battery box positioning method, device, system and medium based on target detection. After acquiring the image data collected by the 2D camera, the pre-trained target detection model can be used to detect it to obtain the position information of the battery box, and the deflection angle of the battery box can be determined based on the position information. Then, the position of the vehicle can be quickly and accurately adjusted based on the position information of the battery box and the deflection angle of the battery box, so that the battery box of the vehicle is adjusted to a preset battery-swappable position to facilitate the replacement of the battery box by the battery-swappable vehicle. Through such a setting, using a 2D camera and a target detection algorithm, the rotation state and position information of battery boxes of different scenes and types can be accurately identified, and the detection accuracy of the rotation angle is high. Even if the battery box rotates or tilts in a complex environment, it can be quickly and accurately positioned, effectively solving the limitations of the battery positioning process when processing rotating targets, improving the accuracy, reliability and compatibility of the battery box positioning during the battery replacement process, and ensuring that the battery box replacement can be carried out quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0050] Figure 1 This is a structural diagram of a battery box positioning system based on target detection according to an embodiment of the present application;

[0051] Figure 2 This is a flow chart of a battery box positioning method based on target detection according to an embodiment of the present application;

[0052] Figure 3 This is a schematic diagram of the battery box detection results according to an embodiment of the present application;

[0053] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application;

[0054] Figure 5 This is a schematic structural diagram of a computing device according to another embodiment of the present application.

[0055] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0057] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the application described herein can be implemented in orders other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products, or apparatus.

[0058] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0059] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0060] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0061] The target detection-based battery box positioning method, device, system and medium of the present application can be used in the field of new energy technology, and can also be used in any field other than the field of new energy technology, such as the field of battery positioning technology, etc. The application field of the target detection-based battery box positioning method, device, system and medium of the present application is not limited.

[0062] The target detection-based battery box positioning method, device, system and medium of the present application can be applied to scenarios where vehicles grab and replace battery boxes at battery swap stations. There are no restrictions on the model of the vehicle, the model of the battery box, the scene conditions of the battery swap station, etc. Any related scenarios involving vehicle battery box positioning can apply the target detection-based battery box positioning method, device, system and medium of the present application.

[0063] With the widespread adoption of new energy vehicles, battery swap stations are gaining increasing attention as a quick way to replenish energy. Accurately picking up and replacing battery boxes is a key step in the battery swap station workflow, making accurate positioning of the battery boxes particularly important.

[0064] Traditional battery box positioning methods rely primarily on mechanical positioning devices. These devices are often complex, costly, and inflexible, making them difficult to adapt to battery box models and specifications. Furthermore, mechanical positioning systems are prone to wear and loss of accuracy over time, impacting the accuracy and efficiency of battery replacement. Consequently, vision-based positioning systems have become increasingly popular.

[0065] In related technologies, a vehicle's parking position can be preset at a battery swap station, and a 3D camera capable of capturing images of the battery compartment can be installed near that position. When a vehicle enters the station and reaches the parking position, the 3D camera captures an image of the battery compartment. The positioning system uses this image to locate the battery compartment, allowing the battery swap vehicle to accurately grasp and replace the battery compartment based on its position.

[0066] However, this positioning method can only handle horizontally or vertically positioned targets. It is difficult to accurately identify the position and posture of battery boxes, which may rotate during handling and storage during actual battery swap station operations. This makes it easy for errors to occur during battery handling and replacement, potentially leading to improper installation and collision damage, seriously affecting the normal operation of the battery swap station and the battery life.

[0067] In addition, the environment inside the battery swap station is relatively complex, with interference factors such as lighting changes, dust, and oil stains. The existing visual positioning system has poor positioning stability and reliability in such an environment and cannot meet the needs of efficient and stable operation of the battery swap station.

[0068] In addition, existing vision-based positioning systems generally use 3D cameras, but 3D cameras inevitably have the following problems:

[0069] (1) In terms of hardware, 3D cameras are expensive, with high procurement, supporting and energy consumption costs. Installation requires precise calibration, and maintenance is difficult and costly. In addition, they have poor adaptability to ambient light, reflections and harsh conditions, which can easily affect data collection and thus affect positioning accuracy.

[0070] (2) In terms of algorithm processing, the amount of data from 3D cameras is huge, and the processing complexity is high. It requires strong computing power and complex algorithms, and is time-consuming. The algorithm is not versatile enough, and it is difficult to adjust and optimize for different batteries and surface changes, which will also affect the accuracy of positioning.

[0071] (3) In terms of system integration, it is difficult to integrate with the existing battery swap station control system and requires transformation and upgrading; the debugging of coordination with other equipment is complex, and communication and action incoordination problems are prone to occur, affecting system efficiency.

[0072] (4) In terms of personnel requirements, operating and maintaining 3D camera systems requires professional knowledge and skills. The high cost and difficulty of personnel training limit the widespread promotion and application of this technology.

[0073] Based on the above technical problems, the inventive concept of this application is: how to provide a battery box positioning solution that can effectively improve the accuracy, reliability and compatibility of battery box positioning.

[0074] The embodiments of the present application provide a method, device, system and medium for positioning a battery box based on target detection. After acquiring the image data collected by a 2D camera, the pre-trained target detection model can be used to detect the image data to obtain the position information of the battery box, and the deflection angle of the battery box can be determined based on the position information. The position of the vehicle can then be quickly and accurately adjusted based on the position information of the battery box and the deflection angle of the battery box, thereby adjusting the battery box of the vehicle to a preset battery-swappable position to facilitate the replacement of the battery box by the battery-swappable vehicle. By utilizing a 2D camera and a target detection algorithm, the battery box can be positioned quickly and accurately even if the battery box rotates or tilts in a complex environment, effectively solving the limitations of the battery positioning process when handling rotating targets, improving the accuracy, reliability and compatibility of the battery box positioning during the battery swap process, and ensuring that the battery box replacement can be carried out quickly and accurately.

[0075] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0076] Figure 1 This is a structural diagram of a battery box positioning system based on target detection according to an embodiment of the present application. Figure 1As shown, the battery box positioning system may include: a 2D camera, a PLC and a computing device; the computing device may be connected to the 2D camera and the PLC through a switch. The PLC may send a photo prompt to the computing device when it detects that the vehicle has entered and reached a preset position. After receiving the photo instruction, the computing device sends a photo instruction to the 2D camera. After receiving the photo instruction, the 2D camera collects image data including the battery box of the vehicle and transmits it to the computing device. The computing device obtains the image data collected by the 2D camera; inputs the image data into the pre-trained target detection model to obtain the position information of the battery box; determines the deflection angle of the battery box according to the position information of the battery box; adjusts the position of the vehicle according to the position information and the deflection angle to adjust the battery box of the vehicle to the preset battery-exchangeable position. After the battery box is adjusted to the preset battery-exchangeable position, the PLC controls the battery-exchange trolley to complete the replacement of the battery box.

[0077] Figure 2 This is a flow chart of a battery box positioning method based on target detection according to an embodiment of the present application. Figure 1 The computing device in the embodiment of the present invention is used to illustrate the battery box positioning method based on target detection. Figure 2 As shown, the battery box positioning method based on target detection may include the following steps:

[0078] S201: Acquire image data collected by a 2D camera.

[0079] In this embodiment, the image data may include a battery compartment of the vehicle.

[0080] In this embodiment, a domestically produced 2D camera is used as the image acquisition device, and a network cable and TCP / IP protocol are used as the image transmission method. When a vehicle stops at a preset location, the 2D camera begins taking photos. The 2D camera automatically adjusts parameters such as exposure time, aperture size, and gain based on ambient lighting to ensure clear images.

[0081] In this embodiment, the 2D camera can be set at the top of the battery exchange channel of the battery exchange station, or at other locations. As long as the 2D camera can collect image data including the battery box of the vehicle when the vehicle stops at a preset position.

[0082] In this embodiment, the computing device can be an industrial host, which can establish data communication with the 2D camera and PLC through a switch. The PLC determines the arrival of a vehicle through sensors, and after the vehicle stops at a preset position, it will send a photo prompt message to the industrial host. After receiving the message, the industrial host will send a photo instruction to the 2D camera, so that the 2D camera can collect image data including the battery box of the vehicle and transmit it to the industrial host.

[0083] In this embodiment, a Category 6 network cable can be used to connect the 2D camera, industrial host, PLC, and switch. Standard RJ-45 connectors are used at both ends of the cable to ensure a stable connection. After the 2D camera successfully captures the image, it can transmit the captured image data to the industrial host using the TCP / IP protocol and the RJ-45 connector.

[0084] In this embodiment, domestic 2D cameras are used for image acquisition. Compared to 3D cameras or imported high-end 2D cameras, domestic 2D cameras are more affordable, significantly reducing equipment procurement costs. Furthermore, the cost of the accompanying network transmission equipment is also relatively low, significantly reducing overall hardware investment costs. This allows battery swap stations to save a significant amount of money when building a visual positioning system, improving economic efficiency.

[0085] Furthermore, the relatively simple structure of domestically produced 2D cameras makes routine maintenance and troubleshooting easier, requiring minimal technical expertise, reducing the cost of hiring specialized technicians. Furthermore, network transmission is stable and reliable, making it less prone to failure. This further reduces system maintenance costs and downtime, ensuring the continued stable operation of the battery swap station.

[0086] S202: Input the image data into a pre-trained target detection model to obtain the location information of the battery box.

[0087] In this embodiment, the position information of the battery box may include pixel center coordinates, pixel width, and pixel height of the battery box (the battery frame in the top view of the battery box, hereinafter referred to as the battery frame).

[0088] In this embodiment, the model can be trained based on the improved target detection network of the YOLO series using the deep learning framework PyTorch to obtain a pre-trained target detection model.

[0089] In this embodiment, a 2D camera can be used to collect data from battery boxes of different vehicle models and sizes under different time periods and environmental conditions to generate sample data. The battery boxes (battery frames) in the images are then annotated using the professional image annotation tool Labelme. This annotation information includes the center coordinates, width, and height of the battery frame. Rectangular box representation (e.g., (X, Y, W1, H1, where (X, Y) represents the center coordinates and W and H represent the width and height) is used to accurately record the battery frame's position and posture.

[0090] After obtaining a sample dataset based on the sample data and annotation information, the dataset can be divided into training, validation, and test sets. During the training process, an appropriate loss function and optimizer are used to continuously adjust hyperparameters to improve the model's detection accuracy and stability. The model is evaluated and optimized using the validation and test sets to ensure that the model can accurately detect battery compartments in different scenarios. This ensures that the pre-trained object detection model can accurately detect the location of battery compartments in images.

[0091] In this embodiment, a pre-trained object detection model can be pre-loaded into the battery box detection module of the industrial host. When the industrial host acquires image data from the 2D camera, the battery box detection module inputs the image into the model in real time for inference. The model then outputs information such as the center coordinates, length, and width of the battery box, thereby locating the battery box in the 2D image.

[0092] S203: Determine the deflection angle of the battery box according to the position information of the battery box.

[0093] In this embodiment, by using position information including the pixel center coordinates, pixel width, and pixel height of the battery box, it is possible to determine whether the battery box is deflected and the deflection angle when deflection occurs, so as to facilitate subsequent adjustment of the battery box (vehicle) position.

[0094] In this embodiment, when the deflection angle of the battery box is 0, the battery box does not rotate and faces the battery-exchangeable position.

[0095] S204: Adjust the position of the vehicle according to the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

[0096] In this embodiment, the preset battery-replaceable position can be the optimal battery-replacement position of the battery box (easy to operate and will not damage the battery box). Technical personnel in this field can flexibly set it according to actual conditions and no restrictions are imposed here.

[0097] In this embodiment, the position threshold range and deflection angle threshold range when the battery box is in a preset battery-replaceable position can be pre-set. After calculating the actual position information and deflection angle of the battery box, they are compared with the preset position threshold range and deflection angle threshold range to determine whether the vehicle position needs to be adjusted.

[0098] In this embodiment, when the battery pack's actual position and deflection angle are within a preset threshold range, no vehicle (battery pack) position adjustment is required, allowing the vehicle to be replaced. If the battery pack's actual position and / or deflection angle are outside the preset threshold range, the actual position and deflection angle can be compared with the preset threshold range to generate intuitive guidance information to guide the driver in adjusting the vehicle's position.

[0099] In this embodiment, the 2D camera's high frame rate (no less than 30 fps) and the high-speed, stable transmission of the network cable (up to [X] Mbps) ensure timely and accurate transmission of image data to the processing device. Furthermore, the optimized object detection model boasts fast inference speed, enabling rapid detection and positioning of the battery rack. The response time from image acquisition to positioning output is no more than [X] milliseconds, significantly improving the efficiency of the battery swap station and reducing vehicle wait times.

[0100] In this embodiment, the angle and coordinates of the vehicle's battery box are calculated in real time, the calculation results are compared with the preset optimal battery swap position, and intuitive guidance information (graphics, text, voice prompts) is generated to guide the driver to adjust the vehicle position. The driver can quickly and accurately understand and execute the adjustment instructions, allowing the vehicle to quickly reach the optimal battery swap position, avoiding the blindness and tediousness of manual adjustment, and further improving the overall efficiency of the battery swap process.

[0101] In this embodiment, the target detection-based battery box positioning system offers excellent compatibility and seamless integration with existing battery swap station management systems and battery handling equipment. The system outputs positioning information in a standard data format (such as JSON or XML), facilitating data sharing and collaboration with other devices and systems. This enables intelligent integration of all aspects of the battery swap station, improving overall station management and operational efficiency.

[0102] In this embodiment, the camera features automatic exposure and autofocus, adapting to varying lighting conditions and shooting distances to ensure clear, accurate images. During data transmission, redundant backup and data verification mechanisms are employed to prevent data loss or errors. Furthermore, the model undergoes rigorous evaluation and optimization during training, ensuring high stability and reliability. It maintains accurate positioning performance over long periods of continuous operation, minimizing interruptions and erroneous operations during battery replacement due to system failures.

[0103] In this embodiment, after acquiring the image data collected by the 2D camera, the pre-trained target detection model can be used to detect the image data to obtain the position information of the battery box, and the deflection angle of the battery box can be determined based on the position information. Then, the position of the vehicle can be quickly and accurately adjusted based on the position information of the battery box and the deflection angle of the battery box, so that the battery box of the vehicle can be adjusted to a preset battery-swappable position to facilitate the replacement of the battery box by the battery-swappable vehicle. Through such a setting, the rotation state and position information of battery boxes of different types and in different scenes can be accurately identified using a 2D camera and a target detection algorithm. The detection accuracy of the rotation angle is high, and even if the battery box rotates or tilts in a complex environment, it can be quickly and accurately positioned, effectively solving the limitations of the battery positioning process when processing rotating targets, improving the accuracy, reliability and compatibility of the battery box positioning during the battery replacement process, and ensuring that the battery box replacement can be carried out quickly and accurately.

[0104] In a possible implementation, before the step S201 of acquiring the image data captured by the 2D camera, the following steps may also be included:

[0105] S11: Obtaining the photo-taking prompt information sent by the PLC. The photo-taking prompt information is sent by the PLC when it detects that a vehicle enters and reaches a preset position.

[0106] S12: Sending a photo-taking instruction to the 2D camera, so that the 2D camera collects image data including the battery box of the vehicle.

[0107] In this embodiment, the preset position can be flexibly set by those skilled in the art according to actual conditions, and no restrictions are imposed here. As long as the vehicle is in the preset position, the battery box is in the preset battery-replaceable position.

[0108] In this embodiment, communication between the industrial host and the PLC (2D camera) can be carried out through a switch; photo prompt information, photo instructions and image data can be transmitted according to the TCP / IP protocol and the RJ-45 interface, realizing fast and stable information transmission.

[0109] In this embodiment, the PLC determines the arrival of a vehicle through sensors, and after the vehicle stops at a preset position, it will send a photo prompt message to the industrial host. After receiving the message, the industrial host will send a photo command to the 2D camera, causing the 2D camera to collect image data including the battery box of the vehicle and transmit it to the industrial host.

[0110] In one possible implementation, the target detection model in step S202 may be trained in the following manner:

[0111] S21: Use a 2D camera to collect sample images under different scene conditions and when different models of vehicles are in preset positions. The sample images include the battery box of the vehicle. The different scene conditions include different lighting conditions and / or different weather conditions. The battery box includes battery boxes of different sizes and specifications, and the battery box is at different rotation angles and postures.

[0112] S22: labeling the sample images to obtain labeling data of each sample image, where the labeling data includes the pixel width, pixel height, and center coordinates of the battery box.

[0113] S23: Generate a data set based on the sample images and the annotation data of each sample image.

[0114] S24: Iteratively train the initial neural network model based on the dataset, the preset loss function and optimizer, and the deep learning framework to obtain the target detection model.

[0115] In this implementation, images of the battery box (the top view of the battery box) can be collected at different time periods and in different scenarios. This includes photos in different lighting conditions, such as strong light, low light, and backlight, and in different weather conditions, such as sunny, rainy, snowy, and foggy days. Furthermore, images of battery boxes from different vehicle models and sizes are included. Images of the battery box at various rotation angles and postures are collected to simulate the various angles that the battery box may appear in actual battery swap stations, providing rich data for subsequent model training.

[0116] In this embodiment, the battery frame in the image captured in the aforementioned environment can be annotated using the professional image annotation tool Labelme. This annotation information includes the battery frame's center coordinates, pixel width, and pixel height. A rectangular box representation (e.g., (X, Y, W1, H1), where (X, Y) represents the center coordinates of the battery frame in the image, and W and H represent the pixel width and height) is used to accurately record the battery frame's position and posture.

[0117] To perform annotation, the operator can open the annotation tool and import the captured image. Using the tool's rotating frame annotation function, select the battery frame in the image and accurately enter the center coordinates (X, Y), width (W), and height (H) of the battery frame. After annotation is completed, a professional can review the annotation data to check whether the rotating frame fully covers the battery frame and whether the coordinate and angle information are accurate. Any annotations that do not meet the requirements will be promptly returned for re-annotation to ensure accuracy and consistency, thereby improving the quality of the annotation data.

[0118] In this embodiment, after generating a dataset, the dataset can be divided into a training set, a validation set, and a test set in the ratio [a]:[b]:[c]. The network structure of the target detection model is then defined, and the loss function and optimizer are set. During the training process, the training set data is input into the model in batches for training. After each training cycle, the validation set is used to evaluate the model's performance, and the model parameters are adjusted based on the evaluation results. After n training cycles, the model is finally evaluated using the test set to ensure that the model's detection accuracy and stability meet the requirements, thus obtaining a pre-trained target detection model.

[0119] In this embodiment, the initial neural network model can be an improved target detection network based on the YOLO series, or other network models, without any limitation.

[0120] In this embodiment, those skilled in the art can flexibly set the preset loss function and optimizer according to actual conditions, and no limitation is imposed here.

[0121] In this embodiment, during the model training stage, a large number of images covering different lighting conditions (strong light, weak light, backlight, etc.), different environments (indoor, outdoor), and different battery box types (square, round, special-shaped, etc.) and postures are collected for annotation and training. This makes the trained target detection model have strong generalization ability and robustness, and can adapt to various complex and changeable actual scenarios in battery swap stations, ensuring stable and accurate detection and positioning of battery boxes under different conditions, greatly improving the compatibility and scalability of battery box positioning.

[0122] In one possible implementation, step S202 inputs the image data into a pre-trained object detection model to obtain the location information of the battery box, which may include:

[0123] S31: Input the image data into a pre-trained target detection model to obtain the first position information output by the model and the confidence level corresponding to each piece of first position information.

[0124] S32: Filter the first location information according to a preset confidence threshold to obtain second location information with a confidence level greater than the confidence threshold.

[0125] S33: Deduplication processing is performed on the second position information using a non-maximum suppression algorithm to obtain position information of the battery box.

[0126] In this embodiment, those skilled in the art can flexibly set the preset confidence threshold according to actual conditions, and no limitation is imposed here.

[0127] In this embodiment, after the model outputs the detected first location information and the corresponding confidence level for each first location information, it can filter the detected location information using a preset confidence threshold, retaining only location information with a confidence level greater than the confidence threshold and filtering out detection results with lower confidence levels, thereby improving the accuracy and reliability of the location information. Furthermore, post-processing algorithms such as non-maximum suppression (NMS) can be used to process the filtered detection frames, removing detection frames with high overlap and retaining the most accurate positioning results, further improving the accuracy and reliability of the location information.

[0128] In one possible implementation, the battery box location information includes a pixel detection width and a pixel detection height of the battery box. Therefore, step S203 of determining the deflection angle of the battery box based on the battery box location information may include:

[0129] S41: Determine the actual pixel width and actual pixel height of the battery box in the image data.

[0130] S42: Determine the deflection angle of the battery box according to the actual pixel width and the actual pixel height, as well as the pixel detection width and the pixel detection height.

[0131] In this embodiment, the actual pixel width and actual pixel height of the battery box in the image data can be obtained by performing edge extraction and other processing on the image data. Of course, the actual pixel width and actual pixel height of the battery box in the image data can also be determined by other methods, and no restrictions are made here.

[0132] For example, Figure 3 This is a schematic diagram of the battery box detection results according to an embodiment of the present application. Figure 3 The shaded part is the top view of the battery box, the dotted part is the circumscribed rectangle of the battery box detected according to the model, W1 represents the pixel detection width, H1 represents the pixel detection height, W represents the actual pixel width, and H represents the actual pixel height.

[0133] like Figure 3 As shown, using trigonometric functions, we can know that ∠1+∠3=90°, ∠2+∠3=90°

[0134] Therefore, ∠1=∠2=deflection angle of the battery box From trigonometric functions, we know that

[0135]

[0136] From this we can see that

[0137] Calculate After that, the deflection angle of the battery box can be calculated .

[0138] In this embodiment, after edge extraction and other processing are performed on the image data, the actual pixel width and actual pixel height of the battery box can be obtained. By using the actual pixel width and actual pixel height and the pixel detection width and pixel detection height detected by the model, the deflection angle of the battery box can be determined quickly and accurately.

[0139] In one possible embodiment, the battery box position information further includes the center detection coordinates of the battery box. Therefore, the above step S204 of adjusting the position of the vehicle according to the position information and the deflection angle may include:

[0140] S51: Perform coordinate transformation on the center detection coordinates to obtain the actual coordinates of the battery box in the physical coordinate system with the battery-exchange vehicle as the origin.

[0141] S52: Adjusting the position of the vehicle according to the actual coordinates of the battery box and the preset battery box coordinate threshold range, as well as the deflection angle of the battery box and the preset deflection angle threshold range.

[0142] In this embodiment, the preset battery box coordinate threshold range and the preset deflection angle threshold range can be flexibly set by those skilled in the art according to actual needs, and no restrictions are imposed here. As long as the battery box is in the optimal battery replacement position (battery replacement position) that is easy to operate and will not damage the battery box within the preset battery box coordinate threshold range and the preset deflection angle threshold range, the battery replacement cart can directly replace the battery box.

[0143] In this embodiment, the battery compartment coordinate threshold range may include a plane x-direction coordinate threshold range and a plane y-direction coordinate threshold range. The x-direction may be the front-to-back direction of the vehicle, and the y-direction may be the left-to-right direction of the vehicle. If the actual x-direction coordinate of the battery compartment exceeds the x-direction coordinate threshold range, the driver may be prompted to adjust the vehicle forward and backward so that the actual x-direction coordinate falls within the x-direction coordinate threshold range. If the actual y-direction coordinate of the battery compartment exceeds the y-direction coordinate threshold range, the driver may be prompted to adjust the vehicle left and right so that the actual y-direction coordinate falls within the y-direction coordinate threshold range.

[0144] In this embodiment, if the deflection angle of the battery box exceeds the preset deflection angle threshold range, the driver needs to be prompted to adjust the vehicle (battery box) angle so that the deflection angle of the battery box is within the preset deflection angle threshold range.

[0145] In this embodiment, when the industrial host determines that the actual coordinates of the battery box and / or the deflection angle of the battery box are not within the corresponding threshold range, it can output prompt information through the voice system (speaker, etc.) in the battery swap station, and can also output graphics, text and other prompt information to prompt the driver to adjust the position of the vehicle.

[0146] In this embodiment, when the industrial host determines that the actual coordinates of the battery box and the deflection angle of the battery box are both within the corresponding threshold range, the actual coordinates of the battery box can be sent to the PLC. The PLC uses the actual coordinates of the battery box to control the battery swapping trolley and other handling equipment to replace the battery box, completing the battery swap operation. Alternatively, since the coordinates and angles are both within the allowable error range, the industrial host can directly notify the PLC to control the handling equipment, and use the preset battery box coordinate threshold range to control the battery swapping trolley and other handling equipment to replace the battery box, completing the battery swap operation.

[0147] In this embodiment, the center detection coordinates are coordinates in the image coordinate system, and the replacement of the battery box is carried out in the real physical world. Therefore, it is necessary to first perform a coordinate conversion on the center detection coordinates to obtain the actual coordinates of the battery box in the physical coordinate system with the battery swap vehicle as the origin, so as to facilitate subsequent vehicle position adjustment and battery box replacement. After obtaining the actual coordinates of the battery box, the actual coordinates of the battery box are compared with the preset battery box coordinate threshold range, and the deflection angle of the battery box is compared with the preset deflection angle threshold range to determine whether the vehicle position needs to be adjusted. When adjustment is required, intuitive guidance information can be generated based on the above comparison information to guide the driver to make quick and accurate vehicle position adjustments.

[0148] In one possible implementation, the above step S51 performs coordinate conversion on the center detection coordinates to obtain the actual coordinates of the battery box in the physical coordinate system with the battery swapping vehicle as the origin, which may include:

[0149] S61: Communicate with the vehicle to obtain model information of the battery box in the vehicle, and determine the actual width of the battery box according to the model information of the battery box.

[0150] S62: Determine the scaling ratio of the physical coordinates according to the actual width of the battery box and the actual width of the pixel.

[0151] S63: Determine the first battery box coordinates of the battery box in the physical coordinate system with the 2D camera as the origin according to the scaling ratio of the physical coordinates and the center detection coordinates.

[0152] S64: Based on the pre-calibrated external parameters of the 2D camera and the coordinates of the first battery box, determine the actual coordinates of the battery box in the physical coordinate system with the battery-exchange vehicle as the origin.

[0153] In this embodiment, the scaling ratio of the physical coordinates δ = the actual width W2 of the battery box / the actual pixel width W of the battery box in the image data. The first battery box coordinate = the center detection coordinate × δ.

[0154] In this implementation, during the system installation and commissioning phase, the 2D camera can be calibrated using the Zhang Zhengyou calibration method (or other calibration methods) to obtain the pre-calibrated extrinsic and intrinsic parameters of the 2D camera. By capturing checkerboard images at different angles and positions, the intrinsic parameters (focal length, principal point coordinates, etc.) and extrinsic parameters (rotation matrix, translation vector, etc.) of the 2D camera can be calculated, establishing the transformation relationship between the image coordinate system and the camera coordinate system.

[0155] In this implementation, a Kalman filter algorithm is used to correct the converted battery box coordinates, taking into account the impact of camera installation errors, environmental interference, and other factors on positioning accuracy. By analyzing and processing multiple measurement data, errors are estimated and compensated in real time, improving positioning accuracy and reliability. Ultimately, the accurate actual battery box position information is transmitted to the station's handling control system (PLC), enabling precise positioning and replacement of the battery box.

[0156] In this embodiment, the center detection coordinates are coordinates in the image coordinate system, and the replacement of the battery box is carried out in the real physical world. Therefore, when performing coordinate conversion, it is necessary to first convert the center detection coordinates in the image coordinate system into the first battery box coordinates in the physical coordinate system with the 2D camera as the origin, and then convert the first battery box coordinates into the actual coordinates of the battery box in the physical coordinate system with the battery exchange vehicle as the origin.

[0157] The battery box positioning method based on target detection of the present application is described below with a specific embodiment.

[0158] In a specific embodiment, a driver drives a vehicle into a battery swap station to replace a battery box. A 2D camera is installed on the top of the battery swap channel of the battery swap station. The 2D camera communicates with an industrial host through a switch. The industrial host also communicates with a PLC through the switch. The PLC can control the movement of the battery swap vehicle. The 2D camera, switch, PLC and industrial host constitute a battery box positioning system based on target detection.

[0159] The industrial host computer is loaded with a pretrained object detection model. This object detection model can be trained using the following method: using a 2D camera to capture sample images of different vehicle models in preset positions under different scene conditions. The sample images include the vehicle's battery compartment. The different scene conditions include different lighting conditions and / or different weather conditions. The battery compartments include battery compartments of different sizes and specifications, and the battery compartments are at different rotation angles and postures. The sample images are annotated to obtain annotation data for each sample image. The annotation data includes the pixel width, pixel height, and center coordinates of the battery compartment. A dataset is generated based on the sample images and the annotation data for each sample image. The dataset is divided into a training set, a validation set, and a test set in the ratio [a]:[b]:[c]. The network structure of the object detection model is then defined, and the loss function and optimizer are set. During training, the training set data is input into the model in batches for training. After each training cycle, the model performance is evaluated using the validation set, and the model parameters are adjusted based on the evaluation results. After n training cycles, the model is finally evaluated using the test set to ensure that the model's detection accuracy and stability meet the requirements, thus obtaining the pretrained object detection model.

[0160] The specific battery replacement process is as follows:

[0161] In the first step, the PLC uses sensors to determine the arrival of a vehicle. After the vehicle stops at a preset location, it sends a photo prompt message to the industrial host. After receiving the message, the industrial host sends a photo command to the 2D camera. After receiving the message, the 2D camera collects image data including the battery box of the vehicle and transmits it to the industrial host.

[0162] In the second step, the industrial host obtains the image data collected by the 2D camera and inputs the image data into the pre-trained target detection model to obtain the first position information output by the model and the confidence level corresponding to each first position information; the first position information is filtered according to the preset confidence threshold to obtain the second position information with a confidence level greater than the confidence threshold; the second position information is deduplicated using the non-maximum suppression algorithm to obtain the position information of the battery box, which includes the pixel center coordinates, pixel width, and pixel height of the battery box.

[0163] In the third step, the industrial host determines the actual pixel width and actual pixel height of the battery box in the image data; based on the actual pixel width and actual pixel height, as well as the pixel detection width and pixel detection height, the deflection angle of the battery box is determined.

[0164] In the fourth step, the industrial host communicates with the vehicle to obtain the model information of the battery box in the vehicle, and determines the actual width of the battery box based on the model information of the battery box; determines the scaling ratio of the physical coordinates based on the actual width of the battery box and the actual pixel width; determines the first battery box coordinates of the battery box in the physical coordinate system with the 2D camera as the origin based on the scaling ratio of the physical coordinates and the center detection coordinates; determines the actual coordinates of the battery box in the physical coordinate system with the battery swap car as the origin based on the pre-calibrated external parameters of the 2D camera and the first battery box coordinates.

[0165] In the fifth step, the industrial host compares the actual coordinates of the battery box with the preset battery box coordinate threshold range to determine that the actual coordinates of the battery box are within the battery box coordinate threshold range; compares the deflection angle of the battery box with the preset deflection angle threshold range to determine that the deflection angle of the battery box exceeds the preset deflection angle threshold range.

[0166] In the sixth step, the industrial host generates a vehicle position adjustment prompt message based on the deflection angle of the battery box and the preset deflection angle threshold range, and outputs the prompt message through the speaker of the battery swap station. The driver adjusts the vehicle position according to the prompt message.

[0167] In the seventh step, the industrial host sends the actual coordinates of the battery box to the PLC. The PLC generates control instructions based on the actual coordinates of the battery box and controls the battery-swapping vehicle to complete the battery box replacement.

[0168] Figure 4 This is a schematic diagram of the structure of a computing device according to an embodiment of the present application. Figure 4 As shown, the computing device includes: an acquisition module 41 for acquiring image data collected by a 2D camera, the image data including the battery box of the vehicle; a processing module 42 for inputting the image data into a pre-trained target detection model to obtain the position information of the battery box; determining the deflection angle of the battery box according to the position information of the battery box; adjusting the position of the vehicle according to the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

[0169] The computing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.

[0170] Figure 5 This is a schematic diagram of the structure of a computing device according to another embodiment of the present application. Figure 5 As shown, the computing device includes: a processor 501, and a memory 502 communicatively connected to the processor 501; the memory 502 stores computer execution instructions; the processor 501 executes the computer execution instructions stored in the memory 502 to implement the steps of the battery box positioning method based on target detection in the above-mentioned method embodiments.

[0171] In the computing device described above, the memory 502 and the processor 501 are electrically connected, directly or indirectly, to enable data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines, such as a bus connection. The memory 502 stores computer-executable instructions for implementing the data access control method, including at least one software function module that may be stored in the memory 502 in the form of software or firmware. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502.

[0172] The memory 502 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 502 is used to store programs, and the processor 501 executes the programs after receiving execution instructions. Furthermore, the software programs and modules in the memory 502 may also include an operating system, which may include various software components and / or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.

[0173] The processor 501 can be an integrated circuit chip with signal processing capabilities. The processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.

[0174] An embodiment of the present application also provides a battery box positioning system based on target detection, such as Figure 1 As shown, the battery box positioning system based on target detection may include: a 2D camera, a PLC and Figure 5The computing device shown; the computing device is connected to the 2D camera and PLC through a switch.

[0175] The PLC is used to send a photo-taking prompt message to the computing device when a vehicle is detected to enter and reach a preset position.

[0176] The computing device is used to send a photo taking instruction to the 2D camera after receiving the photo taking prompt information.

[0177] The 2D camera is used to collect image data including the battery box of the vehicle after receiving a photo taking instruction.

[0178] The computing device is also used to obtain image data collected by the 2D camera; input the image data into a pre-trained target detection model to obtain the position information of the battery box; determine the deflection angle of the battery box based on the position information of the battery box; adjust the position of the vehicle based on the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-swappable position.

[0179] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the steps of each method embodiment of the present application.

[0180] An embodiment of the present application further provides a computer program product, including a computer program, which implements the steps of each method embodiment of the present application when executed by a processor.

[0181] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.

[0182] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0183] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0184] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.

[0185] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0186] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the appended claims.

[0187] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A battery box positioning method based on target detection, characterized in that: include: Acquiring image data captured by a 2D camera, wherein the image data includes a battery box of a vehicle; Inputting the image data into a pre-trained object detection model to obtain the location information of the battery box; determining a deflection angle of the battery box according to the position information of the battery box; The position of the vehicle is adjusted according to the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

2. The battery box positioning method based on target detection according to claim 1, characterized in that: The position information of the battery box includes a pixel detection width and a pixel detection height of the battery box. Determining the deflection angle of the battery box according to the position information of the battery box includes: determining an actual pixel width and an actual pixel height of the battery box in the image data; The deflection angle of the battery box is determined according to the actual pixel width and the actual pixel height, and the detected pixel width and the detected pixel height.

3. The battery box positioning method based on target detection according to claim 2, characterized in that: The position information of the battery box also includes the center detection coordinates of the battery box, and adjusting the position of the vehicle according to the position information and the deflection angle includes: Performing coordinate transformation on the center detection coordinates to obtain the actual coordinates of the battery box in a physical coordinate system with the battery swapping vehicle as the origin; The position of the vehicle is adjusted according to the actual coordinates of the battery box and a preset battery box coordinate threshold range, as well as the deflection angle of the battery box and a preset deflection angle threshold range.

4. The battery box positioning method based on target detection according to claim 3 is characterized in that: The coordinate transformation of the center detection coordinates to obtain the actual coordinates of the battery box in the physical coordinate system with the battery swapping vehicle as the origin includes: Communicating with the vehicle to obtain model information of a battery box in the vehicle, and determining an actual width of the battery box according to the model information of the battery box; Determining a scaling ratio of the physical coordinates according to the actual width of the battery box and the actual width of the pixel; determining a first battery box coordinate of the battery box in a physical coordinate system with the 2D camera as an origin according to the scaling ratio of the physical coordinates and the center detection coordinates; Based on the pre-calibrated external parameters of the 2D camera and the coordinates of the first battery box, the actual coordinates of the battery box in the physical coordinate system with the battery-exchange vehicle as the origin are determined.

5. The battery box positioning method based on target detection according to any one of claims 1 to 4, characterized in that: The target detection model is trained in the following way: Using the 2D camera to capture sample images of vehicles of different models at preset positions under different scene conditions, the sample images including battery compartments of the vehicles, the different scene conditions including different lighting conditions and / or different weather conditions, the battery compartments including battery compartments of different sizes and specifications, and the battery compartments being at different rotation angles and postures; Annotating the sample images to obtain annotation data of each sample image, wherein the annotation data includes pixel width, pixel height, and center coordinates of the battery box; generating a data set based on the sample images and the annotation data of each sample image; The initial neural network model is iteratively trained according to the data set, the preset loss function and optimizer, and the deep learning framework to obtain the target detection model.

6. The battery box positioning method based on target detection according to any one of claims 1 to 4, characterized in that: Inputting the image data into a pre-trained target detection model to obtain the location information of the battery box includes: Inputting the image data into a pre-trained object detection model to obtain first position information output by the model and a confidence level corresponding to each piece of first position information; Filtering the first location information according to a preset confidence threshold to obtain second location information having a confidence level greater than the confidence threshold; The second location information is deduplicated using a non-maximum suppression algorithm to obtain the location information of the battery box.

7. The battery box positioning method based on target detection according to any one of claims 1 to 4, characterized in that: Before acquiring the image data collected by the 2D camera, the method further includes: Obtaining a photo-taking prompt message sent by the PLC, wherein the photo-taking prompt message is sent by the PLC when the PLC detects that the vehicle enters and reaches a preset position; A photo taking instruction is sent to the 2D camera so that the 2D camera collects image data including the battery box of the vehicle.

8. A computing device, characterized in that include: a processor, and a memory communicatively connected to the processor; The memory is used to store computer-executable instructions; The processor is configured to execute the computer-executable instructions stored in the memory, so that the processor executes the battery box positioning method based on target detection according to any one of claims 1 to 7.

9. A battery box positioning system based on target detection, characterized in that: include: A 2D camera, a PLC, and a computing device according to claim 8; the computing device is communicatively connected to the 2D camera and the PLC via a switch; The PLC is configured to send a photo-taking prompt message to the computing device when detecting that a vehicle enters and reaches a preset position; The computing device is configured to send a photo taking instruction to the 2D camera after receiving the photo taking prompt information; The 2D camera is configured to capture image data including the battery box of the vehicle after receiving the photographing instruction; The computing device is also used to obtain image data collected by a 2D camera; input the image data into a pre-trained target detection model to obtain position information of the battery box; determine the deflection angle of the battery box based on the position information of the battery box; and adjust the position of the vehicle based on the position information and the deflection angle to adjust the battery box of the vehicle to a preset battery-replaceable position.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the battery box positioning method based on target detection according to any one of claims 1 to 7.