Abnormality detection method and device, computer equipment and storage medium

By recognizing workpiece identification images and analyzing data, combined with similarity retrieval, the problem of lacking unique identifiers in the identification of defects such as welds has been solved, thereby improving the accuracy and reliability of anomaly detection and forming a complete closed-loop detection logic.

CN121883435APending Publication Date: 2026-04-17CHINA RAILWAY HI TECH IND CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA RAILWAY HI TECH IND CORP LTD
Filing Date
2025-12-31
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing defect identification technologies for welds and other workpieces lack unique identification and management of the inspected objects in continuous or batch inspection scenarios, resulting in data chaos, inaccurate traceability, and affecting location rework and historical quality analysis.

Method used

By acquiring the identification images and data of the workpiece, identifying the workpiece identification, obtaining reference data, detecting candidate abnormal states, and performing similarity analysis with historical workpiece data, the abnormal state is confirmed.

Benefits of technology

This has improved the accuracy and reliability of abnormal workpiece conditions, forming a complete closed-loop processing logic from data acquisition to in-depth analysis, ensuring the accuracy and traceability of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121883435A_ABST
    Figure CN121883435A_ABST
Patent Text Reader

Abstract

The invention relates to an anomaly detection method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring an identification image and workpiece data of a to-be-detected workpiece; identifying the identification image to obtain a workpiece identification of the to-be-detected workpiece; determining reference data of the to-be-detected workpiece based on the workpiece identifier; based on the reference data, workpiece data of the to-be-detected workpiece are detected, and candidate abnormal states of the workpiece data are determined; wherein the candidate abnormal state comprises an abnormal category; acquiring a historical workpiece corresponding to the abnormal category; and performing similarity analysis on the workpiece data of the historical workpiece and the workpiece data of the to-be-detected workpiece, and determining an abnormal state of the to-be-detected workpiece. By adopting the method, the accuracy and intelligent level of anomaly detection can be improved, the dependence on artificial experience is reduced, and the detection efficiency and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automation technology, and in particular to an anomaly detection method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the development of industrial automation and intelligent inspection technologies, defect identification technologies for workpieces such as welds, based on vision and data analysis, have been widely applied. This technology is characterized by its ability to automatically collect workpiece images and waveforms, and then judge anomalies by comparing them against preset thresholds or models. Traditionally, detected anomalies are typically classified and recorded based on attributes such as type and size. However, current methods have a fundamental flaw: the inspection system lacks effective identification and management of the unique identity of the inspected object. In continuous or batch inspection scenarios, the massive amounts of defect images, data, and reports cannot be accurately linked to specific workpieces, leading to data chaos and an inability to accurately trace results. This makes subsequent location and rework, historical quality analysis, and production responsibility determination extremely difficult. Summary of the Invention

[0003] Therefore, it is necessary to provide an anomaly detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0004] Firstly, this application provides an anomaly detection method. The method includes:

[0005] Acquire the identification image and workpiece data of the workpiece to be inspected;

[0006] The identification image is recognized to obtain the workpiece identification of the workpiece to be inspected; and reference data of the workpiece to be inspected is determined based on the workpiece identification.

[0007] Based on the reference data, the workpiece data of the workpiece to be inspected is detected to determine candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include abnormal categories;

[0008] Obtain the historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected to determine the anomaly state of the workpiece to be detected.

[0009] In one embodiment, the identification image includes image data and character data; the step of recognizing the identification image to obtain the workpiece identification of the workpiece to be detected includes:

[0010] The image data is identified to determine the initial workpiece identifier of the workpiece to be detected;

[0011] If the image data does not identify a corresponding initial workpiece identifier, the character data is identified to determine the workpiece identifier of the workpiece to be detected.

[0012] If the image data identifies a corresponding initial workpiece identifier, the character data is identified to determine a candidate workpiece identifier for the workpiece to be inspected, and the workpiece identifier for the workpiece to be inspected is determined based on the initial workpiece identifier and the candidate workpiece identifier.

[0013] In one embodiment, the method further includes:

[0014] If the workpiece identifier is not recognized in either the image data or the character data, the input workpiece identifier or reference data of the workpiece to be detected is received.

[0015] In one embodiment, the workpiece data includes ultrasonic workpiece data; the step of detecting the workpiece data of the workpiece to be inspected based on the reference data to determine candidate abnormal states of the workpiece data includes:

[0016] In the case of ultrasonic workpiece data of the workpiece to be inspected, feature extraction is performed on the ultrasonic workpiece data of the workpiece to be inspected to obtain feature data of the workpiece to be inspected.

[0017] The feature data is input into a preset anomaly classification model to determine the initial anomaly state of the workpiece to be inspected;

[0018] Based on the reference data and the initial abnormal state, the workpiece data of the workpiece to be inspected is detected to determine the candidate abnormal state of the workpiece data.

[0019] In one embodiment, the step of performing similarity analysis between the workpiece data of the historical workpiece and the workpiece data of the workpiece to be inspected to determine the abnormal state of the workpiece to be inspected includes:

[0020] Extract the first feature vector of the workpiece data of the workpiece to be inspected and the second feature vector of the workpiece data of each historical workpiece, respectively.

[0021] Calculate the similarity score between the first feature vector and each of the second feature vectors;

[0022] Based on the similarity score, the abnormal state of the workpiece to be detected is determined.

[0023] In one embodiment, the workpiece data includes detection positions; the method includes:

[0024] In response to a target storage instruction, image data of the workpiece to be detected is acquired;

[0025] The image data, abnormal status, and detection location of the workpiece to be inspected are bound into a target data packet, and the target data packet is stored in the target database.

