Numerical control tool positioning management method and device

By using differentiated acquisition modes and projection correction technology in multi-layer tool cabinets, the problems of poor real-time performance and time-consuming and labor-intensive traditional CNC tool management have been solved, realizing full-process automation and intelligent control of tool management, and improving positioning accuracy and data real-time performance.

CN123128959APending Publication Date: 2026-11-20SICHUAN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611263195.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Traditional CNC tool management relies on manual registration and open shelving, which leads to problems such as tools being taken by mistake, misplaced, or lost; time-consuming and labor-intensive inventory checks; poor real-time inventory data; and inability to accurately trace tool locations. It cannot meet the automated management needs of smart manufacturing and IoT-enabled workshops.

Method used

By employing a multi-layered tool cabinet and combining differentiated acquisition modes of mobile and fixed cameras, the system acquires tool data, identifies tool markings, determines preliminary positioning coordinates, and, in conjunction with physical parameters and camera installation parameters, corrects projection errors. This establishes a unique identification information for each tool and binds it to its actual storage coordinates, enabling fully automated management throughout the entire process.

Benefits of technology

It has achieved full automation of tool management, improved positioning accuracy, eliminated visual projection error interference, provided real-time database support, completed the upgrade from manual management to intelligent control, and solved many drawbacks of traditional management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123128959A_ABST
    Figure CN123128959A_ABST
Patent Text Reader

Abstract

The application provides a numerical control tool positioning management method and device, the method comprises the following steps: acquiring upper tool acquisition data and lower tool acquisition data; determining the preliminary positioning coordinates corresponding to each tool according to the upper tool acquisition data and the lower tool acquisition data; acquiring the physical parameters corresponding to each tool and the installation parameters corresponding to each camera; determining the real storage coordinates corresponding to each tool according to the physical parameters corresponding to each tool, the camera installation parameters and the preliminary positioning coordinates; acquiring the unique identity information of the tool; wherein the unique identity information of the tool is obtained by identifying the tool mark; binding and associating the unique identity information of the tool with the real storage coordinates of the corresponding tool, taking the multi-layer tool cabinet as the hardware carrier, collecting based on the space characteristic differences of the upper and lower layers of the cabinet, and correcting the preliminary coordinates through the projection principle to eliminate the visual perspective deviation caused by the height of the tool, thereby greatly improving the tool positioning accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of CNC cutting tool technology, and more specifically, to a CNC cutting tool positioning management method and device. Background Technology

[0002] CNC cutting tools are core consumables in CNC machining and precision machinery manufacturing, characterized by their wide variety, highly subdivided specifications, large value range, frequent use and circulation, and stringent storage and management requirements. In modern workshop production processes, the storage, retrieval, inventory, positioning, and traceability management of cutting tools directly affect the efficiency of machining lines, equipment utilization rates, and production cost control.

[0003] Traditional CNC tool management often relies on manual registration, open shelving storage, and paper ledger records. This approach has many drawbacks, such as tool mis-taking, misplacement, loss, time-consuming and labor-intensive inventory checks, poor real-time inventory data, and inability to accurately trace tool locations. It is no longer suitable for the automated management needs of smart manufacturing and IoT-enabled workshops. Summary of the Invention

[0004] The purpose of this application is to provide a CNC tool positioning management method and device to solve the problems of poor real-time performance and time-consuming and labor-intensive nature of traditional CNC tool management that relies on manual registration and recording.

[0005] Regarding the upper part, this application provides a CNC tool positioning management method, which is applied to a multi-layer CNC tool cabinet. The multi-layer CNC tool cabinet includes an upper acquisition area and a mobile camera set in the upper acquisition area, a lower acquisition area and an array of fixed cameras set in the lower acquisition area. The method includes: acquiring upper tool acquisition data and lower tool acquisition data; wherein, the upper tool acquisition data is obtained by the mobile camera moving along a preset path and capturing the tool identification of each tool in the upper acquisition area at each preset stop point; the lower tool acquisition data is obtained by the array of fixed cameras in the lower acquisition area simultaneously capturing the tool identification of each tool in each tool placement area corresponding to each camera; determining the preliminary positioning coordinates of each tool based on the upper and lower tool acquisition data; acquiring the physical parameters of each tool and the installation parameters of each camera; determining the actual storage coordinates of each tool based on the physical parameters of each tool, the camera installation parameters, and the preliminary positioning coordinates; acquiring the unique identification information of the tool; wherein, the unique identification information of the tool is obtained by recognizing the tool identification; and binding and associating the unique identification information of the tool with the actual storage coordinates of the corresponding tool.

[0006] This CNC tool positioning management method uses a multi-layer tool cabinet as its hardware carrier. Based on the spatial characteristics of the upper and lower layers of the cabinet and the differences in tool placement density, it adopts a differentiated acquisition mode. This avoids both the transmission interference and hardware redundancy of full-cabinet mobile acquisition and the cost waste and blind spots of full-cabinet fixed acquisition. It perfectly adapts to the structural characteristics of multi-layer cabinets, achieving blind-spot-free full-coverage acquisition. It is adaptable to cabinet structures with different tool layouts. Furthermore, this solution uses projection principles to correct the initial coordinates, eliminating visual perspective deviations caused by the tool's own height, significantly improving tool positioning accuracy, and eliminating interference from visual projection errors. By binding the tool's identity with the correction position, a real-time database is established, providing a data foundation for subsequent automatic inventory, remote retrieval, misplacement alarms, and full lifecycle traceability. This completes the upgrade from manual management to intelligent control, thoroughly solving many drawbacks of traditional manual management and achieving full automation of tool management. In addition, the upper layer of the cabinet uses a mobile acquisition scheme, significantly reducing the number of cameras and controlling hardware costs; the lower layer uses a fixed array acquisition scheme to achieve synchronous shooting, improving acquisition and inventory efficiency, balancing hardware costs and management efficiency.

[0007] In an optional implementation of the upper part, based on the upper tool acquisition data and the lower tool acquisition data, and respectively determining the preliminary positioning coordinates corresponding to each tool, the following steps are taken: Recognition processing is performed on the tool images captured by the upper and lower tool acquisition data to obtain the recognition result corresponding to each tool; wherein, the recognition result corresponding to each tool includes the rectangular recognition area where the corresponding tool is located; based on the recognition result corresponding to each tool, the center coordinates of each tool in the corresponding matrix recognition area are calculated; the field of view division information corresponding to each camera is obtained; wherein, the field of view division information includes the center coordinates corresponding to each of multiple grid areas, the multiple grid areas are obtained by equally dividing the field of view coordinate system of a single camera into an N-row M-column grid matrix, and the center coordinates corresponding to the multiple grid areas corresponding to each camera are pre-stored; based on the center coordinates of each tool in the corresponding matrix recognition area and the field of view division information of the camera corresponding to the tool, the preliminary positioning coordinates corresponding to each tool are determined.

[0008] The above implementation first identifies the range of the tool target through target recognition, and then determines the precise reference point of the tool in the image through the center coordinates of the rectangle. This avoids positioning reference deviations caused by differences in tool shape. At the same time, a pre-calibrated grid matrix is ​​used to divide the field of view, converting continuous pixel coordinates into discrete grid region matching. This significantly reduces the algorithm complexity of coordinate calculation, improves the efficiency of preliminary positioning, reduces the algorithm's computing power requirements, and ensures the consistency and standardization of the positioning reference. The field of view of all cameras adopts a unified equal division rule, and the pre-calibrated grid center coordinates are fixed, avoiding the problem of inconsistent positioning references caused by differences in camera installation and field of view, and improving the stability of the positioning results.

[0009] In an optional implementation of the upper part, the center coordinates of each tool in the corresponding matrix recognition area are calculated based on the recognition result corresponding to each tool, including: obtaining the boundary parameters of the recognition area where each tool is located based on the recognition result corresponding to each tool; using the average pixel coordinates of the left and right boundaries of the recognition area where each tool is located as the X-axis value of the center coordinates of the tool; using the average pixel coordinates of the upper and lower boundaries of the recognition area where each tool is located as the Y-axis value of the center coordinates of the tool, to obtain the center coordinates of each tool in the corresponding camera field of view coordinate system.

[0010] The above implementation method can obtain the center coordinates by averaging two calculations, without the need for complex mathematical operations. The calculation time can be controlled in milliseconds, which fully meets the real-time requirements of batch processing of multiple tools. At the same time, the positioning reference is accurate and has strong anti-interference ability. Using the geometric center of the rectangle as the positioning reference, it is not affected by the shape, size, or placement angle of the tool. Even if the tool marking is worn or there is slight noise in the image, stable center coordinates can be obtained through the circumscribed rectangle. It is also compatible with different types of vision acquisition devices.

[0011] In an optional implementation of the upper part, the preliminary positioning coordinates of each tool are determined based on the center coordinates of each tool in the corresponding matrix recognition area and the field of view division information of the camera corresponding to the tool. This includes: calculating the Euclidean distance between the center coordinates of the matrix recognition area corresponding to each tool and the center coordinates of each grid area of ​​the camera corresponding to the tool, and obtaining multiple Euclidean distances corresponding to each tool; obtaining the minimum Euclidean distance value among the multiple Euclidean distances corresponding to each tool; determining the grid area corresponding to the minimum Euclidean distance value of each tool as the initial matrix position where the initial positioning coordinates of the corresponding tool are located; and calculating the preliminary positioning coordinates of each tool based on the initial matrix position of each tool and the basic coordinates of the shelf in the tool placement area.

