A mold monitoring and clamping interlocking method based on control event and visual event checking

By synchronously acquiring control event and visual event sequences, using a matching cost function for verification, and selecting stable image frames for anomaly detection, the problem of phase detection deviation and control-physical state disconnect in mold monitoring devices is solved, thereby improving the accuracy and safety of mold monitoring.

CN123047412APending Publication Date: 2026-11-06WUXI JIEBAILI AUTOMATION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611338957.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing mold monitoring devices in molding equipment have a problem with phase detection deviation and disconnect between control and physical state, which leads to misjudgment of mold closing and damage to the mold.

Method used

By synchronously acquiring the control event sequence of the molding equipment and the continuous image sequence of the mold area, the time residual, timing sequence and physical logic constraint verification of the event sequence are performed using the matching cost function. The image frame with the highest stability is selected for anomaly detection to ensure that mold closing permission is output only when the electrical phase and physical phase are consistent.

Benefits of technology

It effectively overcomes the problems of mechanical vibration and control signal misinterpretation, and improves the accuracy of interlock control of molding equipment and the safety of production operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047412A_ABST
    Figure CN123047412A_ABST
Patent Text Reader

Abstract

This invention relates to the field of industrial machine vision and molding equipment interlocking technology, specifically to a mold monitoring and mold closing interlocking method based on control event and visual event verification, comprising the following steps: Step S200: forming a process phase sequence based on the control events, and extracting a visual event sequence from the continuous image sequence; Step S300: constraining and verifying the control event sequence and the visual event sequence according to the event sequence and time residual, and determining a phase consistency window. This invention synchronously acquires control event sequences and visual event sequences under the same time base, and uses a matching cost function to strictly constrain and verify the time residual, timing sequence, and physical logic of the two types of events, abandoning the blindness of traditional fixed-delay image acquisition, and achieving adaptive extraction of the most stable image frame from a dynamic "phase consistency window"; combined with spatial position correction of structural anchor points and strict Boolean logic gating output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial machine vision and molding equipment interlocking technology, specifically to a mold monitoring and mold closing interlocking method based on control event and visual event verification. Background Technology

[0002] In molding processes such as injection molding and die casting, which involve complex mechanical mold opening and closing mechanisms, the stable operation of the molding cycle highly depends on the precise emptying of mold cavity residues and the complete return of ejector components (such as ejector pins and ejector plates). To prevent damage to high-value molds caused by forcibly closing the mold before the product has detached or the moving parts have returned to their original positions, existing technologies typically add machine vision monitoring devices to the external control system of the molding equipment.

[0003] Existing mold monitoring devices generally employ an image acquisition strategy based on a single electrical control signal trigger with an additional fixed delay when acquiring detection images. For example, upon receiving a "mold opening complete" or "ejection return" relay signal from the molding equipment, an internal timer is activated, and after the fixed delay, the camera is controlled to capture single or multiple frames for visual comparison. However, this technical solution suffers from a core flaw in practical industrial applications: "phase detection deviation and disconnect between control and physical state," which is difficult to overcome.

[0004] Specifically, this core issue manifests in two dimensions: First, during the production process of different batches or even adjacent cycles, the molding equipment is affected by fluctuations in the hydraulic system, wear of the mechanical structure, and changes in the product's demolding friction. The decay time of mechanical vibration caused by the mold opening action and the physical separation time of the product due to gravity are dynamically changing. Using a rigid, fixed delay mechanism is problematic. If the delay is set too short, the camera will capture an image before the mold has fully stopped or is vibrating, resulting in severe motion blur. If the delay is set too long, the actual image state may have deviated from the optimal process detection phase, leading to false detections. Second, the control signals of the molding equipment (such as the ejector return sensor trigger signal) only represent the state of the control system's electrical circuit or the issuance of action commands, and cannot be absolutely equated to the mold area reaching the corresponding physical state. For example, when the ejector plate fails to return to its original position due to mechanical jamming or is blocked by foreign objects during molding and fails to retract to its physical extreme point, the electrical interface may still output a level signal indicating that the ejector has returned to its original position. If existing technology relies solely on this single control signal as the absolute prerequisite for image acquisition and detection without cross-checking the electrical control state and the actual visual physical state, it will be very easy to perform image discrimination in the misalignment range where the signal and physical facts contradict each other, thus giving incorrect allowable mold closing signals, ultimately leading to mold pressing damage. Summary of the Invention

[0005] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a mold monitoring and mold closing interlocking method based on control event and visual event verification, including the following steps: Step S100: Acquire the control event sequence of the molding equipment and the continuous image sequence of the mold area, and record the acquisition time of the control event and each image frame; Step S200: Form a process phase sequence based on the control events, and extract a visual event sequence from the continuous image sequence; Step S300: Perform constraint verification on the control event sequence and the visual event sequence according to the event sequence and time residual to determine the phase consistency window; Step S400: Within the phase-consistent window, select a target detection frame based on image stability, and perform anomaly detection on the detection region in the target detection frame; Step S500: When there is no phase contradiction, the target detection frame meets the judgment condition, and the detection area is not abnormal, drive to allow mode combination output; otherwise, do not drive to allow mode combination output and drive alarm output.