[0026] Secondly, this application also provides an anomaly detection device. The device includes:

[0027] The data acquisition module is used to acquire the identification image and workpiece data of the workpiece to be inspected;

[0028] The data acquisition module is further configured to recognize the identification image to obtain the workpiece identification of the workpiece to be inspected; and to determine the reference data of the workpiece to be inspected based on the workpiece identification;

[0029] The workpiece inspection module is used to inspect the workpiece data of the workpiece to be inspected based on the reference data, and determine the candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include anomaly categories.

[0030] The workpiece detection module is further configured to acquire historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected, and determine the anomaly state of the workpiece to be detected.

[0031] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the anomaly detection method as described in any one of the embodiments of this disclosure.

[0032] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the anomaly detection method as described in any one of the embodiments of this disclosure.

[0033] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the anomaly detection method as described in any of the embodiments of this disclosure.

[0034] The aforementioned anomaly detection methods, devices, computer equipment, storage media, and computer program products acquire the identification image and workpiece data of the workpiece to be detected, identify the workpiece identification based on the identification image to determine reference data, then use the reference data to detect the workpiece data to obtain candidate anomaly states containing anomaly categories, and finally, by retrieving historical workpiece data of similar anomalies and performing similarity analysis, achieve the final confirmation or refined judgment of the current workpiece anomaly state. This forms a complete closed-loop processing logic from data acquisition, identification and matching, preliminary detection to in-depth analysis, effectively improving the accuracy and reliability of anomaly detection. Attached Figure Description

[0035] Figure 1 This is a diagram illustrating the application environment of an anomaly detection method in one embodiment;

[0036] Figure 2 This is a flowchart illustrating an anomaly detection method in one embodiment;

[0037] Figure 3 This is a schematic diagram of the probe in one embodiment;

[0038] Figure 4 This is a structural block diagram of an anomaly detection device in one embodiment;

[0039] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0041] The anomaly detection method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. In this application environment, terminal 102 can be used to collect identification images (such as barcodes, QR codes, or specific identification patterns) and workpiece data (such as dimensions, morphology, spectral data, or waveform data) of the workpiece to be inspected and upload them to server 104. Server 104 is configured to execute the method in this embodiment: first, the identification image is recognized to obtain a unique workpiece identification, and reference data of the corresponding workpiece is retrieved from the data storage system accordingly; then, based on the reference data, the uploaded workpiece data is preliminarily analyzed to identify candidate abnormal states and their categories; further, for the abnormal category, server 104 retrieves historical workpiece data of the same type of abnormality from historical data and performs similarity analysis with the current workpiece data to finally confirm or refine the determination of the current workpiece's abnormal state. After processing, server 104 can return a complete inspection report (including workpiece identification, abnormal state, and analysis basis) to terminal 102 or archive it to the data storage system. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0042] In one embodiment, such as Figure 2 As shown, an anomaly detection method is provided, including the following steps:

[0043] Step S200: Obtain the identification image and workpiece data of the workpiece to be inspected.

[0044] The identification image of the workpiece to be inspected can be an image containing the unique identification information of the workpiece, which can be obtained by an image acquisition device (such as an industrial camera, scanner, etc.). For example, it can be a label image with a workpiece serial number, a surface image with a QR code or barcode, etc. The workpiece data can be various types of data that characterize the physical properties or state of the workpiece to be inspected. In addition to the ultrasonic workpiece data mentioned above, it can also include the workpiece's size parameter data (such as length, width, thickness, etc., data acquired by a laser rangefinder or caliper), appearance image data (such as workpiece surface images taken by a high-definition camera), temperature data (such as workpiece surface temperature distribution data acquired by an infrared thermometer), etc.

[0045] In an exemplary embodiment, the acquisition of the identification image and workpiece data of the workpiece to be inspected can be achieved in the following way: the terminal device controls the connected image acquisition device (such as an industrial CCD camera with a resolution of not less than 1920×1080 pixels, equipped with a ring LED light source to ensure uniform illumination) to take pictures of the identification area of ​​the workpiece and acquire the identification image; at the same time, the corresponding detection sensor (such as a laser contour sensor for measuring dimensions, or an ultrasonic flaw detector for detecting internal structures) can be controlled to collect the workpiece data at the preset detection position (such as the weld center area, the key dimension marking surface), and the collected identification image and workpiece data can be transmitted in real time to the processing unit (such as a server or local industrial computer) via wired (such as Ethernet) or wireless (such as Wi-Fi 6). After receiving the data, the processing unit first preprocesses it, such as denoising the marked image (using a Gaussian filtering algorithm with a filter kernel size of 3×3) and enhancing the contrast (using an adaptive histogram equalization algorithm), and converting the workpiece data into a format (such as converting the original ultrasonic echo signal into standard CSV format data) and removing outliers (using the 3σ criterion) to ensure the accuracy of subsequent identification and analysis.

[0046] Step S202: Recognize the identification image to obtain the workpiece identification of the workpiece to be inspected; and determine the reference data of the workpiece to be inspected based on the workpiece identification.