[0012] In the above implementation, this solution first identifies the range of the tool target through target recognition, then determines the precise reference point of the tool in the image using the center coordinates of the rectangle, avoiding positioning reference deviations caused by differences in tool shape. Next, a pre-calibrated grid matrix is ​​used to divide the field of view, converting continuous pixel coordinates into discrete grid region matching, significantly reducing the algorithmic complexity of coordinate calculation while ensuring the standardization of the positioning reference, adapting to the limited computing power of embedded devices, and improving positioning efficiency. Furthermore, in a two-dimensional coordinate system, the smaller the Euclidean distance between two coordinate points, the closer their spatial positions are. Therefore, the grid center with the smallest Euclidean distance to the tool target's center coordinates corresponds to the area where the tool target is located. This principle allows for rapid and accurate determination of the tool target's region affiliation. Finally, through a pre-calibrated coordinate transformation relationship, the calculation from pixel coordinates to physical coordinates is completed.

[0013] In an optional implementation of the above aspect, the actual storage coordinates of each tool are determined based on the physical parameters, camera installation parameters, and preliminary positioning coordinates of each tool. This includes: obtaining the target center coordinates of the target grid area corresponding to each tool, wherein the field of view coordinate system of each camera is equally divided into a grid matrix of N rows and M columns, the center coordinates of multiple grid areas corresponding to each camera are pre-stored, and the target grid area represents the grid area with the smallest center coordinates of the matrix recognition area corresponding to the tool among the multiple grid areas; determining whether the preliminary positioning coordinates of the corresponding tool need to be corrected based on the preliminary positioning coordinates of each tool and the target center coordinates of the corresponding target grid area; if it is determined that the preliminary positioning coordinates of the corresponding tool do not need to be corrected, then the preliminary positioning coordinates of the corresponding tool are determined as the corresponding actual storage coordinates.

[0014] In the above implementation method, the visual projection error caused by the height of the tool itself only has a significant impact on the positioning accuracy when the tool target is close to the edge of the grid area. When the tool target is near the center of the grid area, the projection error is negligible. Therefore, by using the preset judgment rules, only the coordinates with significant errors are corrected, and the preliminary positioning results are directly used for the coordinates without significant errors. While ensuring positioning accuracy, the system significantly reduces invalid correction calculations and improves the system operating efficiency.

[0015] In an optional implementation of the above aspect, based on the preliminary positioning coordinates corresponding to each tool and the target center coordinates of the corresponding target grid area, it is determined whether the preliminary positioning coordinates of the corresponding tool need to be corrected. This includes: calculating the distance between the preliminary positioning coordinates of each tool and the target center coordinates of the corresponding target grid area to obtain the preliminary positioning distance; calculating the product of the length of each edge of the target grid area and a preset ratio to obtain multiple length thresholds corresponding to each target grid area; determining whether the preliminary positioning distance is greater than or equal to any length threshold of the corresponding target grid area; and if it is determined that the preliminary positioning distance is greater than or equal to any length threshold of the corresponding target grid area, then it is determined that the preliminary positioning coordinates of the corresponding tool need to be corrected.

[0016] The above implementation method, based on the principle of edge deviation quantification, determines whether a tool target is located within a critical region of the grid edge when the distance between the center of the tool target and the center of the grid exceeds a preset ratio of the grid edge length. At this point, the visual perspective error caused by the tool's height can lead to a significant deviation between the imaged position and the actual position of the tool target, and even misjudgment across grids. By quantifying the critical threshold using the edge length ratio, it is possible to accurately and objectively determine whether the tool target is in an edge region prone to errors, thereby precisely triggering the correction process. Furthermore, by using a fixed ratio of the grid edge length as the threshold, it adapts to cameras with different field-of-view sizes and grid specifications. Regardless of changes in grid size, it can accurately identify tool targets in the critical edge region without omissions or misjudgments.

[0017] In an optional embodiment of the above aspect, the method further includes: if it is determined that the preliminary positioning distance is greater than or equal to any length threshold of the corresponding target grid area, then obtaining the neighboring grids corresponding to the target edge; wherein, the target edge refers to the edge among multiple edges of the target grid area whose preliminary positioning distance is greater than or equal to the length threshold, and the neighboring grids refer to the grid areas among multiple grid areas that are adjacent to the target grid area based on the target edge; obtaining the center coordinates of the neighboring grids; calculating the actual offset of the preliminary positioning coordinates corresponding to the tool based on the center coordinates of the neighboring grids, the physical parameters corresponding to the tool, and the camera installation parameters corresponding to the tool; and calculating the actual storage coordinates corresponding to the tool based on the actual offset of the preliminary positioning coordinates and the preliminary positioning coordinates.

[0018] In the above implementation, when the camera shoots vertically downwards, the tool itself has a height, causing a height difference between the markings on the tool surface and the reference plane of the shelf. The image position of the markings will shift relative to the actual position, and this shift is proportional to the tool height and the camera installation height. In this case, this solution performs correction calculations for tools located at the edge of the grid, combining calculations with adjacent grids. Based on this proportional relationship, a precise shift is calculated, and the initial positioning coordinates are corrected, thus eliminating projection errors and obtaining the true position coordinates of the tool. This improves the accuracy of the tool's position and ensures the accuracy of tool area assignment. Furthermore, this solution only triggers correction when the tool target is in the edge critical area, perfectly matching the influence of projection errors. It neither misses targets with significant errors nor invalidates targets without errors.

[0019] In an optional implementation of the upper part, before acquiring the upper and lower tool acquisition data, the method further includes: performing two-dimensional matrix processing on the tool placement area of ​​each layer of the cabinet to form multiple grid matrices; dividing the matrixed tool placement area into multiple independent tool placement monitoring sub-areas according to a preset tool placement density, forming shelf matrix area information; in the lower acquisition area, determining the number of fixed cameras based on the number of independent tool placement monitoring sub-areas, wherein each tool placement monitoring sub-area corresponds to one fixed camera; in the upper acquisition area, testing and determining the preset stop point of the slider of the synchronous belt drive mechanism of each mobile camera, establishing the correspondence between the pulse number of the synchronous belt drive mechanism, the physical displacement coordinates of the slider, and the matrix coordinates of the tool placement area, wherein the shooting range of the mobile camera at each preset stop point of the slider corresponds to one tool placement monitoring sub-area; assigning a unique ID to each camera according to the shelf matrix area information, and binding the divided tool placement monitoring sub-areas to the corresponding camera IDs one by one.

[0020] In the above implementation method, this solution establishes a unified standardized benchmark for the entire positioning management process. Matrix processing, area binding, and point calibration are all completed during the equipment debugging phase, solidifying all position benchmarks and ensuring benchmark consistency throughout the subsequent data acquisition, positioning, and binding process. This fundamentally avoids positioning errors caused by inconsistent benchmarks. Simultaneously, it eliminates the impact of hardware installation and cabinet structure errors. Through pre-calibration and binding, the effects of camera installation deviations, synchronous belt drive errors, and cabinet structure dimensional deviations can be effectively offset, reducing the hardware processing and installation precision requirements of the equipment, improving the feasibility of mass production, and adapting to different cabinet structures. Furthermore, the fixed camera ID is bound one-to-one with the monitoring area, and the pulse count of the moving camera corresponds one-to-one with the area coordinates, ensuring that each captured image can be accurately matched to the corresponding physical area of ​​the cabinet, providing a precise foundation for subsequent positioning calculations.

[0021] In an optional implementation of the upper part, acquiring upper tool acquisition data and lower tool acquisition data includes: acquiring a tool data acquisition trigger command; synchronously controlling the activation of supplementary lighting strips in the upper and lower acquisition areas according to the tool data acquisition trigger command; synchronously controlling the start and stop of each synchronous belt drive mechanism in the upper acquisition area to drive each moving camera to traverse all preset stop points to complete the shooting and obtain upper tool acquisition data; and controlling the array of fixed cameras in the lower acquisition area to synchronously trigger shooting and acquire lower tool acquisition data.

[0022] The above implementation method uses a unified trigger command to synchronously control the supplementary lighting and shooting actions of the upper and lower acquisition areas, ensuring that the image acquisition of the upper and lower acquisition areas is completed within the same time window. This ensures that the acquired tool status data is a full cabinet snapshot at the same moment, avoiding problems such as tool status changes and inconsistencies in inventory data caused by acquisition time differences. At the same time, the traversal of moving acquisition points and the synchronous shooting of fixed acquisition are both performed based on pre-calibrated benchmarks, ensuring that there are no blind spots or overlaps in the acquisition range.

[0023] In an optional implementation of the upper part, the unique identification information of the tool is bound and associated with the corresponding tool's correction and storage coordinates to realize the positioning management of CNC tools. This includes: binding and associating the unique identification information of the tool with the corresponding tool's correction and storage coordinates to obtain the binding and association results of all tools in the cabinet; establishing a real-time position database of all tools in the cabinet based on the binding and association results of all tools in the cabinet, wherein the tool information in the real-time position database corresponds one-to-one with the actual storage position in the tool placement area; and performing positioning management of tools in the multi-layer CNC tool cabinet based on the real-time position database.

[0024] The above implementation method, based on the principle of digital identity location linkage control, establishes a one-to-one correspondence between the physical entity of the tool and its digital twin data by binding the unique digital identity of the tool with its physical storage coordinates. Through a real-time updated database, it achieves visualized, digital, and automated control of all tools in the cabinet, upgrading traditional manual ledger management to IoT-based real-time intelligent control. Based on the real-time location database, the system can automatically complete all management tasks such as inventory, traceability, early warning, and retrieval without manual intervention, fundamentally solving the problems of low efficiency, error-proneness, and data lag in manual management. At the same time, it realizes full life-cycle traceability management of tools. The database records the entire process data of tools from entry, retrieval, return, and scrapping, and the location information is updated synchronously with each operation, meeting the quality control requirements of the precision machining industry. It also realizes real-time monitoring and alarm of abnormal situations. Based on the location data and binding relationship in the database, the system can identify abnormal situations such as misplacement, loss, and overdue use of tools in real time and immediately trigger alarms to avoid processing accidents and cost waste caused by misuse or loss of tools.

