Digital-twin-based numerical control machine tool energy consumption optimization method and system

CN122883779APending Publication Date: 2026-10-09GUANGDONG TENGXING INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611243711.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]本发明提供了一种基于数字孪生的数控机床能耗优化方法及系统,以解决现有技术中无法实现精准的能耗管控问题

Benefits of technology

(1)本发明首先从物理机床的传感器网络中同步获取机械运动数据与电气能耗数据,并通过特征提取技术挖掘两者之间的物理耦合特征。这一过程改变了现有技术中机械参数与能耗数据相互割裂的分析模式,解决了多源异构数据难以统一表征的问题。通过对原始数据进行降维和特征提取,系统能够有效过滤掉无关的噪声干扰,聚焦于驱动能耗变化的核心物理状态,从而为后续的跨域分析提供了高保真、低冗余的基础数据支撑,确保了后续能耗行为推演的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122883779A_ABST
    Figure CN122883779A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of numerical control machine tools, and discloses a numerical control machine tool energy consumption optimization method and system based on digital twinning. The method acquires machine tool mechanical and electrical data, extracts physical coupling features through feature extraction, acquires an instantaneous power consumption and heat source distribution sequence according to the features, and performs timestamp alignment to obtain a cross-time response sequence, and then a multi-physical field virtual representation model is constructed. The model is analyzed to generate three-dimensional geometric attributes and dynamic energy consumption features, which are output through time synchronization and voxel mapping to output a digital entity with geometric morphology and energy consumption distribution. Comparative virtual and real operation states are subjected to error classification and compensation to generate state compensation instructions, virtual and real mapping features are extracted from the state compensation instructions to establish a time correlation benchmark, an optimal state estimation value is calculated through a fusion algorithm, and the optimal state estimation value simultaneously acts on the physical machine tool and the digital entity to realize bidirectional data interaction and synchronous mapping. The method can realize accurate management and control of machine tool energy consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CNC machine tool technology, and in particular to a method and system for optimizing energy consumption of CNC machine tools based on digital twins. Background Technology

[0002] Currently, in the global manufacturing industry's green transformation, energy consumption management of CNC machine tools has become a key aspect of cost reduction and carbon reduction for enterprises. Traditional methods rely on the workshop's main electricity meter to count overall electricity consumption, which cannot pinpoint the energy consumption details of individual equipment or processes, resulting in a lack of basis for energy-saving optimization of the machine tool itself. To fill this gap, the industry is attempting to introduce digital twin technology, hoping to monitor and simulate the energy consumption behavior of machine tools in real time by building virtual models, thereby identifying hidden waste such as idle standby and ineffective operation of coolant pumps.

[0003] In one existing technology, a digital twin-based CNC machine tool energy consumption optimization scheme collects operational data by deploying multiple sensors on the machine tool and establishing a virtual model corresponding to the physical machine tool to achieve data synchronization. This data is then used to guide equipment start-up and shutdown optimization through energy consumption visualization analysis. However, such schemes typically consider only a single physical field or use simplified numerical models during modeling, neglecting the coupling effects between multiple physical fields such as mechanical vibration, thermal deformation, and fluid cooling. For example, during variable-speed cutting, motor power fluctuates rapidly in milliseconds with the spindle speed, while the thermal response of the cooling system exhibits a significant lag. This cross-timescale energy consumption change cannot be accurately reproduced in the virtual model. Therefore, existing technologies cannot achieve high-precision real-time synchronous mapping between the physical machine tool and the virtual model under dynamic operating conditions. This causes the control commands given by the optimization algorithm to deviate from the actual operating conditions, ultimately leading to the energy consumption optimization strategy deviating from the actual cross-physical domain energy consumption state and failing to achieve truly accurate energy consumption control.

[0004] In summary, existing technologies have limitations in achieving precise energy consumption control. Summary of the Invention

[0005] This invention provides a method and system for optimizing the energy consumption of CNC machine tools based on digital twins, in order to solve the problem of precise energy consumption control that cannot be achieved in the prior art.