[0047] Workpiece identification can be used to uniquely distinguish different workpieces, such as serial numbers, batch numbers, or unique QR codes or barcodes composed of numbers, letters, or combinations thereof. Reference data can be benchmark information associated with the workpiece identification, used to determine whether the workpiece has any abnormalities, including but not limited to the standard size range of the workpiece model, ultrasonic waveform characteristic parameters under normal operating conditions, permissible thresholds for surface defects, and standard values ​​of material composition. In practical applications, multimodal fusion can be used to improve accuracy in identifying identification images. For example, when an identification image contains both a QR code (image data) and a character sequence (character data), the image data is first decoded using a QR code recognition algorithm (such as QRCodeDetector based on OpenCV) to obtain the initial workpiece identification; then, optical character recognition (OCR) technology (such as the Tesseract OCR engine, combined with a training model optimized for industrial characters) is used to recognize the character data to obtain candidate workpiece identifications. If the initial workpiece identifier matches the candidate workpiece identifier, it can be used as the final workpiece identifier. If they do not match, a verification mechanism can be initiated, such as calculating the matching degree using a character similarity algorithm (e.g., edit distance). When the matching degree is higher than a preset threshold (e.g., 90%), the identifier with higher frequency of occurrence can be used. Otherwise, a manual review process can be triggered, where the operator confirms the correct workpiece identifier. After obtaining the workpiece identifier, the system can use it to search a preset database (e.g., a MySQL database, with a table structure containing fields such as workpiece identifier, model, and reference data ID) to obtain the corresponding reference data ID. Then, based on this ID, it retrieves the complete reference data from the reference data storage module (e.g., MongoDB, which stores specific reference data values ​​and ranges). For example, for a certain weld workpiece, its reference data may include the standard range of weld width (5±0.5mm), the echo amplitude threshold for ultrasonic testing (≤50dB), and the maximum allowable defect area (≤2mm²), etc.

[0048] In one exemplary embodiment, when the image data (such as a QR code partially damaged by stains) in the identification image fails to identify the corresponding initial workpiece identifier, the system can automatically switch to the character data recognition process. For example, if the workpiece surface is printed with the character sequence "W20231105-001", the system uses OCR technology to recognize the character region character by character. It can use edge detection algorithms (such as the Canny operator) to locate the character boundaries and use a deep learning-based character recognition model (such as a CRNN model pre-trained on an industrial character dataset) to classify individual characters, ultimately concatenating them to obtain candidate workpiece identifiers. If neither the image data nor the character data identifies a valid workpiece identifier (such as when the identification label is completely detached), a prompt can be issued to the operator through the interactive interface. The operator can then input the workpiece identifier of the workpiece to be inspected via keyboard input, or directly input the reference data of the workpiece (such as manually entering key parameters such as the standard dimensions and material density of the batch of workpieces) to ensure the normal progress of subsequent inspection processes.

[0049] Step S204: Based on the reference data, detect the workpiece data of the workpiece to be detected and determine the candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include abnormal categories.

[0050] Candidate abnormal states can include those that deviate from the normal range in the workpiece data based on preliminary judgment of reference data. Abnormal categories can include specific classifications of these deviations. For example, when the workpiece data is dimensional data, abnormal categories can include dimensional deviations (e.g., length greater than the upper limit or less than the lower limit) and dimensional fluctuation abnormalities (e.g., the rate of dimensional change at multiple consecutive detection points exceeds a set threshold). When the workpiece data is ultrasonic data, abnormal categories can include echo amplitude abnormalities (e.g., amplitude higher than the normal threshold, possibly corresponding to internal defects) and waveform distortion abnormalities (e.g., the rise slope of the waveform changes beyond the standard range). In practice, the process of detecting the workpiece data to be inspected based on reference data to determine candidate abnormal states can be implemented by combining various detection algorithms. For example, for numerical workpiece data (such as dimensions and temperature), a threshold comparison method can be used to compare the data to be detected with the standard range in the reference data. If the data to be detected exceeds the range, it is determined to be a candidate abnormal state of the corresponding abnormal category. For waveform or image workpiece data, it can first be converted into a feature vector by feature extraction algorithms (such as wavelet transform to extract the time domain features of waveforms and convolutional neural networks to extract the deep features of images). Then, a classification model (such as support vector machine and random forest) is used to compare the feature vector with the feature vectors of normal state and various abnormal states in the reference data, and output the probability of belonging to each category of abnormality. When the probability of a certain abnormal category exceeds a preset threshold (such as 80%), it is determined as a candidate abnormal state and the corresponding abnormal category.

[0051] In one exemplary embodiment, taking surface image data as workpiece data as an example, the reference data may include a texture feature library of normal workpiece surfaces and image templates of common defects (such as scratches, dents, and color differences). First, key point features (such as edge contours, texture directions, and local gray-level extreme values) are extracted from the surface image of the workpiece to be detected using the SIFT (Scale Invariant Feature Transform) algorithm, and these features are matched with normal features in the texture feature library to calculate the matching degree. If the matching degree is lower than a set threshold (such as 75%), a deep learning-based defect detection model (such as YOLOv5, trained on a dataset containing 100,000+ labeled defect images) is further invoked to perform region detection on the image to be detected, and the location coordinates, size, and confidence score of each suspected defect region and its defect category (such as scratches with a confidence score of 0.92 and dents with a confidence score of 0.65) are output. When the confidence level of a certain defect category exceeds a preset threshold (e.g., 0.85), the system marks the defect category as a candidate abnormal state. For example, it determines that the workpiece has a "scratch anomaly" and records the specific parameters of the scratch (e.g., length 3.2mm, width 0.5mm, position coordinates (x=120mm, y=85mm)).

[0052] Step S206: Obtain the historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected to determine the anomaly state of the workpiece to be detected.