[0006] Further, the acquisition of the control event sequence of the molding equipment in step S100 includes: acquiring the relay input state change of the molding equipment through the relay input interface, and the resulting control event sequence includes at least the mold opening end event, the ejection return event, and the safety door input event; The recording of the control event and the acquisition time of each image frame includes: using the monotonic clock of the processing device in the mold monitoring device as a unified time base, recording the control time triggered when the control event occurs and the arrival time of each image frame after being acquired by the camera and transmitted to the processing device.

[0007] The resulting control event sequence is expressed as a set of tuples consisting of control event types and corresponding recording times; the continuous image sequence is expressed as a set of tuples consisting of image frame data and corresponding recording times.

[0008] Furthermore, the process phase sequence formed according to the control events in step S200 includes: setting the mold opening end, ejection action, ejection return and detection completion as progressive process phase states in sequence according to the preset state transition relationship; when the collected control events are missing, repeated or have abnormal sequence, the control phase of the current molding cycle is marked as abnormal and the mold closing output is not driven.

[0009] Further, the step S200 of extracting the visual event sequence from the continuous image sequence includes: Calculate the global displacement between adjacent image frames in the structural anchor point region of the mold, and generate a mold stop event when the global displacement is continuously lower than the stop threshold. Calculate the contour displacement or foreground occupancy in the ejected component area, and generate an ejected component return event when the contour displacement or foreground occupancy continuously meets the return threshold. Calculate the grayscale difference or foreground occupancy in the residual area of ​​the mold cavity, and generate a mold cavity clearing event when the grayscale difference or foreground occupancy continuously meets the clearing threshold; In step S200, when generating the mold stop event, ejector component return event, or mold cavity clearing event, a hysteresis judgment logic with different opening and closing thresholds is adopted, and the corresponding visual event is determined to be effective when the number of frames in which the event judgment index continuously meets the corresponding threshold reaches the preset minimum continuous frame number.

[0010] Further, the constraint verification of the control event sequence and the visual event sequence according to the event sequence and time residual in step S300 includes: establishing a matching pair between the mold opening end event in the control event sequence and the mold stop event in the visual event sequence according to the preset event type correspondence, and establishing a matching pair between the ejection return event in the control event sequence and the ejection component return event in the visual event sequence. The constraint verification in step S300 uses a matching cost function for quantitative evaluation. The formula for calculating the matching cost function is as follows: in, To control when events are recorded, The time of occurrence of the visual event corresponding to this control event. Nconflict represents the number of events that violate a preset sequence relationship, α, β, and γ are preset weights, and Nconflict represents the number of contradictory events; only in the matching cost function When the number of conflicting events Nconflict is zero and the number of conflicting events is not greater than the preset verification threshold, the phase-consistent window is formed based on the occurrence time of the matching event and the preset offset range.

[0011] Furthermore, the constraint verification in step S300 also includes phase contradiction determination: when the control event indicates that the ejector component has returned to its original position but the visual event indicates that the ejector component has not returned to its original position, or when the control event indicates that the detection stage has been entered but the visual event indicates that the mold is still in motion, the phase contradiction result is determined and the mold closing output is not driven.

[0012] Further, the step S400 of selecting the target detection frame based on image stability includes: according to the stability function. Calculate the stability of each candidate image frame within the phase-consistent window, where, The normalized motion residual of the structural anchor point relative to adjacent image frames. To normalize image blur, and Preset weights; select the image frame with the smallest stability S and not greater than the preset stability threshold from the phase consistency window as the target detection frame.

[0013] Furthermore, before performing anomaly detection on the detection region in the target detection frame, step S400 also includes structural anchor point spatial correction processing: locating multiple structural anchor points in the target detection frame, estimating rigid transformation or affine transformation based on the multiple structural anchor points and their corresponding structural anchor points in the reference image, and using the rigid transformation or affine transformation to correct the position of the detection region; when the number of matching structural anchor points is insufficient or the transformation residual is greater than the spatial correction threshold, the target detection frame is determined to not meet the judgment condition; The anomaly detection of the detection area specifically includes at least two of the following: performing grayscale difference, contour comparison, or foreground segmentation on the residual area of ​​the mold cavity after spatial correction and the reference area to determine whether there are residues in the mold cavity; and comparing the position or occupancy of the ejector component return area after spatial correction with the return reference area to determine whether the ejector component has completed its return; if any one of the detection results is abnormal, a judgment result of the anomaly of the detection area is generated.

[0014] Furthermore, the logic condition for enabling the mode-combining output described in step S500 is expressed as a Boolean logic expression: in, To determine the phase-consistent results that are within the phase-consistent window and do not exhibit phase inconsistencies, The result is that the target detection frame satisfies the judgment condition. The detection area has an abnormal determination result; only when the logical variable When the value of is true, the driver allows the mode-combining output; when the value of is true, the driver allows the mode-combining output. When the value is false, the mode closing output is not enabled and the alarm output is enabled.