[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides a method for optimizing the energy consumption of CNC machine tools based on digital twins, comprising: Mechanical motion data and electrical energy consumption data are acquired from the sensor network of physical machine tools, and the physical coupling characteristics of the two are obtained through feature extraction. Based on the physical coupling characteristics, the instantaneous power consumption sequence and the heat source distribution matrix are obtained. The instantaneous power consumption sequence and the heat source distribution matrix are then timestamped to obtain the time-series response sequence. Based on the time-series response, a multiphysics virtual representation model describing the dynamic behavior of machine tool thermomechanical coupling is constructed. The multiphysics virtual representation model is analyzed to generate three-dimensional geometric attributes and dynamic energy consumption characteristics. The three-dimensional geometric attributes and dynamic energy consumption characteristics are time-synchronized and voxelized and mapped to output a digital entity that has both geometric shape and energy consumption distribution. The digital entity can intuitively present the spatial shape and energy consumption distribution of the machine tool under a specific machining trajectory. The simulated operating state of digital entities in virtual space and the actual operating state of physical machine tools in real space are obtained. Error classification is performed on the parameters of the two operating states, and state compensation instructions are generated. The operating characteristics of the physical machine tool and the mapping characteristics of the digital entity are extracted from the state compensation command to establish a correlation benchmark between the two in the time dimension. Based on the correlation benchmark, the optimal state estimate is calculated and applied to the physical machine tool and the digital entity to achieve optimized control of machine tool energy consumption.

[0007] Secondly, the present invention provides a CNC machine tool energy consumption optimization system based on digital twins, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described above.

[0008] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.

[0009] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention first acquires mechanical motion data and electrical energy consumption data synchronously from the sensor network of the physical machine tool, and then mines the physical coupling characteristics between the two through feature extraction technology. This process changes the analysis mode of mechanical parameters and energy consumption data being isolated from each other in the prior art, and solves the problem of difficulty in uniformly representing multi-source heterogeneous data. By performing dimensionality reduction and feature extraction on the original data, the system can effectively filter out irrelevant noise interference and focus on the core physical state driving energy consumption changes, thereby providing high-fidelity, low-redundancy basic data support for subsequent cross-domain analysis and ensuring the accuracy of subsequent energy consumption behavior inference.

[0010] (2) This invention utilizes the aforementioned time-series response to construct a multi-physics virtual representation model capable of comprehensively describing the thermo-mechanical coupling dynamic behavior of machine tools. This overcomes the shortcomings of traditional single-physics models in simulating the mutual influence between mechanical motion heat generation and electrical load heat dissipation, and solves the problem of mismatch between the virtual model and the physical entity under complex working conditions. This model achieves the organic integration of energy transfer and conversion processes in multiple physical domains such as mechanics, heat, and electricity, enabling the virtual environment to accurately reproduce the nonlinear dynamic evolution process of real machine tools under complex loads, laying a solid theoretical model foundation for subsequent high-precision geometric and energy consumption state deduction.

[0011] (3) This invention performs in-depth analysis of the multiphysics virtual representation model, generating three-dimensional geometric attributes and dynamic energy consumption characteristics, and performs time synchronization and voxel mapping on them, finally outputting a digital entity that combines geometric shape and energy consumption distribution. This step solves the problem of traditional energy consumption data lacking spatial location perception capabilities, breaking down the barrier between abstract energy consumption curves and specific mechanical structures. By accurately attaching dynamic energy consumption characteristics to the three-dimensional geometric structure, the visualization transformation of machine tool energy consumption distribution from abstract numerical values ​​to intuitive spatial forms is realized, enabling operators to accurately locate the specific physical location of high-energy-consuming areas, providing a new perspective for intuitively understanding the spatial energy consumption status of machine tools.

[0012] (4) This invention performs error classification and compensation by comparing the simulated operating state of the digital entity with the actual operating state of the physical machine tool in real time, and establishes a correlation benchmark between the two in the time dimension. Finally, it achieves bidirectional data interaction and synchronous mapping by fusion calculation of the optimal state estimate. This solves the problem of optimization command failure caused by lag and deviation in virtual-real mapping in the prior art, and ensures the accurate reproduction of the physical entity by the virtual model. By establishing a real-time closed-loop feedback compensation mechanism, seamless connection and dynamic calibration of physical space and virtual space are realized, so that the control commands based on digital twin can accurately match the real operating conditions of the machine tool, thereby effectively ensuring the real-time performance and accuracy of virtual-real interaction. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of a method for optimizing the energy consumption of CNC machine tools based on digital twins, provided in the first embodiment of the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] Reference Figure 1 The first embodiment of the present invention provides a digital twin-based method for optimizing the energy consumption of CNC machine tools, including the following steps: S11: Obtain mechanical motion data and electrical energy consumption data from the sensor network of the physical machine tool, and obtain the physical coupling characteristics of the two through feature extraction; S12, obtain the instantaneous power consumption sequence and heat source distribution matrix according to the physical coupling characteristics, and align the instantaneous power consumption sequence and heat source distribution matrix with timestamps to obtain the time-transition response sequence; S13, Based on the time-series response sequence, construct a multiphysics virtual representation model describing the dynamic behavior of the machine tool's thermo-mechanical coupling; S14, parse the multiphysics virtual representation model, generate three-dimensional geometric attributes and dynamic energy consumption characteristics respectively, perform time synchronization and voxel mapping on the three-dimensional geometric attributes and dynamic energy consumption characteristics, and output a digital entity that has both geometric shape and energy consumption distribution; the digital entity can intuitively present the spatial shape and energy consumption distribution of the machine tool under a specific machining trajectory. S15: Obtain the simulated operating state of the digital entity in the virtual space and the actual operating state of the physical machine tool in the real space. Classify the error parameters of the two operating states and generate state compensation instructions. S16, extract the operating characteristics of the physical machine tool and the mapping characteristics of the digital entity from the state compensation instruction to establish a correlation benchmark between the two in the time dimension, calculate the optimal state estimate based on the correlation benchmark and apply it to the physical machine tool and the digital entity to achieve optimized control of machine tool energy consumption.

[0016] In step S11, mechanical motion data and electrical energy consumption data are acquired from the sensor network of the physical machine tool, and the physical coupling characteristics of the two are obtained through feature extraction, including: Asynchronous mechanical motion data and electrical energy consumption data are acquired from the sensor network of physical machine tools; The mechanical motion data and electrical energy consumption data are time-aligned to obtain aligned data; Feature filtering is performed on the aligned data to obtain physical coupling features that characterize the relationship between the two.

[0017] It should be noted that when acquiring asynchronous mechanical motion data and electrical energy consumption data from the sensor network of the physical machine tool, the mechanical vibration sensor of the machine tool spindle samples at a frequency of 1000 Hz, while the power meter collects electrical energy consumption data at a frequency of 10 Hz, resulting in a significant time asynchrony. When performing time-series alignment processing on the mechanical motion data and electrical energy consumption data, the initial mechanical and energy data are aligned. The input is an asynchronous data stream with its original timestamp, and the output is aligned data uniformly to a 100 Hz time base. This strict alignment in the time dimension eliminates the misalignment error caused by the difference in sampling rates between multiple sensor sources, laying a data foundation for the subsequent joint analysis of the machine tool's dynamic characteristics.

[0018] Next, when performing feature filtering on the aligned data, a random forest algorithm is used for feature dimensionality reduction. Specifically, the mechanical motion data such as the machine tool spindle torque and feed axis displacement, as well as the electrical energy consumption data such as the active and reactive power of the spindle motor, are horizontally concatenated in the aligned data. The input is a multi-source heterogeneous raw data stream, and the output is a high-dimensional feature set containing 120 dimensions. The random forest algorithm is used to train the above high-dimensional feature set. The input is a high-dimensional feature set containing 120 dimensions and the corresponding machine tool processing status label. The number of decision trees in the algorithm is set to 100, and the maximum tree depth is 20 layers. After iterative training, a forest structure composed of multiple decision trees is output. This forest structure maps the nonlinear mapping relationship between mechanical variables and energy consumption variables under complex working conditions. By analyzing the forest structure, the reduction in Gini impurity brought about by each feature splitting at all decision tree nodes is calculated. The Gini impurity reduction values ​​of a certain feature at all splitting nodes in the forest are accumulated and averaged to output an initial feature importance sequence. This sequence quantifies the contribution of each dimension feature to the machine tool status classification.

[0019] The initial feature importance sequence is sorted in descending order, and the top fifteen features are selected to form a core feature subset containing fifteen key dimensions. Data of the corresponding dimensions are extracted from the original high-dimensional feature set as physical coupling features after dimensionality reduction, which are used to characterize the deep correlation between mechanical motion and electrical energy consumption.

[0020] This step employs a random forest algorithm for dimensionality reduction instead of principal component analysis because random forests can directly assess the contribution of each feature to the machine tool state classification through the reduction in Gini impurity, thereby accurately identifying the correlation features between mechanical motion and electrical energy consumption. A larger reduction in Gini impurity indicates a more critical role for the feature in distinguishing different machine tool operating states, and also signifies a stronger involvement of the feature in the coupling relationship between mechanical and energy consumption variables. By selecting the top fifteen most important features, redundant dimensions with weak mechanical-electrical coupling in the original high-dimensional feature set can be removed, leaving core features that carry the core information of the correlation between the two. This allows the dimensionality-reduced physical coupling features to accurately characterize the deep correlation between mechanical motion data and electrical energy consumption data.