[0053] Historical workpieces can include those identified in past inspections as having the same candidate anomaly category as the workpiece to be inspected. Similarity analysis between the workpiece data of historical workpieces and the workpiece data of the workpiece to be inspected is to more accurately confirm whether the workpiece to be inspected actually has this type of anomaly, and the severity or specific pattern of the anomaly. Specifically, firstly, based on the determined anomaly category, all historical workpieces marked with that type of anomaly are selected from the historical database, and their workpiece data is extracted as comparison samples. This historical workpiece data typically contains characteristic information of this type of anomaly under different manifestations. Next, a similarity measurement method suitable for this data type is used to analyze the workpiece data of the workpiece to be inspected and the selected historical workpiece data. For example, if the workpiece data is a numerical sequence (such as a temperature-time curve), the dynamic time warping (DTW) distance can be calculated to measure the similarity of the sequence shapes; if it is image data (such as surface defect images), it can be evaluated by calculating the cosine similarity or Euclidean distance between feature vectors (such as deep features extracted based on convolutional neural networks); if it is waveform data (such as vibration signals), a Fourier transform can be performed first to obtain spectral features, and then the correlation coefficient between the spectra can be calculated as a similarity index. After obtaining the similarity values ​​between the workpiece data to be detected and each historical workpiece data, the system sets a similarity threshold (this threshold can be dynamically adjusted according to the historical detection accuracy and false positive rate). If one or more historical workpiece data have a similarity to the workpiece data to be detected that is higher than this threshold, the abnormal state of the workpiece to be detected is considered to be further confirmed, and the known abnormal details of these highly similar historical workpieces (such as defect level, handling suggestions, etc.) can be combined to enrich the description of the abnormal state of the workpiece to be detected. For example, if the candidate anomaly category of the workpiece to be inspected is "bearing vibration anomaly (high frequency)," and historical data of multiple bearings with high-frequency vibration anomalies is found by searching historical data, and similarity analysis reveals that the vibration spectrum of one of the historical bearings has a similarity of up to 93% with the vibration spectrum of the bearing to be inspected, and this historical bearing is identified as "severe high-frequency vibration anomaly caused by ball wear," then it can be inferred that the bearing to be inspected is very likely to have a similar ball wear problem, and its anomaly state can be determined as "high-frequency vibration anomaly of ball wear type (severe)." If the similarity between the data of the workpiece to be inspected and all historical workpiece data of the same category is below the threshold, there may be two situations: first, the candidate anomaly state of the workpiece to be inspected is a misjudgment, in which case the preliminary analysis results need to be re-examined; second, the workpiece to be inspected may have exhibited a new anomaly pattern under this anomaly category, in which case the system will mark it as "suspected new type of anomaly" and trigger further manual review or more in-depth feature analysis.

[0054] In the above-mentioned anomaly detection method, the identification image and workpiece data of the workpiece to be detected are acquired, and the workpiece identification is identified based on the identification image to determine reference data. Then, the workpiece data is detected using the reference data to obtain candidate anomaly states containing anomaly categories. Finally, by retrieving historical workpiece data of the same type of anomaly and performing similarity analysis, the final confirmation or refined judgment of the current workpiece anomaly state is achieved. This forms a complete closed-loop processing logic from data acquisition, identification and matching, preliminary detection to in-depth analysis, which effectively improves the accuracy and reliability of anomaly detection.

[0055] In one embodiment, the identification image includes image data and character data; the step of recognizing the identification image to obtain the workpiece identification of the workpiece to be detected includes:

[0056] The image data is identified to determine the initial workpiece identifier of the workpiece to be inspected.

[0057] If the image data does not identify a corresponding initial workpiece identifier, the character data is identified to determine the workpiece identifier of the workpiece to be detected.

[0058] If the image data identifies a corresponding initial workpiece identifier, the character data is identified to determine a candidate workpiece identifier for the workpiece to be inspected, and the workpiece identifier for the workpiece to be inspected is determined based on the initial workpiece identifier and the candidate workpiece identifier.

[0059] Specifically, the workpiece identifier of the workpiece to be detected is determined based on the initial workpiece identifier and the candidate workpiece identifier. This can be achieved by performing string matching on the initial workpiece identifier and the candidate workpiece identifier. If the two are completely identical (e.g., both are "SN202312001"), then the identical identifier can be used as the workpiece identifier of the workpiece to be detected. If the two are not completely identical, but meet a preset similarity condition, such as using an edit distance algorithm to calculate the similarity between the two, when the similarity is greater than or equal to a preset threshold (e.g., 95%), then further analysis can be performed based on the character composition patterns of the two identifiers. For example, suppose the initial workpiece identifier is "QR20231125-089" and the candidate workpiece identifier is "QR20231125-098". By comparison, it is found that only the last digits "89" and "98" are different. It may be a misjudgment of the digits "8" and "9" during OCR recognition. At this time, the system can extract the common part "QR20231125-0" and combine it with the numbering rules of the production batch of the workpiece (such as the maximum daily output is 100, and the numbering starts from 001) to determine which one, "089" or "098", is more in line with the actual production logic. If the production record of the day shows that the maximum number up to the present is 090, then "089" is more likely to be the correct identifier, thus determining "QR20231125-089" as the final workpiece identifier. If the similarity between the initial workpiece identifier and the candidate workpiece identifier is lower than a preset threshold, or if the system cannot determine the identifier using rules, an alarm mechanism will be triggered. The system will display the contents of the initial and candidate workpiece identifiers on the human-machine interface and prompt the operator for manual confirmation. The operator can select the correct identifier based on the physical identifier on the actual workpiece (e.g., by directly viewing the label on the workpiece) or manually enter the accurate workpiece identifier. After receiving the operator's confirmation instruction, the processing unit will use it as the final workpiece identifier for subsequent processing.