[0015] Furthermore, step S500 also includes traceability and verification processing: the processing device of the mold monitoring device stores the control events, visual events, event constraint verification results, target detection frames, area detection results, and results of allowing mold closing output or alarm output for each molding cycle, for tracing alarm causes and verifying detection results, and the traceability and verification processing does not change the logical conditions for driving to allow mold closing output.

[0016] Beneficial effects This invention synchronously acquires control event sequences and visual event sequences under the same time base, and uses a matching cost function to strictly constrain and verify the time residuals, temporal order, and physical logic of the two types of events. It abandons the blindness of traditional fixed-delay image acquisition and achieves adaptive extraction of the most stable image frames from a dynamic "phase-consistent window". Combined with the spatial position correction of structural anchor points and strict Boolean logic gating output, this invention effectively overcomes the misjudgment problems caused by mechanical vibration, camera micro-motion, and contradictions between control signals and the physical reality. It ensures that the mold monitoring system only outputs mold closing permission under the stringent condition that the electrical phase and physical phase are completely consistent and the image is of high quality and can be judged, which significantly improves the accuracy of interlocking control of molding equipment and the safety of production operation. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram illustrating the constraint verification of control events and visual events according to the present invention. Detailed Implementation

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

[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but includes other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] The present invention will now be described in further detail with reference to the accompanying drawings: Example: like Figures 1-2 As shown, a mold monitoring and mold closing interlocking method based on control event and visual event verification includes the following steps: Step S100: Acquire the control event sequence of the molding equipment and the continuous image sequence of the mold area, and record the acquisition time of the control events and each image frame; Step S200: Form a process phase sequence based on control events and extract a visual event sequence from a continuous image sequence; Step S300: Perform constraint verification on the control event sequence and visual event sequence according to the event sequence and time residual to determine the phase consistency window; Step S400: Within the phase-consistent window, select the target detection frame based on image stability, and perform anomaly detection on the detection region in the target detection frame; Step S500: When there is no phase contradiction, the target detection frame meets the judgment condition, and there is no abnormality in the detection area, drive the mode-combining output to be enabled; otherwise, do not drive the mode-combining output to be enabled and drive the alarm output.

[0021] Furthermore, the specific implementation process of step S100 is as follows: In the specific implementation of step S100, the mold monitoring device establishes a physical signal connection with the electrical control system of molding equipment such as injection molding machines or die casting machines through the relay input / output interface 30. The relay input / output interface 30 integrates an opto-isolation circuit and general-purpose input / output pins. The control nodes of the molding equipment, including the output terminals of the mold opening end-stroke switch, the ejection end sensor, and the safety door status relay, are respectively connected to specific opto-isolated input channels of the relay input / output interface 30. The processing device 40 monitors the level changes of the relay input / output interface 30 through a hardware interrupt pin or a periodic level polling mechanism. When a high-low level transition is detected in a certain input channel, i.e., a rising edge transitioning from low to high or a falling edge transitioning from high to low, the processing device 40 identifies the corresponding electrical action and parses it into a specific control event type. The signal transition triggered by the closure of the mold opening end-stroke switch contact is parsed as a mold opening end event; the signal transition triggered by the ejection end sensor is parsed as an ejection return event; and the signal transition triggered by the safety door position sensor is parsed as a safety door input event.

[0022] Simultaneously, under the constant or pulse-compensated light source provided by the illumination device 20, the camera 10 continuously acquires images of the mold area containing the moving mold and the fixed mold. The camera 10 transmits the acquired video frame stream to the processing device 40 in real time via an industrial bus (such as GigEVision bus, USB 3.0 bus, or CSI interface). The processing device 40 allocates a dynamic circular buffer in the system memory to temporarily store the received continuous image frames. Each frame of image data contains a grayscale image matrix or an RGB three-channel image matrix. The matrix dimensions are determined by the photosensitive resolution of the camera 10 (e.g., 1920×1080 pixels), and the sampling depth of a single pixel is 8 bits or 16 bits.

[0023] In order to eliminate the asynchronous deviation between the clock of the programmable logic controller (PLC) inside the molding equipment and the image acquisition clock of the mold monitoring device, the processing device 40 uses a monotonic clock composed of internal hardware timers to establish a unified time base coordinate system.

[0024] When the hardware interrupt controller of the processing unit 40 detects a level transition signal triggered by the relay input / output interface 30, the interrupt service routine immediately reads the current count value of the monotonic clock and generates a control time with microsecond-level precision. When an image frame acquired by the camera 10 is completely transferred to the memory circular buffer of the processing unit 40 via the direct memory access (DMA) controller and triggers a frame end interrupt, the processing unit 40 again reads the current count value of the same monotonic clock and generates the frame arrival time of that image frame. Both the control time and the frame arrival time originate from the same monotonic clock time base within the processing unit 40, eliminating interference from network time synchronization or clock drift between different devices on the accuracy of the timestamp.

[0025] The processing device 40 binds the parsed control event types with their corresponding control moments, generating control event tuples. The control event types are encoded using preset integer enumeration values ​​or binary bit masks; for example, the value "1" represents the mold opening completion event, "2" represents the ejection return event, "3" represents the safety door closing event, and "4" represents the safety door opening event. The processing device 40 stores multiple control event tuples generated sequentially in chronological order into a control event queue, constructing a control event sequence. ,in Indicates the first The type encoding of each control event, Indicates the first The recording time of each control event under a monotonic clock.