[0021] In step S12, the instantaneous power consumption sequence and heat source distribution matrix are obtained based on the physical coupling characteristics. The instantaneous power consumption sequence and heat source distribution matrix are then timestamped to obtain a time-series response sequence, including: Based on the physical coupling characteristics, the underlying control node is located and the original operating state sequence is collected; Extract the instantaneous power consumption sequence from the original operating state sequence; The instantaneous power consumption sequence is mapped to a thermodynamic grid and interpolated to obtain the heat source distribution matrix; The instantaneous power consumption sequence and the heat source distribution matrix are time-aligned and spatially fused to output a time-transitional response sequence.

[0022] It should be noted that when locating the underlying control node and acquiring the original operating state sequence based on the physical coupling characteristics, the physical coupling characteristics with fifteen dimensions output from the previous dimensionality reduction are used as input. The spindle load fluctuation identifier and feed axis torque anomaly identifier contained in these characteristics are parsed. Based on these identifiers, node addressing instructions for the machine tool servo drive and spindle controller are generated. This node addressing instruction is an industrial fieldbus control instruction containing the target node address and acquisition trigger parameters. Specifically, the instruction header contains a bus protocol identifier and instruction type code, and the instruction body contains a target node address field determined by the numerical comparison result of the spindle load fluctuation identifier and the feed axis torque anomaly identifier, as well as a unified timestamp field and a sampling parameter configuration field for triggering synchronous acquisition. The addressing command locates specific servo amplifier boards and spindle inverters, among other low-level control nodes, within the machine tool's internal control network, thereby establishing a node communication link based on the industrial fieldbus protocol. Based on this established node communication link, a synchronous acquisition queue with a unified timestamp is sent to the aforementioned low-level control nodes. This queue triggers the control nodes to upload the three-phase current and bus voltage data of the spindle motor and feed motor in real time, forming the original operating status sequence.

[0023] When extracting the instantaneous power consumption sequence from the original operating state sequence, the original operating state sequence is subjected to data frame unpacking and industrial fieldbus protocol parsing to remove the communication header and check bit, and the pure instantaneous power consumption sequence is extracted.

[0024] The sampling frequency threshold is determined based on a combination of factors, including the hardware sampling capability of the machine tool's underlying control node and the time resolution required for energy consumption analysis. First, the hardware specifications of the machine tool servo drive and spindle inverter were investigated, confirming that their internal analog-to-digital converters support a maximum of 2,000 current and voltage data samples per second; this value is the upper limit achievable by the hardware. Second, considering the typical power fluctuation cycle of the motor during variable-speed cutting in CNC machine tools, spectral analysis revealed significant power pulsations in the spindle motor on a millisecond-level timescale. To accurately capture these pulsations without aliasing, according to the Nyquist sampling theorem, the sampling frequency must be at least twice the highest frequency of the target signal. Actual measurements showed that the highest frequency of the spindle power pulsation is approximately 800 Hz; therefore, theoretically, the minimum sampling frequency should not be lower than 1,600 Hz. To ensure engineering margin and compatibility with differences in different machine tool models, the threshold was set to 2,000 times per second, which fully utilizes existing hardware resources while meeting the accuracy requirements of transient energy consumption analysis.

[0025] When mapping the instantaneous power consumption sequence to a thermodynamic grid and interpolating to obtain the heat source distribution matrix, the instantaneous power consumption sequence is used as input data, and spatial coordinate mapping is performed in conjunction with the machine tool's structural dimension parameters. First, the three-dimensional spatial coordinates of key heat-generating components such as the spindle bearing and lead screw nut are extracted from the machine tool's digital design model. These coordinates are based on the origin of the machine tool coordinate system and are in millimeters. Then, the physical coupling features obtained in the previous steps are analyzed to extract the spindle load fluctuation indicator and the feed axis torque anomaly indicator. The values ​​of these two indicators reflect which mechanical component the current power consumption mainly belongs to. If the value of the spindle load fluctuation indicator is higher than that of the feed axis torque anomaly indicator, it is determined that the current instantaneous power consumption is mainly caused by frictional heat generation from the spindle bearing. In this case, the instantaneous power consumption value is assigned according to the spatial coordinate point where the spindle bearing is located. Conversely, if the value of the feed axis torque anomaly indicator is higher, it is determined that the power consumption mainly comes from the transmission loss of the lead screw nut pair, and the value is assigned to the spatial coordinate point corresponding to the lead screw nut. When two identifier values ​​are similar, the instantaneous power consumption value is split into two parts proportional to their values ​​and assigned to the spatial coordinate points of the spindle bearing and the leadscrew nut, respectively. After performing the above mapping on the values ​​in all instantaneous power consumption sequences, a set of discrete spatial coordinate points with heat source intensity is obtained. Subsequently, the physical processing area of ​​the machine tool is divided into a thermodynamic grid consisting of 100*100*100 three-dimensional pixels. Spatial interpolation calculations are performed on the above discrete spatial coordinate points to deduce the heat distribution values ​​of each three-dimensional pixel node in the entire thermodynamic grid, and finally a high-dimensional heat source distribution matrix is ​​output.

[0026] It should be noted that the size of the grid is not fixed at 100×100×100. Instead, it is determined based on the outer cube size of the physical machining area according to the digital design model of the machine tool. This outer cube is used as the dividing boundary, and the number of grids is adaptively determined based on the target voxel side length. For a typical medium-sized CNC machine tool, the side length of the outer cube of the machining area is about 500 mm. When the target voxel side length is set to 5 mm, 100×100×100 3D pixels are divided. For machine tools with larger or smaller machining areas, the number of grids is scaled proportionally to the target voxel side length to ensure that the heat source distribution matrix of different machine tools has a consistent spatial resolution.

[0027] The instantaneous power consumption sequence and the heat source distribution matrix are time-aligned and spatially fused. Timestamps are extracted from both the instantaneous power consumption sequence and the heat source distribution matrix. Based on cubic spline interpolation, the instantaneous power consumption sequence is resampled to the same sampling frequency as the heat source distribution matrix, forming a time-aligned power consumption sequence. The aligned power consumption values ​​are then assigned to corresponding coordinate points in the three-dimensional spatial coordinates of the heat-generating components, constructing a time-series response sequence containing the spatial distribution of power consumption.

[0028] In step S13, based on the time-series response sequence, a multiphysics virtual representation model describing the thermomechanical coupling dynamic behavior of the machine tool is constructed, including: Based on the time-transition response sequence, the temperature gradient and thermally induced displacement are extracted and fused to form the field boundary conditions; A three-dimensional model of the machine tool is acquired and meshed. The field boundary conditions are used as constraints to construct a multiphysics field coupled evolution equation. The state evolution trajectory is obtained by numerically integrating the multiphysics coupled evolution equations. The state evolution trajectory is mapped to a three-dimensional geometric topology to construct a multiphysics virtual representation model.