[0025] In the lower aspect, this application also provides a CNC tool positioning management device, including a multi-layer tool cabinet, a mobile acquisition module, a fixed acquisition module, and a control module; the multi-layer tool cabinet includes an upper acquisition area and a lower acquisition area, the mobile acquisition module is disposed in the upper acquisition area, and the fixed acquisition module is disposed in the lower acquisition area; the mobile acquisition module includes a synchronous belt drive mechanism and a mobile camera; the mobile camera is fixed on the slider of the synchronous belt drive mechanism, and the mobile camera is used to move with the synchronous belt drive mechanism to capture tool images of each tool in the upper acquisition area and output upper tool acquisition data; the fixed acquisition positioning module includes multiple fixed cameras arranged in an array according to the density of the tool placement area, and the multiple fixed cameras correspond one-to-one with multiple tool placement monitoring sub-areas in the lower acquisition area, each fixed camera is used to capture tool images in the corresponding tool placement monitoring sub-area to obtain lower tool acquisition data; the control module is electrically connected to the mobile acquisition module and the fixed acquisition module respectively; wherein, the control module is used to execute the CNC tool positioning management method described in any optional embodiment of the upper aspect.

[0026] This solution provides a CNC tool positioning and management device with a hardware architecture combining upper-level mobile acquisition and lower-level fixed array acquisition. Modular acquisition modules enable blind-spot-free image acquisition, while the control module runs corresponding intelligent positioning and management methods to complete image recognition, coordinate calculation, error correction, identity binding, and intelligent control. This achieves deep adaptation between the hardware architecture and software algorithms, providing a complete and implementable physical device for intelligent CNC tool management. This device offers a complete and implementable intelligent CNC tool management physical device that can directly replace traditional tool cabinets. The device integrates the cabinet, acquisition module, control module, and intelligent management algorithm, enabling automated tool positioning, inventory, and traceability management immediately upon opening the package, without requiring additional hardware. It can directly replace existing traditional tool cabinets in the workshop. Simultaneously, the hardware architecture and algorithm scheme are deeply adapted. The upper mobile acquisition module links the slider displacement coordinates with the QR code information captured by the camera to directly obtain the precise X / Y axis coordinates of the tool. The lower fixed acquisition module pre-calibrates the monitoring area of ​​each camera, directly associating the tool position with the captured image through the camera ID, without the need for complex algorithms.

[0027] In an optional embodiment of the lower part, the synchronous belt drive mechanism includes a synchronous belt fixing plate, a synchronous belt body, a synchronous belt slide rail, a synchronous belt slider, a synchronous belt fixing frame, and a stepper motor; the synchronous belt body and the synchronous belt slide rail are both fixed to the synchronous belt fixing plate of the upper acquisition area through the synchronous belt fixing frame; the stepper motor is fixed to the end of the synchronous belt fixing plate, and the output shaft of the stepper motor is drivenly connected to the synchronous belt body; the synchronous belt slider is slidably connected to the synchronous belt body and the synchronous belt slide rail respectively; the moving camera is vertically fixed to the synchronous belt slider through the camera fixing frame, and the shooting direction is directly facing the tool placement area of ​​the upper acquisition area below.

[0028] In the above implementation method, this solution uses precise pulse control of a stepper motor to convert electrical signals into precise angular displacement. Then, through the meshing transmission of a synchronous belt, the angular displacement is converted into the horizontal linear displacement of the slider, thereby achieving precise control of the slider's movement position. This ensures that the moving camera can accurately stop at each pre-calibrated stop point, and the shooting position is completely matched with the coordinate reference, providing a precise positional basis for subsequent positioning calculations.

[0029] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the method described in the above aspect and any optional embodiment of the above aspect.

[0030] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the methods described in the preceding aspect and any optional embodiments thereof.

[0031] Fifthly, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, performs the method described in the above aspect and any optional embodiment of the above aspect.

[0032] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0033] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a flowchart of the upper part of the CNC tool positioning management method provided in the embodiments of this application; Figure 2 This is a diagram of the upper structure of the CNC tool positioning and management device provided in the embodiments of this application. Figure 3 This is a lower structure diagram of the CNC tool positioning and management device provided in the embodiments of this application; Figure 4 The following is a flowchart of the CNC tool positioning management method provided in the embodiments of this application; Figure 5 This is a third flowchart of the CNC tool positioning management method provided in the embodiments of this application; Figure 6 This is a fourth flowchart of the CNC tool positioning management method provided in the embodiments of this application; Figure 7 This is the fifth flowchart of the CNC tool positioning management method provided in the embodiments of this application; Figure 8 This is a schematic diagram of the structure of the CNC tool positioning management device provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0035] Icons: 10-Multi-layer tool cabinet; 110-Upper acquisition area; 120-Lower acquisition area; 20-Mobile acquisition module; 210-Synchronous belt drive mechanism; 2110-Synchronous belt fixed shelf; 2120-Synchronous belt body; 2130-Synchronous belt slide rail; 2140-Synchronous belt slider; 2150-Synchronous belt fixing bracket; 2160-Stepper motor; 2170-Camera fixing bracket; 220-Mobile camera; 30-Fixed acquisition module; 310-Fixed camera; 40-Control module; 800-Acquisition module; 810-Confirmation module; 820-Binding association module; 9-Electronic device; 901-Processor; 902-Memory; 903-Communication bus. Detailed Implementation

[0036] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0038] In the description of the embodiments of this application, technical terms such as "upper part" and "lower part" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0039] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0040] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0041] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0042] In the description of the embodiments of this application, the technical terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of this application and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.

[0043] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0044] CNC cutting tools are core consumables in CNC machining and precision machinery manufacturing, characterized by their wide variety, highly subdivided specifications, large value range, frequent use and circulation, and stringent storage and management requirements. In modern workshop production processes, the storage, retrieval, inventory, positioning, and traceability management of cutting tools directly affect the efficiency of machining lines, equipment utilization rates, and production cost control.

[0045] Traditional CNC tool management often relies on manual registration, open shelving storage, and paper ledger records. This approach has many drawbacks, such as tool mis-taking, misplacement, loss, time-consuming and labor-intensive inventory checks, poor real-time inventory data, and inability to accurately trace tool locations. It is no longer suitable for the automated management needs of smart manufacturing and IoT-enabled workshops.

[0046] To address the aforementioned issues, this application designs a CNC tool positioning management method and device. Using a multi-layer tool cabinet as the hardware carrier, and based on the spatial characteristics of the upper and lower layers of the cabinet and the differentiated tool placement density, a differentiated acquisition mode is adopted. This avoids both the transmission interference and hardware redundancy of full-cabinet mobile acquisition, and the cost waste and blind spots of full-cabinet fixed acquisition. It perfectly adapts to the structural characteristics of multi-layer cabinets, achieving blind-spot-free full-coverage acquisition across multiple layers. It is adaptable to cabinet structures with different tool layouts. Furthermore, this solution uses projection principles to correct the initial coordinates, eliminating visual perspective deviations caused by the tool's own height. This solution significantly improves tool positioning accuracy, eliminates interference from visual projection errors, and establishes a real-time database by binding tool identification with correction positions. This provides a data foundation for subsequent automatic inventory, remote retrieval, misplacement alarms, and full lifecycle traceability, completing the upgrade from manual management to intelligent control. It completely solves many drawbacks of traditional manual management and achieves full automation of tool management. In addition, the upper cabinet of this solution uses a mobile acquisition scheme to significantly reduce the number of cameras and control hardware costs; the lower cabinet uses a fixed array acquisition scheme to achieve synchronous shooting, improving acquisition and inventory efficiency, and balancing hardware costs and management efficiency.

[0047] Based on the above ideas, this application first provides a CNC tool positioning management method. This method can be applied to computing devices, including but not limited to computers, servers, control chips, etc. Figure 1 As shown, this CNC tool positioning management method can be implemented in the following ways, including: Step S100: Acquire upper tool acquisition data and lower tool acquisition data.

[0048] Step S110: Based on the data collected from the upper tool and the lower tool, determine the preliminary positioning coordinates for each tool.

[0049] Step S120: Obtain the physical parameters corresponding to each tool and the installation parameters corresponding to each camera.

[0050] Step S130: Determine the actual storage coordinates of each tool based on the physical parameters, camera installation parameters, and preliminary positioning coordinates.

[0051] Step S140: Obtain the unique identification information of the cutting tool.

[0052] Step S150: Bind and associate the unique identification information of the tool with the actual storage coordinates of the corresponding tool.

[0053] Before explaining the above-mentioned CNC tool positioning management method, we will first describe the application scenario of this solution, such as... Figure 2 A CNC tool positioning and management device is provided, which includes a multi-layer tool cabinet 10, a mobile acquisition module 20, a fixed acquisition module 30, and a control module 40.

[0054] Among them, the multi-layer tool cabinet 10 is the main load-bearing structure of the equipment. The interior is divided into multiple independent storage spaces by shelves. According to the spatial characteristics and tool placement density of each layer, it is divided into the upper collection area 110 and the lower collection area 120. It is also equipped with auxiliary components such as cabinet doors, electric locks, supplementary light strips, and human-machine interaction screens.