[0060] In one exemplary embodiment, if the QR code in the image data is complete and the character sequence is clear, the system can simultaneously initiate both QR code recognition and OCR character recognition processes. For example, the QR code decoding yields the initial workpiece identifier "P20230918-156", and the OCR-recognized character sequence is "P20230918-158". The only difference between the two is the last two digits, "6" and "8". At this point, the system calls the edit distance algorithm to calculate the similarity between the two, and the score is 8 (total length 13, number of differing characters 1, edit distance 1, similarity = (13-1) / 13≈92.3%), which is higher than the preset threshold (90%). Further analysis of the character image features revealed that the "8" character area recognized by OCR was slightly blurred, while the corresponding encoding module in the QR code image was complete. By comparing historical OCR recognition error cases, the probability of the number "6" being misjudged as "8" due to wear on the right vertical line was relatively high (accounting for 65% of this type of error). Therefore, the QR code recognition result "P20230918-156" was ultimately used as the workpiece identifier, and the character recognition difference and processing basis were recorded in the system log.

[0061] In this embodiment, by combining image data and character data in a dual recognition mechanism, along with similarity analysis and manual verification processes, the accuracy and robustness of workpiece identification are ensured. This effectively addresses the potential for misidentification or failure to identify using a single recognition method, providing a reliable prerequisite for subsequent acquisition of reference data based on the identification.

[0062] In one embodiment, the method further includes:

[0063] If the workpiece identifier is not recognized in either the image data or the character data, the input workpiece identifier or reference data of the workpiece to be detected is received.

[0064] The input reference data can include, but is not limited to, key indicators such as the workpiece's design parameters (e.g., theoretical dimensions, tolerance range), material properties (e.g., density, hardness standard values), and process requirements (e.g., welding current range, heat treatment temperature curve). For example, if an operator confirms that the workpiece is identified as "B20231210-052" but the system database does not yet store reference data for this batch, the operator can input the data item by item through the form controls on the interactive interface, such as "standard length: 150mm, allowable deviation ±0.3mm; standard tensile strength: ≥450MPa; surface roughness Ra≤1.6μm". After input, the system will automatically associate and store the reference data with the workpiece identification for direct retrieval during subsequent inspections of similar workpieces. If the operator chooses to directly input the reference data without inputting the workpiece identification, the system will generate a temporary inspection number (e.g., "TEMP-20231210-1435") for this inspection and bind the input reference data to the temporary number. After the inspection is completed, the operator can decide whether to add the workpiece identification or archive it as an unidentified inspection record.

[0065] In one exemplary embodiment, when the identification image of the workpiece to be inspected is severely damaged (e.g., the QR code is completely blurred, or the character area is obscured), making it impossible to identify the workpiece identification from either the image data or the character data, a prompt window can pop up on the inspection interface, displaying "No workpiece identification detected. Please select the input method: 1. Manually input the workpiece identification; 2. Directly enter reference data." If the operator selects "Manually input the workpiece identification," they can input the unique identification code of the workpiece (e.g., "M20231210-078") via the virtual keyboard. After receiving the input, the system will automatically search the database to see if there is reference data corresponding to the identification. If it exists, it will be retrieved and used directly; if it does not exist, the system will further prompt "No associated reference data for this workpiece identification. Please enter additional data," and will redirect to the reference data entry interface. If the operator selects "Directly Enter Reference Data," the system skips the workpiece identification matching step and directly displays the reference data entry template. The operator must fill in the following information according to the workpiece's design drawings or process documents: "Workpiece Type (e.g., shaft / disc)," "Key Dimensions (e.g., diameter Φ50±0.02mm, length 120±0.1mm)," "Material Grade (e.g., 45# steel)," and "Inspection Items (e.g., hardness HB200-250, no surface cracks)." During the entry process, the system will perform validity checks on some fields (e.g., dimension inputs must include both numerical value and unit, and material grades must be selected from the preset material library or manually confirmed) to ensure the entered reference data is formatted correctly and complete. For example, if the operator mistakenly enters "120" instead of "length 120mm" (missing a unit), the system will prompt "Please add the dimension unit (e.g., mm, cm)" and highlight the incorrect field until the input meets the requirements. Only then can the operator click the "Confirm Entry" button to complete the reference data setting and proceed to the workpiece data inspection process.

[0066] In this embodiment, by providing alternative solutions such as manually inputting workpiece identification or directly entering reference data, the problem of interruption of the detection process due to failure of identification image recognition is effectively avoided, the adaptability and operational flexibility of the device under complex working conditions are enhanced, and the detection work can still be carried out smoothly even under extreme conditions.

[0067] In one embodiment, the workpiece data includes ultrasonic workpiece data; the step of detecting the workpiece data of the workpiece to be inspected based on the reference data and determining candidate abnormal states of the workpiece data includes:

[0068] Given the ultrasonic workpiece data of the workpiece to be inspected, feature extraction is performed on the ultrasonic workpiece data of the workpiece to be inspected to obtain the feature data of the workpiece to be inspected.

[0069] The feature data is input into a preset anomaly classification model to determine the initial anomaly state of the workpiece to be inspected.

[0070] Based on the reference data and the initial abnormal state, the workpiece data of the workpiece to be inspected is detected to determine the candidate abnormal state of the workpiece data.