[0029] It should be noted that when extracting temperature gradient and thermal displacement based on the time-series response sequence and fusing them to form field boundary conditions, the time-series response sequence obtained from the aforementioned processing is input into a preset thermo-mechanical coupling analysis module. The temperature gradient distribution inside the machine tool is extracted using Fourier's heat conduction law to form a thermodynamic conduction field. At the same time, the thermal displacement of key components such as the spindle bearing is calculated to generate a spatial deformation field. Subsequently, tensor product operation is used to fuse the thermodynamic conduction field and the spatial deformation field in the spatial coordinate system to output field boundary conditions containing both temperature and displacement constraints.

[0030] The acquisition process of the preset thermo-mechanical coupling analysis module is as follows: First, collect historical operating data of the machine tool under various typical working conditions, including spindle speed, feed rate, load current, and corresponding measured values ​​of temperature field and thermal deformation, to construct a training dataset; then, build an initial physical model based on Fourier's law of heat conduction and thermoelasticity theory, using power consumption and temperature data in the time-series response as model input, and measured temperature field and thermal deformation as supervision labels, iteratively optimizing the parameters in the model until the average absolute error between the temperature gradient and thermally induced displacement output by the model and the measured values ​​converges to a preset range. At this point, the optimized parameters are solidified into the model, thus obtaining the preset thermo-mechanical coupling analysis module. After obtaining the boundary conditions of the field, the three-dimensional solid model of the machine tool spindle is discretized. First, the three-dimensional solid model of the machine tool spindle is initially discretized using a 5 mm initial mesh size. After initial discretization, the temperature difference between adjacent nodes within each initial mesh unit is calculated, and the temperature difference is compared with a preset temperature gradient threshold. The process of setting the temperature gradient threshold is as follows: historical temperature field data of the machine tool under various typical operating conditions is collected, the distribution pattern of temperature differences between adjacent nodes within the initial discretized mesh unit is statistically analyzed, and a critical temperature difference value that can distinguish between regions with gentle heat transfer and regions with drastic temperature changes is selected as the temperature gradient threshold. If the temperature difference within a certain initial mesh unit is greater than the preset temperature gradient threshold, it is determined that the temperature gradient in that region is drastic, and an automatic mesh refinement operation is performed on that initial mesh unit. Specifically, the initial mesh unit is further subdivided evenly into multiple sub-mesh units, and the mesh is automatically refined in regions with drastic temperature gradient changes. After discretization, a node mapping matrix containing 20,000 spatial nodes is generated. This matrix records the three-dimensional coordinates of each node and its corresponding thermodynamic initial state.

[0031] After mesh generation, the temperature boundary conditions in the field boundary conditions are applied to the corresponding nodes in the node mapping matrix, and the displacement boundary conditions in the field boundary conditions are applied to the corresponding nodes in the node mapping matrix. Then, combining thermoelastic dynamics theory, and using the node mapping matrix as the basis for spatial discretization, a multiphysics coupling evolution equation describing the interaction between machine tool thermal deformation and structural stiffness degradation is established. This equation is expressed as follows: the left side is the product of the mass matrix and the second-order time derivative of the displacement, plus the product of the damping matrix and the first-order time derivative of the displacement, plus the product of the reduced stiffness matrix and the displacement vector; the right side is the sum of the temperature load vector and the mechanical load vector, where the temperature load vector is obtained by converting the temperature gradient through the coefficient of thermal expansion. This equation fully describes the evolution of the thermomechanical coupling dynamic behavior of the machine tool during high-speed spindle cutting over time.

[0032] Finally, when numerically integrating the multiphysics coupling evolution equations to obtain the state evolution trajectory, a fourth-order Runge-Kutta numerical integration algorithm is used to solve the multiphysics coupling evolution equations with time steps. The integration time step is set to 10 milliseconds, deriving the continuous change path of temperature distribution and spatial displacement of the machine tool spindle over the next 3000 time steps, i.e., the state evolution trajectory. When mapping the state evolution trajectory to a three-dimensional geometric topology to construct a multiphysics virtual representation model, the three-dimensional geometric topology of the machine tool spindle is first extracted. This structure is defined by the node mapping matrix generated by the aforementioned Delaunay adaptive mesh generation algorithm, containing the three-dimensional coordinates of 20,000 spatial nodes and their topological connections. Then, the spatial displacement vector and temperature distribution vector at each time step in the state evolution trajectory are mapped one-to-one to the corresponding nodes in the three-dimensional geometric topology according to the node number. That is, the spatial displacement vector is superimposed on the original three-dimensional coordinates of the node to obtain the deformed geometric shape of that time step, while the temperature distribution vector is assigned to the corresponding node as the thermodynamic state of that time step. Next, the geometric topological snapshots with displacement and temperature attributes at each time step are organized in chronological order to construct a multiphysics virtual representation model that can reflect the dynamic behavior of the physical machine tool's thermomechanical coupling in real time. This model is essentially a four-dimensional data structure that progresses over time. Its spatial dimension is described by the geometric shape of the machine tool spindle, and its temporal dimension is driven by the state evolution trajectory to continuously evolve the geometric shape and thermodynamic state of the machine tool spindle, thus fully representing the dynamic behavior of the machine tool's thermal deformation and structural stiffness degradation during the machining process.

[0033] In step S14, the multiphysics virtual representation model is parsed to generate three-dimensional geometric attributes and dynamic energy consumption characteristics. The three-dimensional geometric attributes and dynamic energy consumption characteristics are then time-synchronized and voxelized, outputting a digital entity that combines geometric shape and energy consumption distribution, including: The multiphysics virtual representation model was analyzed to separate the blade tip spatial coordinate sequence and the motor operating state sequence; The tool tip spatial coordinate sequence is geometrically reconstructed to extract the tool sweep volume and machining contour boundary, and three-dimensional geometric properties are generated. The instantaneous power and cumulative work done are calculated based on the motor operating state sequence to generate dynamic energy consumption characteristics; The dynamic energy consumption characteristics are subjected to nonlinear stretching and optimal matching to output a feature fusion matrix; An octree spatial segmentation algorithm is used to voxelize the machining area of ​​the machine tool. The feature fusion matrix is ​​mapped to a voxel grid, and each voxel is assigned a geometric occupancy identifier and an energy consumption intensity scalar to generate a digital entity that has both three-dimensional geometric shape and dynamic energy consumption distribution.

[0034] It should be noted that when analyzing the multiphysics virtual representation model to separate the tool tip spatial coordinate sequence and the motor operating state sequence, the previously constructed multiphysics virtual representation model is loaded into the analysis engine. This model stores the spatial displacement field and electromagnetic field data of the machine tool at each time step during the machining process in the form of a four-dimensional tensor. By setting the local coordinate system range where the tool tip is located, the values ​​of the node coordinates within this range as a function of time are retrieved from the displacement field tensor of the model to extract the tool tip spatial coordinate sequence. At the same time, the node current and voltage data corresponding to the spindle motor and feed motor are retrieved from the electromagnetic field tensor of the model to extract the motor operating state sequence.