[0055] The mobile acquisition module 20 is installed on each layer of the upper acquisition area 110. It consists of a synchronous belt drive mechanism 210 and a mobile camera 220. The synchronous belt drive mechanism 210 can drive the mobile camera 220 to move back and forth along the horizontal direction of the shelf, complete the shooting at the preset stop point, and output the upper tool acquisition data to the control module 40.

[0056] Specifically, in order to achieve mobile shooting by the mobile acquisition module 20, such as Figure 3 As shown, the synchronous belt drive mechanism 210 designed in this scheme includes a synchronous belt fixing plate 2110, a synchronous belt body 2120, a synchronous belt slide rail 2130, a synchronous belt slider 2140, a synchronous belt fixing frame 2150, and a stepper motor 2160.

[0057] Both the synchronous belt body 2120 and the synchronous belt slide rail 2130 are fixed to the synchronous belt fixing plate 2110 of the upper acquisition area 110 via the synchronous belt fixing bracket 2150; the stepper motor 2160 is fixed to the end of the synchronous belt fixing plate 2110, and the output shaft of the stepper motor 2160 is connected to the synchronous belt body 2120 via transmission; the synchronous belt slider 2140 is slidably connected to the synchronous belt body 2120 and the synchronous belt slide rail 2130 respectively; the moving camera 220 is vertically fixed downward on the synchronous belt slider 2140 via the camera fixing bracket 2170, with the shooting direction facing the tool placement area of ​​the upper acquisition area 110 below. In this way, through the precise pulse control of the stepper motor, the electrical signal can be converted into a precise angular displacement, and then through the meshing transmission of the synchronous belt, the angular displacement is converted into the horizontal linear displacement of the slider, realizing the precise control of the slider's movement position, ensuring that the moving camera can accurately stop at each pre-calibrated stop point, and the shooting position is completely matched with the coordinate reference, providing a precise position basis for subsequent positioning calculation.

[0058] The fixed acquisition module 30 is installed on each layer of the lower acquisition area 120. It consists of multiple fixed cameras 310 arranged in an array according to the tool placement density. Each fixed camera 310 corresponds to a pre-calibrated tool placement monitoring sub-area and can be triggered to capture images synchronously, outputting the lower tool acquisition data to the control module 40.

[0059] The control module 40 includes an embedded development board, an application server, a storage unit, etc., which are electrically connected to human-machine interaction components such as the mobile acquisition module, the fixed acquisition module, the supplementary light strip, and the electric lock. It can execute the CNC tool positioning management method and complete the process control, data processing, and intelligent management functions of the entire equipment.

[0060] The aforementioned CNC tool positioning management method is applied to the multi-layered CNC tool cabinet with the above-mentioned layered design. For step S100, this scheme acquires upper tool acquisition data and lower tool acquisition data. Specifically, for the upper acquisition area, a synchronous belt drive mechanism can be used to drive a mobile camera to move along a preset horizontal path, triggering shooting at each pre-calibrated stop point, acquiring tool identification images of all tools within the coverage area of ​​that point, and summarizing them to form upper tool acquisition data; for the lower acquisition area, all fixed cameras deployed in the array are controlled to synchronously trigger shooting, with each camera acquiring tool identification images within its bound monitoring sub-area, and summarizing them to form lower tool acquisition data.

[0061] Based on the acquisition data of the upper and lower tools obtained above, this scheme can determine the preliminary positioning coordinates of each tool according to the acquisition data of the upper and lower tools.

[0062] As one possible implementation, this solution can utilize artificial intelligence algorithms to identify and process all tool images in the upper and lower tool acquisition data. This process extracts the unique identification information corresponding to the QR code in the tool image and the tool's position within the frame. Combined with pre-calibrated camera field-of-view division information and shelf base coordinates, the preliminary positioning coordinates of each tool in the field-of-view coordinate system are calculated. The field-of-view coordinate system is a pixel coordinate system established with the upper left corner of the camera's captured image as the origin, the X-axis horizontally, and the Y-axis vertically, used to describe the target's position in the captured image.

[0063] Because the height of the cutting tools may cause visual projection errors or edge recognition deviations, the initial positioning coordinates of each tool in the camera coordinate system may not be accurate. Therefore, this solution can determine the actual storage coordinates of each tool based on these initial positioning coordinates, combined with the physical parameters of each tool and the camera installation parameters. The actual storage coordinates represent the actual physical storage coordinates of the tool within the cabinet after projection error correction and elimination of visual perspective deviations caused by the tool's height. The tool's physical parameters include at least its actual height, and the camera installation parameters include at least the vertical installation height of the camera relative to the corresponding shelf reference plane. Both types of parameters are pre-calibrated and stored in the system database, and can be directly retrieved.

[0064] The data collected from the upper and lower tools can include tool identifiers for each tool. This solution uses image recognition algorithms to parse the coded information carried in the tool identifiers and retrieves the unique identification information of each tool, which is bound to the coded information, from the system database. Based on this, and with the actual storage coordinates and unique identification information of each tool, this solution binds the unique identification information of each tool to its actual storage coordinates, establishing a correspondence between tool identification and actual location. This achieves the binding of identification and location through tool identifiers, upgrading traditional manual passive ledger management to proactive digital control by the system.

[0065] This CNC tool positioning management method uses a multi-layer tool cabinet as its hardware carrier. Based on the spatial characteristics of the upper and lower layers of the cabinet and the differences in tool placement density, it adopts a differentiated acquisition mode. This avoids both the transmission interference and hardware redundancy of full-cabinet mobile acquisition and the cost waste and blind spots of full-cabinet fixed acquisition. It perfectly adapts to the structural characteristics of multi-layer cabinets, achieving blind-spot-free full-coverage acquisition. It is adaptable to cabinet structures with different tool layouts. Furthermore, this solution uses projection principles to correct the initial coordinates, eliminating visual perspective deviations caused by the tool's own height, significantly improving tool positioning accuracy, and eliminating interference from visual projection errors. By binding the tool's identity with the correction position, a real-time database is established, providing a data foundation for subsequent automatic inventory, remote retrieval, misplacement alarms, and full lifecycle traceability. This completes the upgrade from manual management to intelligent control, thoroughly solving many drawbacks of traditional manual management and achieving full automation of tool management. In addition, the upper layer of the cabinet uses a mobile acquisition scheme, significantly reducing the number of cameras and controlling hardware costs; the lower layer uses a fixed array acquisition scheme to achieve synchronous shooting, improving acquisition and inventory efficiency, balancing hardware costs and management efficiency.

[0066] In an optional implementation of this embodiment, as one possible approach, before acquiring tool data, this solution establishes a unified and standardized benchmark for subsequent image acquisition, coordinate calculation, and position matching by matrixing the tool placement area, binding the camera to the monitoring area, and calibrating the moving acquisition points. This eliminates positioning deviations caused by hardware installation errors and differences in cabinet structure, ensuring that the correspondence between all acquired data and position coordinates is accurate and unique. Figure 4 As shown, it includes: Step S400: Perform two-dimensional matrix processing on the tool placement area of ​​each layer of the cabinet to form multiple grid matrices.

[0067] Step S410: Divide the matrixed tool placement area into multiple tool placement monitoring sub-areas according to the preset tool placement density.

[0068] Step S420: In the lower acquisition area, determine the number of fixed cameras to be deployed based on the number of tool placement monitoring sub-areas, wherein each tool placement monitoring sub-area corresponds to one fixed camera.

[0069] Step S430: In the upper acquisition area, test and determine the preset stop point of the slider of the synchronous belt drive mechanism of each moving camera, and establish the correspondence between the pulse number of the synchronous belt drive mechanism, the physical displacement coordinates of the slider, and the matrix coordinates of the tool placement area.

[0070] Step S440: Assign a unique ID to each camera and bind the designated knife placement monitoring sub-area to the corresponding camera ID.

[0071] In the above implementation, two-dimensional matrixing refers to dividing the tool placement area of ​​each layer of the cabinet into a regular and equal grid matrix, thereby standardizing and digitally calibrating the tool storage location. After the two-dimensional matrixing is completed, this solution divides the matrixed tool placement area into multiple tool placement monitoring sub-areas according to a preset tool placement density. Each tool placement monitoring sub-area represents the set of monitoring areas corresponding to each preset stop point reached by the moving camera on each layer in the upper acquisition area, and the set of monitoring areas corresponding to all fixed cameras on each layer in the lower acquisition area.

[0072] Based on the above, this solution determines the number of fixed cameras deployed in the lower acquisition area according to the number of tool placement monitoring sub-areas. Each tool placement monitoring sub-area corresponds to one fixed camera. For example, the tool placement area on each layer of the cabinet is divided into multiple tool slots by a grid. Tool boxes are placed in the corresponding slots, which are equivalent to two-dimensional coordinate points. The grid is made according to the size of the tool boxes. Assuming the tool placement area on one layer is divided into 36 slots, the camera's shooting range can include a 3×3 grid area. In this case, the 36 slots can be divided into 4 tool placement monitoring sub-areas. Each tool placement monitoring sub-area can be assigned a corresponding area code. This solution sets up 4 fixed cameras, with each camera corresponding to one tool placement monitoring sub-area, thus forming multiple tool placement monitoring sub-areas in the lower acquisition area. Finally, this solution assigns a unique ID to each fixed camera, binding the divided tool placement monitoring sub-areas to the corresponding fixed camera ID.