[0071] The feature extraction of the ultrasonic shape data of the workpiece to be tested can be achieved through the following steps: preprocessing the original ultrasonic shape data, which may include filtering (such as using wavelet threshold denoising to remove high-frequency interference noise), signal smoothing (such as using moving average to process signal fluctuations), and baseline correction (eliminating baseline drift caused by probe coupling instability). After preprocessing, the time-domain and frequency-domain features of the waveform are extracted. The time-domain features may include peak amplitude (e.g., the maximum peak voltage of the echo signal is 2.8V), peak position (e.g., a reflected peak appears 35mm away from the probe incident point), number of peaks (e.g., three obvious peaks appear within the effective detection range), pulse width (e.g., the full width at half maximum of the main peak is 0.8μs), and rise time (e.g., the time to rise from 10% amplitude to 90% amplitude is 0.3μs). The frequency-domain features are obtained by performing a Fast Fourier Transform (FFT) on the preprocessed time-domain signal, including characteristic frequency (e.g., a significant peak appears at 3.5MHz in the spectrum), spectral energy distribution (e.g., the energy in the 2-4MHz band accounts for 68% of the total energy), and bandwidth (e.g., the -3dB bandwidth is 1.2MHz). These feature data collectively constitute a multi-dimensional vector describing the characteristics of the ultrasonic wave, such as (amplitude 2.8V, position 35mm, number 3, peak half-width at half-maximum 0.8μs, characteristic frequency 3.5MHz, energy percentage of 2-4MHz band 68%). The extracted feature data is input into a pre-defined anomaly classification model, which is typically trained based on historical ultrasonic testing data, using architectures such as Support Vector Machine (SVM) or Convolutional Neural Network (CNN). The model matches the input feature vector with the feature distribution of various anomaly patterns (such as cracks, porosity, inclusions, etc.), outputting the initial anomaly state of the workpiece to be inspected, such as "suspected porosity anomaly," and providing the confidence level of the classification result (e.g., 85%). Subsequently, further inspection of the workpiece data is performed based on reference data and the initial anomaly state. The reference data related to ultrasonic testing may include standard waveform feature ranges (e.g., the peak amplitude of a normal workpiece should be between 1.5-2.5V, and the characteristic frequency should be concentrated between 3.0-3.3MHz), allowable defect size thresholds (e.g., the diameter of a single pore should not exceed 0.3mm), etc. For example, if the initial abnormal state is "suspected porosity anomaly" and the extracted peak amplitude is 2.8V (exceeding the 1.5-2.5V range in the reference data), then based on the rule in the reference data that "amplitude anomalies may indicate internal defects", the abnormal state is initially identified as a candidate abnormal state, and the abnormal parameters in the feature data (such as amplitude exceeding the standard by 0.3V, feature frequency offset by 0.2MHz) are recorded to provide a basis for subsequent similarity analysis with historical workpiece data.

[0072] In this embodiment, by extracting multi-dimensional features from ultrasonic workpiece data and combining them with a preset anomaly classification model and reference data for hierarchical detection, a systematic analysis path from signal preprocessing and feature quantization to preliminary anomaly judgment is constructed. This approach utilizes the pattern recognition capability of the model algorithm and incorporates the process standard constraints of the reference data, laying a technical foundation for the accurate identification of candidate anomaly states.

[0073] In one embodiment, the step of performing similarity analysis between the workpiece data of the historical workpiece and the workpiece data of the workpiece to be inspected to determine the abnormal state of the workpiece to be inspected includes:

[0074] The first feature vector of the workpiece data of the workpiece to be detected and the second feature vector of the workpiece data of each historical workpiece are extracted respectively.

[0075] Calculate the similarity score between the first feature vector and each of the second feature vectors.

[0076] Based on the similarity score, the abnormal state of the workpiece to be detected is determined.

[0077] The first and second feature vectors can include key feature parameters of the workpiece data. For example, for ultrasonic testing data, the feature vectors can include quantitative indicators such as peak amplitude, peak position, characteristic frequency, and spectral energy ratio; for dimensional testing data, they can include the deviation between the actual measured size and the standard size, and the dimensional fluctuation range. When calculating the similarity score, a cosine similarity algorithm or a Euclidean distance algorithm can be used to numerically compare the first feature vector with each of the second feature vectors. For example, if the first feature vector of the workpiece to be tested is (amplitude 2.8V, position 35mm, characteristic frequency 3.5MHz), and the second feature vector of a historical workpiece is (amplitude 2.7V, position 34.8mm, characteristic frequency 3.45MHz), the similarity score calculated using cosine similarity is 0.96; while the second feature vector of another historical workpiece is (amplitude 1.8V, position 20mm, characteristic frequency 3.1MHz), the similarity score is only 0.62. Based on the similarity score, the system can set a similarity threshold (e.g., 0.85) and use the abnormal states corresponding to historical workpiece data with scores higher than the threshold as a reference. If multiple historical workpieces have abnormal states exceeding the threshold and their abnormal states are consistent (e.g., all are "porosity anomalies"), then the abnormal state is directly identified as the abnormal state of the workpiece to be detected. If multiple highly similar historical workpieces have inconsistent abnormal states (e.g., some are "cracks," some are "inclusions"), then a comprehensive judgment is made by combining the confidence level of each historical workpiece's abnormal state with the specific differences in feature vectors from the workpiece to be detected. For example, if two historical workpieces have similarity scores of 0.92 (abnormal state "crack," confidence level 90%) and 0.88 (abnormal state "inclusions," confidence level 85%), the system will compare the feature differences between the workpiece to be detected and the two. If the rise time of the peak of the workpiece to be detected (0.3μs) is closer to the rise time of the historical workpiece with "cracks" (0.28μs), but significantly different from the rise time of the historical workpiece with "inclusions" (0.45μs), then "cracks" will be prioritized as the abnormal state of the workpiece to be detected, and the comprehensive judgment basis will be noted in the results. If the similarity score of all historical workpiece data is lower than the threshold, the system determines that the abnormal state of the workpiece to be detected is "unknown type of abnormality" and triggers a deep analysis process, such as calling a more complex multi-model fusion algorithm or prompting engineers to conduct a special analysis.