[0035] When using the directed bounding box algorithm to geometrically reconstruct the tool tip spatial coordinate sequence to extract the tool sweep volume and machining contour boundary and generate three-dimensional geometric attributes, the tool tip spatial coordinate sequence is used as input. First, the covariance matrix of all coordinate points in the sequence in three dimensions is calculated. The covariance matrix is ​​then decomposed into eigenvalues ​​to obtain three eigenvectors as the three principal axes of the directed bounding box. Then, the extreme values ​​of the projection of each coordinate point in the three principal axes are calculated to determine the minimum bounding box cuboid. Finally, based on the tool's geometric parameters and tool tip trajectory, the tool sweep volume and machining contour boundary are generated using the voxel labeling method. Specifically, firstly, the smallest circumscribed cuboid is used as the boundary of the machining area, and it is discretized into a uniform voxel mesh with a side length of one-tenth of the tool diameter. Then, each tool tip position in the tool tip spatial coordinate sequence is traversed, and with that position as the center and the tool radius as the radius, all voxels intersecting the sphere are marked as "sweeped by the tool". After performing the above marking operation on all tool tip positions, the set of all marked voxels constitutes a discrete representation of the tool sweep volume. Finally, the surface voxels of this voxel set, that is, voxels with at least one unmarked adjacent voxel, are extracted, and the outer surfaces of these surface voxels are connected to generate three-dimensional geometric properties describing the tool sweep volume and the machining contour boundary.

[0036] It should be noted that when calculating the instantaneous power and cumulative work to generate dynamic energy consumption characteristics based on the motor operating state sequence, the three-phase current and three-phase voltage values ​​at each moment are first extracted from the motor operating state sequence. The specific calculation process is as follows: Let the A-phase current be... The current in phase B is The current in phase C is Phase A voltage is Phase B voltage is The voltage of phase C is Then the total instantaneous power at that moment The above calculations are performed sequentially for all times, and the total instantaneous power at each time point is arranged in chronological order to obtain an instantaneous power sequence. Next, the trapezoidal numerical integration method is used to accumulate and integrate the instantaneous power sequence along the time axis to calculate the cumulative work done. Specifically, the average instantaneous power of two adjacent times is taken, and then multiplied by the time interval Δt between these two times to obtain the increment of work done during that time interval. The incremental work done in all time periods is accumulated sequentially to obtain the cumulative work sequence from the start time to the current time. Finally, the instantaneous power sequence and the cumulative work sequence are combined to output a dynamic energy consumption feature, which includes both the transient power fluctuation information of the motor at each moment and the energy accumulation information of the entire processing process.

[0037] To address the existing issue of inconsistency between location feedback and electrical parameter acquisition cycles, time synchronization processing is performed on dynamic energy consumption features and spatial coordinate sequences. First, the timestamp arrays of the spatial coordinate sequences and dynamic energy consumption features are extracted and sorted chronologically. For missing time points in the dynamic energy consumption features, since their original sampling frequency is lower than that of the spatial coordinate sequences, linear interpolation is performed between adjacent known points using the dynamic energy consumption features to fill in all missing energy consumption values. For duplicate or abnormal timestamps in the spatial coordinate sequences caused by signal jitter, median filtering is used for smoothing. After the above processing, both sets of sequences have one-to-one corresponding data values ​​at each sampling time. The synchronized spatial coordinates and dynamic energy consumption features are concatenated column-wise to output a feature fusion matrix. Each row of this matrix corresponds to a sampling time, containing the spatial coordinates and the instantaneous power value at that time.

[0038] An octree spatial segmentation algorithm is used to voxelize the machining area of ​​the machine tool. The feature fusion matrix is ​​mapped to a voxel mesh, and each voxel is assigned a geometric occupant identifier and an energy intensity scalar. When generating a digital entity with both three-dimensional geometry and dynamic energy distribution, the maximum recursion depth of the octree is first set to four levels. The circumscribed cube of the machine tool machining area is used as the root node of the octree. This cube is recursively and uniformly divided into eight sub-cubes until the maximum depth is reached. At this point, each leaf node corresponds to a voxel, and the spatial position and size of the voxel are recorded to obtain the basic voxel mesh. Based on this, an adaptive resolution strategy is adopted: in the area near the tool trajectory, i.e., within a radius of twice the tool diameter around the tool tip spatial coordinate point, the octree depth is increased to six levels to obtain a finer voxel subdivision; in areas far from the tool trajectory, a low-resolution subdivision of four levels is maintained. Simultaneously, at fixed time intervals, such as 100 milliseconds, the tool tip spatial coordinates and instantaneous power values ​​of all sampling time steps within this time interval are batch processed. The number of times each voxel is swept by the tool and the cumulative energy consumption value within this time interval are counted. Then, the geometric occupancy identifier and energy consumption intensity scalar of the voxel are updated. Then, each row in the feature fusion matrix is ​​traversed. This row contains the tool tip spatial coordinates and the corresponding instantaneous power value at a time step. The voxel to which it belongs is determined based on the tool tip spatial coordinates. The geometric occupancy identifier of the voxel is set to 1 to indicate that the voxel has been swept by the tool. At the same time, the instantaneous power value is accumulated into the energy consumption intensity scalar of the voxel. After all time steps are traversed, the energy consumption intensity scalar of each voxel is divided by the number of times the voxel is visited to obtain the average energy consumption intensity. Finally, a digital entity is output. This digital entity is composed of a voxel grid. Each voxel carries a geometric occupancy identifier and an energy consumption intensity scalar, which can intuitively present the spatial morphology and energy consumption distribution of the machine tool under a specific machining trajectory.

[0039] In step S15, the simulated operating state of the digital entity in the virtual space and the actual operating state of the physical machine tool in the real space are obtained, including: The simulated operating state of a digital entity in virtual space includes tool tip coordinates and spindle torque values; The actual operating state of a physical machine tool in real space includes the tool tip coordinates and the torque values ​​output by the spindle torque sensor.

[0040] It should be noted that when acquiring the simulated operating state of the digital entity in virtual space and the actual operating state of the physical machine tool in real space, the coordinate values ​​of the tool tip in three axes and the torque values ​​output by the spindle torque sensor are collected in real time from the servo drive and grating ruler position encoder of the physical machine tool at a frequency of 1,000 times per second, forming a four-dimensional vector of the actual operating state. At the same time, the tool tip coordinates and spindle torque values ​​at the corresponding time steps are read from the simulation engine of the digital entity at the same sampling frequency, forming a four-dimensional vector of the simulated operating state.

[0041] In one implementation, error classification is performed on the parameters of both operating states, and state compensation instructions are generated, including: The tool tip coordinates and spindle torque of the simulated operating state and the actual operating state are subtracted to construct a four-dimensional state difference vector; The four-dimensional state difference vector includes lateral position deviation, longitudinal position deviation, vertical position deviation, and torque deviation; If any dimension of the four-dimensional state difference vector exceeds a preset deviation threshold, the difference vector is input for error classification to obtain the error type; Generate a micro-displacement compensation sequence for each feed axis based on the error type; The micro-displacement compensation sequence is encapsulated into an additional macro instruction data packet according to the CNC underlying communication protocol, a state compensation instruction is generated and sent to the servo drive module of the physical machine tool for execution.