[0073] In the upper acquisition area, this scheme tests and determines the preset stop point of the slider of the synchronous belt drive mechanism of each moving camera, so as to establish the correspondence between the pulse number of the synchronous belt drive mechanism, the physical displacement coordinates of the slider, and the matrix coordinates of the tool placement area. Specifically, for example, the tool placement area on each layer of the cabinet is divided into multiple tool slots by a grid plate. The tool boxes are placed into the corresponding slots, which are equivalent to two-dimensional coordinate points. The grid plate is made according to the size of the tool box. Based on this, assuming that the tool placement area on one layer is divided into 36 slots by the grid plate, this solution can test that the shooting range of each mobile camera at each preset stop point includes a 3×3 grid area. This allows the mobile camera to complete the acquisition of the tool placement area on that layer at 4 preset stop points. Each preset stop point can be associated with a region code corresponding to a tool placement monitoring sub-area. The preset stop points that have been tested are recorded with the corresponding region codes, thereby establishing the correspondence between the pulse number of the synchronous belt drive mechanism, the physical displacement coordinates of the slider, and the matrix coordinates of the tool placement area. Finally, this solution can assign a unique ID to each mobile camera and bind the divided tool placement monitoring sub-area to the corresponding camera ID one by one.

[0074] In the above implementation method, this solution establishes a unified standardized benchmark for the entire positioning management process. Matrix processing, area binding, and point calibration are all completed during the equipment debugging phase, solidifying all position benchmarks and ensuring benchmark consistency throughout the subsequent data acquisition, positioning, and binding process. This fundamentally avoids positioning errors caused by inconsistent benchmarks. Simultaneously, it eliminates the impact of hardware installation and cabinet structure errors. Through pre-calibration and binding, the effects of camera installation deviations, synchronous belt drive errors, and cabinet structure dimensional deviations can be effectively offset, reducing the hardware processing and installation precision requirements of the equipment, improving the feasibility of mass production, and adapting to different cabinet structures. Furthermore, the fixed camera ID is bound one-to-one with the monitoring area, and the pulse count of the moving camera corresponds one-to-one with the area coordinates, ensuring that each captured image can be accurately matched to the corresponding physical area of ​​the cabinet, providing a precise foundation for subsequent positioning calculations.

[0075] In an optional implementation of this embodiment, after the preliminary configuration is completed as described above, for step S100, when acquiring tool acquisition data, this solution can do so as follows: Figure 5 As shown, this can be achieved in the following ways, including: Step S500: Obtain the tool data acquisition trigger command.

[0076] Step S510: Based on the tool data acquisition trigger command, synchronously control the activation of the supplementary light strips in the upper and lower acquisition areas.

[0077] Step S520: Simultaneously control the start and stop of each synchronous belt drive mechanism in the upper acquisition area, drive each moving camera to traverse all preset stop points to complete the shooting, and obtain the upper tool acquisition data.

[0078] Step S530: Control the array-type fixed camera in the lower acquisition area to synchronously trigger shooting and acquire data collected from the lower tool.

[0079] In the above implementation method, when acquiring tool acquisition data, a tool data acquisition trigger command is first acquired. Based on the tool data acquisition trigger command, the fill light strips in the upper and lower acquisition areas are synchronously turned on, thereby improving the image acquisition effect.

[0080] Then, the start and stop control of each synchronous belt drive mechanism in the upper acquisition area is synchronously controlled, driving each mobile camera to traverse all preset stop points to complete the shooting and obtain the upper tool acquisition data. At the same time, the array of fixed cameras in the lower acquisition area is controlled to synchronously trigger shooting and obtain the lower tool acquisition data. This process is based on the synchronous acquisition control principle. Through a unified trigger command, the supplementary lighting and shooting actions of the upper and lower acquisition areas are synchronously controlled to ensure that the image acquisition of the upper and lower acquisition areas is completed within the same time window. This ensures that the acquired tool status data is a snapshot of the entire cabinet at the same moment, avoiding problems such as tool status changes and inconsistencies in inventory data caused by acquisition time differences. At the same time, the traversal of the mobile acquisition points and the synchronous shooting of the fixed acquisition are both performed based on the pre-calibrated benchmark, ensuring that there are no blind spots or overlaps in the acquisition range.

[0081] In an optional implementation of this embodiment, for step S110, as follows: Figure 6 As shown, this solution can obtain preliminary positioning coordinates in the following ways: Step S600: Perform recognition processing on the tool images corresponding to the upper tool acquisition data and the lower tool acquisition data to obtain the recognition result for each tool.

[0082] Step S610: Calculate the center coordinates of each tool in the corresponding matrix recognition area based on the recognition result of each tool.

[0083] Step S620: Obtain the field of view division information corresponding to each camera.

[0084] Step S630: Determine the preliminary positioning coordinates of each tool based on the center coordinates of each tool in the corresponding matrix recognition area and the field of view division information of the camera corresponding to the tool.

[0085] In the above implementation, this solution uses a deep learning target detection algorithm (such as the YOLO algorithm) to identify the tool images corresponding to the upper and lower tool acquisition data, locate the tool and / or tool identifier in the image, and generate the smallest bounding rectangle that encloses each tool target, i.e., a rectangular recognition region. Simultaneously, the boundary parameters of this rectangular recognition region in the field of view coordinate system are recorded. Here, the rectangular recognition region represents the smallest bounding rectangle that encloses the tool target after it has been located using the image recognition algorithm, and is used to determine the position range of the tool in the image.

[0086] Based on the identification results obtained for each tool, this scheme calculates the center coordinates of each tool in the corresponding matrix identification area according to the identification results of each tool.

[0087] As one possible implementation, this solution can first obtain the boundary parameters of the recognition area where each tool is located based on the recognition result corresponding to each tool. For example, this solution can extract the four boundary pixel coordinates of the rectangular recognition area corresponding to the tool from the tool recognition result, including the pixel value of the left boundary on the X-axis, the pixel value of the right boundary on the X-axis, the pixel value of the upper boundary on the Y-axis, and the pixel value of the lower boundary on the Y-axis.

[0088] Then, the average pixel coordinates of the left and right boundaries of the recognition area where each tool is located are used as the X-axis value of the center coordinates of the tool, and the average pixel coordinates of the upper and lower boundaries of the recognition area where each tool is located are used as the Y-axis value of the center coordinates of the tool. Then, by combining the calculated X-axis and Y-axis values, the two-dimensional center coordinates of the tool target in the camera's field of view coordinate system are generated, which serve as the unique reference for subsequent grid matching.

[0089] Based on the above method to obtain the center coordinates of each tool in the corresponding matrix recognition area, this solution retrieves the field of view division information corresponding to the camera that captured the image from the system database. This information is pre-calibrated and stored during the equipment debugging phase, and includes the range of all grid areas after the field of view coordinate system is divided, and the center pixel coordinates of each grid area. The field of view division information represents the generation of an N-row, M-column grid matrix by equally dividing the field of view coordinate system of a single camera. The center coordinates of multiple grid areas corresponding to each camera are pre-stored. For example, as described above, four fixed cameras correspond to four area codes, where each area code corresponds to a 3×3 grid area. In this case, the field of view coordinate system of each fixed camera is divided based on the 3×3 grid area, forming the field of view division information corresponding to that fixed camera. The field of view coordinate system division for the moving camera is similar. It should also be noted that although the moving camera moves between different tool monitoring sub-areas, the field of view coordinate system formed by its division remains unchanged.

[0090] Having obtained the field-of-view division information for each camera, this solution determines the initial positioning coordinates for each tool based on the center coordinates of each tool within its corresponding matrix recognition area and the field-of-view division information of the camera corresponding to the tool. Specifically, this solution calculates the Euclidean distance between the center coordinates of the matrix recognition area corresponding to each tool and the center coordinates of each grid area of ​​the camera corresponding to the tool, obtaining multiple Euclidean distances for each tool. Then, it compares all the calculated Euclidean distance values ​​and selects the smallest value, which represents the closest distance between the tool target center and the center of the corresponding grid area. The grid area corresponding to the smallest Euclidean distance value is then determined as the initial matrix position of the tool target in the field-of-view coordinate system, i.e., the grid area where the tool is located in the field of view of the camera. Finally, combining the pre-calibrated basic coordinates of the shelf corresponding to the camera and the physical coordinate range of the initial matrix position in the shelf matrix, the pixel position in the field-of-view coordinate system is converted into physical coordinates in the cabinet coordinate system to obtain the initial positioning coordinates of the tool. Among them, the shelf base coordinates represent the fixed physical coordinates of each pre-calibrated cabinet layer in the overall cabinet coordinate system, which are used to convert the pixel coordinates in the camera field of view coordinate system into the actual physical coordinates of the tool in the cabinet.

[0091] In the above implementation, this solution first identifies the range of the tool target through target recognition, then determines the precise reference point of the tool in the image using the center coordinates of the rectangle, avoiding positioning reference deviations caused by differences in tool shape. Next, a pre-calibrated grid matrix is ​​used to divide the field of view, converting continuous pixel coordinates into discrete grid region matching, significantly reducing the algorithmic complexity of coordinate calculation while ensuring the standardization of the positioning reference, adapting to the limited computing power of embedded devices, and improving positioning efficiency. Furthermore, in a two-dimensional coordinate system, the smaller the Euclidean distance between two coordinate points, the closer their spatial positions are. Therefore, the grid center with the smallest Euclidean distance to the tool target's center coordinates corresponds to the area where the tool target is located. This principle allows for rapid and accurate determination of the tool target's region affiliation. Finally, through a pre-calibrated coordinate transformation relationship, the calculation from pixel coordinates to physical coordinates is completed.

[0092] In an optional implementation of this embodiment, as one possible implementation, for step S120, as follows: Figure 7 As shown, this solution can determine the actual storage coordinates in the following ways: Step S700: Obtain the target center coordinates of the target grid area corresponding to each tool.