[0078] In this embodiment, a structured comparison mechanism based on feature vectors is constructed to quantitatively match the multidimensional feature parameters of historical workpieces and the workpiece to be inspected. Combined with similarity threshold filtering and weighted anomaly state confidence, the goal of transferring knowledge from historical data to assist current inspection decisions is achieved. This data-driven similarity analysis method not only effectively utilizes past inspection experience but also improves the scenario adaptability of anomaly state judgment by dynamically adjusting feature weights (such as assigning higher weights to features related to key process parameters). Especially when candidate anomaly states are ambiguous, it provides interpretable quantitative evidence for accurate classification.

[0079] In one embodiment, the workpiece data includes detection location; the method includes:

[0080] In response to a target storage instruction, image data of the workpiece to be inspected is acquired.

[0081] The image data, abnormal status, and detection location of the workpiece to be inspected are bound into a target data packet, and the target data packet is stored in the target database.

[0082] The target storage command can be automatically triggered by the system after an abnormal state is determined, or manually triggered by the operator clicking the "Store Detection Results" button on the detection interface. The acquired image data of the workpiece to be inspected includes the original overall appearance image of the workpiece, magnified images of key detection areas (such as real-time images of the ultrasonic probe coupling position, optical imaging images during dimensional measurement), and the original image when identifying the workpiece markings (even if the markings are not successfully identified, the image is still stored for traceability). The detection location information is specified to the three-dimensional coordinates or relative position description of the workpiece, such as "Φ50mm outer circular surface of shaft workpiece A end (0° position in the circumferential direction 20mm away from the end face)" or "M10-3 bolt hole on the upper surface of disc workpiece (the 3rd hole in the positive X-axis direction with the workpiece center as the origin)". This information is automatically recorded by the positioning system of the detection equipment (such as robotic arm coordinates, visual positioning marks) or manually selected and entered by the operator according to the detection point number in the process drawing (such as selecting "Detection Point D3-02" from the drop-down list). When binding image data, abnormal status, and detection location into a target data package, the system generates a unique detection record ID (e.g., “REC-20231210-0089”) for the data package and automatically adds metadata such as detection time (accurate to the second), detection device number (e.g., “UT-05”, “VM-12”), and operator ID. For example, a complete target data package includes: detection record ID “REC-20231210-0089”, image data (3 images: overall workpiece view, enlarged view of Φ50mm outer surface, and original QR code recognition image), abnormal status “candidate abnormal status: crack (confidence 88%), feature data: amplitude 2.8V, position 35mm”, detection location “Φ50mm outer surface of shaft workpiece A end (0° position in the circumferential direction, 20mm from the end face)”, detection time “2023-12-10 15:30:22”, device number “UT-05”, and operator ID “OP-1024”. The target database adopts a distributed storage architecture, which is partitioned and stored according to workpiece type (such as "shaft", "disc", "box") and inspection date. It supports fast retrieval based on multi-dimensional fields such as inspection record ID, workpiece identifier, inspection location, and abnormal status. At the same time, the image data is compressed and encoded (such as using JPEG2000 format) to save storage space and ensure that the data packets can be efficiently called in subsequent quality traceability, process optimization analysis or historical data similarity comparison.

[0083] In this embodiment, by structurally binding the image data, abnormal state, and detection location of the workpiece to be inspected, and combining this with metadata to generate a complete target data package, full-element recording and traceable management of the detection results are achieved. This standardized storage method for data packages not only provides multi-dimensional retrieval criteria including spatial location, visual features, and abnormal attributes for subsequent historical data similarity analysis, but also optimizes storage efficiency and access speed while ensuring data integrity through partitioned storage and compression encoding strategies, thus building a reliable data foundation for data accumulation and knowledge deposition during the long-term operation of the device.

[0084] In one exemplary embodiment, the anomaly detection method may include detection preparation and intelligent standard matching: An operator uses an intelligent ultrasonic probe to inspect the workpiece. The camera on the probe automatically captures the workpiece surface number (such as a stamp or QR code). The information recognition and retrieval module reads the number using OCR (Optical Character Recognition) or QR code recognition technology and automatically queries the workpiece information database for key information such as material, thickness, and welding process. Based on this information, the system automatically retrieves preset, precisely matched acceptance standards (such as rejection lines, quantitative lines, and rating grades) from the acceptance standard library and automatically sets the ultrasonic instrument's detection parameters. If the workpiece has no number or recognition fails, the system provides a manual input interface. If the database does not contain workpiece information, the standard recommendation submodule recommends the most commonly used acceptance standards based on the workpiece type or provides a list for manual selection. Flaw detection process and human-machine collaborative decision-making: The operator performs scanning according to the standard procedure. When a suspicious defect echo appears on the A-scan interface, the intelligent auxiliary diagnosis module calculates the waveform characteristics (such as echo height, position, waveform envelope, etc.) in real time and quickly compares it with historical cases in the defect map library. The system displays one or more recommended judgment results (such as "porosity", "crack", "slag inclusion") on the interface, along with their confidence levels. Operators can judge the system's recommendations based on their experience: Acceptable judgment: Direct confirmation is possible, and the system records the result. Uncertain judgment: Click the "Suspected / Uncertain" button. At this point, the system will pop up a similar case comparison interface, displaying several cases with the most similar waveform characteristics in the historical database and their final judgment conclusions, assisting operators in decision-making. Regardless of whether it is confirmed or not, when it is necessary to record the defect location for re-inspection or expert review, the operator can press the custom function key on the probe to trigger the data synchronization and storage module. This module will immediately bind the current ultrasonic waveform, probe position (which can be a manually measured result or a manual label at the defect location), and the real-time image of the workpiece surface captured by the camera, saving them as a "data package" to the defect atlas library. This image greatly facilitates subsequent defect location and re-inspection. Knowledge accumulation and model self-evolution: For all data packages marked as "Suspected / Uncertain" and stored, the system will mark them as "Pending expert review". Subsequently, senior experts or other detection methods (such as RT) will make a final ruling on these questionable cases. The model self-learning module will use the expert's final ruling as a "tag" for the data packet, formally incorporating it into the defect map library, and using these new, validated samples to fine-tune and optimize the internal diagnostic model (such as a machine learning-based classifier). Through this closed-loop process, the system accumulates increasingly rich "experience," and its accuracy and reliability in assisted diagnosis continuously improve. Specifically, the probe can be as follows: Figure 3As shown, specifically, pressing a button can trigger the camera to take a picture. When the probe is close to the object being measured, it can display the largest and clearest image, which is also the most suitable time to capture images when weld defects are detected.