[0042] It should be noted that when constructing a four-dimensional state difference vector by subtracting the tool tip coordinates and spindle torque from the simulated operating state and the actual operating state, the differences between the simulated tool tip coordinates and the actual tool tip coordinates on the X-axis, Y-axis, and Z-axis, as well as the difference between the simulated spindle torque and the actual spindle torque, are calculated respectively. These four differences are combined into a four-dimensional vector in the order of spatial coordinates first and torque second. The value of each dimension of this vector reflects the degree of deviation of the corresponding physical quantity between the virtual and real. If any dimension of the four-dimensional state difference vector exceeds a preset deviation threshold, when classifying the difference vector to obtain the error type, the preset deviation threshold is set based on the machine tool's factory precision level. For example, the deviation threshold for each axis of the tool tip coordinate is set to 0.01 mm, and the spindle torque deviation threshold is set to 5% of the rated torque. When any dimension is detected to exceed the threshold, the complete four-dimensional state difference vector is sent to a pre-trained support vector machine classifier. This classifier uses the radial basis function as the kernel function, and the training data comes from various error samples measured by a laser interferometer and torque calibration table in historical machining. The classifier outputs an error type label, which corresponds to one of thermal deformation error, force deformation error, or geometric clearance error.

[0043] Depending on the type of error, compensation values ​​are calculated directly based on the deviation characteristics. If the error is thermal deformation error, the displacement deviation of each feed axis due to thermal expansion is calculated based on the difference between the current spindle temperature and the reference temperature, combined with the thermal expansion coefficients of the machine tool spindle and feed axes. This displacement deviation is then inverted and used as the micro-displacement compensation value. If the error is force deformation error, the cutting force is estimated based on the current spindle torque and feed speed, combined with the stiffness coefficients of various machine tool components. The displacement deviation of each feed axis due to force deformation is then calculated. This displacement deviation is then inverted and used as the micro-displacement compensation value. If the error is geometric clearance error, a compensation value equal in magnitude and opposite in direction to the pre-determined backlash value of each axis is directly output at the reversal time. These compensation values ​​are then distributed one by one over the subsequent one hundred time steps to form a micro-displacement compensation sequence for each feed axis.

[0044] When the micro-displacement compensation sequence is encapsulated into an additional macro instruction data packet according to the CNC underlying communication protocol to generate a state compensation instruction and send it to the servo drive module of the physical machine tool for execution, the micro-displacement compensation sequence of each feed axis is arranged in chronological order. Each compensation data includes the axis identifier, compensation direction, and compensation micron value. It is encapsulated using a macro instruction format supported by the CNC system. For example, in the FANUC system, the instruction template of G10L2P axis address R compensation value is used to package the entire sequence into a continuous data packet, which is sent to the servo drive module of the physical machine tool through the Ethernet fieldbus interface. After receiving the instruction, the servo drive module parses the compensation value and adds it to the current position loop setpoint to realize the real-time correction of the virtual and real state deviation.

[0045] In step S16, the operating characteristics of the physical machine tool and the mapping characteristics of the digital entity are extracted from the state compensation instruction to establish a correlation benchmark between the two in the time dimension. Based on the correlation benchmark, the optimal state estimate is calculated and applied to the physical machine tool and the digital entity to achieve optimized control of machine tool energy consumption, including: The state compensation command is split into a physical control sequence for driving the servo motor and a virtual drive sequence for driving the digital entity. Based on the differences in transmission characteristics between the physical control sequence and the virtual drive sequence, the data is encapsulated into bidirectional interactive data packets according to the frame structure of the Industrial Ethernet publish-subscribe protocol; the differences in transmission characteristics include low latency on the physical side and high bandwidth on the virtual side. The bidirectional interactive data packets are parsed and entity state features and twin state features are extracted. Based on the entity state features and twin state features, a twin synchronization matrix is ​​constructed by aligning the timestamps. Calculate the optimal state estimate based on the twin synchronization matrix; Based on the optimal state estimate, the physical machine tool registers and digital entity memory variables are overwritten to achieve bidirectional data interaction and synchronous mapping.

[0046] It should be noted that when the state compensation command is split into a physical control sequence to drive the servo motor and a virtual drive sequence to drive the digital entity, the system first parses the data packet header in the state compensation command to identify the target object identifier of the command. If the target identifier points to the physical machine tool, the micro displacement compensation value in the command is split into independent servo position increment commands according to the axis number and time step. Each command includes the axis identifier, compensation direction, compensation micron value, and execution timestamp, forming a physical control sequence. If the target identifier points to the digital entity, the same compensation value is converted into a joint motion parameter update command that can be recognized by the digital entity simulation engine, including the joint number, displacement increment, and timestamp, forming a virtual drive sequence.

[0047] Based on the differences in transmission characteristics between the physical control sequence and the virtual drive sequence, the physical control sequence requires high real-time performance and deterministic transmission. Therefore, it is filled into a process data object frame of an industrial Ethernet underlying protocol (such as EtherCAT). This protocol is based on the MAC layer and achieves microsecond-level synchronization through hardware timestamps and distributed clocks. The frame structure includes a frame header, data length, axis identifier, compensation value, timestamp, and cyclic redundancy check field. The virtual drive sequence has lower real-time requirements and is encapsulated as a standard User Datagram Protocol (UDP) message based on the IP layer, transmitted through the standard Ethernet protocol stack. The frame structure includes a session identifier, sequence number, joint data area, and checksum. The two types of frames operate at different protocol layers: the physical control sequence uses the industrial Ethernet underlying channel, and the virtual drive sequence uses the TCP / IP upper layer channel, without interfering with each other. The two types of frames are registered to the publisher of the protocol stack according to the publish / subscribe topic names, and are uniformly scheduled and sent by the protocol stack to form bidirectional interactive data packets.

[0048] The difference in transmission characteristics is manifested in the fact that the physical control sequence is oriented towards the real-time closed-loop control of the servo driver, which requires microsecond-level transmission delay, strict timing determinism, and zero packet loss guarantee. Any data transmission failure or out-of-order transmission may lead to a decrease in processing accuracy or even equipment damage. On the other hand, the virtual drive sequence is oriented towards the visualization simulation drive of digital entities, which has lower real-time requirements, allows millisecond-level transmission delay, and can tolerate a certain amount of network jitter, but has higher requirements for data bandwidth and integrity in order to support the smooth rendering of 3D models.