[0026] The processing device 40 binds the image frame data in the memory circular buffer with the corresponding frame arrival time to generate an image frame tuple. The processing device 40 stores multiple image frame tuples arranged in order of frame sampling time into an image data queue, constructing a continuous image sequence. ,in Indicates the first Pixel matrix data of a frame image, Indicates the first The recording time of the frame image under the same monotonic clock. During algorithm execution, the sequence of control events. With continuous image sequences Dynamic updates and queue maintenance are maintained in the random access memory of the processing device 40 to provide a data source with a unified time scale for logic state machine analysis and image analysis in subsequent steps.

[0027] Furthermore, the specific implementation process of step S200 is as follows: In the specific implementation of step S200, the processing device 40 reads the control event sequence generated in step S100. The process phase sequence is constructed using a built-in finite state machine model. The processing device 40 pre-sets five progressively distributed process phase nodes in the finite state machine: initial idle state, mold opening end phase state, ejection action phase state, ejection return phase state, and detection completion phase state. The finite state machine internally maintains a current phase state variable. During the initial stage of the molding equipment's operation, the current phase state variable is initialized to the initial idle state. When the processing device 40 retrieves the control event sequence... The system reads the mold opening end event with type code "1", and the recording time of the mold opening end event is also read. When the reset time is greater than the previous molding cycle, the processing device 40 drives the current phase state variable to transition from the initial idle state to the mold opening end phase state. In the mold opening end phase state, when the processing device 40 receives an ejection mechanism action signal, it drives the current phase state variable to transition to the ejection action phase state. When the processing device 40 reads an ejection return event with type code "2", it drives the current phase state variable to transition to the ejection return phase state. During the sequential transition of the current phase state variable along the preset path, if the processing device 40 detects a timing disorder in the control events—for example, skipping the mold opening end event in the initial idle state and directly reading the ejection return event, or continuously receiving multiple duplicate mold opening end events within the same molding cycle—the processing device 40 immediately determines that the control event logic is abnormal, triggers the control phase abnormality flag to be set, marks the control phase state of the current molding cycle as abnormal, and blocks subsequent relay drive signals.

[0028] For the extraction of visual event sequences, the processing device 40 targets continuous image sequences. The processing unit 40 performs multi-region parallel image analysis on each image frame. To extract the mold stopping event, the processing unit 40 extracts pre-calibrated structural anchor point regions in the image pixel coordinate system. The structural anchor point regions are selected within the pixel rectangles containing the screw holes of the mold fixing plate or the mold positioning pins. The processing unit 40 uses the Lucas-Kanade optical flow algorithm to analyze the current image frame. Compared with the previous image frame Feature tracking is performed on pixels within the structural anchor point region. The two-dimensional motion vector of each pixel is calculated, and the average amplitude of the motion vectors of all feature points is obtained to determine the global displacement at the current image frame. To eliminate interference from minor mechanical vibrations and ambient light flickering on the static determination, the processing device 40 employs a dual-threshold hysteresis determination logic. The processing device 40 sets a stop-start threshold. With stop and close threshold The threshold for stopping the start is less than the threshold for stopping the stop. When the global displacement... First drop below the stop-start threshold At that time, the processing device 40 starts the internal frame counter; if in the continuous Global displacement in a frame image (e.g., three consecutive frames). All remain below the stop-start threshold The processing device 40 determines that the mold structure has completely stopped, generates a mold stop event, and then... Recording time of frame image The moment of occurrence of the mold stop event is used as the time, and the reciprocal of the displacement residual is calculated as the confidence level of the mold stop event.

[0029] In order to extract from a continuous image sequence The processing device 40 extracts the return event of the ejector component and extracts the pre-defined region of interest (ROI) of the ejector component in the image pixel coordinate system. The ROI of the ejector component covers the physical motion trajectory of the ejector plate and the ejector head. The processing device 40 processes the current image frame... The processing device 40 performs pixel-level analysis on the region of interest of the protruding component, calculating the foreground occupancy or contour displacement of the protruding component. In one embodiment, the processing device 40 processes the current image frame... The pixel matrix of the region of interest (ROI) of the ejected component is compared with the pixel matrix of the fully repositioned reference image of the ejected component stored in memory using pixel-by-pixel absolute value difference to generate a difference image matrix. The processing device 40 performs binarization segmentation on the difference image matrix, counts the number of pixels with values ​​greater than zero in the binarized matrix, and divides this count by the total number of pixels in the ROI of the ejected component to calculate the foreground occupancy. The processing device 40 adopts a return-to-start threshold. With return-to-close threshold Perform a hysteresis comparison. When the foreground occupancy... Drop below the return-to-start threshold At that time, the processing device 40 inspects the subsequent continuous processes. Frame image. If the foreground occupancy continuously falls below the return-to-start threshold. Under the given conditions, the processing device 40 determines that the ejector component has returned to the physical origin, generates an ejector component return event, and records the time and event confidence of the corresponding image frame.