[0093] Step S710: Based on the preliminary positioning coordinates of each tool and the target center coordinates of the corresponding target grid area, determine whether the preliminary positioning coordinates of the corresponding tool need to be corrected. If yes, proceed to steps S720 to S740; otherwise, proceed to step S750. Step S720: Obtain the center coordinates of the adjacent grid cells corresponding to the target edge.

[0094] Step S730: Calculate the actual offset of the preliminary positioning coordinates of the tool based on the center coordinates of the adjacent grid, the physical parameters of the tool, and the camera installation parameters of the tool.

[0095] Step S740: Calculate the actual storage coordinates of the tool based on the actual offset of the preliminary positioning coordinates and the preliminary positioning coordinates.

[0096] Step S750: Determine the preliminary positioning coordinates of the corresponding tool as the corresponding actual storage coordinates.

[0097] In the above implementation, as described above, this solution can obtain the target grid area corresponding to each tool. In this case, this solution can retrieve the center coordinates of the target grid area to which the tool belongs, i.e., the target center coordinates. The center coordinates of each grid area can be pre-stored in the field of view division information.

[0098] In the above situation, this solution uses the pixel coordinates corresponding to the initial positioning coordinates of the tool and the target center coordinates of the target grid area as a basis, combined with the preset correction trigger threshold, to determine whether there is a significant projection error in the initial positioning coordinates of the tool and whether coordinate correction is required.

[0099] Specifically, as one possible implementation, this solution can first calculate the pixel coordinates corresponding to the initial positioning coordinates of the tool and the straight-line distance between them and the target center coordinates of the target grid area to obtain the initial positioning distance. This distance represents the degree of deviation between the target center of the tool and the center of the assigned grid.

[0100] Then, this solution can obtain the horizontal and vertical side lengths of the target grid area, and then multiply each side length by a preset ratio (e.g., 40%) to obtain multiple length thresholds. These multiple length thresholds are the critical values ​​for determining whether correction is needed.

[0101] Based on the above, this solution compares the initial positioning distance with all length thresholds to determine whether the initial positioning distance is greater than or equal to any one of the length thresholds. If all of them are less than all the length thresholds, it is determined that no correction is needed, and then the steps are executed to determine the initial positioning coordinates of the corresponding tool as the corresponding actual storage coordinates.

[0102] If the initial positioning distance is greater than or equal to any length threshold, it indicates that the center of the tool target is close to the edge of the grid area, and the projection error will significantly affect the positioning accuracy. The system determines that the initial positioning coordinates of the tool need to be corrected. Further, this solution can first determine the target edge of the target grid area that the tool target is close to, then retrieve the grid areas adjacent to the target grid area through the field of view division information, i.e., the neighboring grids, as candidate true belonging areas for the tool, and retrieve the center pixel coordinates of the corresponding neighboring grids to provide a benchmark for subsequent offset calculations.

[0103] Then, based on the actual height of the tool and the installation height of the camera, and combined with the center coordinates of the target grid and adjacent grids, the projection offsets in the X-axis and Y-axis directions, i.e. the actual offsets, are calculated based on the pinhole imaging projection principle. Then, the X-axis values ​​of the initial positioning coordinates are added to the X-axis offsets, and the Y-axis values ​​are added to the Y-axis offsets to obtain the corrected actual center coordinates. Finally, combined with the basic coordinates of the shelf, the true storage coordinates of the tool are calculated.

[0104] The specific calculation formula is as follows: ; ; ; in, and These are the initial positioning coordinates for the cutting tool; This represents the actual offset in the X-axis direction; This is the actual offset in the Y-axis direction; The height dimension of the cutting tool (target object); The installation height of the camera; , These are the center pixel coordinates of the adjacent grid cells.

[0105] In the above implementation, when the camera shoots vertically downwards, the tool itself has a height, causing a height difference between the markings on the tool surface and the reference plane of the shelf. The image position of the markings will shift relative to the actual position, and this shift is proportional to the tool height and the camera installation height. In this case, this solution performs correction calculations for tools located at the edge of the grid, combining calculations with adjacent grids. Based on this proportional relationship, a precise shift is calculated, and the initial positioning coordinates are corrected, thus eliminating projection errors and obtaining the true position coordinates of the tool. This improves the accuracy of the tool's position and ensures the accuracy of tool area assignment. Furthermore, this solution only triggers correction when the tool target is in the edge critical area, perfectly matching the influence of projection errors. It neither misses targets with significant errors nor invalidates targets without errors.

[0106] In an optional implementation of this embodiment, after the identity and location binding is completed, the unique identity information of the tool can be bound and associated with the corresponding tool's calibration and storage coordinates to obtain the binding and association results of all tools in the cabinet. Then, a real-time location database of all tools in the cabinet is established based on the binding and association results of all tools in the cabinet. The tool information in the real-time location database corresponds one-to-one with the actual storage location in the tool placement area. Finally, the tools in the multi-layer CNC tool cabinet are positioned and managed based on the real-time location database.

[0107] The above implementation method, based on the principle of digital identity location linkage control, establishes a one-to-one correspondence between the physical entity of the tool and its digital twin data by binding the unique digital identity of the tool with its physical storage coordinates. Through a real-time updated database, it achieves visualized, digital, and automated control of all tools in the cabinet, upgrading traditional manual ledger management to IoT-based real-time intelligent control. Based on the real-time location database, the system can automatically complete all management tasks such as inventory, traceability, early warning, and retrieval without manual intervention, fundamentally solving the problems of low efficiency, error-proneness, and data lag in manual management. At the same time, it realizes full life-cycle traceability management of tools. The database records the entire process data of tools from entry, retrieval, return, and scrapping, and the location information is updated synchronously with each operation, meeting the quality control requirements of the precision machining industry. It also realizes real-time monitoring and alarm of abnormal situations. Based on the location data and binding relationship in the database, the system can identify abnormal situations such as misplacement, loss, and overdue use of tools in real time and immediately trigger alarms to avoid processing accidents and cost waste caused by misuse or loss of tools.

[0108] As a specific example: Based on a four-layer CNC tool cabinet, the upper two layers of the cabinet are the upper acquisition area, with tools sparsely placed on each layer. Each layer is equipped with a synchronous belt drive mechanism and a mobile camera. The lower two layers are the lower acquisition area, with tools densely placed on each layer. An array of eight fixed cameras is deployed. The field of view of all cameras is pre-divided into a 3×3 nine-square grid. The preset ratio of correction trigger is 40%. The specific implementation process of this embodiment is as follows.

[0109] First, the standardized construction of the multi-layer cabinet hardware carrier and core functional modules was completed. The cabinet is divided into two core parts: the main storage area and the electrical control area. The main storage area is divided into four independent storage spaces by shelves. The upper two layers are planned as mobile acquisition areas, and the lower two layers are planned as fixed acquisition areas. The electrical control area houses control modules and other electrical control components, and is equipped with auxiliary components such as transparent cabinet doors, electromagnetic locks, LED supplementary lighting strips, and sound and light alarms. The mobile acquisition and positioning modules are built layer by layer in the upper two cabinets. Each layer is equipped with a synchronous belt fixed shelf, synchronous belt slide rail, and synchronous belt body, with a stepper motor as the power source. A camera mounting bracket and a 2-megapixel global shutter mobile camera are installed on the synchronous belt slider. The camera shoots vertically downwards. The transmission structure of the stepper motor, synchronous belt, slider, and camera is completed, realizing the horizontal reciprocating movement of the mobile camera along the synchronous belt. A single camera can cover the corresponding monitoring sub-area of ​​the entire layer.

[0110] Fixed acquisition modules were built layer by layer on the lower two cabinets. Multiple camera fixed shelves were installed on each layer. Based on the density of the tools placed on that layer, eight 2-megapixel fixed-focus cameras were arranged in a 2x4 array. All cameras were shooting vertically downwards. Each camera corresponded to a fixed 3x3 grid of tool placement monitoring area, covering all tool placement positions on the entire layer without overlap or blind spots. The hardware layout and wiring of the supplementary lighting strips, sound and light alarm devices, human-machine interaction display screen, and control modules were completed. The mobile acquisition modules and fixed acquisition modules were electrically connected to the control module to achieve full connectivity of the hardware layer.

[0111] After completing the hardware setup, the acquisition area and hardware devices were pre-calibrated and their rules were solidified. The tool placement area on each of the four cabinet layers was processed into a two-dimensional matrix, forming a standardized 24×8 grid matrix on each layer. Each grid corresponds to a standard tool storage location. Based on the number of cameras deployed on each layer, the matrixed shelves were divided into independent sub-areas corresponding to the number of cameras. The upper two layers were each divided into one monitoring sub-area, corresponding to one mobile camera, and the lower two layers were each divided into eight monitoring sub-areas, corresponding to eight fixed cameras, ensuring that each sub-area corresponds to a unique camera. A globally unique ID was assigned to each camera, and the divided sub-areas were bound one-to-one with the corresponding camera ID, solidifying the physical installation location and monitoring matrix range of each fixed camera. Simultaneously, the Linux system udev rules were configured. Therefore, a fixed device alias and port number are bound to the camera at each physical port to ensure that the camera ID, physical port, and monitoring area are permanently bound and will not be disordered due to device restarts or plugging / unplugging. The four predetermined stop points of the synchronous belt slider are pre-tested and fixed, and each stop point of the slider is mapped one-to-one with the column coordinates of the shelf matrix. The correspondence between the stepper motor pulse count, the slider physical displacement, and the shelf matrix coordinates is established to ensure that when the camera moves to the designated point, the shooting range accurately corresponds to the preset matrix area. Each CNC tool is assigned unique identification information, including model, specifications, material, production batch, and rated service life, and a corresponding unique QR code is generated. The QR code is laser-engraved on the surface of the tool to ensure that it can be clearly captured by the cameras on the upper and lower layers, serving as the unique medium for tool identification and location association.

