Method and system for reconstruction of building cluster wind field based on deep learning and sparse data
Patent Information
- Application Number
- CN202611501527.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
然而,这类方法通常依赖于规则网格和稠密的数据输入,难以直接处理稀疏、分布不规则的监测点数据,且纯数据驱动的模型容易产生违背基本物理规律(如建筑内部风速不为零、流场不连续)的预测结果,物理可解释性差
本发明适用于极稀疏数据场景,能够有效利用占空间数据总量约1%的极稀疏监测点数据进行全场重建,在实际城市环境中具有极高的应用价值和部署可行性,具体的:
Smart Images

Figure CN123013718A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wind field reconstruction technology, and specifically refers to a method and system for wind field reconstruction of building complexes based on deep learning and sparse data. Background Technology
[0002] As the impacts of global climate change intensify, cities, as areas with high concentrations of population and economic activity, are becoming increasingly vulnerable to climate change. Against this backdrop, urban wind field research is crucial for mitigating the negative effects of climate change, playing a vital role in improving air quality, mitigating the urban heat island effect, optimizing street ventilation, and enhancing pedestrian comfort.
[0003] Traditional methods for acquiring urban wind fields primarily rely on computational fluid dynamics (CFD) numerical simulations. While CFD simulations can provide high-precision flow field information, their computational cost is extremely high, especially for large-scale three-dimensional large eddy simulations of urban building complexes, which often require hours or even days of computation time, making it difficult to meet the needs of real-time monitoring and rapid assessment. Furthermore, in real-world urban environments, limitations in cost and installation conditions typically mean that only a small number of wind speed sensors can be sparsely deployed (accounting for less than 1% of the total spatial data), making it impossible to obtain comprehensive wind field distribution information.
[0004] Existing wind field reconstruction methods are mainly divided into two categories: The first is traditional methods based on spatial interpolation, such as radial basis function interpolation, inverse distance weighted interpolation, and Kriging interpolation. These methods rely only on local neighborhood information and have low computational complexity, but they struggle to capture the complex nonlinear spatial distribution characteristics and long-distance spatial dependencies in wind fields, especially in densely built-up areas where prediction accuracy often falls short of requirements. The second category is image super-resolution reconstruction methods based on deep learning, which treat the wind field as a two-dimensional image. However, these methods typically rely on regular grids and dense data inputs, making it difficult to directly process sparse, irregularly distributed monitoring point data. Furthermore, purely data-driven models are prone to producing prediction results that violate basic physical laws (such as non-zero wind speeds inside buildings and discontinuous flow fields), resulting in poor physical interpretability.
[0005] Therefore, there is a lack of existing technologies that can utilize extremely sparse monitoring point data to achieve rapid reconstruction of urban-scale wind fields with a response time of up to seconds, while ensuring high accuracy and physical plausibility. Summary of the Invention
[0006] To address the technical problems existing in the prior art, this invention provides a method and system for reconstructing wind fields in building clusters based on deep learning and sparse data. The technical solution is as follows: On the one hand, a method for reconstructing wind fields in building clusters based on deep learning and sparse data is provided, which includes: S1. Obtain wind speed data of sparsely distributed monitoring points in the target area, the location coordinates of all grid points in the target area, and building masks. The number of monitoring points is less than the total number of grid points. S2. Input the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask into the trained wind field reconstruction model based on the Transformer architecture. The wind field reconstruction model includes a position encoding and feature fusion module PEFFM and a physical information-based Transformer encoder PITE. The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. S3. Based on the predicted wind speed, obtain the overall wind field distribution of the urban building complex.
[0007] Optionally, the method for obtaining the building mask includes: Based on the outer contour polygon of the target area buildings and the coordinates (x, y) of the calculation grid points, the spatial relationship between the corresponding point and the polygon is determined for each grid point; When a grid point is located inside the building's outer contour, it is marked as an interior point with a mask value of 1. When a grid point is located outside the building's outer contour, it is marked as a fluid region point with a mask value of 0. When a grid point is located on the building's boundary line, it is classified as an interior point to obtain a 2D building mask that corresponds one-to-one with the computational grid.
[0008] Optionally, the PEFFM performs multi-scale encoding of position coordinates by: using Fourier high-frequency encoding to map two-dimensional position coordinates into high-dimensional position encoding features. This encoding uses a set of log-sampled frequency sequences, calculates sine and cosine function values for each frequency, and concatenates them in the feature dimension to obtain multi-scale position encoding, so as to enhance the model's ability to represent flow field changes at different spatial scales. Furthermore, the PITE Transformer encoder introduces Rotational Position Encoding (RoPE) through attention calculation. Based on the position coordinates, it applies rotational transformation to the query vector Q and the key vector K to explicitly inject relative position information, thereby improving the model's ability to model spatial relative relationships and non-local coupling structures.
[0009] Optionally, the PEFFM employs a multi-stage fusion mechanism to fuse location coding features and wind speed features, including: First, the location encoding features and the wind speed features obtained by normalizing the wind speed values are concatenated in the feature dimension, and then mapped to the main dimension of the model through linear projection to obtain the initial backbone features; Subsequently, the location encoding features are independently linearly transformed and then element-wise summed and injected with the initial backbone features to strengthen the constraint of spatial location information on the backbone representation. Finally, the building mask is processed through a separate linear layer to generate a building information bias vector aligned with the model dimensions. This building information bias vector is broadcast to the initial backbone features, which is equivalent to assigning a unique feature bias to all points inside the building, enabling the network to clearly distinguish between non-flowing solid regions and flowable fluid regions from the first layer.
[0010] Optionally, the PITE includes: an input feature submodule, a multi-layer Transformer encoder submodule, and an output projection submodule; The input feature submodule receives the fused feature sequence output by PEFFM as its only input, without introducing any new input design. The multi-layer Transformer encoder submodule is formed by stacking N identical coding blocks. Each coding block includes: layer normalization, multi-head self-attention, residual connection and feedforward network, which are used to model global spatial dependency and extract contextual wind field features. The output projection submodule maps the encoder output to grid point wind speed prediction and uses building masks as output constraints: at the output end, the predicted wind speed of the grid points inside the building is set to zero to meet the boundary physical constraints.
[0011] Optionally, in the multi-head self-attention, the query vector Q, key vector K, and value vector V are first obtained from the input features through linear transformations. Then, an attention mask matrix M is constructed based on the building mask. M is used to identify point pairs that are not allowed to exchange information with each other between points inside the building and points in the fluid area. During the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. After applying Softmax, the attention weight of this type of point pair approaches zero. Thus, attention is aggregated between effective points in non-building areas, while points inside buildings are only used as boundary constraint objects and do not participate in the propagation of non-physical information. Among them, the use of multi-head self-attention can model the flow field correlation at different spatial scales and directions in parallel in multiple feature subspaces, thereby simultaneously characterizing local flow details and global coupling structures, and improving the accuracy and stability of wind field reconstruction under building occlusion constraints.
[0012] Optionally, the method for constructing the attention mask matrix M based on the building mask includes: Obtain the building mask vector corresponding to the number of attention calculation points S. Where b i =1 indicates that the i-th point is located inside the building, b i =0 indicates that the i-th point is located in a non-building area, and the number of attention points is the number of grid points involved in the calculation; Construct a point-to-point attention mask matrix based on the building mask vector. When the point pair (i,j) belongs to the preset non-physical interaction relationship, let M ij =1, otherwise let M =1, otherwise let M ij =0, wherein the preset non-physical interaction relationship is the interaction relationship between points inside the building and points in non-building areas.
[0013] Optionally, during the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. The specific process is as follows: In multi-head self-attention computation, the query vector Q, key vector K, and value vector V are first obtained from the input features through a linear transformation, and then the scaled dot product score is calculated. ; Then, M is converted into an additive penalty term and added to the scaled dot product score: right The position is assigned a minimal constant penalty value, for The location is assigned a zero penalty value, which means that no additional offset is applied to the original attention score, so that the information interaction between the corresponding point pairs is preserved, that is, attention calculation is allowed to proceed normally; while the penalty value of a very small constant is equivalent to superimposing a very large negative bias on the scaled dot product score. After Softmax normalization, the attention weight at this location is suppressed to approach zero, thereby prohibiting cross-boundary information propagation between points inside the building and points in the fluid region, ensuring that the model only focuses on the physically allowed internal associations within the fluid region.
[0014] Optionally, the loss function used in the wind field reconstruction model training process includes data fitting loss and physical constraint loss:
[0015] in This refers to the physical weighting coefficient;
[0016] The data fitting loss mentioned above Calculate the error between the predicted wind speed and the actual wind speed at all grid points; The physical constraint loss This includes boundary condition constraints, smoothness constraints, and continuity equation constraints to improve the physical consistency of the prediction results. Its complete expression is:
[0017]
[0018]
[0019]
[0020] in , The prediction component given by the deep learning model at the i-th spatial discrete point; Boundary condition constraint loss term Loss boundary To force zero wind speed inside the building and meet the no-slip wall condition, the building mask is calculated. m i =1 represents the sum of squares of the predicted wind speeds within the region; Smoothness constraint loss term Loss smooth To promote the spatial continuity of the wind field, it is represented by penalizing drastic changes in wind speed at adjacent grid points; Continuity equation constraints Loss cont This requires that in the fluid region m i =0 conforms to the law of conservation of mass for incompressible fluids.
[0021] On the other hand, a building cluster wind field reconstruction system based on deep learning and sparse data is provided, the system comprising: The acquisition module is used to acquire wind speed data of sparsely distributed monitoring points in the target area, the location coordinates of all grid points in the target area, and building masks. The number of monitoring points is less than the total number of grid points. The wind field reconstruction model is a wind field reconstruction model based on the Transformer architecture, which is trained by inputting the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask. The wind field reconstruction model includes a position encoding and feature fusion PEFFM and a physically based Transformer encoder PITE. The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. The reconstruction module is used to reconstruct the overall wind field distribution of the urban building complex based on the predicted wind speed.
[0022] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method for reconstructing building cluster wind fields based on deep learning and sparse data.
[0023] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement the above-described method for reconstructing building cluster wind fields based on deep learning and sparse data.
[0024] The beneficial effects of the technical solution provided by this invention include at least the following: This invention is applicable to extremely sparse data scenarios and can effectively utilize approximately 1% of the total spatial data from extremely sparse monitoring points for full-field reconstruction. It has extremely high application value and deployment feasibility in real-world urban environments. Specifically: (1) The method based on deep learning model of this invention realizes fast and efficient wind field acquisition. Once the model is trained, the wind field of the whole domain can be reconstructed from sparse monitoring point data in seconds. Its speed is much faster than the traditional CFD numerical simulation method, which can fully meet the needs of real-time monitoring and rapid evaluation of urban wind environment.
[0025] (2) This invention achieves high-precision reconstruction. Through the self-attention mechanism of Transformer, the model can realize global information interaction between monitoring points and grid points, effectively capturing long-distance spatial dependencies. Its performance is significantly better than traditional interpolation methods that only rely on local information.
[0026] (3) This invention ensures the physical consistency of the prediction results. By introducing a loss function based on physical information (including boundary condition constraints, smoothness constraints and continuity constraints) and integrating building masks into the model structure, it ensures that the prediction results conform to basic physical laws in terms of zero velocity inside the building and continuous flow field space, thereby significantly improving the interpretability and robustness of the model.
[0027] (4) This invention has multi-scale spatial perception capability. Through Fourier multi-frequency coding in PEFFM and RoPE rotational position coding in PITE, the model can simultaneously capture wind field characteristics from the block scale to the local building scale, and finely depict local turbulent structures such as building flow around the building. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a flowchart of a method for reconstructing the wind field of a building complex based on deep learning and sparse data, provided by an embodiment of the present invention. Figure 2 This is a general block diagram of a method for reconstructing the wind field of a building complex based on deep learning and sparse data, provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of the wind field reconstruction result of the wind field reconstruction model provided in the embodiment of the present invention; Figure 4 This is a block diagram of a building cluster wind field reconstruction system based on deep learning and sparse data provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0030] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0031] This invention provides a method for reconstructing the wind field of a building complex based on deep learning and sparse data. This method can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The flowchart of this method is shown below. Figure 2 The diagram shown is an overall block diagram of the method. The processing flow may include the following steps: S1. Obtain wind speed data of sparsely distributed monitoring points in the target area, the location coordinates of all grid points in the target area, and building masks. The number of monitoring points is less than the total number of grid points (the number of monitoring points accounts for less than 1% of the total number of grid points in the entire field). Each wind field data consists of multiple structured tensors: a location array (recording the planar coordinates x, y of grid points), a wind speed array (recording the horizontal wind speed components u and v at the corresponding points), a building mask (identifying the area occupied by buildings), and a monitoring mask (identifying the locations of sparse sensors).
[0032] Optionally, the method for obtaining the building mask includes: Based on the outer contour polygon of the building in the target area and the coordinates (x, y) of the grid points, the spatial relationship between the corresponding point and the polygon is determined for each grid point (the spatial relationship determination between the point and the polygon can be achieved by one of the ray method, the number of turns method or its equivalent geometric determination method, and the specific steps are existing technologies, which will not be described in detail here). When a grid point is located inside the building's outer contour, it is marked as an interior point with a mask value of 1. When a grid point is located outside the building's outer contour, it is marked as a fluid region point with a mask value of 0. When a grid point is located on the building's boundary line, it is classified as an interior point to obtain a 2D building mask that corresponds one-to-one with the computational grid.
[0033] The embodiments of the present invention also include a preprocessing stage, in which all wind speed components are first normalized to eliminate the influence of dimensions. Subsequently, the monitoring points and predicted grid points are concatenated into a unified sequence in a fixed order and stored in conjunction with the corresponding mask to ensure data consistency during batch processing.
[0034] S2. Input the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask into the trained wind field reconstruction model based on the Transformer architecture. The wind field reconstruction model includes a Position Encoding and Feature Fusion Module (PEFFM) and a Physics-Informed Transformer Encoder (PITE). The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. Optionally, the PEFFM performs multi-scale encoding of position coordinates by: using Fourier high-frequency encoding to map two-dimensional position coordinates into high-dimensional position encoding features. This encoding uses a set of log-sampled frequency sequences, calculates sine and cosine function values for each frequency, and concatenates them in the feature dimension to obtain multi-scale position encoding, so as to enhance the model's ability to represent flow field changes at different spatial scales. Furthermore, the PITE Transformer encoder introduces Rotational Position Encoding (RoPE) through attention calculation. Based on the position coordinates, it applies rotational transformation to the query vector Q and the key vector K to explicitly inject relative position information, thereby improving the model's ability to model spatial relative relationships and non-local coupling structures.
[0035] Optionally, the PEFFM employs a multi-stage fusion mechanism to fuse location coding features and wind speed features, including: First, the location encoding features and the wind speed features obtained by normalizing the wind speed values are concatenated in the feature dimension, and then mapped to the main dimension of the model through linear projection to obtain the initial backbone features; Subsequently, the location encoding features are independently linearly transformed and then element-wise summed and injected with the initial backbone features to strengthen the constraint of spatial location information on the backbone representation. Finally, the building mask is processed through a separate linear layer to generate a building information bias vector aligned with the model dimensions. This building information bias vector is broadcast to the initial backbone features, which is equivalent to assigning a unique feature bias to all points inside the building, enabling the network to clearly distinguish between non-flowing solid regions and flowable fluid regions from the first layer.
[0036] Optionally, the PITE includes: an input feature submodule, a multi-layer Transformer encoder submodule, and an output projection submodule; The input feature submodule receives the fused feature sequence output by PEFFM as its only input, without introducing any new input design. The multi-layer Transformer encoder submodule is formed by stacking N identical coding blocks. Each coding block includes: layer normalization, multi-head self-attention, residual connection and feedforward network, which are used to model global spatial dependency and extract contextual wind field features. The output projection submodule maps the encoder output to grid point wind speed prediction and uses building masks as output constraints: at the output end, the predicted wind speed of the grid points inside the building is set to zero to meet the boundary physical constraints.
[0037] Optionally, in the multi-head self-attention, the query vector Q, key vector K, and value vector V are first obtained from the input features through linear transformations. Then, an attention mask matrix M is constructed based on the building mask. M is used to identify point pairs that are not allowed to exchange information with each other between points inside the building and points in the fluid area. During the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. After applying Softmax, the attention weight of this type of point pair approaches zero. Thus, attention is aggregated between effective points in non-building areas, while points inside buildings are only used as boundary constraint objects and do not participate in the propagation of non-physical information. Among them, the use of multi-head self-attention can model the flow field correlation at different spatial scales and directions in parallel in multiple feature subspaces, thereby simultaneously characterizing local flow details and global coupling structures, and improving the accuracy and stability of wind field reconstruction under building occlusion constraints.
[0038] Optionally, the method for constructing the attention mask matrix M based on the building mask includes: Obtain the building mask vector corresponding to the number of attention calculation points S. Where b i =1 indicates that the i-th point is located inside the building, b i =0 indicates that the i-th point is located in a non-building area, and the number of attention points is the number of grid points involved in the calculation; Construct a point-to-point attention mask matrix based on the building mask vector. When the point pair (i,j) belongs to the preset non-physical interaction relationship, let M ij =1, otherwise let M =1, otherwise let M ij =0, wherein the preset non-physical interaction relationship is the interaction relationship between points inside the building and points in non-building areas.
[0039] Optionally, during the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. The specific process is as follows: In multi-head self-attention computation, the query vector Q, key vector K, and value vector V are first obtained from the input features through a linear transformation, and then the scaled dot product score is calculated. ; Then, M is converted into an additive penalty term and added to the scaled dot product score: right The position is assigned a minimal constant penalty value, for The location is assigned a zero penalty value, which means that no additional offset is applied to the original attention score, so that the information interaction between the corresponding point pairs is preserved, that is, attention calculation is allowed to proceed normally. On the other hand, assigning a very small constant penalty value (e.g. -1e9, which is much smaller than the lower bound of the normal attention score) is equivalent to superimposing a very large negative bias on the scaled dot product score. After Softmax normalization, the attention weight at this location is suppressed to approach zero, thereby prohibiting cross-boundary information propagation between points inside the building and points in the fluid region, ensuring that the model only focuses on the physically allowed internal associations within the fluid region.
[0040] Optionally, the loss function used in the wind field reconstruction model training process includes data fitting loss and physical constraint loss:
[0041] in Physical weighting coefficient ( A dynamic adaptive strategy is adopted to determine this value: in the early stages of training, this value is set to a small value (such as 0.01) to allow the model to fit the data first; as training progresses, it is gradually increased (such as increasing to 0.1) to force the model to conform to physical constraints.
[0042] The data fitting loss Calculate the error between the predicted wind speed and the actual wind speed at all grid points; The physical constraint loss This includes boundary condition constraints, smoothness constraints, and continuity equation constraints to improve the physical consistency of the prediction results. Its complete expression is:
[0043]
[0044]
[0045]
[0046] in , The prediction component given by the deep learning model at the i-th spatial discrete point; Boundary condition constraint loss term Loss boundary To force zero wind speed inside the building and meet the no-slip wall condition, the building mask is calculated. m i =1 represents the sum of squares of the predicted wind speeds within the region; Smoothness constraint loss term Loss smoothTo promote the spatial continuity of the wind field, it is represented by penalizing drastic changes in wind speed at adjacent grid points; Continuity equation constraints Loss cont This requires that in the fluid region m i =0 conforms to the law of conservation of mass for incompressible fluids.
[0047] S3. Based on the predicted wind speed, obtain the overall wind field distribution of the urban building complex.
[0048] Figure 3 This is a schematic diagram of the wind field reconstruction result provided by the deep learning model in an embodiment of the present invention.
[0049] like Figure 4 As shown, this embodiment of the invention also provides a building cluster wind field reconstruction system based on deep learning and sparse data, the system comprising: The acquisition module 410 is used to acquire wind speed data of sparsely arranged monitoring points in the target area, the position coordinates of all grid points in the target area, and building masks, wherein the number of monitoring points is less than the total number of grid points; Wind field reconstruction model 420 is a wind field reconstruction model based on the Transformer architecture trained by inputting the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask. The wind field reconstruction model includes a position encoding and feature fusion PEFFM and a physically based Transformer encoder PITE. The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. Reconstruction module 430 is used to reconstruct the overall wind field distribution of the urban building complex based on the predicted wind speed.
[0050] The wind field reconstruction system for building clusters based on deep learning and sparse data provided in this embodiment of the invention has a functional structure that corresponds to the wind field reconstruction method for building clusters based on deep learning and sparse data provided in this embodiment of the invention, and will not be described again here.
[0051] Figure 5This is a schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present invention. The electronic device 500 may vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs) 501 and one or more memories 502. The memory 502 stores at least one instruction, which is loaded and executed by the processor 501 to implement the steps of the above-described method for reconstructing the wind field of a building complex based on deep learning and sparse data.
[0052] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions that can be executed by a processor in a terminal to complete the aforementioned method for reconstructing building cluster wind fields based on deep learning and sparse data. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.
[0053] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for reconstructing wind fields in building clusters based on deep learning and sparse data, characterized in that, The method includes: S1. Obtain wind speed data of sparsely distributed monitoring points in the target area, the location coordinates of all grid points in the target area, and building masks. The number of monitoring points is less than the total number of grid points. S2. Input the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask into the trained wind field reconstruction model based on the Transformer architecture. The wind field reconstruction model includes a position encoding and feature fusion module PEFFM and a physical information-based Transformer encoder PITE. The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. S3. Based on the predicted wind speed, obtain the overall wind field distribution of the urban building complex.
2. The method according to claim 1, characterized in that, The method for obtaining the building mask includes: Based on the outer contour polygon of the target area buildings and the coordinates (x, y) of the calculation grid points, the spatial relationship between the corresponding point and the polygon is determined for each grid point; When a grid point is located inside the building's outer contour, it is marked as an interior point with a mask value of 1. When a grid point is located outside the building's outer contour, it is marked as a fluid region point with a mask value of 0. When a grid point is located on the building's boundary line, it is classified as an interior point to obtain a 2D building mask that corresponds one-to-one with the computational grid.
3. The method according to claim 1, characterized in that, The PEFFM multi-scale encoding of position coordinates includes: using Fourier high-frequency encoding to map two-dimensional position coordinates into high-dimensional position encoding features. This encoding uses a set of log-sampled frequency sequences, calculates sine and cosine function values for each frequency, and concatenates them in the feature dimension to obtain multi-scale position codes, so as to enhance the model's ability to represent flow field changes at different spatial scales. Furthermore, the PITE Transformer encoder introduces Rotational Position Encoding (RoPE) through attention calculation. Based on the position coordinates, it applies rotational transformation to the query vector Q and the key vector K to explicitly inject relative position information, thereby improving the model's ability to model spatial relative relationships and non-local coupling structures.
4. The method according to claim 1, characterized in that, The PEFFM employs a multi-stage fusion mechanism to fuse location coding features and wind speed features, including: First, the location encoding features and the wind speed features obtained by normalizing the wind speed values are concatenated in the feature dimension, and then mapped to the main dimension of the model through linear projection to obtain the initial backbone features; Subsequently, the location encoding features are independently linearly transformed and then element-wise summed and injected with the initial backbone features to strengthen the constraint of spatial location information on the backbone representation. Finally, the building mask is processed through a separate linear layer to generate a building information bias vector aligned with the model dimensions. This building information bias vector is broadcast to the initial backbone features, which is equivalent to assigning a unique feature bias to all points inside the building, enabling the network to clearly distinguish between non-flowing solid regions and flowable fluid regions from the first layer.
5. The method according to claim 1, characterized in that, The PITE includes: an input feature submodule, a multi-layer Transformer encoder submodule, and an output projection submodule; The input feature submodule receives the fused feature sequence output by PEFFM as its only input, without introducing any new input design. The multi-layer Transformer encoder submodule is formed by stacking N identical coding blocks. Each coding block includes: layer normalization, multi-head self-attention, residual connection and feedforward network, which are used to model global spatial dependency and extract contextual wind field features. The output projection submodule maps the encoder output to grid point wind speed prediction and uses building masks as output constraints: at the output end, the predicted wind speed of the grid points inside the building is set to zero to meet the boundary physical constraints.
6. The method according to claim 5, characterized in that, In the multi-head self-attention method, the query vector Q, key vector K, and value vector V are first obtained by linear transformation of the input features; Then, an attention mask matrix M is constructed based on the building mask. M is used to identify point pairs that are not allowed to exchange information with each other between points inside the building and points in the fluid area. During the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. After applying Softmax, the attention weight of this type of point pair approaches zero. Thus, attention is aggregated between effective points in non-building areas, while points inside buildings are only used as boundary constraint objects and do not participate in the propagation of non-physical information. Among them, the use of multi-head self-attention can model the flow field correlation at different spatial scales and directions in parallel in multiple feature subspaces, thereby simultaneously characterizing local flow details and global coupling structures, and improving the accuracy and stability of wind field reconstruction under building occlusion constraints.
7. The method according to claim 6, characterized in that, The method for constructing the attention mask matrix M based on building masks includes: Obtain the building mask vector corresponding to the number of attention calculation points S. Where b i =1 indicates that the i-th point is located inside the building, b i =0 indicates that the i-th point is located in a non-building area, and the number of attention points is the number of grid points involved in the calculation; Construct a point-to-point attention mask matrix based on the building mask vector. When the point pair (i,j) belongs to the preset non-physical interaction relationship, let M ij =1, otherwise let M =1, otherwise let M ij =0, wherein the preset non-physical interaction relationship is the interaction relationship between points inside the building and points in non-building areas.
8. The method according to claim 6, characterized in that, In the attention score calculation phase, M is applied as an additive constraint to the scaled dot product score. The specific process is as follows: In multi-head self-attention computation, the query vector Q, key vector K, and value vector V are first obtained from the input features through a linear transformation, and then the scaled dot product score is calculated. ; Then, M is converted into an additive penalty term and added to the scaled dot product score: right The position is assigned a minimal constant penalty value, for The location is assigned a zero penalty value, which means that no additional offset is applied to the original attention score, so that the information interaction between the corresponding point pairs is preserved, that is, attention calculation is allowed to proceed normally; while the penalty value of a very small constant is equivalent to superimposing a very large negative bias on the scaled dot product score. After Softmax normalization, the attention weight at this location is suppressed to approach zero, thereby prohibiting cross-boundary information propagation between points inside the building and points in the fluid region, ensuring that the model only focuses on the physically allowed internal associations within the fluid region.
9. The method according to claim 1, characterized in that, The loss function used in the training of the wind field reconstruction model includes data fitting loss and physical constraint loss: in This refers to the physical weighting coefficient; The data fitting loss mentioned above Calculate the error between the predicted wind speed and the actual wind speed at all grid points; The physical constraint loss This includes boundary condition constraints, smoothness constraints, and continuity equation constraints to improve the physical consistency of the prediction results. Its complete expression is: in , The prediction component given by the deep learning model at the i-th spatial discrete point; Boundary condition constraint loss term Loss boundary To force zero wind speed inside the building and meet the no-slip wall condition, the building mask is calculated. m i =1 represents the sum of squares of the predicted wind speeds within the region; Smoothness constraint loss term Loss smooth To promote the spatial continuity of the wind field, it is represented by penalizing drastic changes in wind speed at adjacent grid points; Continuity equation constraints Loss cont This requires that in the fluid region m i =0 conforms to the law of conservation of mass for incompressible fluids.
10. A building cluster wind field reconstruction system based on deep learning and sparse data, characterized in that, The system includes: The acquisition module is used to acquire wind speed data of sparsely distributed monitoring points in the target area, the location coordinates of all grid points in the target area, and building masks. The number of monitoring points is less than the total number of grid points. The wind field reconstruction model is a wind field reconstruction model based on the Transformer architecture, which is trained by inputting the wind speed data of the monitoring points, the position coordinates of all grid points and the building mask. The wind field reconstruction model includes a position encoding and feature fusion PEFFM and a physically based Transformer encoder PITE. The PEFFM method encodes location coordinates at multiple scales to obtain location coding features, and then fuses the location coding features with wind speed features using a multi-stage fusion mechanism to generate a fused feature sequence. The PITE includes a multi-layer Transformer encoder block, which processes the fused feature sequence through a global self-attention mechanism to realize information interaction between monitoring points and grid points, and outputs the predicted wind speed of all grid points in the field. The reconstruction module is used to reconstruct the overall wind field distribution of the urban building complex based on the predicted wind speed.