[0030] To extract the cavity emptying event, the processing device 40 extracts the region of interest (ROI) for the cavity in the image pixel coordinate system. The ROI encompasses the product molding cavity and the sprue / running channel area. The processing device 40 uses background subtraction to extract the current image frame... The pixel matrix within the region of interest of the mold cavity is compared with the pixel matrix of a pre-acquired standard empty mold image without residue to obtain a mold cavity differential image. The processing device 40 performs thresholding processing on the mold cavity differential image to obtain a binarized residual foreground image, and calculates the area ratio occupied by foreground pixels in the binarized residual foreground image as the mold cavity foreground occupancy. The processing device 40 uses a clearing and opening threshold. With clear and close threshold Hysteresis detection is performed. When the foreground occupancy of the mold cavity... Below the threshold for clearing And the number of image frames that are continuously satisfied reaches the preset minimum duration of frames. For example, when there are four consecutive frames, the processing device 40 confirms that there is no residual product or sprue in the mold cavity and generates a mold cavity clearing event. The processing device 40 encapsulates the event type encoding, occurrence time, and confidence level of the extracted mold stop event, ejector component return event, and mold cavity clearing event into a visual event triplet, and stores it in the visual event queue in chronological order to construct a visual event sequence. This completes the event extraction and state modeling in step S200.

[0031] Furthermore, the specific implementation process of step S300 is as follows: In the specific implementation of step S300, the processing device 40 retrieves the control event sequence generated in step S100 from the memory queue. and the visual event sequence generated in step S200 The processing unit 40 first establishes a one-to-one matching topology between control events and visual events based on an event type mapping table pre-stored in non-volatile memory. The processing unit 40 binds a control event in the control event sequence coded as "mold opening completion" to a visual event in the visual event sequence coded as "mold stop" as a first event matching pair; and binds a control event in the control event sequence coded as "ejector return" to a visual event in the visual event sequence coded as "ejector component return" as a second event matching pair.

[0032] After establishing an event matching pair, the processing device 40 calls the matching cost calculation module to quantitatively evaluate the temporal and physical logic consistency between the control event sequence and the visual event sequence. The processing device 40 calculates the matching cost of the current forming cycle according to the following formula. : In the formula for calculating the matching cost, The recorded moment representing a specific control event. This represents the occurrence time of the visual event corresponding to the control event. The processing device 40 calculates the absolute time difference between the mold opening end time and the mold stopping time in the first event matching pair, and the absolute time difference between the ejection return time and the ejection component return time in the second event matching pair. The summation is then multiplied by a preset time residual weighting coefficient. . This represents the number of violation events where the sequence of events violates the preset process logic. The processing device 40 checks the temporal relationship between the two events. For example, if the mold stop event occurs earlier than the mold opening end event and the time difference exceeds the reasonable physical delay limit, or if the ejector component return event occurs earlier than the mold stop event, the processing device 40 will count the number of violation events. Increment the count value and multiply it by a preset timing violation weighting factor. .

[0033] This represents the number of conflicting events where the control logic state and the visual physical state contradict each other. The processing device 40 determines this by checking the following physical scenarios. The value: In the first scenario, when a push-out return event has been recorded in the control event sequence, indicating that the push-out mechanism at the electrical control level has returned to its endpoint, but the processing device 40 does not find a push-out component return event when searching the visual event sequence at the same time, or the foreground occupancy of the region of interest of the push-out component is still greater than the return-off threshold, the processing device 40 determines that there is a hard conflict between the control signal and the actual physical motion state, and increases the number of conflict events. Add 1.

[0034] In the second scenario, when the control event sequence indicates that the process cycle has completed the ejection action and entered the preparation for inspection, but the real-time motion residual of the structural anchor point area calculated by the processing device 40 is still greater than the stop and close threshold, it indicates that the mold mechanical structure is still in a state of severe vibration or displacement. The processing device 40 determines that there is a conflict between the control phase and the visual phase, and increases the number of conflict events. The number of conflict events is incremented by 1. The processing device 40 multiplies the number of conflict events by a preset conflict weighting coefficient. Among them, the contradiction weight coefficient The value is set to be much larger than the time residual weighting coefficient. With timing violation weighting coefficient The magnitude of this means that any collision event will result in a matching cost. It increased dramatically.

[0035] Calculate the matching cost Then, the processing unit 40 will match the cost. With the preset verification threshold Perform numerical comparisons and examine the number of conflict events. Is it zero? If and only if processing device 40 determines the matching cost. The number of conflict events is not greater than the verification threshold. When the time interval is zero, the processing device 40 confirms that the control event sequence and the visual event sequence are in phase in both the time domain and the logical domain, and generates a phase-consistent result. Then, the processing device 40 uses the occurrence time of the matching and alignment visual event as the central reference, combined with a preset forward time offset. With backward time offset By extracting continuous time intervals on the time axis, a phase-consistent window is constructed. The processing unit 40 will use a phase-consistent window. The start and end times are written into the window register in memory, so that subsequent steps can limit the selection range of image frames.

