High-speed detection data processing method and system for medical appearance
Patent Information
- Application Number
- CN202610525808.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-21
- Publication Date
- 2026-08-28
AI Technical Summary
其优点是减少设备的使用种类,减少硬件之间的交互线路,但是其缺点就是只能识别较简单的且慢速的,对于产品的判断是初级的判别结果分拣
[0034] This application discloses a high-speed pharmaceutical appearance inspection data processing method and system. Through multiple collaborative innovations, this application achieves high-speed and high-precision inspection and rejection of aluminum-plastic blister pack pharmaceuticals: It adopts a custom message structure to compactly encapsulate key information such as starting pulse, defect marker, and rejection status, supporting direct offset addressing by PLC, eliminating parsing overhead, and significantly reducing data processing latency; it constructs a FIFO queue and encoder pulse binding mechanism to ensure that no product position data is lost, greatly reducing the position data loss rate; and it establishes a rejection closed-loop verification system, through triple matching of rejection action feedback, downstream residual sensor, and encoder position, determining whether rejection is truly completed in the confirmation area, significantly improving pharmaceutical packaging quality and automation reliability.
Smart Images

Figure CN122656981A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of production line data processing technology, specifically to a method and system for high-speed detection data of pharmaceutical appearance. Background Technology
[0002] Pharmaceutical companies mostly use aluminum-plastic blister packaging for drugs. However, during the sealing process using aluminum-plastic packaging machines, defects inevitably appear on the surface of the blister packs, leading to problems with drug quality and appearance. These defects commonly include horizontal lines on the blister packs, powder accumulation, missing tablets, and tablet blistering. Furthermore, the complex textures of the blister pack surface and the small size of tablet defects increase the difficulty of defect detection. While advancements in visual algorithms have improved detection capabilities, the data exchange between PLCs and industrial control computers remains a crucial issue that needs to be addressed.
[0003] In existing solutions, the industrial control computer uses camera I / O to control the NG signal output. The lack of PLC involvement weakens intelligent control, and any adjustments to the production line can cause the system to malfunction. There is also no corresponding removal confirmation mechanism, resulting in defective products not being removed in a timely manner, reducing product yield and impacting brand image. Another approach is to use embedded development for control functions and image processing. Its advantages include reducing the types of equipment used and minimizing hardware interaction lines. However, its disadvantages include being limited to simpler and slower tasks, resulting in only a rudimentary sorting process. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method and system for high-speed detection data processing of pharmaceutical appearance, so as to solve the problems in the background art.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] The pharmaceutical appearance high-speed detection data processing method of this application includes:
[0007] Acquire incoming material signals from the pharmaceutical production line and store the incoming material signals in a FIFO queue;
[0008] The current incoming material signal is extracted from the FIFO queue, and the image acquisition device is triggered to acquire the appearance image of the drug based on the current incoming material signal. The image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm.
[0009] Upon receiving a detection result data packet from the industrial control computer, the detection result data packet is read to obtain the detection result; if the detection result is abnormal, a rejection and verification process is triggered to obtain the rejection verification result, thereby controlling the execution device to reject the current drug; wherein, the rejection verification result is either rejection completed or rejection failed, and the detection result data packet is a structured data packet of the target bytes;
[0010] The rejection verification result is encapsulated into a structured return data packet of the target bytes, and the return data packet is returned to the industrial control computer so that the industrial control computer can perform a detection action based on the rejection verification result.
[0011] In one embodiment of this application, the execution device of the high-speed pharmaceutical appearance detection data processing method is a PLC, and the PLC and the industrial control computer have a pre-established TCP connection.
[0012] In one embodiment of this application, the TCP connection establishment process between the PLC and the industrial control computer includes:
[0013] The industrial control computer is connected to the PLC as a TCP client and a continuous connection is maintained, wherein the local device port of the PLC is fixed.
[0014] In one embodiment of this application, the length of the detection result data packet and the length of the detection result data packet are both 164 bytes. The detection result data packet includes a message type field, a parameter field, an operation command field, and a visual result field. The detection result data packet also includes a message type field, a parameter field, a device status field, an input IO field, and an output IO field. When reading the detection result data packet, the visual result field of the detection result data packet is located using the TRCV instruction.
[0015] In one embodiment of this application, both the current incoming material signal and the incoming material signal are pulse values of a conveyor belt encoder. The process of triggering an image acquisition device to acquire an image of the drug's appearance based on the current incoming material signal includes:
[0016] Obtain the current pulse value of the current incoming material signal. ;
[0017] Based on the current pulse value Calculate the pulse value at the shooting location Wherein, the pulse value at the shooting location The mathematical expression is:
[0018]
[0019] In the formula, This indicates the number of pulses required for the drug to move from the sensing position to the photographing position.
[0020] In one embodiment of this application, the depth of the FIFO queue satisfies:
[0021]
[0022] In the formula, Indicates the depth of the FIFO queue. Indicates the production speed of the production line. This indicates the processing cycle for a single drug.
[0023] In one embodiment of this application, triggering a rejection and verification process to obtain rejection and verification results includes:
[0024] The starting pulse value corresponding to the current incoming material signal is marked for rejection and placed in a FIFO queue; and a rejection offset is calculated based on the starting pulse value corresponding to the current incoming material signal, wherein the mathematical expression for the rejection offset is:
[0025]
[0026] In the formula, This indicates the removal offset. Indicates the starting position Movement and Removal Location The distance between them This indicates the distance traveled for each pulse;
[0027] When the encoder pulses accumulate to At that time, a rejection signal is output to control the execution equipment to reject defective drugs;
[0028] When the rejection signal is output, timing begins, and during the timing period, a feedback signal is received from the execution device, and the pulse accumulates to... If no detection signal is received from the downstream residual detection sensor, the cleaning is considered complete; otherwise, the cleaning is considered to have failed. This indicates the pulse offset corresponding to the downstream residual detection sensor.
[0029] This application also provides a high-speed pharmaceutical appearance inspection data processing system, including:
[0030] The acquisition module is used to acquire incoming material signals from the pharmaceutical production line and store the incoming material signals into a FIFO queue;
[0031] The image acquisition module is used to extract the current incoming material signal from the FIFO queue and trigger the image acquisition device to acquire the appearance image of the drug based on the current incoming material signal. The image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm.
[0032] The clearing detection module is used to read the detection result data packet received from the industrial control computer to obtain the detection result; when the detection result is abnormal, it triggers the rejection and verification process to obtain the rejection verification result, so as to control the execution device to reject the current drug; wherein, the rejection verification result is clearing completed or clearing failed, and the detection result data packet is a structured data packet of the target bytes;
[0033] The return module is used to encapsulate the rejection verification result into a structured return data packet of the target bytes and return the return data packet to the industrial control computer, so that the industrial control computer can perform a detection action based on the rejection verification result.
[0034] This application discloses a high-speed pharmaceutical appearance inspection data processing method and system. Through multiple collaborative innovations, this application achieves high-speed and high-precision inspection and rejection of aluminum-plastic blister pack pharmaceuticals: It adopts a custom message structure to compactly encapsulate key information such as starting pulse, defect marker, and rejection status, supporting direct offset addressing by PLC, eliminating parsing overhead, and significantly reducing data processing latency; it constructs a FIFO queue and encoder pulse binding mechanism to ensure that no product position data is lost, greatly reducing the position data loss rate; and it establishes a rejection closed-loop verification system, through triple matching of rejection action feedback, downstream residual sensor, and encoder position, determining whether rejection is truly completed in the confirmation area, significantly improving pharmaceutical packaging quality and automation reliability. Attached Figure Description
[0035] The present application will be further described below with reference to the accompanying drawings and embodiments:
[0036] Figure 1 This is a system topology diagram of a high-speed pharmaceutical appearance detection data processing method shown in one embodiment of this application;
[0037] Figure 2 This is a flowchart illustrating the high-speed pharmaceutical appearance detection data processing method in one embodiment of this application.
[0038] Figure 3 This is a schematic diagram of the image acquisition process in one embodiment of this application;
[0039] Figure 4 This is a schematic diagram of the structure of a Socket data packet in one embodiment of this application;
[0040] Figure 5This is a structural diagram of the detection result data packet in one embodiment of this application;
[0041] Figure 6 This is a schematic diagram of the structure of a high-speed pharmaceutical appearance detection data processing system according to an embodiment of this application. Detailed Implementation
[0042] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the layers related to this application and are not drawn according to the actual number, shape and size of the layers in the actual implementation. In the actual implementation, the form, number and proportion of each layer can be arbitrarily changed, and the layer layout may also be more complex.
[0044] Numerous details are explored in the following description to provide a more thorough explanation of embodiments of this application; however, it will be apparent to those skilled in the art that embodiments of this application may be practiced without these specific details.
[0045] In the high-speed production of aluminum-plastic blister-packaged pharmaceuticals, high-speed processing of production and inspection data is necessary to ensure data accuracy for subsequent rejection of defective products. The location of defective products must also be clearly identified during rejection. Based on the production line conditions, the applicant found that aluminum-plastic blister-packaged pharmaceuticals are transported on a conveyor belt after production. Therefore, the applicant's team used a combination of encoders and measuring wheels to determine position changes. The high-speed processing requirements necessitate a simple and fast interaction protocol to ensure stable, accurate, and efficient interaction between the PLC and the industrial computer. Based on these requirements, this application adopts a socket protocol, and the PLC internally employs queued data access, high-speed acquisition and capture of position information, numerical conversion processing, and product rejection confirmation. This patent primarily describes the technical aspects of the PLC; the industrial computer's basic functions are only introduced, and its internal processing algorithms are not described in detail.
[0046] Figure 1 This is a system topology diagram of a high-speed pharmaceutical appearance detection data processing method shown in one embodiment of this application, as follows: Figure 1 As shown, the hardware configuration of the system in this application includes:
[0047] Industrial control computers (ICCs) are industrial devices that integrate machine vision technology with ICC functionality. They capture real-time images or videos through cameras, sensors, and other devices, and then use computers to process and analyze this image data, thereby achieving automatic detection and identification of production lines, products, and equipment. To meet the complex image processing and data analysis needs, they are typically equipped with high-performance CPUs and large-capacity memory. In addition, they are equipped with dedicated image processing chips, such as GPUs or dedicated vision processing units, to efficiently perform image acquisition, processing, and analysis.
[0048] The monitor is the primary tool for human-computer interaction and serves as the external display for image processing. It allows users to set production parameters within the image processing software interface according to their specific needs.
[0049] PLC (Programmable Logic Controller) is a digital electronic system designed specifically for industrial applications. Its core function is to store instructions in a programmable memory to achieve logical control, sequential control, timing / counting, motion control, and process control of industrial production processes. It is the "core brain" of industrial automation. In this system, it serves as the main core for logical judgment, action execution, and result output.
[0050] Cameras: Industrial cameras are the "eyes" of machine vision systems. Their core function is to convert optical signals in industrial production and inspection scenarios into digital image signals that can be processed by computers. They are characterized by high stability, high definition, high frame rate, and anti-interference capabilities, and are widely used in fields such as automated production and quality inspection.
[0051] Before officially starting the high-speed inspection data processing for pharmaceutical appearance, it is necessary to connect the industrial control computer and the PLC. This application uses the TCP communication protocol for connection; specifically, the TCP connection is established using the TCON instruction.
[0052] Input interface:
[0053] EN: Enables the call to the connection block. AlwaysTRUE is used as the enable signal.
[0054] REQ: On the rising edge, initiate the corresponding job to establish the connection specified by the ID.
[0055] ID: A reference to an assigned connection.
[0056] CONNECT:Connect parameter structure.
[0057] CONNECT byte structure:
[0058] interfaceID: Hardware identifier for the IE interface submodule
[0059] ID: Connection ID is the connection identifier, and its possible range is 0-65534. Set to 1.
[0060] ConnectionType: Select the network connection mode: TCP / IP or UDP. This system selects TCP / IP.
[0061] ActiveEstablished:TURE = Active connection (client), FALSE = Passive connection (server). When set to passive connection, the connection is not actively disconnected, thus maintaining a persistent connection. Combined with a fixed local port and continuous calls, this forms the basic architecture for continuous communication.
[0062] RemoteAddress: This is a four-byte number, where IPadd1-IPadd4 are the four octets of the address. IPaddr1 is the most significant byte of the IP address, and IPaddr4 is the least significant byte. Set the IP address to 0.0.0.0.
[0063] RemotePort: The port number on the remote device. The remote port number ranges from 1 to 49151. For passive connections, zero can be used. This system sets it to 0 for passive connections.
[0064] LocalPort: The port number of the local device. The range is 1-49151. Set to 40000.
[0065] Output interface:
[0066] Done: When the connection operation is complete and there are no errors, the instruction sets the Done output.
[0067] Busy: The instruction sets the Busy output when a connection operation is in progress.
[0068] Error: When a connection operation completes but an error occurs, the instruction sets the Error flag to be output.
[0069] Status: If the instruction sets the Error output, the Status output will display the error code. If the instruction sets the Busy or Done output, the Status will be zero (no error).
[0070] TCON command code display
[0071] "TCON_DB"(REQ:="AlwaysTRUE",
[0072] ID:=1,
[0073] DONE=># Connection complete,
[0074] BUSY=># Connecting,
[0075] ERROR=>#Connection error,
[0076] STATUS=>#Error code,
[0077] CONNECT:="Socket_Connection_DB").
[0078] Figure 2 This is a flowchart of a high-speed pharmaceutical appearance detection data processing method shown in one embodiment of this application. The following flowchart is described with PLC as the main device. Figure 2 As shown, the pharmaceutical appearance high-speed detection data processing method and system of this embodiment includes:
[0079] S210, acquire the incoming material signal from the pharmaceutical production line and store the incoming material signal in a FIFO queue;
[0080] Specifically, the incoming material signal is triggered by a high-speed sensor and sent to the PLC. The incoming material signal is triggered by an I / O signal. It detects high-speed moving targets with a detection capability of approximately 50 microseconds, and completes the acquisition of parameters such as the starting position, the length of material passing through the sensor, and the time of separation from the sensor, providing a basis for subsequent logic program judgments.
[0081] One of the innovations of this application is the construction of a FIFO (First-In, First-Out) queue in high-speed scenarios, wherein the depth of the FIFO queue satisfies:
[0082]
[0083] In the formula, Indicates the depth of the FIFO queue. Indicates the production speed of the production line. This indicates the processing cycle for a single drug.
[0084] In high-speed scenarios, a FIFO queue mechanism is used to buffer encoder pulse values, preventing data overwriting caused by high-speed interruptions. In high-speed detection systems, a FIFO queue depth ≥ This ensures that it can accommodate the storage of all product location data within 10 seconds.
[0085] S220, extract the current incoming material signal from the FIFO queue, and trigger the image acquisition device to acquire the appearance image of the drug based on the current incoming material signal, wherein the image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm;
[0086] Figure 3 This is a schematic diagram of the image acquisition process in one embodiment of this application, as shown below. Figure 3 As shown, the specific process includes:
[0087] S221, after receiving the incoming material signal, the PLC acquires the current pulse value of the incoming material signal. ;
[0088] S222, based on the current pulse value Calculate the pulse value at the shooting location Wherein, the pulse value at the shooting location The mathematical expression is:
[0089]
[0090] In the formula, This indicates the number of pulses required for the drug to move from the sensing position to the photographing position.
[0091] This application converts distance into pulse values from the encoder on the conveyor belt motor shaft and determines whether the medicine has moved to the photographing position by accumulating pulses. If so, the camera is controlled via Ethernet to take a picture. The camera is triggered primarily through I / O communication, using a Q-point output to ensure the stability of the trigger signal.
[0092] After taking a picture, the camera directly sends the image to the industrial control computer for image processing, and then returns the result to the PLC via a TCP connection.
[0093] Specifically, the industrial control computer processes and analyzes image data to achieve automatic product detection and recognition. To meet the complex needs of image processing and data analysis, it is typically equipped with a high-performance CPU and large-capacity memory. In addition, it is equipped with a dedicated image processing chip, such as a GPU or a dedicated vision processing unit, to efficiently perform image acquisition, processing, and analysis. In this process, it is responsible for receiving, processing, judging, outputting, and recording the camera's captured data, and returning the data results to the PLC via a socket.
[0094] S230: When receiving a detection result data packet from the industrial control computer, the detection result data packet is read to obtain the detection result; when the detection result is abnormal, the rejection and verification process is triggered to obtain the rejection verification result, so as to control the execution device to reject the current drug; wherein, the rejection verification result is rejection completed or rejection failed, and the detection result data packet is a structured data packet of the target byte;
[0095] Socket communication is existing technology and will not be elaborated upon here. However, the Socket data packets used in this application are all structured custom data packets. Based on custom data packets, the processing speed in this application can be significantly improved. Figure 4 This is a schematic diagram of the structure of a Socket data packet in one embodiment of this application, as shown below. Figure 4 As shown, the PLC receives a 164-byte data packet of detection results from the industrial computer, including a message type field (4 bytes), a parameter field (72 bytes), an operation command field (24 bytes), and a visual result field (64 bytes). The PLC does not need to parse this data; it uses the TRCV instruction to locate the visual result field of the detection result data packet. This significantly improves data processing speed.
[0096] The PLC reads the visual result field. If the detection result is normal, no action is triggered. If the detection result is abnormal (NG has defects), a closed-loop rejection and verification process is triggered, specifically including:
[0097] S231, mark the starting pulse value corresponding to the current incoming material signal as a rejection mark and put it into the FIFO queue; and calculate the rejection offset based on the starting pulse value corresponding to the current incoming material signal, wherein the mathematical expression of the rejection offset is:
[0098]
[0099] In the formula, This indicates the removal offset. Indicates the starting position Movement and Removal Location The distance between them This indicates the distance traveled for each pulse;
[0100] The rejection offset refers to the pulse data corresponding to the distance from the current detection position to the rejection position. This application calculates the distance by accumulating pulses.
[0101] S232, when the encoder pulses accumulate to At that time, a rejection signal is output to control the execution equipment to reject defective drugs;
[0102] When the encoder pulses accumulate to When the time is right, it indicates that the medicine has reached the rejection station. The PLC detection result data packet includes a rejection signal output (such as a high level signal Q). The rejection mechanism (such as a pneumatic push rod) is activated, pushing the defective medicine board out of the conveyor belt.
[0103] S233 starts timing when the rejection signal is output, and receives a feedback signal from the execution device during the timing period, and accumulates pulses until... If no detection signal is received from the downstream residual detection sensor, the cleaning is considered complete; otherwise, the cleaning is considered to have failed. This indicates the pulse offset corresponding to the downstream residual detection sensor.
[0104] The validation process for determining whether elimination is complete also includes the following three layers of validation:
[0105] First layer: Eliminate feedback signals from mechanism actions;
[0106] The rejection cylinder / solenoid valve is equipped with a position sensor (such as a reed switch), and the PLC receives a "rejection action completed" signal (such as an I-point input). If no feedback is received, an alarm is triggered or a retry is initiated (supported by some systems).
[0107] Second layer: Encoder position matching (core verification)
[0108] After rejection, the system sets up a "Confirm Zone" located 10-20mm downstream of the rejection station. If the product is not rejected, it will continue to pass through this zone, triggering a "residue detection sensor" (such as a photoelectric switch). If the residue sensor is not triggered, the system determines "rejection successful"; if the residue sensor is triggered, it determines "rejection failed," records the anomaly, and issues an alarm.
[0109] Third layer: Time window verification (to prevent false positives)
[0110] The PLC is set to a rejection response time window (e.g., 50ms). Within this window: feedback from the rejection mechanism must be received and no residual sensor signal should be received; otherwise, the rejection is considered invalid.
[0111] S240, the rejection verification result is encapsulated into a structured return data packet of the target byte, and the return data packet is returned to the industrial control computer so that the industrial control computer performs a detection action based on the rejection verification result.
[0112] Figure 5 This is a structural diagram of the detection result data packet in one embodiment of this application, as shown below. Figure 5 As shown, the rejection verification result is encapsulated into a detection result data packet, which is also 164 bytes long, including a message type field (4 bytes), a parameter field (72 bytes), a device status field (64 bytes), an input IO field (12 bytes), and an output IO field (12 bytes).
[0113] If the industrial control computer confirms that the clearing process is complete, production will continue. If the clearing process fails, an alarm message will be output and relevant personnel will be contacted for maintenance.
[0114] This application discloses a high-speed pharmaceutical appearance inspection data processing method. Through multiple collaborative innovations, this application achieves high-speed and high-precision inspection and rejection of aluminum-plastic blister pack pharmaceuticals: It employs a custom message structure to compactly encapsulate key information such as the starting pulse, defect marker, and rejection status, supporting direct offset addressing by PLC, eliminating parsing overhead, and significantly reducing data processing latency; it constructs a FIFO queue and encoder pulse binding mechanism to ensure that no product position data is lost, greatly reducing the position data loss rate; and it establishes a rejection closed-loop verification system, through triple matching of rejection action feedback, downstream residual sensor, and encoder position, determining in the confirmation area whether rejection has been truly completed, significantly improving pharmaceutical packaging quality and automation reliability.
[0115] like Figure 6 As shown, this application also provides a high-speed pharmaceutical appearance inspection data processing system, including:
[0116] The acquisition module is used to acquire incoming material signals from the pharmaceutical production line and store the incoming material signals into a FIFO queue;
[0117] The image acquisition module is used to extract the current incoming material signal from the FIFO queue and trigger the image acquisition device to acquire the appearance image of the drug based on the current incoming material signal. The image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm.
[0118] The clearing detection module is used to read the detection result data packet received from the industrial control computer to obtain the detection result; when the detection result is abnormal, it triggers the rejection and verification process to obtain the rejection verification result, so as to control the execution device to reject the current drug; wherein, the rejection verification result is clearing completed or clearing failed, and the detection result data packet is a structured data packet of the target bytes;
[0119] The return module is used to encapsulate the rejection verification result into a structured return data packet of the target bytes and return the return data packet to the industrial control computer, so that the industrial control computer can perform a detection action based on the rejection verification result.
[0120] This application discloses a high-speed pharmaceutical appearance inspection data processing system. Through multiple collaborative innovations, it achieves high-speed, high-precision inspection and rejection of aluminum-plastic blister pack pharmaceuticals: It employs a custom message structure to compactly encapsulate key information such as the starting pulse, defect marker, and rejection status, supporting direct offset addressing by the PLC, eliminating parsing overhead and significantly reducing data processing latency; it constructs a FIFO queue and encoder pulse binding mechanism to ensure no data loss at each product location, greatly reducing the location data loss rate; and it establishes a rejection closed-loop verification system, using triple matching of rejection action feedback, downstream residual sensors, and encoder position to determine whether rejection is truly completed in the confirmation area, significantly improving pharmaceutical packaging quality and automation reliability.
[0121] This embodiment also provides an electronic terminal, including: a processor and a memory;
[0122] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory so that the terminal performs any of the methods in this embodiment.
[0123] As will be understood by those skilled in the art, the computer-readable storage medium described in this embodiment allows for the implementation of all or part of the steps in the above method embodiments by computer program-related hardware. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0124] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic terminal performs the steps of the above method.
[0125] In this embodiment, the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0126] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0127] In the above embodiments, although the present application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. The embodiments of the present application are intended to cover all such substitutions, modifications, and variations falling within the broad scope of the appended claims.
[0128] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A high-speed detection data processing method for pharmaceutical appearance, characterized in that, include: Acquire incoming material signals from the pharmaceutical production line and store the incoming material signals in a FIFO queue; The current incoming material signal is extracted from the FIFO queue, and the image acquisition device is triggered to acquire the appearance image of the drug based on the current incoming material signal. The image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm. Upon receiving a detection result data packet from the industrial control computer, the detection result data packet is read to obtain the detection result; if the detection result is abnormal, a rejection and verification process is triggered to obtain the rejection verification result, thereby controlling the execution device to reject the current drug; wherein, the rejection verification result is either rejection completed or rejection failed, and the detection result data packet is a structured data packet of the target bytes; The rejection verification result is encapsulated into a structured return data packet of the target bytes, and the return data packet is returned to the industrial control computer so that the industrial control computer can perform a detection action based on the rejection verification result.
2. The high-speed pharmaceutical appearance detection data processing method according to claim 1, characterized in that, The execution device for the high-speed pharmaceutical appearance detection data processing method is a PLC, and the PLC and the industrial control computer have a pre-established TCP connection.
3. The high-speed pharmaceutical appearance detection data processing method according to claim 2, characterized in that, The process of establishing a TCP connection between the PLC and the industrial computer includes: The industrial control computer is connected to the PLC as a TCP client and a continuous connection is maintained, wherein the local device port of the PLC is fixed.
4. The high-speed pharmaceutical appearance detection data processing method according to claim 1, characterized in that, The length of the detection result data packet and the length of the detection result data packet are both 164 bytes. The detection result data packet includes a message type field, a parameter field, an operation command field, and a visual result field. The detection result data packet also includes a message type field, a parameter field, a device status field, an input IO field, and an output IO field. When reading the detection result data packet, the visual result field of the detection result data packet is located using the TRCV instruction.
5. The high-speed pharmaceutical appearance detection data processing method according to claim 1, characterized in that, Both the current incoming material signal and the incoming material signal are pulse values from the conveyor belt encoder. The process of triggering an image acquisition device to acquire an image of the drug's appearance based on the current incoming material signal includes: Obtain the current pulse value of the current incoming material signal. ; Based on the current pulse value Calculate the pulse value at the shooting location Wherein, the pulse value at the shooting location The mathematical expression is: In the formula, This indicates the number of pulses required for the drug to move from the sensing position to the photographing position.
6. The high-speed pharmaceutical appearance detection data processing method according to claim 1, characterized in that, The depth of the FIFO queue satisfies: In the formula, Indicates the depth of the FIFO queue. Indicates the production speed of the production line. This indicates the processing cycle for a single drug.
7. The high-speed pharmaceutical appearance detection data processing method according to claim 1, characterized in that, Trigger the removal and verification process to obtain the removal and verification results, including: The starting pulse value corresponding to the current incoming material signal is marked for rejection and placed in a FIFO queue; and a rejection offset is calculated based on the starting pulse value corresponding to the current incoming material signal, wherein the mathematical expression for the rejection offset is: In the formula, This indicates the removal offset. Indicates the starting position Movement and Removal Location The distance between them This indicates the distance traveled for each pulse; When the encoder pulses accumulate to At that time, a rejection signal is output to control the execution equipment to reject defective drugs; When the rejection signal is output, timing begins, and during the timing period, a feedback signal is received from the execution device, and the pulse accumulates to... If no detection signal is received from the downstream residual detection sensor, the cleaning is considered complete; otherwise, the cleaning is considered to have failed. This indicates the pulse offset corresponding to the downstream residual detection sensor.
8. A high-speed pharmaceutical appearance inspection data processing system, characterized in that, include: The acquisition module is used to acquire incoming material signals from the pharmaceutical production line and store the incoming material signals into a FIFO queue; The image acquisition module is used to extract the current incoming material signal from the FIFO queue and trigger the image acquisition device to acquire the appearance image of the drug based on the current incoming material signal. The image acquisition device sends the appearance image of the drug to the industrial control computer to execute the detection algorithm. The clearing detection module is used to read the detection result data packet received from the industrial control computer to obtain the detection result; when the detection result is abnormal, it triggers the rejection and verification process to obtain the rejection verification result, so as to control the execution device to reject the current drug; wherein, the rejection verification result is clearing completed or clearing failed, and the detection result data packet is a structured data packet of the target bytes; The return module is used to encapsulate the rejection verification result into a structured return data packet of the target bytes and return the return data packet to the industrial control computer, so that the industrial control computer can perform a detection action based on the rejection verification result.
9. An electronic device, characterized in that, include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 7.
10. 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 method as described in any one of claims 1 to 7.