A method and device for diagnosing internal defects of a casting, a storage medium and an electronic device
By acquiring a three-dimensional digital model of the casting and using CT scanning technology, combined with anomaly analysis of casting parameters, the localization of internal defects in the casting is optimized, solving the problem of inaccurate localization of internal defects in castings in existing technologies, and achieving higher localization accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TYCON ALLOY IND (ZHONGSHAN) CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-29
Smart Images

Figure CN122115377A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect diagnosis technology, specifically to a method, apparatus, storage medium, and electronic device for diagnosing internal defects in castings. Background Technology
[0002] Castings are metal products with specific shapes and dimensions obtained by pouring molten metal (such as iron, aluminum, and copper alloys) into a pre-made mold (sand mold, metal mold, etc.), allowing the metal to cool and solidify, and then removing the mold. They are the fundamental technological product for obtaining metal parts in mechanical manufacturing. Furthermore, the final quality of castings (including whether they are qualified and whether they have defects) is directly and closely related to casting parameters. The setting and control of casting parameters are the core factors determining whether castings that meet requirements can be obtained. Casting parameters are key process data that can be artificially controlled during the casting production process. They directly determine the filling state of the molten metal, the solidification law, and the final quality of the casting. The core parameters are set around three dimensions: "molten metal control," "mold environment," and "forming process," and are the core basis for ensuring the qualification of castings. In addition, internal defects in castings refer to structural anomalies or material inhomogeneities hidden inside the casting after solidification, which cannot be directly observed with the naked eye. These defects can damage the density and mechanical properties of the casting, and in severe cases, may lead to breakage, leakage, or even safety accidents during use.
[0003] Currently, the common method for diagnosing internal defects in castings is as follows: Inspection personnel use an ultrasonic flaw detector to scan the casting to be diagnosed. The ultrasonic flaw detector displays the reflected waves on a screen, and the inspection personnel, based on their experience and the waveform, height, and other characteristics of the reflected waves, locate the defects. This method relies heavily on the inspector's experience and is highly subjective, resulting in poor accuracy in locating internal defects in the casting. Summary of the Invention
[0004] To improve the accuracy of locating internal defects in castings, this application provides a method, apparatus, storage medium, and electronic device for diagnosing internal defects in castings.
[0005] The first aspect of this application provides a method for diagnosing internal defects in castings, specifically including: Obtain the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed; Based on the geometric feature information, determine the CT scan path corresponding to the casting to be diagnosed; According to the CT scan path, the casting to be diagnosed is subjected to a CT scan to obtain X-ray projection data; The X-ray projection data is input into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed. The initial location of each actual internal defect is determined by a preset CT reconstruction algorithm. Based on the historical internal defects that occurred in historical castings and the historical areas where such internal defects existed when a single casting parameter dimension was abnormal, the initial positions of each casting are adjusted and optimized to obtain the corresponding final positions. The historical castings and the casting to be diagnosed are the same type of castings with the same material and size.
[0006] By employing the aforementioned technical solution, the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed is obtained, thereby determining the geometric features of the casting body. Based on this geometric feature information and combined with the geometric features of the casting, a CT scanning path capable of omnidirectional scanning of the casting is determined. Then, the casting is scanned according to the CT scanning path, thus more comprehensively detecting internal defects. Next, X-ray projection data (data reflecting the three-dimensional structure inside the casting) is input into the defect recognition model. The defect recognition model analyzes the three-dimensional structure reflected in the X-ray projection data to accurately identify the actual internal defects. Furthermore, through a CT reconstruction algorithm, the three-dimensional density distribution inside the casting is reconstructed, thereby more accurately pinpointing the initial location of the actual internal defects, avoiding the ambiguity of human judgment and improving the accuracy of internal defect localization. Finally, by combining historical internal defects and historical regions, the probability of the actual internal defects in the casting being located at the corresponding initial positions is analyzed, thereby achieving verification and optimization of each initial position, further improving the accuracy of internal defect localization.
[0007] In one implementation, the step of adjusting and optimizing each initial position based on historical internal defects that have occurred in historical castings and historical regions where such internal defects exist, when a single casting parameter dimension is abnormal, to obtain the corresponding final position, specifically includes: Based on multiple historical internal defects that have appeared in historical castings when a single casting parameter dimension is abnormal, at least one target internal defect under the casting parameter dimension is determined, and the target internal defect is a historical internal defect that is prone to appear in historical castings. Based on multiple historical regions where the internal defects of the target exist, at least one target region corresponding to the internal defects of the target is determined, wherein the target region is a historical region where the internal defects of the target are prone to occur. A first weighting coefficient is determined for the target internal defect, and a second weighting coefficient is determined for each target region corresponding to the target internal defect. The first weighting coefficient represents the probability of the target internal defect appearing in the historical casting, and the second weighting coefficient represents the probability of the target internal defect appearing in the corresponding target region in the historical casting. Based on the first weighting coefficient and each of the second weighting coefficients, the initial positions are adjusted and optimized to obtain the corresponding final positions.
[0008] In one implementation, adjusting and optimizing each of the initial positions based on the first weighting coefficient and each of the second weighting coefficients to obtain the corresponding final position specifically includes: When the target internal defect is an actual internal defect, the target internal defect is determined as a reference internal defect. If the target area corresponding to the reference internal defect contains the initial position of the reference internal defect, the corresponding target area is determined as a reference area. The first weighting coefficient of the reference internal defect is multiplied by the second weighting coefficient of the reference region to obtain the first product result; The first product results corresponding to each of the aforementioned internal defects are summed to obtain the first comprehensive result; If the first comprehensive result is greater than the preset first threshold, then the casting parameter dimension is determined as the dimension to be checked. The dimension to be checked is the casting parameter dimension that needs to be checked to see if the casting parameters are abnormal. Based on at least one of the dimensions to be inspected, determine the actual abnormal dimension in which the casting parameters of the casting to be diagnosed are abnormal; Based on the first weight coefficient and the second weight coefficient corresponding to at least one of the actual abnormal dimensions, the initial positions are adjusted and optimized to obtain the corresponding final positions.
[0009] In one implementation, determining the actual abnormal dimension of the casting parameters of the casting to be diagnosed as abnormal based on at least one of the dimensions to be inspected specifically includes: Obtain a first casting parameter for at least one dimension to be inspected of the casting to be diagnosed, and obtain a second casting parameter for at least one non-inspection dimension of the casting to be diagnosed, wherein the non-inspection dimension is a casting parameter dimension other than the dimension to be inspected. Based on the first comprehensive result corresponding to each dimension to be inspected, the first judgment order of the corresponding dimensions to be inspected is determined, and the second judgment order of the non-inspection dimensions is determined. The larger the first comprehensive result, the earlier the corresponding judgment order is, and the second judgment order is after the first judgment order. According to the first judgment order, determine whether there is an abnormality in the first casting parameter of the corresponding dimension to be inspected. If there is an abnormality, the corresponding dimension to be inspected is determined as the actual abnormal dimension. According to the second judgment order, determine whether there is an abnormality in the second casting parameter of the corresponding non-inspection dimension. If there is an abnormality, the corresponding non-inspection dimension is determined as the actual abnormal dimension.
[0010] In one implementation, adjusting and optimizing each of the initial positions based on a first weight coefficient and a second weight coefficient corresponding to at least one of the actual anomaly dimensions to obtain the corresponding final positions specifically includes: The first weight coefficient of the internal defect of the target under the actual anomaly dimension is multiplied with the second weight coefficient of the corresponding target region to obtain the second product result; The second product results corresponding to the same target region in each of the actual anomaly dimensions are summed to obtain the second comprehensive result. The second comprehensive result is compared with a preset second threshold. If the second comprehensive result is greater than the second threshold, the target area corresponding to the second comprehensive result is determined as an important area. If the initial position is within the important region, the corresponding actual internal defect is determined as the defect to be verified, and the largest second product result is selected from each second product result corresponding to the important region. If the target internal defect corresponding to the result of the maximum second product is the defect to be verified, then the initial position of the defect to be verified is determined as the final position.
[0011] In one embodiment, the method further includes: Based on the second comprehensive result corresponding to each important region, the scanning order of the corresponding important regions is determined. The larger the second comprehensive result, the earlier the corresponding scanning order. Based on the scanning order, at least one alternative scanning path is determined for the casting to be diagnosed. The alternative scanning path includes switching sub-paths of different switching links, and the switching link includes two important regions that need to be switched. The second comprehensive results corresponding to the non-critical areas traversed by the switching sub-paths of the same switching link in each of the candidate scanning paths are summed to obtain the risk values of multiple path defects. The non-critical areas are target areas other than the critical areas. The maximum risk value is selected from all the risk values, and the switching sub-path corresponding to the maximum risk value is determined as the final sub-path. Based on all the final sub-paths, the reference scanning path of the casting to be diagnosed is determined. When the CT scan path is consistent with the reference scan path, the CT scan path verification is deemed successful.
[0012] In one embodiment, the method further includes: Cluster analysis is performed on all the important regions to obtain multiple distribution regions, each of which contains at least one important region; The initial scanning frequency corresponding to the distribution area is determined based on the distribution density of important areas within the distribution area. Identify high-risk defects in each important region included in the distribution area, determine at least one defect combination from all the high-risk defects, and determine the aggravation coefficient of each defect combination. The larger the aggravation coefficient, the greater the aggravation effect of the corresponding defect combination on the quality of the casting to be diagnosed. Based on the aggravation coefficient, the initial scanning frequency is optimized to obtain the final scanning frequency of the distribution area.
[0013] A second aspect of this application provides a device for diagnosing internal defects in castings, specifically comprising: The information acquisition module is used to acquire the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed; The path determination module is used to determine the CT scan path corresponding to the casting to be diagnosed based on the geometric feature information. The casting scanning module is used to perform CT scanning on the casting to be diagnosed according to the CT scanning path to obtain X-ray projection data; The defect identification module is used to input the X-ray projection data into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed. The location determination module is used to determine the initial location of each of the actual internal defects using a preset CT reconstruction algorithm; The position optimization module is used to adjust and optimize each initial position based on the historical internal defects that have occurred in historical castings and the historical areas where the historical internal defects exist when a single casting parameter dimension is abnormal, so as to obtain the corresponding final position. The historical castings and the casting to be diagnosed are the same type of castings with the same material and size.
[0014] By adopting the above technical solution, the information acquisition module acquires geometric feature information, the path determination module determines the CT scan path corresponding to the casting to be diagnosed based on the geometric feature information, the casting scanning module performs a CT scan on the casting to be diagnosed based on the CT scan path to obtain X-ray projection data, then the defect identification module inputs the X-ray projection data into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed, the position determination module determines the initial position of each actual internal defect through a preset CT reconstruction algorithm, and finally, the position optimization module adjusts and optimizes each initial position to obtain the corresponding final position.
[0015] A third aspect of this application provides a computer-readable storage medium storing a computer program that, when loaded and executed by a processor, performs the steps of the method described in any one of the first aspects.
[0016] A fourth aspect of this application provides an electronic device, specifically comprising: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, the processor being configured to load and execute the computer program stored in the memory to cause the electronic device to perform the method as described in any one of the first aspects.
[0017] In summary, this application includes at least one of the following beneficial technical effects: It acquires the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed, thereby determining the geometric features of the casting body. Then, based on this geometric feature information and combined with the geometric features of the casting, it determines a CT scanning path that can perform a full-range scan of the casting. Next, the casting is scanned according to the CT scanning path, thereby more comprehensively detecting internal defects. Then, X-ray projection data (data reflecting the three-dimensional structure inside the casting) is input into the defect recognition model. The defect recognition model analyzes the three-dimensional structure reflected by the X-ray projection data to accurately identify the actual internal defects. Furthermore, through a CT reconstruction algorithm, the three-dimensional density distribution inside the casting is restored, thereby more accurately locking the initial position of the actual internal defects, avoiding the ambiguity of human judgment, and improving the accuracy of internal defect localization. Finally, by combining historical internal defects and historical regions, the probability of the actual internal defects of the casting being located at the corresponding initial positions is analyzed, thereby realizing the verification and optimization of each initial position, further improving the accuracy of internal defect localization. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a method for diagnosing internal defects in castings provided in an embodiment of this application; Figure 2 This is a schematic diagram illustrating the relationship between an internal defect of a target and a target region, provided in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of a casting internal defect diagnosis device provided in an embodiment of this application; Figure 4 This is a schematic diagram of another casting internal defect diagnosis device provided in the embodiments of this application.
[0019] Explanation of reference numerals in the attached diagram: 11. Information acquisition module; 12. Path determination module; 13. Casting scanning module; 14. Defect identification module; 15. Position determination module; 16. Position optimization module; 17. Path verification module; 18. Frequency determination module. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0021] In the description of the embodiments of this application, words such as "exemplarily," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.
[0022] In the description of the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, B existing alone, or A and B existing simultaneously. Furthermore, unless otherwise stated, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0023] See Figure 1 This application discloses a flowchart of a method for diagnosing internal defects in castings, which can be implemented using a computer program or run on a casting internal defect diagnosis device based on the von Neumann architecture. The computer program can be integrated into an application or run as a standalone tool application, specifically including: S101: Obtain the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed.
[0024] Specifically, in this embodiment, the casting to be diagnosed is a casting produced through the casting process that requires internal defect inspection and location. The three-dimensional digital model is a CAD digital model of the casting to be diagnosed; in other embodiments, the three-dimensional digital model can also be a three-dimensional scanning model. The three-dimensional digital model maintains the same dimensions as the casting to be diagnosed. Geometric feature information refers to the mathematical or data-driven expression describing the shape, structure, and spatial relationships of the casting to be diagnosed, and is a core component of the three-dimensional digital model. In this embodiment, geometric feature information includes, but is not limited to, information such as wall thickness variation and curvature.
[0025] The method for diagnosing internal defects in castings disclosed in this application is implemented using a server as the execution entity. The server is wirelessly connected to a terminal, which is a personal computer or tablet computer with a defect diagnosis-related client installed. The server serves as the backend server for the client and can be a standalone physical server or a cluster of multiple physical servers. The server also wirelessly communicates with an industrial robot equipped with an X-ray source and a detection source. Further, a feasible method for obtaining the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed is to acquire the CAD digital model corresponding to the casting to be diagnosed sent by the terminal, then import the CAD digital model into a preset CAD software, and finally obtain the geometric feature information. In other embodiments, the geometric feature information of the CAD digital model can also be obtained through a preset OpenCASCADE. OpenCASCADE is a powerful CAD modeling library that provides rich geometric processing functions and is suitable for feature extraction and analysis of high-precision CAD graphics.
[0026] S102: Determine the CT scan path corresponding to the casting to be diagnosed based on the geometric feature information.
[0027] Specifically, after determining the geometric features of the 3D digital model, it is necessary to determine the corresponding CT scan path for the casting to be diagnosed. This allows the industrial robot to perform a comprehensive, multi-angle scan of the casting's interior based on this CT scan path, in order to identify internal defects. The core purpose of the CT equipment's X-ray beam moving around the casting is to completely acquire information about the casting's internal structure, thereby detecting internal defects such as porosity, cracks, and inclusions. In this embodiment, a feasible method for determining the CT scan path is as follows: A pre-defined intelligent planning algorithm, combined with geometric feature information, determines the CT scan path corresponding to the casting to be diagnosed. The intelligent planning algorithm can be a fast greedy algorithm. The specific process of determining the CT scan path using the fast greedy algorithm is as follows: First, a basic scan path (e.g., 360° spiral scan) is set, and ray tracing simulation is performed using a CAD model to identify obstructed areas (areas where rays cannot penetrate, i.e., blind spots). Second, based on the geometric feature information of the blind spot location, the "scanning angle" is calculated: that is, the direction of the ray that can penetrate the blind spot (by solving for the intersection of the ray and the casting surface, the effective angle is deduced). Third, the area with the largest blind spot area is scanned first, and ray tracing is performed again after each scan to update the blind spot. Termination condition: the percentage of the blind spot area < a threshold (e.g., 0.1%, which satisfies the requirement of no blind spots). Finally, the basic path and the scanning path are merged to optimize the motion trajectory. The above process for determining the CT scan path is existing technology and will not be elaborated further here.
[0028] S103: Perform a CT scan on the casting to be diagnosed according to the CT scan path to obtain X-ray projection data.
[0029] S104: Input the X-ray projection data into the preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed.
[0030] Specifically, after the CT scan path is determined, an industrial robot performs a CT scan on the casting to be diagnosed according to the CT scan path, obtaining X-ray projection data. This X-ray projection data is digital image information generated during the CT scan of the casting. The X-rays emitted by the X-ray source mounted on the industrial robot penetrate the casting and are received and converted by the detector. Essentially, it records the attenuation differences of X-rays at different locations within the casting, serving as the "raw material" for subsequent reconstruction of the casting's internal three-dimensional structure and defect detection.
[0031] Furthermore, the X-ray projection data obtained after scanning the casting to be diagnosed is input into a preset defect recognition model to identify at least one actual internal defect in the casting. The defect recognition model is a trained 3D U-Net model; in other embodiments, it can also be a trained 3D Attention U-Net model. The training process is as follows: X-ray projection data samples labeled with defect contours and defect categories are preprocessed, and then the preprocessed samples are input into the model for training. During the process, the hyperparameters of the model are continuously adjusted to minimize the preset cross-entropy loss function until the model converges, resulting in a defect recognition model capable of identifying and segmenting internal defects. This model training process is existing technology and will not be described in detail here.
[0032] S105: Determine the initial location of each actual internal defect through a preset CT reconstruction algorithm.
[0033] Specifically, based on the identified actual internal defects, a preset CT reconstruction algorithm is used to generate actual 3D point clouds of each actual internal defect in digital space. Based on these point clouds, the corresponding actual 3D data of the internal defects is automatically calculated. This actual 3D data includes, but is not limited to, the spatial coordinates, volume, shape complexity, and distance from critical load-bearing surfaces of the internal defects. Finally, the spatial coordinates of the internal defects are determined as their initial positions. This is existing technology and will not be elaborated further. The CT reconstruction algorithm is a core technology that uses X-ray projection data obtained from CT scans to mathematically deduce the 3D internal structure of the casting to be diagnosed. Essentially, it "reconstructs the 3D density distribution from 2D projections from multiple angles," ultimately generating 3D tomographic images that can be used for defect detection and structural analysis.
[0034] In other embodiments, based on step S105, the actual 3D point cloud of each actual internal defect can be obtained. Then, the actual 3D point cloud of each actual internal defect is superimposed onto the 3D digital model of the casting to be diagnosed to obtain a digital twin of the defects corresponding to the casting to be diagnosed. That is, a digital twin that can intuitively present the internal defects of the casting to be diagnosed. The specific superposition process is as follows: the 3D digital model and the actual 3D point cloud are registered using a preset ICP algorithm, and then the two are superimposed using the MeshLab tool. Further, the quantitative parameters of each actual internal defect in the defect digital twin (such as the type, size, and depth of the defect) are input into a preset repair scheme prediction model to obtain a suitable repair scheme corresponding to each actual internal defect. The repair scheme prediction model can be a trained classification model or a regression model. The training process is briefly described as follows: the type, size, and depth of historical defects are used as sample data, and this sample data and the corresponding defect repair scheme are used to train the model simultaneously. During the process, the model parameters are tuned using the back gradient algorithm, and finally a model that can generate a relatively suitable repair scheme for the internal defects is obtained.
[0035] S106: Based on the historical internal defects that have occurred in historical castings and the historical areas where historical internal defects exist when a single casting parameter dimension is abnormal, adjust and optimize each initial position to obtain the corresponding final position.
[0036] Specifically, in this application, the casting parameter dimension refers to the dimensions involved in the casting parameters used during the casting process. Casting parameters are key, controllable process data during casting, which directly determine the filling and solidification state of the molten metal and the final quality of the casting, and may even be related to the generation and location of internal defects in the casting. Casting parameter dimensions include, but are not limited to, pouring temperature, molten metal purity, pouring speed, and riser location.
[0037] Furthermore, based on historical casting records cached in the database, multiple historical internal defects that appeared in historical castings when a single casting parameter dimension was abnormal during the historical casting process are obtained. Historical casting records include, but are not limited to, information such as the abnormal casting parameter dimension, the corresponding internal defects, and the internal regions containing these defects. The historical castings and the casting to be diagnosed are of the same type, with identical material and dimensions. For example, both the historical casting and the casting to be diagnosed are gearbox housings made of aluminum alloy. Historical internal defects are internal defects that appeared in the historical castings. Internal defects refer to structural anomalies hidden within the casting after solidification, which cannot be directly observed with the naked eye. These defects can damage the density and mechanical properties of the casting, and in severe cases, may lead to casting failure during use. For example, internal defects include, but are not limited to, porosity, shrinkage cavities, internal cracks, and cold shuts.
[0038] The frequency of recurrence of a single historical internal defect is counted across all historical internal defects. If the frequency exceeds a preset frequency threshold, it indicates that the corresponding historical internal defect is more frequent in the historical casting under abnormal casting parameter dimensions. This historical internal defect is then identified as a target internal defect, i.e., a historical internal defect that is prone to occur in the historical casting. At least one target internal defect exists. Further, based on the aforementioned historical casting records, multiple historical regions containing a single target internal defect are obtained. The number of times a single historical region recurs across all historical regions is counted. If the number exceeds a preset frequency threshold, this historical region is identified as the target region corresponding to the target internal defect, i.e., a historical region prone to the occurrence of the target internal defect. At least one target region exists. Additionally, a historical region is a three-dimensional spatial region within the historical casting. For example, if the target internal defect is porosity, then a historical region containing porosity can be represented as: X: 15~20mm, Y: 30~35mm, Z: 25~30mm.
[0039] Further, a first weighting coefficient for the target internal defect is determined. This first weighting coefficient is the ratio of the frequency of recurrence of the target internal defect to the sum of the frequencies of recurrence of all target internal defects. The first weighting coefficient characterizes the probability of the target internal defect appearing in a historical casting when an anomaly exists in a single casting parameter dimension. Then, a second weighting coefficient is determined for each target region corresponding to the target internal defect. This second weighting coefficient is the ratio of the number of recurrences of a single target region to the sum of the numbers of recurrences of all target regions. The second weighting coefficient characterizes the probability of the target internal defect appearing in the corresponding target region within a historical casting. For details, please refer to [link to relevant documentation]. Figure 2 In the figure, target area 211 and target area 212 are both target areas corresponding to internal defects 21.
[0040] For example, when there is an anomaly in the casting parameter dimension, there are target internal defects A, target internal defects B, and target internal defects C. Target internal defect A recurs 60 times, target internal defect B recurs 20 times, and target internal defect C recurs 20 times. Then, the first weight coefficient of target internal defect A is: 60 times / (60 times + 20 times + 20 times) = 0.6. Furthermore, target internal defect A corresponds to target regions a1, a2, and a3. Target region a1 recurs 40 times, target region a2 recurs 50 times, and target region a3 recurs 10 times. Then, the second weight coefficient of target region a1 is: 40 times / (40 times + 50 times + 10 times) = 0.4.
[0041] Furthermore, based on the first and second weighting coefficients under a single casting parameter dimension, the initial positions of each actual internal defect are adjusted and optimized to more accurately locate the internal defects of the casting to be diagnosed, ultimately obtaining the corresponding final positions. One feasible implementation method is as follows: When the target internal defect is an actual internal defect, it is designated as a reference internal defect. If the target region corresponding to the reference internal defect contains the initial position of the reference internal defect, then the corresponding target region is designated as the reference region, i.e., the region where the actual internal defect is distributed within the casting to be diagnosed. The first weighting coefficient of the reference internal defect is multiplied by the second weighting coefficient of the reference region to obtain a first product result. The first product result characterizes the probability of a reference internal defect appearing within the reference region when an anomaly exists in a single casting parameter dimension. Similarly, other target internal defects that are actual internal defects can also have their corresponding first product results determined according to this logic. Furthermore, the first product results corresponding to each reference internal defect are summed to obtain a first comprehensive result. The first comprehensive result characterizes the probability of an anomaly actually existing in a single casting parameter dimension during the casting process of the casting to be diagnosed, given each actual internal defect and its initial position. The first comprehensive result is compared with the preset first threshold. If the first comprehensive result is greater than the first threshold, it indicates that there is a high probability that the casting parameter dimension is actually abnormal in the casting process of the casting to be diagnosed. Then, the casting parameter dimension is determined as the dimension to be checked, that is, the casting parameter dimension that needs to be checked for abnormality.
[0042] Furthermore, from the casting parameter records of the casting stage of the casting to be diagnosed, at least one first casting parameter of the casting to be inspected dimension and at least one second casting parameter of the casting to be diagnosed non-inspection dimension are obtained. The non-inspection dimension refers to the casting parameter dimensions other than the dimension to be inspected. Then, based on the first comprehensive result corresponding to the dimension to be inspected, the first judgment order for that dimension is determined, i.e., the judgment order of whether the first casting parameter of the dimension to be inspected is abnormal. The larger the first comprehensive result, the greater the probability that the corresponding dimension to be inspected in the casting stage is actually abnormal, and the higher the priority of judgment. The earlier the first judgment order, the faster and more accurately the cause of the internal defects in the casting to be diagnosed can be identified. Further, a random method can be used to determine the second judgment order of the non-inspection dimensions, which is after the first judgment order. Finally, based on the first judgment order, it is determined whether the first casting parameter of the corresponding dimension to be inspected is within the corresponding normal threshold range. If not, it indicates that the corresponding dimension to be inspected is abnormal, and it is then determined as an actual abnormal dimension. Similarly, based on the second judgment order, it is determined whether the second casting parameter of the corresponding non-inspection dimension is abnormal. If an abnormality exists, the corresponding non-inspection dimension is determined as an actual abnormal dimension. In other embodiments, if no actual abnormal dimension is found among the dimensions to be inspected, then a second judgment order for the non-inspected dimensions is determined based on the first comprehensive result of the non-inspected dimensions, and the second casting parameter of the corresponding non-inspected dimension is judged to be abnormal according to the second judgment order. If an actual abnormal dimension is found among the dimensions to be inspected, then no abnormality check is performed on the non-inspected dimensions. It should be noted that the actual abnormal dimension is the casting parameter dimension in which the casting parameter of the casting to be diagnosed is abnormal during the casting stage.
[0043] Since the first weighting coefficient of the target internal defect and the second weighting coefficient of the corresponding target region under each casting parameter dimension have been determined, after the actual abnormal dimension of the casting to be diagnosed during the casting stage is determined, the first weighting coefficient of the target internal defect under the actual abnormal dimension is multiplied by the second weighting coefficient of each corresponding target region to obtain the second product result. The second product result represents the probability of the target internal defect appearing in the corresponding target region when an abnormality already exists in the actual abnormal dimension. For example, if casting parameter dimension 2 is the actual abnormal dimension among casting parameter dimension 1, casting parameter dimension 2, casting parameter dimension 3, etc., then the target internal defects under the actual abnormal dimension would be target internal defect 21, target internal defect 22, etc. See details. Figure 2 .
[0044] The second comprehensive result is obtained by summing the second product results corresponding to the same target region among all the second product results for each actual anomaly dimension. This second comprehensive result characterizes the probability of internal defects appearing in the corresponding target region when each actual anomaly dimension exists during the casting stage. Furthermore, the second comprehensive result is compared with a preset second threshold. If the second comprehensive result is greater than the second threshold, it indicates a higher probability that the casting currently has internal defects within the target region. Therefore, the target region corresponding to this second comprehensive result is identified as an important region, i.e., a region where internal defects are highly likely to exist within the casting.
[0045] Furthermore, based on the three-dimensional coordinates of the initial position of a single actual internal defect, it is determined whether the initial position of the single actual internal defect is within the aforementioned important region. If the initial position is within the important region, it indicates that the initial position is likely correct, and thus the actual internal defect is identified as the defect to be verified, i.e., the internal defect whose rationality needs to be verified. Then, the largest second product result is selected from the various second product results corresponding to this important region. The target internal defect corresponding to the largest second product result can be understood as: the target internal defect most likely to appear within the important region. Furthermore, if the target internal defect corresponding to the largest second product result is the defect to be verified, it indicates that the defect to be verified identified by the defect identification model is correct, ensuring that the internal defects identified in the casting to be diagnosed are relatively accurate, and at the same time, it can also verify that the initial position of the defect to be verified is correct, making the location of the internal defect more accurate. Finally, the initial position of the defect to be verified is directly determined as the final position. In other embodiments, if the target internal defect corresponding to the result of the largest second product is not the defect to be verified, it indicates that the defect to be verified may have been misidentified. In this case, a defect re-examination reminder is sent to the personnel's terminal, so that the initial position of the defect to be verified is re-CT scanned and the internal defect at the initial position is re-identified.
[0046] In other embodiments, the scanning order of the corresponding target regions is determined based on the second comprehensive result corresponding to each important region. The larger the second comprehensive result, the greater the possibility that the casting to be diagnosed has internal defects in the corresponding important region. Therefore, the earlier the corresponding scanning order, the higher the priority for CT scanning. Finally, the important regions are sorted in the order of scanning from front to back. The earlier the scanning order, the higher the ranking of the important regions. Based on the ranked important regions, at least one candidate scanning path for the casting to be diagnosed is determined. Each candidate scanning path covers all important regions according to the scanning order. At the same time, each candidate scanning path contains a switching sub-path of different switching links. The switching link includes two important regions that need to be switched. For example, there are three important regions M, N and P. The scanning order is M→N→P. Then each candidate scanning path contains a switching sub-path of M→N and a switching sub-path of N→P. M→N and N→P can both be understood as switching links. Furthermore, the second comprehensive results corresponding to the non-critical areas traversed by the switching sub-paths of the same switching link in each candidate scanning path are summed to obtain the risk value of defects traversed by different switching sub-paths of the same switching link. The higher the risk value, the greater the overall probability of internal defects existing in the entire switching process of the key area using the corresponding switching sub-path. Then, the maximum risk value is selected from each risk value, and the switching sub-path corresponding to this maximum risk value is determined as the final sub-path. That is, the overall probability of internal defects existing in the switching process of the corresponding switching link using this final sub-path is the greatest. This process is repeated to determine the final sub-paths corresponding to each switching link. Finally, according to the switching order of each switching link, each final sub-path is combined sequentially to obtain the reference scanning path for the casting to be diagnosed. When scanning the casting to be diagnosed using this reference scanning path, not only can important areas with a high probability of internal defects be scanned in a targeted manner, accurately and efficiently discovering internal defects, but also as many internal defects as possible can be discovered along the way from one important area to the next important area, further improving the efficiency of internal defect discovery. The CT scan path is verified by referencing the scan path. If the two are consistent, the CT scan path is verified and the casting to be diagnosed is scanned using this CT scan path. Otherwise, if the two are inconsistent, the casting to be diagnosed is scanned using the reference scan path.
[0047] In one embodiment, at least one non-important region existing within a preset range of the important region is obtained. The second comprehensive results corresponding to each non-important region are summed to obtain the occurrence risk value of nearby defects. The higher the occurrence risk value, the greater the overall probability of detecting internal defects near the important region. Then, a corresponding correction factor is determined based on the occurrence risk value. The correction factor is not less than 1, and the higher the occurrence risk value, the larger the corresponding correction factor. Specifically, the correction factor corresponding to the occurrence risk value can be matched from a preset factor matching table. The factor matching table includes different occurrence risk values and their corresponding correction factors, all of which are set based on human experience. Then, the second comprehensive results corresponding to each important region are summed. The result is multiplied by the corresponding correction factor to obtain the corrected result for the corresponding important region. Finally, based on the corrected result, the CT scan order for the corresponding important region is determined. The larger the corrected result, the earlier the CT scan order. Then, based on each CT scan order, a reference scan path is determined for each important region. Scanning the casting to be diagnosed using this reference scan order not only allows for targeted scanning of important regions where internal defects are highly likely to occur, accurately and efficiently detecting internal defects, but also, when no internal defects are found in an important region, using the important region as a reference to appropriately expand the scan range can help detect potential internal defects as much as possible, improving defect scanning efficiency. Finally, the CT scan path is verified against this reference scan path; if they match, the verification passes.
[0048] In other embodiments, a preset clustering algorithm is used to perform cluster analysis on all important regions, dividing them into multiple relatively large distribution regions. Each distribution region contains at least one important region. The clustering algorithm can be the K-Means algorithm or a hierarchical clustering algorithm. Then, the number of important regions contained in a single distribution region is divided by the area of the distribution region to obtain the distribution density of important regions within that region. The higher the distribution density, the more severe the internal defect problem in that distribution region. Based on this distribution density, the initial scanning frequency corresponding to the distribution region is determined. The higher the distribution density, the higher the corresponding initial scanning frequency. Specifically, a preset frequency matching table can be used to match the initial scanning frequency corresponding to this distribution density. The frequency matching table contains different distribution density ranges and their corresponding scanning frequencies. The scanning frequency corresponding to the distribution density range is determined as the initial scanning frequency.
[0049] Furthermore, high-risk defects in each important region within the distribution area are identified. Specifically, the internal defects corresponding to the maximum second product of the important regions are defined as high-risk defects. Next, these high-risk defects are combined to obtain multiple defect combinations. From a pre-defined mapping table, the aggravation coefficient for each defect combination is determined. The aggravation coefficient is not less than 1. The mapping table includes different defect combinations and their corresponding aggravation coefficients. For example, a defect combination could be porosity + shrinkage porosity with an aggravation coefficient of 1.1; a defect combination could be segregation + shrinkage porosity + cracks with an aggravation coefficient of 1.2; a defect combination could be inclusions + cracks with an aggravation coefficient of 1.3, and so on. Finally, the initial scanning frequency is multiplied sequentially by each aggravation coefficient and rounded to obtain the final scanning frequency for the distribution area. Subsequent CT scans will use this final scanning frequency when passing through this distribution area.
[0050] In another embodiment, the initial position of the actual internal defect is adjusted and optimized based on the first and second weighting coefficients corresponding to at least one actual anomaly dimension to obtain the corresponding final position. One feasible implementation is as follows: the first weighting coefficient of the key internal defect under the actual anomaly dimension is multiplied by the second weighting coefficient of each corresponding target region to obtain a third product result. The key internal defect under the actual anomaly dimension can be understood as: a target internal defect (consistent with the identified single actual internal defect) that is likely to occur in the casting to be diagnosed when the actual anomaly dimension is abnormal. Furthermore, the third product result characterizes the probability of a key internal defect appearing in the corresponding target region of the casting to be diagnosed when the actual anomaly dimension is abnormal. At least one key internal defect exists. Additionally, the key internal defects under each actual anomaly dimension are all the same actual internal defect. Next, the third product results corresponding to the same target region in each actual anomaly dimension are summed to obtain a third comprehensive result. The third comprehensive result characterizes the overall probability of a key internal defect appearing in the target region. If the third comprehensive result is greater than the preset third threshold, it indicates that there is a high probability of key internal defects appearing in the target area corresponding to the third comprehensive result. Therefore, the target area corresponding to the third comprehensive result is identified as a suitable area containing key internal defects. For example, there are actual anomaly dimensions 2 and 3. Actual anomaly dimension 2 corresponds to target internal defects 21, 22, and 23, while actual anomaly dimension 3 corresponds to target internal defects 31, 32, and 33. If a single actual internal defect is a pore, then the target internal defects with pores among target internal defects 21, 22, and 23 are identified as key internal defects, and the target internal defects with pores among target internal defects 31, 32, and 33 are also identified as key internal defects.
[0051] Furthermore, if the initial location of the key internal defect is within a suitable area, it indicates that the location of this key internal defect is relatively accurate and the error is small. In this case, the initial location of the key internal defect is directly determined as the final location. Conversely, if the initial location of the key internal defect is not within a suitable area, it indicates that the location of this key internal defect is biased and needs to be corrected. In this case, the suitable area is determined as the final location of the key internal defect.
[0052] The implementation principle of the casting internal defect diagnosis method in this application embodiment is as follows: Geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed is obtained to determine the geometric features of the casting body. Then, based on this geometric feature information and combined with the geometric features of the casting, a CT scanning path capable of omnidirectional scanning of the casting is determined. The casting is then scanned according to the CT scanning path to more comprehensively detect internal defects. Next, X-ray projection data (data reflecting the three-dimensional structure inside the casting) is input into the defect recognition model. The defect recognition model analyzes the three-dimensional structure reflected by the X-ray projection data to accurately identify the actual internal defects. Furthermore, a CT reconstruction algorithm is used to reconstruct the three-dimensional density distribution inside the casting, thereby more accurately pinpointing the initial location of the actual internal defects, avoiding the ambiguity of human judgment and improving the accuracy of casting internal defect location. Finally, by combining historical internal defects and historical regions, the probability of the actual internal defects of the casting being located at the corresponding initial positions is analyzed, thereby achieving verification and optimization of each initial position, further improving the accuracy of casting internal defect location.
[0053] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0054] Please see Figure 3 This is a schematic diagram of the internal defect diagnosis device for castings provided in an embodiment of this application. This device for diagnosing internal defects in castings can be implemented as all or part of a device through software, hardware, or a combination of both. The device includes an information acquisition module 11, a path determination module 12, a casting scanning module 13, a defect identification module 14, a position determination module 15, and a position optimization module 16.
[0055] Information acquisition module 11 is used to acquire geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed; The path determination module 12 is used to determine the CT scan path corresponding to the casting to be diagnosed based on the geometric feature information. The casting scanning module 13 is used to perform CT scanning on the casting to be diagnosed according to the CT scanning path to obtain X-ray projection data. The defect identification module 14 is used to input X-ray projection data into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed. The location determination module 15 is used to determine the initial location of each actual internal defect through a preset CT reconstruction algorithm; The position optimization module 16 is used to adjust and optimize each initial position based on the historical internal defects that have occurred in historical castings and the historical areas where historical internal defects exist when a single casting parameter dimension is abnormal, so as to obtain the corresponding final position. The historical castings and the casting to be diagnosed are the same type of castings with the same material and size.
[0056] Optional, the position optimization module 16 is specifically used for: Based on the multiple historical internal defects that have appeared in historical castings when a single casting parameter dimension is abnormal, at least one target internal defect is determined under the casting parameter dimension. The target internal defect is a historical internal defect that is prone to appear in historical castings. Based on multiple historical regions where internal defects exist, at least one target region corresponding to the internal defects is determined, and the target region is a historical region where internal defects are likely to occur. Determine the first weighting coefficient of the target internal defect and the second weighting coefficient of each target region corresponding to the target internal defect. The first weighting coefficient represents the probability of the target internal defect appearing in the historical casting, and the second weighting coefficient represents the probability of the target internal defect appearing in the corresponding target region in the historical casting. Based on the first weight coefficient and each of the second weight coefficients, the initial positions are adjusted and optimized to obtain the corresponding final positions.
[0057] Optional, the position optimization module 16 is specifically used for: When the target internal defect is an actual internal defect, the target internal defect is determined as a reference internal defect. If the target area corresponding to the reference internal defect contains the initial position of the reference internal defect, then the corresponding target area is determined as a reference area. Multiply the first weighting coefficient of the reference internal defect by the second weighting coefficient of the reference region to obtain the first product result; The first product results corresponding to each reference internal defect are summed to obtain the first comprehensive result; If the first comprehensive result is greater than the preset first threshold, then the casting parameter dimension is determined as the dimension to be checked. The dimension to be checked is the casting parameter dimension that needs to be checked to see if the casting parameters are abnormal. Based on at least one dimension to be inspected, determine the actual abnormal dimension in which the casting parameters of the casting to be diagnosed are abnormal; Based on the first and second weight coefficients corresponding to at least one actual abnormal dimension, each initial position is adjusted and optimized to obtain the corresponding final position.
[0058] Optional, the position optimization module 16 is specifically used for: Obtain first casting parameters for at least one dimension to be inspected in the casting to be diagnosed, and obtain second casting parameters for at least one non-inspection dimension of the casting to be diagnosed, wherein the non-inspection dimension is the casting parameter dimension other than the dimension to be inspected. Based on the first comprehensive result corresponding to each dimension to be inspected, the first judgment order of the corresponding dimension to be inspected is determined, and the second judgment order of the non-inspection dimension is determined. The larger the first comprehensive result, the earlier the corresponding judgment order is, and the second judgment order is after the first judgment order. According to the order of the first judgments, determine whether there is any abnormality in the first casting parameter of the corresponding dimension to be inspected. If there is an abnormality, the corresponding dimension to be inspected is determined as the actual abnormal dimension. According to the order of the second judgments, determine whether there is an anomaly in the second casting parameter of the corresponding non-inspection dimension. If there is an anomaly, the corresponding non-inspection dimension is determined as the actual anomaly dimension.
[0059] Optional, the position optimization module 16 is specifically used for: The first weight coefficient of the internal defect of the target under the actual anomaly dimension is multiplied with the second weight coefficient of the corresponding target region to obtain the second product result; The second comprehensive result is obtained by summing the second product results corresponding to the same target region in each actual anomaly dimension; The second comprehensive result is compared with the preset second threshold. If the second comprehensive result is greater than the second threshold, the target area corresponding to the second comprehensive result is determined as an important area. If the initial position is within an important region, the corresponding actual internal defect is identified as the defect to be verified, and the largest second product result is selected from the second product results corresponding to the important region. If the internal defect of the target corresponding to the result of the second largest product is the defect to be verified, then the initial position of the defect to be verified is determined as the final position.
[0060] like Figure 4 As shown, the device also includes a path verification module 17, specifically used for: Based on the second comprehensive result corresponding to each important region, the scanning order of the corresponding important regions is determined. The larger the second comprehensive result, the earlier the corresponding scanning order. Based on each scanning sequence, at least one alternative scanning path is determined for the casting to be diagnosed. The alternative scanning path includes switching sub-paths of different switching links, and the switching link includes two important areas that need to be switched. For each alternative scanning path, the second comprehensive result corresponding to the non-critical area traversed by the switching sub-path of the same switching link is summed to obtain the risk value of multiple path defects. The non-critical area is the target area other than the critical area. From each risk value, select the maximum risk value, determine the switching sub-path corresponding to the maximum risk value as the final sub-path, and determine the reference scanning path of the casting to be diagnosed based on all the final sub-paths; If the CT scan path matches the reference scan path, the CT scan path verification is considered successful.
[0061] Optionally, the device also includes a frequency determination module 18, specifically used for: Cluster analysis was performed on all important regions to obtain multiple distribution regions, each containing at least one important region; The initial scanning frequency corresponding to the distribution area is determined based on the distribution density of important areas within the distribution area. Identify high-risk defects in each important region within the distribution area, determine at least one defect combination from all high-risk defects, and determine the aggravation coefficient of each defect combination. The larger the aggravation coefficient, the greater the aggravation effect of the corresponding defect combination on the quality of the casting to be diagnosed. Based on the aggravation factor, the initial scanning frequency is optimized to obtain the final scanning frequency of the distribution area.
[0062] It should be noted that the casting internal defect diagnosis device provided in the above embodiments is only illustrated by the division of the above functional modules when performing the casting internal defect diagnosis method. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the casting internal defect diagnosis device and the casting internal defect diagnosis method embodiment provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiment, which will not be repeated here.
[0063] This application also discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, it implements a method for diagnosing internal defects in castings as described in the above embodiments.
[0064] The computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or certain middleware. The computer-readable medium includes any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the computer-readable medium includes, but is not limited to, the above-mentioned components.
[0065] The above-described method for diagnosing internal defects in castings is stored in the computer-readable storage medium and loaded and executed on a processor to facilitate the storage and application of the method.
[0066] This application also discloses an electronic device in which a computer program is stored in a computer-readable storage medium. When the computer program is loaded and executed by a processor, it implements the above-mentioned method for diagnosing internal defects in castings.
[0067] The electronic device can be a desktop computer, a laptop computer, or a cloud server, and includes, but is not limited to, a processor and a memory. For example, the electronic device may also include input / output devices, network access devices, and buses.
[0068] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.
[0069] The memory can be an internal storage unit of an electronic device, such as a hard disk or RAM, or an external storage device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) equipped on the electronic device. Furthermore, the memory can be a combination of an internal storage unit and an external storage device. The memory is used to store computer programs and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0070] In this electronic device, the method for diagnosing internal defects in castings according to the above embodiments is stored in the memory of the electronic device and loaded and executed on the processor of the electronic device for convenient use.
[0071] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.
Claims
1. A method for diagnosing internal defects in castings, characterized in that, The method includes: Obtain the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed; Based on the geometric feature information, determine the CT scan path corresponding to the casting to be diagnosed; According to the CT scan path, the casting to be diagnosed is subjected to a CT scan to obtain X-ray projection data; The X-ray projection data is input into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed. The initial location of each actual internal defect is determined by a preset CT reconstruction algorithm. Based on the historical internal defects that occurred in historical castings and the historical areas where such internal defects existed when a single casting parameter dimension was abnormal, the initial positions of each casting are adjusted and optimized to obtain the corresponding final positions. The historical castings and the casting to be diagnosed are the same type of castings with the same material and size.
2. The method for diagnosing internal defects in castings according to claim 1, characterized in that, The step of adjusting and optimizing the initial positions based on the historical internal defects that have occurred in historical castings and the historical regions where such internal defects exist, when a single casting parameter dimension is abnormal, to obtain the corresponding final positions, specifically includes: Based on multiple historical internal defects that have appeared in historical castings when a single casting parameter dimension is abnormal, at least one target internal defect under the casting parameter dimension is determined, and the target internal defect is a historical internal defect that is prone to appear in historical castings. Based on multiple historical regions where the internal defects of the target exist, at least one target region corresponding to the internal defects of the target is determined, wherein the target region is a historical region where the internal defects of the target are prone to occur. A first weighting coefficient is determined for the target internal defect, and a second weighting coefficient is determined for each target region corresponding to the target internal defect. The first weighting coefficient represents the probability of the target internal defect appearing in the historical casting, and the second weighting coefficient represents the probability of the target internal defect appearing in the corresponding target region in the historical casting. Based on the first weighting coefficient and each of the second weighting coefficients, the initial positions are adjusted and optimized to obtain the corresponding final positions.
3. The method for diagnosing internal defects in castings according to claim 2, characterized in that, The step of adjusting and optimizing each initial position based on the first weighting coefficient and each of the second weighting coefficients to obtain the corresponding final position specifically includes: When the target internal defect is an actual internal defect, the target internal defect is determined as a reference internal defect. If the target area corresponding to the reference internal defect contains the initial position of the reference internal defect, the corresponding target area is determined as a reference area. The first weighting coefficient of the reference internal defect is multiplied by the second weighting coefficient of the reference region to obtain the first product result; The first product results corresponding to each of the aforementioned internal defects are summed to obtain the first comprehensive result; If the first comprehensive result is greater than the preset first threshold, then the casting parameter dimension is determined as the dimension to be checked. The dimension to be checked is the casting parameter dimension that needs to be checked to see if the casting parameters are abnormal. Based on at least one of the dimensions to be inspected, determine the actual abnormal dimension in which the casting parameters of the casting to be diagnosed are abnormal; Based on the first weight coefficient and the second weight coefficient corresponding to at least one of the actual abnormal dimensions, the initial positions are adjusted and optimized to obtain the corresponding final positions.
4. The method for diagnosing internal defects in castings according to claim 3, characterized in that, The step of determining the actual abnormal dimension of the casting parameters of the casting to be diagnosed as abnormal based on at least one of the dimensions to be inspected specifically includes: Obtain a first casting parameter for at least one dimension to be inspected of the casting to be diagnosed, and obtain a second casting parameter for at least one non-inspection dimension of the casting to be diagnosed, wherein the non-inspection dimension is a casting parameter dimension other than the dimension to be inspected. Based on the first comprehensive result corresponding to each dimension to be inspected, the first judgment order of the corresponding dimensions to be inspected is determined, and the second judgment order of the non-inspection dimensions is determined. The larger the first comprehensive result, the earlier the corresponding judgment order is, and the second judgment order is after the first judgment order. According to the first judgment order, determine whether there is an abnormality in the first casting parameter of the corresponding dimension to be inspected. If there is an abnormality, the corresponding dimension to be inspected is determined as the actual abnormal dimension. According to the second judgment order, determine whether there is an abnormality in the second casting parameter of the corresponding non-inspection dimension. If there is an abnormality, the corresponding non-inspection dimension is determined as the actual abnormal dimension.
5. The method for diagnosing internal defects in castings according to claim 3, characterized in that, The step of adjusting and optimizing each of the initial positions based on the first and second weight coefficients corresponding to at least one of the actual anomaly dimensions to obtain the corresponding final positions specifically includes: The first weight coefficient of the internal defect of the target under the actual anomaly dimension is multiplied with the second weight coefficient of the corresponding target region to obtain the second product result; The second product results corresponding to the same target region in each of the actual anomaly dimensions are summed to obtain the second comprehensive result. The second comprehensive result is compared with a preset second threshold. If the second comprehensive result is greater than the second threshold, the target area corresponding to the second comprehensive result is determined as an important area. If the initial position is within the important region, the corresponding actual internal defect is determined as the defect to be verified, and the largest second product result is selected from each second product result corresponding to the important region. If the target internal defect corresponding to the result of the maximum second product is the defect to be verified, then the initial position of the defect to be verified is determined as the final position.
6. The method for diagnosing internal defects in castings according to claim 5, characterized in that, The method further includes: Based on the second comprehensive result corresponding to each important region, the scanning order of the corresponding important regions is determined. The larger the second comprehensive result, the earlier the corresponding scanning order. Based on the scanning order, at least one alternative scanning path is determined for the casting to be diagnosed. The alternative scanning path includes switching sub-paths of different switching links, and the switching link includes two important regions that need to be switched. The second comprehensive results corresponding to the non-critical areas traversed by the switching sub-paths of the same switching link in each of the candidate scanning paths are summed to obtain the risk values of multiple path defects. The non-critical areas are target areas other than the critical areas. The maximum risk value is selected from all the risk values, and the switching sub-path corresponding to the maximum risk value is determined as the final sub-path. Based on all the final sub-paths, the reference scanning path of the casting to be diagnosed is determined. When the CT scan path is consistent with the reference scan path, the CT scan path verification is deemed successful.
7. The method for diagnosing internal defects in castings according to claim 6, characterized in that, The method further includes: Cluster analysis is performed on all the important regions to obtain multiple distribution regions, each of which contains at least one important region; The initial scanning frequency corresponding to the distribution area is determined based on the distribution density of important areas within the distribution area. Identify high-risk defects in each important region included in the distribution area, determine at least one defect combination from all the high-risk defects, and determine the aggravation coefficient of each defect combination. The larger the aggravation coefficient, the greater the aggravation effect of the corresponding defect combination on the quality of the casting to be diagnosed. Based on the aggravation coefficient, the initial scanning frequency is optimized to obtain the final scanning frequency of the distribution area.
8. A device for diagnosing internal defects in castings, characterized in that, include: The information acquisition module (11) is used to acquire the geometric feature information of the three-dimensional digital model corresponding to the casting to be diagnosed; The path determination module (12) is used to determine the CT scan path corresponding to the casting to be diagnosed based on the geometric feature information. The casting scanning module (13) is used to perform CT scanning on the casting to be diagnosed according to the CT scanning path to obtain X-ray projection data; The defect identification module (14) is used to input the X-ray projection data into a preset defect identification model to obtain at least one actual internal defect of the casting to be diagnosed. The location determination module (15) is used to determine the initial location of each actual internal defect by means of a preset CT reconstruction algorithm; The position optimization module (16) is used to adjust and optimize each of the initial positions based on the historical internal defects that have occurred in the historical castings and the historical areas where the historical internal defects exist when a single casting parameter dimension is abnormal, so as to obtain the corresponding final position. The historical castings and the casting to be diagnosed are the same type of castings with the same material and size.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is loaded and executed by the processor, it implements the method of any one of claims 1-7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor loads and executes the computer program, it implements the method of any one of claims 1-7.