[0036] Conversely, if the processing device 40 determines that the matching cost is greater than the verification threshold, or the number of conflict events is... If the value is greater than zero, the processing device 40 determines that the two-track event verification has failed, generates a phase contradiction result, and sets the phase consistency result to zero. In this case, the processing device 40 no longer constructs a phase-consistent window, directly blocks the mold closing permission drive command, controls the relay input / output interface 30 to cut off the drive current of the mold closing permission output 52, and sends a high-level trigger signal to the alarm output 51 to complete the constraint verification and reverse fuse processing in step S300.

[0037] Furthermore, the specific implementation process of step S400 is as follows: In the specific implementation of step S400, the processing device 40 first reads the start and end times of the phase-consistency window stored in the memory register, and extracts all image frames whose arrival times fall within the time span of the phase-consistency window from the continuous image sequence, forming a candidate image frame set. For each image frame in the candidate image frame set, the processing device 40 calls its internal stability evaluation function to calculate the image stability index.

[0038] The stability calculation depends on two floating-point parameters: normalized motion residual and normalized image blur. Processing device 40 extracts the pixel matrix of the preset structural anchor point region in the candidate image frame, calculates the optical flow displacement vector of the feature points relative to the previous image frame using the Lucas-Kanade optical flow algorithm, calculates the average Euclidean distance of all optical flow displacement vectors, and normalizes it by dividing by a preset displacement extremum constant, obtaining the normalized motion residual with a value between zero and one. Simultaneously, the processing device 40 applies the Laplacian operator to the pixel matrix of the candidate image frames to extract high-frequency edge components, calculates the global variance of the edge component matrix, takes the reciprocal of the global variance and divides it by a preset blur extremum for normalization, obtaining a normalized image blur with a value between zero and one. The processing device 40 operates according to the formula. Execute floating-point multiply-accumulate instructions, where The motion residual weighting coefficients are pre-written into the configuration file. This represents the ambiguity weighting coefficient. The processing device 40 traverses the candidate image frame set, recording the stability value of each frame sequentially. After traversal, it selects the image frame with the smallest stability value. The processing device 40 compares the selected smallest stability value with a preset stability threshold in non-volatile memory. If the smallest stability value is not greater than the preset stability threshold, the processing device 40 writes the corresponding image frame to a specific memory address as the target detection frame; if the stability values ​​of all image frames in the candidate image frame set are greater than the preset stability threshold, the processing device 40 directly generates a logic state where the target detection frame is undecidable, forcibly interrupting subsequent pixel-level detection operations.

[0039] After acquiring the target detection frame, the processing device 40 activates the structural anchor point spatial correction module to eliminate the absolute offset of physical coordinates caused by camera micro-movements or mold thermal expansion during the molding cycle. In the global pixel matrix of the target detection frame, the processing device 40 uses a normalized cross-correlation algorithm to locate the current two-dimensional pixel coordinates of multiple pre-set reference structural anchor points (e.g., the center pixel of the mold fixing bolt hole). The processing device 40 then retrieves the reference two-dimensional pixel coordinates of the corresponding reference structural anchor points from the standard empty mold reference image in memory. The processing device 40 inputs the current two-dimensional pixel coordinates and the reference two-dimensional pixel coordinates into the least squares estimation module to solve for the affine transformation matrix composed of rotation parameters, translation parameters, and scaling parameters. In the iterative calculation of the affine transformation matrix, the processing device 40 calculates the coordinate reprojection residual based on the distance between feature points and counts the number of successfully matched structural anchor points. When the number of successfully matched structural anchor points is less than the minimum number of feature points required to solve the affine transformation matrix, or when the coordinate reprojection residual is greater than the preset spatial correction tolerance threshold, the processing device 40 determines that the spatial coordinate alignment has failed and generates a logic state that the target detection frame is undeterminable.

[0040] If the affine transformation matrix is ​​successfully solved and the coordinate reprojection residual meets the tolerance threshold condition, the processing device 40 uses the solved affine transformation matrix to perform matrix multiplication mapping operation on the reference coordinates of the mold cavity residual area and the reference coordinates of the ejector component return area that are predefined in the coordinate system, and generates a spatially corrected mold cavity residual detection window and a spatially corrected ejector component return detection window.