[0049] When parsing the bidirectional interactive data packets and extracting entity state features and twin state features, the subscription thread at the receiving end filters data packets according to the topic name. For physical-side data packets, it parses the actual position, speed, and torque values ​​of the servo drive to form an entity state feature vector; for virtual-side data packets, it parses the simulated position, speed, and torque values ​​of the digital entity to form a twin state feature vector. When constructing the twin synchronization matrix based on the entity state features and twin state features, the timestamp field in each data packet is extracted. The entity state features and twin state features are sorted according to the chronological order of the timestamps. For cases where the timestamps do not completely overlap, they are aligned to a unified time base. Then, each pair of aligned entity states and twin states is arranged by column to form a two-dimensional matrix. The rows of the matrix correspond to time points, and the columns correspond to state dimensions. This matrix is ​​the twin synchronization matrix.

[0050] Next, the optimal state estimate is calculated based on the twin synchronization matrix. First, the fusion weights of the actual physical machine tool state and the digital entity simulation state at each moment are determined. The weights are calculated based on the real-time reliability of both. Specifically, for the position component, the initial weight is the ratio of the physical sensor measurement noise variance to the digital entity simulation error variance; the smaller the measurement noise variance, the larger the physical side weight, and the smaller the simulation error variance, the larger the virtual side weight. For the velocity component, the weight is determined by the ratio of the grating ruler velocity resolution to the simulation velocity residual variance. For the spindle temperature component, the weight is determined by the ratio of the temperature sensor accuracy to the thermal model prediction error variance. After normalizing the above weights, a weighted average is calculated for the physical state value and the virtual state value corresponding to each moment in the twin synchronization matrix, i.e., the physical state value multiplied by the physical side weight plus the virtual state value multiplied by the virtual side weight, to obtain the optimal state estimate at that moment. This estimate balances the realism of physical measurements with the continuity of virtual simulation. When sensor noise is high, it automatically reduces the weight of the physical side and increases the weight of the virtual side, and vice versa when the simulation model has a large deviation, thus achieving adaptive fusion of virtual and real states.

[0051] Then, an observation matrix H is established, which maps the state space to the observation space. The observations come from a single row of data in the twin synchronization matrix, containing the actual position, actual speed, and actual torque of the physical machine tool, as well as the simulated position, simulated speed, and simulated torque of the digital entity, for a total of six observations. Since torque is not included in the state variables, the observation matrix H is designed as a 6×7 matrix. The first three rows correspond to position observations, directly extracting the position component from the state; the middle three rows correspond to speed observations, directly extracting the speed component from the state; and the last three rows correspond to torque observations, using pre-calibrated linear relationship coefficients between torque and position / speed to linearly combine the position and speed in the state to obtain the torque observation.

[0052] Next, the state covariance matrix P is initialized. The initial diagonal elements of this matrix are set according to the initial uncertainties of each state variable: the initial variance of position is set to 0.01 square millimeters, the initial variance of velocity is set to 0.1 square millimeters per second, and the initial variance of temperature is set to 1 degree Celsius squared. The off-diagonal elements are initialized to 0. The observation noise covariance matrix R is set according to the noise characteristics of the sensors: the position measurement noise variance is taken from the nominal accuracy of the laser interferometer, the velocity measurement noise variance is taken from the velocity resolution of the grating ruler, and the torque measurement noise variance is taken from the nominal accuracy of the torque sensor. Since the observation noises are uncorrelated, R is a diagonal matrix. The process noise covariance matrix Q is set according to the model uncertainty: the position process noise variance is set to the minimum value, the velocity process noise variance is set to the acceleration disturbance variance multiplied by the square of the time step, and the temperature process noise variance is set to the thermal model error variance. The Kalman filter sequentially performs the prediction step, which calculates the prior estimate of the current time step based on the optimal estimate and state transition matrix of the previous time step, and the update step, which corrects the prior estimate using the observation value of the current time step, i.e., a row of data in the twin synchronization matrix. The confidence of the prediction and the observation is weighed by the Kalman gain matrix, and finally the posterior optimal state estimate of the current time step is output.

[0053] It should be noted that while error compensation and state compensation instructions have been generated through deterministic physical rules in step S15, in actual industrial settings, the sensor feedback of the physical machine tool and the simulation output of the digital entity are still subject to interference from sensor measurement noise, communication transmission delays, and unilateral state drift, resulting in the states at both ends not being entirely reliable. Therefore, a Kalman filter is introduced to further fuse and filter the states at both ends to eliminate residual timing deviations and suppress noise interference, thereby obtaining a common state reference with unified time reference and the highest confidence level. This provides a refined driving basis for the subsequent bidirectional synchronous mapping between the physical machine tool and the digital entity.

[0054] Based on the optimal state estimate, the physical machine tool registers and digital entity memory variables are overwritten to achieve bidirectional data interaction and synchronous mapping. The position and velocity components in the optimal state estimate are written into the position loop setpoint register and velocity loop setpoint register of the physical machine tool servo driver via the industrial Ethernet protocol. At the same time, the corresponding components in the estimate are written into the memory variable area of ​​the digital entity simulation engine via the inter-process communication interface. This allows the actual movement of the physical machine tool and the simulated movement of the digital entity to be controlled by the same optimal state estimate, thereby completing the virtual-real bidirectional data interaction and synchronous mapping.

[0055] In summary, this invention discloses a method for optimizing the energy consumption of CNC machine tools based on digital twins. The method includes acquiring mechanical motion data and electrical energy consumption data from the sensor network of the physical machine tool, obtaining the physical coupling characteristics of these two data points through feature extraction, and obtaining an instantaneous power consumption sequence and a heat source distribution matrix accordingly. After timestamp alignment, a time-series response sequence is obtained. Based on this, a multiphysics virtual representation model describing the dynamic behavior of the machine tool's thermomechanical coupling is constructed according to the time-series response sequence. This model is then analyzed to generate three-dimensional geometric attributes and dynamic energy consumption characteristics. After time synchronization and voxel mapping of these two data points, a digital entity with both geometric shape and energy consumption distribution is output. This entity can intuitively represent the spatial shape and energy consumption distribution of the machine tool under a specific machining trajectory. Subsequently, the simulated operating state of the digital entity in virtual space and the actual operating state of the physical machine tool in real space are acquired. Error classification and compensation are performed on the parameters of both operating states to generate state compensation instructions. The operating characteristics of the physical entity and the mapping characteristics of the virtual twin are extracted from these state compensation instructions to establish a time-dimensional correlation benchmark between the two. Finally, the optimal state estimate is calculated based on the associated benchmark using a fusion algorithm and applied to both the physical machine tool and the digital entity to achieve bidirectional data interaction and synchronous mapping.

[0056] This invention extracts machine tool data to construct a digital entity, compares the virtual and real states to generate compensation instructions, and achieves bidirectional synchronous mapping, thereby realizing precise control of machine tool energy consumption.

[0057] The second embodiment of the present invention provides a CNC machine tool energy consumption optimization system based on digital twin, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described above.