[0112] After pre-calibration is completed, the user stores and retrieves the tool and closes the cabinet door. The system automatically receives the tool data acquisition trigger command. Based on the number of cabinet layers and cameras, the application server synchronously controls the activation of the supplementary lighting strips on all four layers of the cabinet to provide supplementary lighting for the shooting environment. For the upper two layers of the moving acquisition area, control commands are sent to the stepper motors. The stepper motors are started and stopped by controlling the number of pulses, driving the synchronous belt slider to move the camera sequentially to four preset stop points. After the camera moves to each preset stop point, it automatically triggers the shooting, vertically shooting the tool QR code within the coverage area of ​​that point to obtain the corresponding image. Like data, the physical displacement coordinates of the slider corresponding to the shooting point are recorded synchronously, that is, the X-axis coordinates of the shelf. Combined with the position of the QR code in the image of the shooting screen, the Y-axis coordinates of the tool in the shelf matrix are calculated. The slider displacement X-axis coordinates and the image calculated Y-axis coordinates are linked to obtain the precise two-dimensional physical coordinates of the tool in the shelf. At the same time, the unique identity information of the tool is deciphered by the QR code recognition, and the initial association between the tool identity and the precise coordinates is completed. After the slider traverses all 4 preset stop points, the acquisition and positioning calculation of all tools in the whole layer are completed. The stepper motor drives the camera to reset and the fill light bar is turned off.

[0113] For the two lower fixed acquisition areas, the development board simultaneously sends shooting commands to all eight array cameras deployed on that layer. All cameras trigger shooting synchronously, vertically shooting down the QR codes of the tools within their respective bound monitoring areas, and simultaneously acquiring image data from all areas. Based on the pre-calibrated camera IDs and the binding relationship of the monitoring matrix areas, the basic coordinates of the layer corresponding to the camera that captured the QR code are directly determined. Then, combined with the position of the QR code in the camera's image, the precise coordinates of the tool in the sub-matrix are calculated. The basic coordinates calibrated by the camera are superimposed with the sub-coordinates calculated in the image to obtain the precise two-dimensional physical coordinates of the tool in the layer. At the same time, the unique identity information of the tool is parsed through QR code recognition, completing the initial association between the tool's identity and precise coordinates. After all cameras have completed shooting and image uploading, the entire layer acquisition process ends, and the supplementary light strip is turned off.

[0114] The image data captured by the camera is uploaded in real time to an application server with computing power. The server uses the YOLO deep learning algorithm to process the images, locate the tool target, generate a rectangular recognition area, parse the tool identification information corresponding to the QR code, and output the recognition result. Subsequently, the system determines the preliminary positioning coordinates of each tool based on the collected data. After processing the captured image, it obtains the four boundary pixel parameters of the rectangular recognition area corresponding to each tool: left boundary, right boundary, top boundary, and bottom boundary. The average pixel coordinates of the left and right boundaries of the recognition area of ​​each tool are used as the X-axis value of the center coordinate of the tool. The average pixel coordinates of the left and right boundaries of the recognition area of ​​each tool are used as the X-axis value of the center coordinate of the tool. The average pixel coordinates are used as the Y-axis value of the corresponding tool's center coordinates to obtain the center coordinates of each tool in the corresponding camera's field of view coordinate system. Simultaneously, the 3×3 nine-grid field of view division information pre-stored by each camera is retrieved to obtain the center coordinates corresponding to each grid area. The Euclidean distance between the center coordinates of each tool and the center coordinates of each grid area of ​​the corresponding camera is calculated to obtain 9 Euclidean distance values ​​for each tool. The minimum Euclidean distance value is selected, and the grid area corresponding to the minimum Euclidean distance value is determined as the initial matrix position of the initial positioning coordinates of the corresponding tool. Then, based on the initial matrix position of each tool and the basic coordinates of the shelf in the tool placement area, the preliminary positioning coordinates of each tool are calculated.

[0115] After obtaining the initial positioning coordinates, the system retrieves the actual height parameters corresponding to each tool and the installation height parameters of the corresponding camera. It first obtains the target center coordinates of the target grid area corresponding to each tool, calculates the initial positioning distance between the tool's initial positioning coordinates and the target center coordinates, and calculates the product of the side length of the target grid area and a preset ratio of 40% to obtain a length threshold. It then determines whether the initial positioning distance is greater than or equal to this length threshold. If it is less than the threshold, the initial positioning coordinates of the corresponding tool do not need correction, and are directly determined as the corresponding actual storage coordinates. If it is greater than or equal to the threshold, the initial positioning coordinates of the corresponding tool need correction. The correction algorithm is activated, first determining the target edge of the target grid area near the tool, and then obtaining the corresponding edge's... The system uses a near-grid approach to obtain the four neighboring locations of the target center position. It calculates the Euclidean distance between the target center coordinates and the four neighboring centers, selecting the neighboring location with the shortest Euclidean distance as the candidate true location. Then, based on the actual tool height of 50mm and the installation height of the camera relative to the shelf reference plane of 500mm, it calculates the positional offset between the captured image and the actual shelf matrix using the principle of visual projection. This eliminates the visual perspective error caused by the tool height. Combining the candidate location and the projection offset, it corrects the target center coordinates using planar projection, calculating the actual planar coordinates of the tool within the shelf matrix. This serves as the final true location information for the tool, completing the correction and optimization of the positioning results. Finally, it binds the corrected true coordinates with the identity information parsed from the tool's QR code, achieving precise positioning of a single tool.

[0116] Finally, based on the obtained real-time data, the server can automatically update the real-time database of tool identification information and storage location coordinates, establish a digital ledger of all tools in the cabinet, and automatically compare the location data collected from the entire cabinet with historical data in the database to complete the unmanned automatic inventory of all tools in the cabinet. If the inventory comparison finds abnormalities such as misplaced tools, incorrect tool retrieval, lost tools, or incomplete storage of tools to be stored, the system will immediately trigger the cabinet's audible and visual alarm device, and simultaneously push abnormal alarm information to the management platform, waiting for staff to handle and reset on-site. If there are no abnormalities in the inventory, the system will automatically update the tool inventory ledger, recording the entire process data such as tool retrieval, return, operator, and time, realizing full life cycle traceability of tools. Users can quickly retrieve the storage location of the target tool through the cabinet's human-machine interface screen or the management platform to achieve rapid tool retrieval and remote control.

[0117] Figure 8 A schematic structural block diagram of a CNC tool positioning management device provided in this application is presented. It should be understood that this device is installed in the computing device described above, and this device is integrated with... Figures 1 to 7The method embodiments executed in the above text correspond to the steps involved in the aforementioned method. The specific functions of the device can be found in the description above, and detailed descriptions are omitted here to avoid repetition. The device includes at least one software functional module that can be stored in memory or embedded in the device's operating system (OS) in the form of software or firmware. Specifically, the device includes: an acquisition module 800, a determination module 810, and a binding and association module 820. The acquisition module 800 acquires upper tool acquisition data and lower tool acquisition data. The upper tool acquisition data is obtained by moving a camera along a preset path and capturing the tool identification of each tool in the upper acquisition area at each preset stop point. The lower tool acquisition data is obtained by simultaneously capturing the tool identification of each tool in the corresponding tool placement area using an array of fixed cameras in the lower acquisition area. The determination module 810 determines the preliminary positioning coordinates of each tool based on the upper and lower tool acquisition data. The acquisition module 800 is also used to acquire the physical parameters of each tool and the installation parameters of each camera. The determination module 810 is also used to determine the actual storage coordinates of each tool based on the physical parameters of each tool, the camera installation parameters, and the preliminary positioning coordinates. The acquisition module is also used to acquire unique tool identification information, which is obtained by identifying the tool identification. The binding and association module 820 is used to bind and associate the unique tool identification information with the actual storage coordinates of the corresponding tool.

[0118] This CNC tool positioning and management device uses a multi-layer tool cabinet as its hardware carrier. Based on the spatial characteristics of the upper and lower layers of the cabinet and the differences in tool placement density, it adopts a differentiated acquisition mode. This avoids both the transmission interference and hardware redundancy of full-cabinet mobile acquisition and the cost waste and blind spots of full-cabinet fixed acquisition. It perfectly adapts to the structural characteristics of multi-layer cabinets, achieving blind-spot-free full-coverage acquisition. It is adaptable to cabinet structures with different tool layouts. Furthermore, this solution uses the projection principle to correct the initial coordinates, eliminating visual perspective deviation caused by the tool's own height, significantly improving tool positioning accuracy, and eliminating interference from visual projection errors. By binding the tool's identity with the correction position, a real-time database is established, providing a data foundation for subsequent automatic inventory, remote retrieval, misplacement alarms, and full lifecycle traceability. This completes the upgrade from manual management to intelligent control, thoroughly solving many drawbacks of traditional manual management and achieving full automation of tool management. In addition, the upper layer of the cabinet uses a mobile acquisition scheme, significantly reducing the number of cameras and controlling hardware costs; the lower layer uses a fixed array acquisition scheme to achieve synchronous shooting, improving acquisition and inventory efficiency, balancing hardware costs and management efficiency.