[0041] After completing the spatial coordinate remapping, the processing device 40 extracts the corresponding local pixel matrix within the image memory area of ​​the target detection frame according to the spatially corrected mold cavity residue detection window, and performs residue anomaly identification. The processing device 40 performs pixel-by-pixel gray-level subtraction between the extracted local pixel matrix and the reference pixel matrix of the standard empty mold reference image at the corresponding window position to generate an absolute difference matrix. The processing device 40 applies the Otsu algorithm to the absolute difference matrix to calculate the adaptive segmentation threshold, completes the binarized foreground segmentation operation, and iterates through the binarized matrix to count the cumulative total number of foreground pixels with a pixel value of 255. The processing device 40 compares the cumulative total number of foreground pixels with a preset residue alarm area threshold in memory to determine whether there are any undemolded residue products inside the mold cavity. Similarly, the processing device 40, based on the spatially corrected ejector component return detection window, extracts the local pixel matrix of the ejector mechanism within the target detection frame, uses the Canny edge detection operator to extract the actual physical edge contour pixel coordinates of the top plate, calculates the position coordinate offset between these coordinates and the standard return reference edge coordinates, and determines whether the top plate has returned to its physical pole. The processing device 40 integrates the detection data from the two windows. When residual product is detected in the mold cavity, or when the top plate has not returned to its physical pole, the processing device 40 generates a judgment result indicating an anomaly in the detection area, and stores the internally stored abnormal Boolean variable... Set to logic 1; when it is determined that there is no residue in the mold cavity and the top plate has completely returned to its original position, the processing device 40 will set the abnormal Boolean variable. The system is reset to logic 0, thereby completing the physical feature calculation and abnormal state determination of the image data.

[0042] Furthermore, the specific implementation process of step S500 is as follows: In the specific implementation of step S500, the logic operation unit inside the processing device 40 extracts the three independent Boolean logic state variables generated in the aforementioned steps and performs low-level logical AND gate evaluation operations. Specific input parameters include: the phase consistency result variable generated in step S300. In step S400, the conditional variable representing whether the target detection frame has been successfully extracted and spatially registered is a determinable conditional variable. ; and the abnormal variables of the detection area output in step S400. The processing device 40 detects abnormal variables in the detection area. Perform a logical NOT operation, then combine it with the phase-consistent result variable and the decidable condition variable. Perform a logical AND operation to calculate the overall license condition variable. The core Boolean algebra gated expression is rigorously defined as follows: .

[0043] When the comprehensive license condition variables When the logical operation evaluates to true (logic 1), the processing device 40 determines that the current molding equipment is in an absolutely safe, permissible closed physical state. At this time, the underlying hardware driver of the processing device 40 sends a high-level drive command to the permissible mold closing output channel in the relay input / output interface 30. The optocoupler isolation device in the relay input / output interface 30 is turned on, closing the permissible mold closing physical circuit coil connected in series with the main controller of the molding equipment, driving the permissible mold closing output 52 to take effect, thereby instructing the molding equipment to start the mechanical mold closing action of the next cycle.

[0044] Conversely, if the evaluation result of the comprehensive permission condition variable is false (logic 0), it covers the failure of phase constraint verification. Zero, severe image vibration or off-target effect In the event of any single or combined abnormal scenario, such as zero, mold cavity residue, or failure of the top plate to retract, resulting in a zero value, the processing device 40 immediately triggers a safety blocking mechanism. The underlying hardware driver refuses to send drive commands to the allow mold closing output channel, keeping the allow mold closing physical circuit physically disconnected, i.e., not driving the allow mold closing output 52. Simultaneously, the processing device 40 sends a transient pulse or high-level latching signal in parallel to the alarm output channel in the relay input / output interface 30, driving the alarm output 51 to take effect. Upon receiving the signal from the alarm output 51, the electrical control system of the molding equipment forcibly locks the moving mold mechanism's action circuit.

[0045] After completing the relay closed-loop control output, the processing device 40 starts the background data persistence storage thread. The processing device 40 packages and serializes all the raw data and structured result data of the current molding cycle and writes them to the local non-volatile solid-state drive storage medium. The serialized packaged data includes the control event sequence, visual event sequence, matching cost algebraic value, selected target detection frame pixel matrix, spatial correction coordinates after matrix affine transformation, identification results of the mold cavity and ejection area, and the final output mold closing permission or alarm signal status logic value. The data persistence storage thread asynchronously executes non-blocking read and write instructions in an independent background memory allocation area, without interfering with the main control thread, and without changing the Boolean logic judgment condition for allowing mold closing output. The persistently recorded data file is stored in the storage medium and is used to provide raw data slices with a unified time scale for alarm root cause tracing in industrial sites, equipment operation cycle verification, and secondary optimization of visual detection algorithm thresholds.

[0046] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for mold monitoring and mold closing interlocking based on control event and visual event verification, characterized in that, Includes the following steps: Step S100: Acquire the control event sequence of the molding equipment and the continuous image sequence of the mold area, and record the acquisition time of the control events and each image frame; Step S200: Form a process phase sequence based on the control events, and extract a visual event sequence from the continuous image sequence; Step S300: Perform constraint verification on the control event sequence and the visual event sequence according to the event sequence and time residual to determine the phase consistency window; Step S400: Within the phase-consistent window, select a target detection frame based on image stability, and perform anomaly detection on the detection region in the target detection frame; Step S500: When there is no phase contradiction, the target detection frame meets the judgment condition, and the detection area is not abnormal, drive to allow mode combination output; otherwise, do not drive to allow mode combination output and drive alarm output.

2. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 1, characterized in that, The acquisition of the control event sequence of the molding equipment in step S100 includes: acquiring the relay input state change of the molding equipment through the relay input interface, and the resulting control event sequence includes at least the mold opening end event, the ejection return event, and the safety door input event; The recording of the control event and the acquisition time of each image frame includes: using the monotonic clock of the processing device in the mold monitoring device as a unified time base, recording the control time triggered when the control event occurs and the arrival time of each image frame after being acquired by the camera and transmitted to the processing device. The resulting control event sequence is expressed as a set of tuples consisting of control event types and corresponding recording times; the continuous image sequence is expressed as a set of tuples consisting of image frame data and corresponding recording times.

3. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 2, characterized in that, The process phase sequence formed according to the control events in step S200 includes: setting the mold opening end, ejection action, ejection return and detection completion as progressive process phase states in sequence according to the preset state transition relationship; when the collected control events are missing, repeated or have abnormal sequence, the control phase of the current molding cycle is marked as abnormal and the mold closing output is not driven.

4. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 3, characterized in that, Step S200, which involves extracting a visual event sequence from the continuous image sequence, includes: Calculate the global displacement between adjacent image frames in the structural anchor point region of the mold, and generate a mold stop event when the global displacement is continuously lower than the stop threshold. Calculate the contour displacement or foreground occupancy in the ejected component area, and generate an ejected component return event when the contour displacement or foreground occupancy continuously meets the return threshold. Calculate the grayscale difference or foreground occupancy in the residual area of ​​the mold cavity, and generate a mold cavity clearing event when the grayscale difference or foreground occupancy continuously meets the clearing threshold; In step S200, when generating the mold stop event, ejector component return event, or mold cavity clearing event, a hysteresis judgment logic with different opening and closing thresholds is adopted, and the corresponding visual event is determined to be effective when the number of frames in which the event judgment index continuously meets the corresponding threshold reaches the preset minimum continuous frame number.

5. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 4, characterized in that, The constraint verification of the control event sequence and the visual event sequence according to the event sequence and time residual in step S300 includes: establishing a matching pair between the mold opening end event in the control event sequence and the mold stop event in the visual event sequence according to the preset event type correspondence, and establishing a matching pair between the ejection return event in the control event sequence and the ejection component return event in the visual event sequence. The constraint verification in step S300 uses a matching cost function for quantitative evaluation. The formula for calculating the matching cost function is as follows: in, To control when events are recorded, The time of occurrence of the visual event corresponding to this control event. Nconflict represents the number of events that violate a preset sequence relationship, α, β, and γ are preset weights, and Nconflict represents the number of contradictory events; only in the matching cost function When the number of conflicting events Nconflict is zero and the number of conflicting events is not greater than the preset verification threshold, the phase-consistent window is formed based on the occurrence time of the matching event and the preset offset range.

6. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 5, characterized in that, The constraint verification in step S300 also includes phase contradiction determination: when the control event indicates that the ejector component has returned to its original position but the visual event indicates that the ejector component has not returned to its original position, or when the control event indicates that the detection stage has been entered but the visual event indicates that the mold is still in motion, the phase contradiction result is determined and the mold closing output is not driven.

7. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 6, characterized in that, Step S400, which involves selecting the target detection frame based on image stability, includes: according to the stability function. Calculate the stability of each candidate image frame within the phase-consistent window, where, The normalized motion residual of the structural anchor point relative to adjacent image frames. To normalize image blur, and Preset weights; select the image frame with the smallest stability S and not greater than the preset stability threshold from the phase consistency window as the target detection frame.

8. The mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 7, characterized in that, Before performing anomaly detection on the detection region in the target detection frame, step S400 further includes structural anchor point spatial correction processing: locating multiple structural anchor points in the target detection frame, estimating rigid transformation or affine transformation based on the multiple structural anchor points and their corresponding structural anchor points in the reference image, and using the rigid transformation or affine transformation to correct the position of the detection region; when the number of matching structural anchor points is insufficient or the transformation residual is greater than the spatial correction threshold, the target detection frame is determined to not meet the judgment condition; The anomaly detection of the detection area specifically includes at least two of the following: performing grayscale difference, contour comparison, or foreground segmentation on the spatially corrected residual area of ​​the mold cavity and the reference area to determine whether there are residues in the mold cavity; The system compares the position or occupancy of the ejector component's return area after spatial correction with the return reference area to determine whether the ejector component has completed its return; if any detection result is abnormal, a judgment result indicating an abnormality in the detection area is generated.

9. A mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 8, characterized in that, The logic condition for enabling the mode-combining output described in step S500 is expressed as a Boolean logic expression: in, To determine the phase-consistent results that are within the phase-consistent window and do not exhibit phase inconsistencies, The result is that the target detection frame satisfies the judgment condition. The detection area has an abnormal determination result; only when the logical variable When the value of is true, the driver allows the mode-combining output; when the value of is true, the driver allows the mode-combining output. When the value is false, the mode closing output is not enabled and the alarm output is enabled.

10. A mold monitoring and mold closing interlocking method based on control event and visual event verification according to claim 9, characterized in that, Step S500 also includes traceability and verification processing: the processing device of the mold monitoring device stores the control events, visual events, event constraint verification results, target detection frames, area detection results, and results of allowing mold closing output or alarm output for each molding cycle, for tracing alarm causes and verifying detection results, and the traceability and verification processing does not change the logical conditions for driving to allow mold closing output.