[0058] It should be noted that the CNC machine tool energy consumption optimization system based on digital twin provided in this embodiment of the invention is used to execute all the process steps of the CNC machine tool energy consumption optimization method based on digital twin in the above embodiment. The working principle and beneficial effect of the two are one-to-one, so they will not be described again.

[0059] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0060] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method for optimizing energy consumption of CNC machine tools based on digital twins, characterized in that, include: Mechanical motion data and electrical energy consumption data are acquired from the sensor network of physical machine tools, and the physical coupling characteristics of the two are obtained through feature extraction. Based on the physical coupling characteristics, the instantaneous power consumption sequence and the heat source distribution matrix are obtained. The instantaneous power consumption sequence and the heat source distribution matrix are then timestamped to obtain the time-series response sequence. Based on the time-series response, a multiphysics virtual representation model describing the dynamic behavior of machine tool thermomechanical coupling is constructed. The multiphysics virtual representation model is analyzed to generate three-dimensional geometric attributes and dynamic energy consumption characteristics. The three-dimensional geometric attributes and dynamic energy consumption characteristics are time-synchronized and voxelized and mapped to output a digital entity that has both geometric shape and energy consumption distribution. The digital entity can intuitively present the spatial shape and energy consumption distribution of the machine tool under a specific machining trajectory. The simulated operating state of digital entities in virtual space and the actual operating state of physical machine tools in real space are obtained. Error classification is performed on the parameters of the two operating states, and state compensation instructions are generated. The operating characteristics of the physical machine tool and the mapping characteristics of the digital entity are extracted from the state compensation command to establish a correlation benchmark between the two in the time dimension. Based on the correlation benchmark, the optimal state estimate is calculated and applied to the physical machine tool and the digital entity to achieve optimized control of machine tool energy consumption.

2. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The process of acquiring mechanical motion data and electrical energy consumption data from the sensor network of the physical machine tool, and obtaining the physical coupling characteristics of the two through feature extraction, includes: Asynchronous mechanical motion data and electrical energy consumption data are acquired from the sensor network of physical machine tools; The mechanical motion data and electrical energy consumption data are time-aligned to obtain aligned data; Feature filtering is performed on the aligned data to obtain physical coupling features that characterize the relationship between the two.

3. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The step of obtaining the instantaneous power consumption sequence and heat source distribution matrix based on the physical coupling characteristics, and aligning the instantaneous power consumption sequence and heat source distribution matrix with timestamps to obtain the time-series response sequence includes: Based on the physical coupling characteristics, the underlying control node is located and the original operating state sequence is collected; Extract the instantaneous power consumption sequence from the original operating state sequence; The instantaneous power consumption sequence is mapped to a thermodynamic grid and interpolated to obtain the heat source distribution matrix; The instantaneous power consumption sequence and the heat source distribution matrix are time-aligned and spatially fused to output a time-transitional response sequence.

4. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The step of constructing a multiphysics virtual representation model describing the thermomechanical coupling dynamic behavior of the machine tool based on the time-series response sequence includes: Based on the time-transition response sequence, the temperature gradient and thermally induced displacement are extracted and fused to form the field boundary conditions; A three-dimensional model of the machine tool is acquired and meshed. The field boundary conditions are used as constraints to construct a multiphysics field coupled evolution equation. The state evolution trajectory is obtained by numerically integrating the multiphysics coupled evolution equations. The state evolution trajectory is mapped to a three-dimensional geometric topology to construct a multiphysics virtual representation model.

5. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The process involves analyzing the multiphysics virtual representation model to generate three-dimensional geometric attributes and dynamic energy consumption characteristics. These attributes are then time-synchronized and voxelized, resulting in a digital entity that combines geometric shape and energy distribution. The multiphysics virtual representation model was analyzed to separate the blade tip spatial coordinate sequence and the motor operating state sequence; The tool tip spatial coordinate sequence is geometrically reconstructed to extract the tool sweep volume and machining contour boundary, and three-dimensional geometric properties are generated. The instantaneous power and cumulative work done are calculated based on the motor operating state sequence to generate dynamic energy consumption characteristics; The dynamic energy consumption characteristics are subjected to nonlinear stretching and optimal matching to output a feature fusion matrix; An octree spatial segmentation algorithm is used to voxelize the machining area of ​​the machine tool. The feature fusion matrix is ​​mapped to the voxel grid, and each voxel is assigned a geometric occupancy identifier and an energy consumption intensity scalar to generate a digital entity that has both three-dimensional geometric shape and dynamic energy consumption distribution.

6. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The process of classifying errors in the parameters of both operating states and generating state compensation instructions includes: The tool tip coordinates and spindle torque of the simulated operating state and the actual operating state are subtracted to construct a four-dimensional state difference vector; The four-dimensional state difference vector includes lateral position deviation, longitudinal position deviation, vertical position deviation, and torque deviation; If any dimension of the four-dimensional state difference vector exceeds a preset deviation threshold, the difference vector is input for error classification to obtain the error type. Generate a micro-displacement compensation sequence for each feed axis based on the error type; The micro-displacement compensation sequence is encapsulated into an additional macro instruction data packet according to the CNC underlying communication protocol, a state compensation instruction is generated and sent to the servo drive module of the physical machine tool for execution.

7. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The acquisition of the simulated operating state of digital entities in virtual space and the actual operating state of physical machine tools in real space includes: The simulated operating state of a digital entity in virtual space includes tool tip coordinates and spindle torque values; The actual operating state of a physical machine tool in real space includes the tool tip coordinates and the torque values ​​output by the spindle torque sensor.

8. The energy consumption optimization method for CNC machine tools based on digital twins according to claim 1, characterized in that, The process of extracting the operating characteristics of the physical machine tool and the mapping characteristics of the digital entity from the state compensation command to establish a correlation benchmark between the two in the time dimension, calculating the optimal state estimate based on the correlation benchmark and applying it to the physical machine tool and the digital entity to achieve optimized control of machine tool energy consumption includes: The state compensation command is split into a physical control sequence for driving the servo motor and a virtual drive sequence for driving the digital entity. Based on the differences in transmission characteristics between the physical control sequence and the virtual drive sequence, the data is encapsulated into bidirectional interactive data packets according to the frame structure of the Industrial Ethernet publish-subscribe protocol; the differences in transmission characteristics include low latency on the physical side and high bandwidth on the virtual side. The bidirectional interactive data packets are parsed and entity state features and twin state features are extracted. Based on the entity state features and twin state features, a twin synchronization matrix is ​​constructed by aligning the timestamps. Calculate the optimal state estimate based on the twin synchronization matrix; Based on the optimal state estimate, the physical machine tool registers and digital entity memory variables are overwritten to achieve bidirectional data interaction and synchronous mapping.

9. A CNC machine tool energy consumption optimization system based on digital twins, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the method described in any one of claims 1 to 8.