[0085] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0086] Based on the same inventive concept, this application also provides an anomaly detection device for implementing the anomaly detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more anomaly detection device embodiments provided below can be found in the limitations of the anomaly detection method described above, and will not be repeated here.

[0087] In one embodiment, such as Figure 4 As shown, an anomaly detection device 400 is provided, including: a data acquisition module 401 and a workpiece detection module 403, wherein:

[0088] The data acquisition module is used to acquire the identification image and workpiece data of the workpiece to be inspected;

[0089] The data acquisition module is further configured to recognize the identification image to obtain the workpiece identification of the workpiece to be inspected; and to determine the reference data of the workpiece to be inspected based on the workpiece identification;

[0090] The workpiece inspection module is used to inspect the workpiece data of the workpiece to be inspected based on the reference data, and determine the candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include anomaly categories.

[0091] The workpiece detection module is further configured to acquire historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected, and determine the anomaly state of the workpiece to be detected.

[0092] Each module in the aforementioned anomaly detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0093] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an anomaly detection method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0094] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0095] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0096] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0097] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0098] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An anomaly detection method, characterized in that, The method includes: Acquire the identification image and workpiece data of the workpiece to be inspected; The identification image is recognized to obtain the workpiece identification of the workpiece to be inspected; and reference data of the workpiece to be inspected is determined based on the workpiece identification. Based on the reference data, the workpiece data of the workpiece to be inspected is detected to determine candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include abnormal categories; Obtain the historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected to determine the anomaly state of the workpiece to be detected.

2. The method according to claim 1, characterized in that, The identification image includes image data and character data; the process of recognizing the identification image to obtain the workpiece identification of the workpiece to be inspected includes: The image data is identified to determine the initial workpiece identifier of the workpiece to be detected; If the image data does not identify a corresponding initial workpiece identifier, the character data is identified to determine the workpiece identifier of the workpiece to be detected. If the image data identifies a corresponding initial workpiece identifier, the character data is identified to determine a candidate workpiece identifier for the workpiece to be inspected, and the workpiece identifier for the workpiece to be inspected is determined based on the initial workpiece identifier and the candidate workpiece identifier.

3. The method according to claim 2, characterized in that, The method further includes: If the workpiece identifier is not recognized in either the image data or the character data, the input workpiece identifier or reference data of the workpiece to be detected is received.

4. The method according to claim 1, characterized in that, The workpiece data includes ultrasonic workpiece data; the step of detecting the workpiece data of the workpiece to be inspected based on the reference data and determining candidate abnormal states of the workpiece data includes: In the case of ultrasonic workpiece data of the workpiece to be inspected, feature extraction is performed on the ultrasonic workpiece data of the workpiece to be inspected to obtain feature data of the workpiece to be inspected. The feature data is input into a preset anomaly classification model to determine the initial anomaly state of the workpiece to be inspected; Based on the reference data and the initial abnormal state, the workpiece data of the workpiece to be inspected is detected to determine the candidate abnormal state of the workpiece data.

5. The method according to claim 1, characterized in that, The step of performing similarity analysis between the workpiece data of the historical workpieces and the workpiece data of the workpiece to be inspected to determine the abnormal state of the workpiece to be inspected includes: Extract the first feature vector of the workpiece data of the workpiece to be inspected and the second feature vector of the workpiece data of each historical workpiece, respectively. Calculate the similarity score between the first feature vector and each of the second feature vectors; Based on the similarity score, the abnormal state of the workpiece to be detected is determined.

6. The method according to claim 1, characterized in that, The workpiece data includes the detection position; the method includes: In response to a target storage instruction, image data of the workpiece to be detected is acquired; The image data, abnormal status, and detection location of the workpiece to be inspected are bound into a target data packet, and the target data packet is stored in the target database.

7. An anomaly detection device, characterized in that, The device includes: The data acquisition module is used to acquire the identification image and workpiece data of the workpiece to be inspected; The data acquisition module is further configured to recognize the identification image to obtain the workpiece identification of the workpiece to be inspected; and to determine the reference data of the workpiece to be inspected based on the workpiece identification; The workpiece inspection module is used to inspect the workpiece data of the workpiece to be inspected based on the reference data, and determine the candidate abnormal states of the workpiece data; wherein, the candidate abnormal states include anomaly categories; The workpiece detection module is further configured to acquire historical workpieces corresponding to the anomaly category; perform similarity analysis on the workpiece data of the historical workpieces and the workpiece data of the workpiece to be detected, and determine the anomaly state of the workpiece to be detected.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.