[0119] According to some embodiments of this application, such as Figure 9 As shown, this application provides an electronic device 9, including: a processor 901 and a memory 902. The processor 901 and the memory 902 are interconnected and communicate with each other through a communication bus 903 and / or other forms of connection mechanism (not shown). The memory 902 stores a computer program executable by the processor 901. When the computing device is running, the processor 901 executes the computer program to execute any of the optional implementation methods of the aforementioned client execution, such as steps S100 to S130: acquiring upper tool acquisition data and lower tool acquisition data; determining the preliminary positioning coordinates corresponding to each tool based on the upper tool acquisition data and lower tool acquisition data; acquiring the physical parameters corresponding to each tool and the installation parameters corresponding to each camera; determining the actual storage coordinates corresponding to each tool based on the physical parameters corresponding to each tool, the camera installation parameters, and the preliminary positioning coordinates; acquiring the unique identification information of the tool; and binding and associating the unique identification information of the tool with the actual storage coordinates of the corresponding tool.

[0120] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the method in any of the aforementioned optional implementations.

[0121] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0122] This application provides a computer program product that, when run on a computer, causes the computer to perform a method in any of the optional implementations.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no structural conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A method for managing the positioning of CNC cutting tools, characterized in that, The method is applied to a multi-layer CNC tool cabinet; the multi-layer CNC tool cabinet includes an upper acquisition area and a mobile camera disposed in the upper acquisition area, a lower acquisition area and an array of fixed cameras disposed in the lower acquisition area; the method includes: The upper tool acquisition data and the lower tool acquisition data are obtained. The upper tool acquisition data is obtained by the moving camera moving along a preset path and capturing the tool identification of each tool in the upper acquisition area at each preset stop point. The lower tool acquisition data is obtained by the array of fixed cameras in the lower acquisition area simultaneously capturing the tool identification of each tool in the tool placement area corresponding to each camera. Based on the data collected from the upper and lower tools, the preliminary positioning coordinates corresponding to each tool are determined. Obtain the physical parameters for each tool and the installation parameters for each camera; Based on the physical parameters of each tool, the camera installation parameters, and the preliminary positioning coordinates, determine the actual storage coordinates of each tool. Obtain the unique identification information of the cutting tool; wherein, the unique identification information of the cutting tool is obtained by identifying the cutting tool identifier; The unique identification information of the tool is bound and associated with the actual storage coordinates of the corresponding tool.

2. The method according to claim 1, characterized in that, The step of determining the preliminary positioning coordinates for each tool based on the data acquired by the upper and lower tools includes: The tool images corresponding to the upper tool acquisition data and the lower tool acquisition data are processed for recognition to obtain the recognition result for each tool; wherein, the recognition result for each tool includes the rectangular recognition area where the corresponding tool is located; Based on the recognition result corresponding to each tool, calculate the center coordinates of each tool in the corresponding matrix recognition area; Obtain the field of view division information corresponding to each camera; wherein, the field of view division information includes the center coordinates of each grid region in multiple grid regions, the multiple grid regions are obtained by equally dividing the field of view coordinate system of a single camera into a grid matrix of N rows and M columns, and the center coordinates of the multiple grid regions corresponding to each camera are pre-stored; Based on the center coordinates of each tool in the corresponding matrix recognition area and the field of view division information of the camera corresponding to the tool, the preliminary positioning coordinates of each tool are determined.

3. The method according to claim 2, characterized in that, The step of calculating the center coordinates of each tool in the corresponding matrix recognition area based on the recognition result of each tool includes: Based on the recognition results corresponding to each tool, obtain the boundary parameters of the recognition area where each tool is located; The average pixel coordinates of the left and right boundaries of the recognition area where each tool is located are used as the X-axis value of the center coordinate of the tool. The average pixel coordinates of the upper and lower boundaries of the recognition area where each tool is located are used as the Y-axis value of the corresponding center coordinates of the tool, thus obtaining the center coordinates of each tool in the corresponding camera field of view coordinate system.

4. The method according to claim 2, characterized in that, The step of determining the preliminary positioning coordinates of each tool based on the center coordinates of each tool in the corresponding matrix recognition area and the field-of-view division information of the camera corresponding to the tool includes: Calculate the Euclidean distance between the center coordinates of the matrix recognition area corresponding to each tool and the center coordinates of each grid area of ​​the camera corresponding to the tool, and obtain multiple Euclidean distances corresponding to each tool; Obtain the minimum Euclidean distance value among multiple Euclidean distances corresponding to each tool; The grid area corresponding to the minimum Euclidean distance value for each tool is determined as the initial matrix position of the initial positioning coordinates of the corresponding tool. Based on the initial matrix position corresponding to each tool and the basic coordinates of the shelf in the corresponding tool placement area, calculate the preliminary positioning coordinates of each tool.

5. The method according to claim 1, characterized in that, The process of determining the actual storage coordinates of each tool based on its physical parameters, camera installation parameters, and preliminary positioning coordinates includes: Obtain the target center coordinates of the target grid area corresponding to each tool. The field of view coordinate system of each camera is equally divided into a grid matrix of N rows and M columns. The center coordinates of the multiple grid areas corresponding to each camera are pre-stored. The target grid area represents the grid area with the smallest center coordinates from the matrix recognition area corresponding to the tool among the multiple grid areas. Based on the initial positioning coordinates of each tool and the target center coordinates of the corresponding target grid area, determine whether the initial positioning coordinates of the corresponding tool need to be corrected. If it is determined that the initial positioning coordinates of the corresponding tool do not need to be corrected, then the initial positioning coordinates of the corresponding tool are determined as the corresponding actual storage coordinates.

6. The method according to claim 5, characterized in that, The step of determining whether the initial positioning coordinates of the corresponding tool need to be corrected based on the initial positioning coordinates of each tool and the target center coordinates of the corresponding target grid area includes: Calculate the distance between the initial positioning coordinates of each tool and the target center coordinates of the corresponding target grid area to obtain the initial positioning distance; Calculate the product of the length of each edge corresponding to the target grid region and a preset ratio to obtain multiple length thresholds corresponding to each target grid region; Determine whether the preliminary positioning distance is greater than or equal to any length threshold of the corresponding target grid area; If the preliminary positioning distance is determined to be greater than or equal to any length threshold of the corresponding target grid area, then the preliminary positioning coordinates of the corresponding tool need to be corrected.

7. The method according to claim 6, characterized in that, The method further includes: If the initial positioning distance is determined to be greater than or equal to any length threshold of the corresponding target grid area, then the center coordinates of the adjacent grids corresponding to the target edge are obtained; wherein, the target edge refers to the edge among the multiple edges of the target grid area whose initial positioning distance is greater than or equal to the length threshold, and the adjacent grids refer to the grid areas among the multiple grid areas that are adjacent to the target grid area based on the target edge; Based on the center coordinates of the adjacent grid, the physical parameters of the tool, and the camera installation parameters of the tool, calculate the actual offset of the preliminary positioning coordinates of the tool. The actual storage coordinates of the tool are calculated based on the actual offset of the preliminary positioning coordinates and the preliminary positioning coordinates.

8. The method according to claim 1, characterized in that, Before acquiring the upper tool acquisition data and the lower tool acquisition data, the method further includes: The tool placement area on each layer of the cabinet is processed into a two-dimensional matrix to form multiple grid matrices; Based on the preset tool placement density, the matrixed tool placement area is divided into multiple independent tool placement monitoring sub-areas; In the lower acquisition area, the number of fixed cameras is determined based on the number of independent tool placement monitoring sub-areas, with each tool placement monitoring sub-area corresponding to one fixed camera. In the upper acquisition area, the preset stop point of the slider of the synchronous belt drive mechanism of each moving camera is tested and determined, and the correspondence between the pulse number of the synchronous belt drive mechanism, the physical displacement coordinate of the slider, and the matrix coordinate of the tool placement area is established. Among them, the shooting range of the moving camera at each preset stop point of the slider corresponds to a tool placement monitoring sub-area. Assign a unique ID to each camera, and bind the designated knife placement monitoring sub-areas to the corresponding camera IDs one by one.

9. The method according to claim 1, characterized in that, The step of binding the unique identification information of the tool with the corresponding tool's correction storage coordinates to achieve CNC tool positioning management includes: The unique identification information of the tool is bound and associated with the corresponding tool's correction and storage coordinates to obtain the binding and association results of all tools in the cabinet; A real-time location database of all the cutlery in the cabinet is established based on the binding and association results of all the cutlery in the cabinet. The cutlery information in the real-time location database corresponds one-to-one with the actual storage location of the cutlery in the placement area. Based on the real-time location database, the tools in the multi-layer CNC tool cabinet are positioned and managed.

10. A CNC tool positioning and management device, characterized in that, It includes a multi-layer tool cabinet, a mobile acquisition module, a fixed acquisition module, and a control module; the multi-layer tool cabinet includes an upper acquisition area and a lower acquisition area, the mobile acquisition module is located in the upper acquisition area, and the fixed acquisition module is located in the lower acquisition area; The mobile acquisition module includes a synchronous belt drive mechanism and a mobile camera; the mobile camera is fixed on the slider of the synchronous belt drive mechanism, and the mobile camera is used to move with the synchronous belt drive mechanism to capture tool images of each tool in the upper acquisition area and output upper tool acquisition data. The fixed acquisition module includes multiple fixed cameras arranged in a density array according to the tool placement area. Each fixed camera corresponds to a tool placement monitoring sub-area in the lower acquisition area. Each fixed camera is used to capture tool images in the corresponding tool placement monitoring sub-area to obtain lower tool acquisition data. The control module is electrically connected to the mobile acquisition module and the fixed acquisition module respectively; wherein, the control module is used to execute the CNC tool positioning management method according to any one of claims 1-9.