Drug production line data acquisition method
Through the detailed classification of photoelectric data and the application of sliding window technology, combined with the correction of vibration data and LOF algorithm, the problem of photoelectric sensors' detection sensitivity decrease in drug production lines is solved, and the accurate collection of drug production quantities and inventory management are achieved.
Patent Information
- Application Number
- CN202510502319.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-22
AI Technical Summary
When the photoelectric sensors operate on the drug production line for a long time, they are susceptible to dust and mechanical vibrations, resulting in a decrease in detection sensitivity and false triggering or missed detection, which affects the accurate collection of drug production quantities.
By obtaining the photoelectric data on the drug packaging production line, it is divided into high-level data, low-level data and jump data, the sliding window technology is used to determine the jump length and jump window, the vibration vector and reference vector are obtained, the state outliers are calculated, and the LOF algorithm is used to correct the local outlier factor to collect the drug production line data.
It improves the accuracy of data collection and anti-interference ability, reduces the occurrence of counting errors, ensures accurate recording of drug production quantities, and improves the effectiveness of inventory management and the degree of automation of production lines.
Smart Images

Figure CN120030293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and more specifically, to a method for collecting data from a drug production line. Background Art
[0002] In the pharmaceutical production process, the scientific management of the pharmaceutical production line occupies a core position. Its management effectiveness is directly related to the quality and efficiency of pharmaceutical production. If the production line is not properly controlled, it will have a negative impact on the inventory management of the pharmaceuticals, and then cause waste of materials, manpower, time, etc., and increase the production cost of the pharmaceuticals.
[0003] The currently commonly used solution is to arrange photoelectric sensors on the drug packaging production line to collect the number of drugs. By monitoring the drug flow, the overall efficiency of drug production can be dynamically adjusted, and the drug inventory can be optimized. The number collection on the drug production line is achieved by the photoelectric sensor receiving the emitted light. When the medicine box moves along the production line and passes through the detection area of the photoelectric sensor, it will block the light propagation path, causing the light signal received by the receiver that originally continuously receives the light signal to be interrupted instantly. The interruption change of this light signal will be captured by the system, thereby triggering a count, thereby realizing the successive accumulation statistics of the number of drugs.
[0004] However, in actual production environments, photoelectric sensors face the following technical challenges in long-term operation: 1) Dust gradually accumulates on the surface of the sensor optical system (including light source transmitters and photosensitive receivers), which reduces light transmittance; 2) Mechanical vibration of the equipment may cause optical path deviation. These factors will significantly affect the detection sensitivity of the sensor, resulting in false triggering or missed detection, and ultimately leading to distortion of drug counting data, affecting the accuracy of drug production planning and the effectiveness of inventory management. Summary of the invention
[0005] In order to solve the problem that the photoelectric sensor may be affected by dust on the surface of the light source or receiver and the mechanical vibration of the production line equipment, thereby reducing the detection sensitivity, causing counting errors, resulting in errors in the collection of drug production quantities, affecting the accuracy of drug production plans and the effectiveness of inventory management, the present invention proposes a drug production line data collection method, which includes the following steps: Obtain photoelectric data of each position on the pharmaceutical packaging production line at each training moment and each transportation moment; record any position as the target position, divide the photoelectric data into high-level data, low-level data and jump data based on the size of the photoelectric data of the target position in the sliding window at each moment, and obtain multiple segments to be detected in the sliding window based on the category of the photoelectric data between adjacent jump data in the sliding window; determine the jump length of the target position at each training moment according to the length of each segment to be detected in the sliding window of the target position at each training moment; take the mode of the non-zero jump lengths of the target position at all training moments as the length of the jump window of the target position at each moment; obtain the length of the target position at each moment based on the jump window The vibration vector of the target position is obtained by using the LOF algorithm, and multiple reference vectors in the vibration vector of the training moment in each moment; according to the similarity between the vibration vector of the target position at each transportation moment and all the reference vectors, the state abnormal value of the target position at each transportation moment is determined; each to-be-detected segment in the sliding window of the target position at each transportation moment is constructed as a data point of the target position, and according to the length of the jump window, the length of the to-be-detected segment corresponding to each data point of the target position, and the mean of the state abnormal value of the transportation moment corresponding to all the photoelectric data in the to-be-detected segment corresponding to each data point, the local outlier factor of each data point of the target position obtained by using the LOF algorithm is corrected, and the data of the pharmaceutical production line is collected according to the corrected outlier factor.
[0006] The present invention can capture the real production status more accurately and reduce misjudgment caused by environmental factors through detailed classification of photoelectric data and sliding window technology; the jump window length determined by the mode at the training moment makes data collection more stable, reduces data deviation caused by abnormal conditions, and ensures accurate recording of drug production quantities; by comparing the similarity with the reference vector, it can monitor the status of the production line in real time and automatically identify abnormal conditions, and take timely measures to ensure smooth production; the combination of LOF algorithm and state abnormal value enables noise and abnormal data in the data collection process to be effectively corrected to ensure the authenticity and reliability of the data; with the help of accurate data collection methods, it can effectively support the formulation and adjustment of drug production plans, improve the effectiveness of inventory management, and avoid insufficient or excessive inventory due to data errors; through automatic monitoring and abnormal processing, it reduces manual intervention, improves the degree of automation of drug production lines, and improves production efficiency as a whole.
[0007] Furthermore, the photoelectric data is divided into high-level data, low-level data and transition data, including: recording the average of all photoelectric data in the sliding window at each moment as the division threshold at each moment; for any moment, all photoelectric data in the sliding window at that moment that is less than the division threshold at that moment is recorded as low-level data, and the remaining photoelectric data is recorded as high-level data; for any high-level data, in response to the photoelectric data on either side of the high-level data being low-level data, the high-level data is recorded as transition data.
[0008] Furthermore, the method of acquiring multiple segments to be detected in the sliding window includes: for any two adjacent transition data in the sliding window at the target position at any moment, in response to the absence of low-level data between the two adjacent transition data, the two adjacent transition data and all high-level data therebetween constitute a segment to be detected.
[0009] Furthermore, the jump length satisfies: ; In the formula, is the target position at the training time The jump length, is the target position at the training time The number of segments to be detected in the sliding window, is the target position at the training time The sliding window of The length of the segment to be detected, is the target position at the training time The average length of all segments to be detected in the sliding window of is the target position at the training time The number of high-level data in the sliding window, for function, The symbol for rounding up.
[0010] The present invention calculates the jump length by comprehensively considering the length of each segment to be detected and the amount of high-level data, so that the present invention can adapt to different production environments and conditions more dynamically and improve the flexibility of detection; the definition of the jump length integrates the characteristics of different segments to be detected, takes into account their mean and distribution, so that the obtained jump length can more comprehensively reflect the actual state of the target position and reduce the error caused by a single data segment.
[0011] Furthermore, the method for obtaining the vibration vector is: obtaining the vibration data of each position on the pharmaceutical packaging production line at each training moment and each transportation moment, and recording the time series composed of all vibration data in the jump window of the target position at each moment as the vibration vector of the target position at each moment.
[0012] Furthermore, the method for acquiring the reference vector is: for the vibration vector at each training moment in each moment, the vibration vector that does not contain abnormal vibration data in the vibration vector is recorded as the reference vector.
[0013] Furthermore, the abnormal state value satisfies: ; In the formula, The target location at the time of transport The abnormal value of the state, The target location at the time of transport The vibration vector of The target position A reference vector, is the number of reference vectors at the target position, is the natural exponential function, is the cosine similarity function, is the maximum value function.
[0014] By calculating the cosine similarity between the current state and multiple reference vectors, the present invention can effectively quantify the difference between the normal state and the abnormal state of the target position at the time of transportation, thereby improving the accuracy of anomaly detection; by converting the cosine similarity into an exponential form, it can effectively suppress the noise that is greatly different from the reference state, thereby emphasizing the real abnormal state and reducing the probability of false alarms.
[0015] Furthermore, the method of constructing each to-be-detected segment of the target position within the sliding window of each transport moment as a data point of the target position includes: for each to-be-detected segment, taking the mean of the photoelectric data of all corresponding transport moments in the to-be-detected segment as the coordinate of the first dimension, and taking the mean of the state anomaly values of all corresponding transport moments in the to-be-detected segment as the coordinate of the second dimension, to construct a data point of the target position.
[0016] Furthermore, the modified outlier factor satisfies: ; In the formula, The target position The corrected outlier factor for data points is The target position The local outlier factor of the data point is The target position The data points correspond to the length of the segment to be detected. The length of the jump window of the target position at each moment, The target position The data point corresponds to the mean of the state anomaly values of the transportation time corresponding to all the photoelectric data in the section to be detected, is the absolute value symbol.
[0017] The present invention makes a more comprehensive evaluation of the outlier nature of data points by combining the local outlier factor and the mean of the state outlier value, thereby ensuring that the result of the outlier factor can more truly reflect the actual state of the data; the correction factor takes into account the relationship between the length of the segment to be detected and the length of the jump window, making data analysis more flexible and targeted, and able to adapt to data segments of different lengths, thereby improving the adaptability of the system; by introducing the mean of the state outlier value, the outlier factor calculation error caused by random noise can be effectively suppressed, thereby improving the robustness of the overall data.
[0018] Furthermore, the collection of drug production line data based on the corrected local outlier factor includes: for any data point at the target position, in response to the corrected outlier factor of the data point being less than a preset abnormal threshold, the data point is identified as a normal data point, and real-time counting is performed to obtain the drug production quantity at the target position, thereby completing the drug production line data collection.
[0019] The present invention can quickly identify and process abnormal data points by real-time monitoring of the corrected outlier factor of each data point, thereby improving the real-time and accuracy of data collection, thereby helping to promptly discover and respond to problems in the production process; when the outlier factor is lower than a preset abnormal threshold, the data point can be confirmed as a normal data point, ensuring that only reliable data is counted, greatly reducing counting errors caused by noise and abnormal interference.
[0020] The present invention has the following beneficial effects: (1) The present invention can effectively eliminate abnormal photoelectric data interference caused by dust on the surface of the light source or receiver by finely dividing the photoelectric data and determining the jump length and jump window based on a sliding window or other methods, thereby improving the anti-interference ability of data acquisition and avoiding the decrease in detection sensitivity caused by the influence of dust, thereby reducing the occurrence of counting errors and improving the accuracy of drug production quantity collection.
[0021] (2) By using the acquired vibration vector and reference vector and calculating the similarity, the state abnormal value is determined, and the impact of the mechanical vibration of the production line equipment on the photoelectric sensor is accurately identified. The possible abnormal state is discovered in time, so that the data collection process of the pharmaceutical production line can better adapt to the vibration conditions of the equipment and ensure the reliability of the data.
[0022] (3) The operation of correcting the local outlier factor fully considers multiple factors such as the jump window length, the length of the segment to be detected, and the state outlier value, making the judgment of outlier data more accurate, avoiding misjudgment and missed judgment, and further improving the quality of data collection, providing solid data support for the accuracy of drug production planning and the effectiveness of inventory management.
[0023] (4) This data acquisition method comprehensively considers the various factors that affect the detection sensitivity of photoelectric sensors, processes and analyzes the data through a series of scientific and reasonable steps, and forms a complete and effective data acquisition mechanism. It has strong practicality and operability, and can be widely used in pharmaceutical production lines to improve the production management level and efficiency of pharmaceutical manufacturers. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flow chart of the steps of a method for collecting data on a drug production line according to an embodiment of the present invention.
[0025] Figure 2 It is a schematic diagram of a section to be detected in a method for collecting data on a pharmaceutical production line according to an embodiment of the present invention; in the figure, 1 represents high-level data and 0 represents low-level data. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present invention are described clearly and completely below, and the described embodiments are part of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0028] See also Figure 1 , which shows a flowchart of a method for collecting data of a drug production line provided by an embodiment of the present invention, the method comprising the following steps: S1: Obtain photoelectric data of each position on the pharmaceutical packaging production line at each training time and each transportation time.
[0029] It should be noted that when the material passes through the photoelectric sensor on the drug packaging production line, the light emitted by the light source will be blocked, so that the light signal detected by the receiver will change, and then the electrical signal (voltage) converted from the light signal will also change, and the production count of the drug can be performed by the change of the electrical signal output by the photoelectric sensor. Therefore, the present invention obtains the output data of the photoelectric sensor at each position on the drug packaging production line (the medicine board delivery position, the instruction manual delivery position, the box loading position, the medicine box sealing position, the box output reversing position, etc.) at each time, that is, the photoelectric data; wherein the training time is the pre-preparation stage of the present invention, and the transportation time is the normal drug production stage.
[0030] Implementers can set the acquisition frequency of photoelectric data according to specific implementation conditions, for example, 50 Hz.
[0031] S2: Divide the photoelectric data into categories and obtain the segments to be detected within the sliding window at each moment.
[0032] Any position is recorded as the target position, and based on the size of the photoelectric data in the sliding window at each moment of the target position, the photoelectric data is divided into high-level data, low-level data and transition data.
[0033] Implementers can set the size of the sliding window according to specific implementation conditions, for example, the same as the collection frequency, which is 50.
[0034] Specifically, the photoelectric data is divided into high-level data, low-level data and transition data, including: The mean value of all photoelectric data in the sliding window at each moment is recorded as the division threshold at each moment; At any moment, all photoelectric data within the sliding window at that moment that are less than the division threshold at that moment are recorded as low-level data, and the remaining photoelectric data are recorded as high-level data; See also Figure 2 For any high-level data, when the photoelectric data on either side of the high-level data is low-level data, the high-level data is recorded as transition data.
[0035] Based on the categories of the photoelectric data between adjacent jump data in the sliding window, a plurality of segments to be detected in the sliding window are obtained.
[0036] Specifically, the acquiring of multiple segments to be detected within the sliding window includes: See also Figure 2 For any two adjacent transition data in the sliding window of the target position at any time, in response to the absence of low-level data between the two adjacent transition data, the two adjacent transition data and all high-level data therebetween constitute a segment to be detected.
[0037] S3: Determine the jump length of each position at each training moment.
[0038] It should be noted that on the drug packaging production line, different positions play different roles in drug packaging. For example, the medicine plate conveying station plays the role of conveying the medicine plate, the medicine box filling station plays the function of loading the medicine plate and the instructions into the medicine box, and the packaging sealing station plays the role of sealing the medicine box. The functions of different positions require different times to be realized. Therefore, when the drug passes through the photoelectric sensors at different positions, the length of light blocking is also different. In order to collect the number of drugs by integrating the photoelectric sensors at various positions on the drug packaging production line, the present invention calculates the jump length of the photoelectric sensor at each position at each training moment based on the output data of the photoelectric sensors at various positions on the drug packaging production line, and then obtains the length of the jump window of the photoelectric sensor at each position, that is, the length of the jump window of each position at each moment (the length of the jump window of each position at each moment is the same).
[0039] According to the length of each to-be-detected segment in the sliding window of the target position at each training moment, the jump length of the target position at each training moment is determined.
[0040] Specifically, the jump length satisfies: ; In the formula, is the target position at the training time The jump length is is the target position at the training time The number of segments to be detected in the sliding window, is the target position at the training time The sliding window of The length of the segment to be detected, is the target position at the training time The average length of all segments to be detected in the sliding window of is the target position at the training time The number of high-level data in the sliding window, for function, The round-up symbol.
[0041] in, The output of the function is a sequence, namely It represents, use The first On the pharmaceutical packaging production line, when the material does not pass through the photoelectric sensor, the light beam is not blocked, the receiver receives the light signal, and the data output by the photoelectric sensor will be low-level data. When the material passes through the photoelectric sensor, the receiver detects that the light signal is interrupted, and the photoelectric data output by the photoelectric sensor will be high-level data. Therefore, It can represent the time when the material passes through the photoelectric sensor. The jump length is calculated based on the length of the jump. The jump length represents the length of the data generated when the medicine box passes through the sensor under normal circumstances. However, in the long-term use process, due to the influence of factors such as dust and vibration on the light source or the receiver surface of the photoelectric sensor, there will be a short jump in the data output by the sensor, forming a shorter jump interval. This data jump is not generated by the medicine box passing through the sensor. Therefore, the influence of the jump interval generated in this case on the jump length should be reduced. Therefore, As The weight of the jump length is used to calculate the jump length. The bigger, the The more likely it is caused by material transportation, the more likely it is that the jump length will be calculated. The greater the weight it should have; The smaller, the The more likely it is caused by dust or other factors, the more likely it is that the jump length will be calculated. should have a smaller weight; for ease of calculation, we divide by The way to was normalized and passed The function will Converted to weights.
[0042] It should be noted that since abnormal vibration of parts on the production line may cause the emission direction of the light source of the photoelectric sensor to deviate or the receiver to deviate from the emission position of the light, a vibration sensor is arranged at each photoelectric sensor to analyze the vibration conditions at each position, and the collection frequency of the vibration data must be synchronized with the collection frequency of the photoelectric sensor.
[0043] The mode of non-zero jump lengths of the target position at all training moments is taken as the length of the jump window of the target position at each moment; based on the jump window, the vibration vector of the target position at each moment and multiple reference vectors in the vibration vector of the training moment at each moment are obtained.
[0044] It should be noted that the implementers can set the duration of the training time according to the specific implementation situation, for example, 10 minutes, or it can be the length of time required to complete the packaging of a specified number of drugs, but it is necessary to ensure that all the reference vectors finally contain at least all the vectors corresponding to the complete process of processing one material.
[0045] Specifically, the method for obtaining the vibration vector is: The vibration data of each position on the pharmaceutical packaging production line at each training moment and each transportation moment are obtained, and the time series consisting of all vibration data in the jump window of the target position at each moment is recorded as the vibration vector of the target position at each moment.
[0046] Specifically, the method for obtaining the reference vector is: For the vibration vector of each training moment in each moment, the vibration vector that does not contain abnormal vibration data is recorded as a reference vector. The method of judging abnormal vibration data can be selected according to the actual situation. For example, through manual monitoring, it is determined that no abnormal vibration occurs within the segment jump window time.
[0047] S4: Determine the state abnormal value of each location at each transportation moment.
[0048] It should be noted that counting by means of photoelectric sensors is achieved by the photoelectric sensor's receiver receiving changes in the light source. If abnormal vibration occurs on the production line, it will affect the photoelectric sensor's reception of the light signal, thereby affecting the collection of the drug quantity on the drug production line. Therefore, vibration data is needed to assist in the collection of the drug quantity. However, the functions of each workstation on the drug packaging production line are realized through a mechanical structure. Under normal circumstances, the operation of the mechanical mechanism will also cause certain vibrations. In order to analyze the cause of the vibration and make the drug quantity collection on the drug packaging production line more accurate, the present invention calculates the state abnormality value of the photoelectric sensor at each position through the length of the photoelectric sensor's jump window and the vibration vector.
[0049] According to the similarity between the vibration vector of the target position at each transportation moment and all reference vectors, the state abnormal value of the target position at each transportation moment is determined.
[0050] Specifically, the abnormal state value satisfies: ; In the formula, The target location at the time of transport The abnormal value of the state, The target location at the time of transport The vibration vector of The target position A reference vector, is the number of reference vectors at the target position, is the natural exponential function, is the cosine similarity function, is the maximum value function.
[0051] in, Represents the transportation time The vibration vector of The similarity between the reference vectors is larger. and The more similar, because represents the vibration characteristics of the target position under normal conditions, so The larger the value, the more likely the state at the target position is normal, and the smaller the abnormal value of the photoelectric sensor at the target position is; the smaller the value, the more likely the state at the target position is normal. and The greater the difference between represents the vibration characteristics of the target sensor under normal conditions, so The smaller it is, the more likely the state at the target position is abnormal, and the larger the state abnormality value of the photoelectric sensor at the target position is; at the same time, in order to facilitate subsequent calculations, here we add 1 and divide by 2 to calculate Since all reference vectors contain vibration data of the photoelectric sensor at the target position in various states under normal circumstances, the vibration vector under normal circumstances is not similar to all reference vectors in the reference vector set. Therefore, it is only necessary to find the vector in the reference vector set that is most similar to the vibration vector to calculate the real-time state abnormality value of the photoelectric sensor at the target position. When the cosine similarity between the vibration vector and the most similar reference vector is at a low level, it means that the photoelectric sensor at the target position is more likely to be in an abnormal vibration state. Therefore, Calculate the real-time status abnormal value of the target location.
[0052] S5: construct the data points at each position, and determine the corrected outlier factor of each data point at each position.
[0053] Each to-be-detected segment of the target location within the sliding window at each transportation moment is constructed as a data point of the target location.
[0054] Specifically, constructing each to-be-detected segment of the target location in the sliding window of each transportation moment as a data point of the target location (each data point is detected only once, assuming that there is a data point constructed by a to-be-detected segment in a certain sliding window, the detection segment still exists in the sliding window of the next moment, but the data point constructed by the detection segment has been detected, so there is no need to repeat the detection), includes: For each segment to be detected, the mean of the photoelectric data of all corresponding transportation moments in the segment to be detected is used as the coordinate of the first dimension, and the mean of the state anomaly values of all corresponding transportation moments in the segment to be detected is used as the coordinate of the second dimension to construct a data point of the target position.
[0055] It should be noted that the light source or receiver of the photoelectric sensor will be affected by factors such as dust and vibration on the surface, resulting in counting errors, thus causing errors in the collection of the production quantity of drugs and affecting the production management of the drug production line. Therefore, the corrected outlier factor is calculated through the state outliers of the transportation moments corresponding to all the photoelectric data in the detection section corresponding to each data point position.
[0056] According to the length of the jump window, the length of the detection section corresponding to each data point at the target position, and the mean value of the state outliers of the transportation moments corresponding to all the photoelectric data in the detection section corresponding to each data point, the local outlier factors of each data point at the target position obtained by using the LOF algorithm are corrected to obtain the corrected outlier factor of each data point at the target position.
[0057] Specifically, the corrected outlier factor satisfies: ; In the formula, is the corrected outlier factor of the th data point at the target position, is the local outlier factor of the th data point at the target position, is the length of the detection section corresponding to the th data point at the target position, is the length of the jump window at each moment at the target position, is the mean value of the state outliers of the transportation moments corresponding to all the photoelectric data in the detection section corresponding to the th data point at the target position, is the absolute value symbol.
[0058] Among them, The larger it is, the more outlier the data point is, the more likely it is collected under the abnormal state of the photoelectric sensor, and the less likely it is caused by the drug material passing through the sensor. The corrected outlier factor of this data point should be larger; The smaller it is, the more likely the data point is in the dense position of the data set, the more likely it is collected under the normal state of the sensor, and the more likely it is caused by the drug material passing through the sensor. The corrected outlier factor of this data point should be smaller. represents the gap between the length of the detection section of this data point and the length of the jump window. Since the length of the jump window represents the length of the continuous high-level data generated by the material passing through the sensor when the photoelectric sensor is in the normal state, therefore The larger it is, the more likely the data point is collected under the abnormal state of the photoelectric sensor, and the less likely it is caused by the drug material passing through the sensor. The corrected outlier factor of this data point should be larger; The smaller it is, the more likely the data point is in a dense location in the data set, the more likely the data point is collected by the photoelectric sensor in a normal state, and the more likely it is generated by the drug material passing through the sensor. The smaller the corrected outlier factor of the data point should be. The larger the value is, the more likely the data point is collected when the photoelectric sensor is in an abnormal state, and the more likely it is not generated by the drug material passing through the photoelectric sensor. The larger the corrected outlier factor of the data point should be. The smaller it is, the more likely the data point is to be located in a dense position in the data set, the more likely the data point is collected by the photoelectric sensor under normal conditions, and the more likely it is generated by the pharmaceutical material passing through the photoelectric sensor. The smaller the corrected outlier factor of the data point should be.
[0059] S6: Collect drug production line data based on the corrected outlier factor.
[0060] Specifically, the collection of drug production line data according to the corrected local outlier factor includes: For any data point at the target location, in response to the corrected outlier factor of the data point being less than the preset abnormal threshold, the data point is identified as a normal data point, and real-time counting is performed to obtain the drug production quantity at the target location, thereby completing the drug production line data collection.
[0061] Implementers can set the abnormal threshold according to specific implementation circumstances, for example, 0.5.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for collecting data from a pharmaceutical production line, characterized in that: include: Obtain photoelectric data of each position on the pharmaceutical packaging production line at each training time and each transportation time; Record any position as the target position, divide the photoelectric data into high-level data, low-level data and transition data based on the size of the photoelectric data in the sliding window at each moment of the target position, and obtain multiple segments to be detected in the sliding window based on the categories of the photoelectric data between adjacent transition data in the sliding window; Determine the jump length of the target position at each training moment according to the length of each to-be-detected segment in the sliding window of the target position at each training moment; take the mode of the non-zero jump lengths of the target position at all training moments as the length of the jump window of the target position at each moment; based on the jump window, obtain the vibration vector of the target position at each moment, and multiple reference vectors in the vibration vector of the training moment at each moment; According to the similarity between the vibration vector of the target position at each transportation moment and all reference vectors, the state outlier value of the target position at each transportation moment is determined; each to-be-detected segment in the sliding window of the target position at each transportation moment is constructed as a data point of the target position, and according to the length of the jump window, the length of the to-be-detected segment corresponding to each data point of the target position, and the mean of the state outlier value at the transportation moment corresponding to all photoelectric data in the to-be-detected segment corresponding to each data point, the local outlier factor of each data point of the target position obtained by using the LOF algorithm is corrected, and the drug production line data is collected according to the corrected outlier factor.
2. A pharmaceutical production line data collection method according to claim 1, characterized in that: The step of dividing the photoelectric data into high level data, low level data and transition data includes: The mean value of all photoelectric data in the sliding window at each moment is recorded as the division threshold at each moment; At any moment, all photoelectric data within the sliding window at that moment that are less than the division threshold at that moment are recorded as low-level data, and the remaining photoelectric data are recorded as high-level data; For any high-level data, when the photoelectric data on either side of the high-level data is low-level data, the high-level data is recorded as transition data.
3. A drug production line data collection method according to claim 1, characterized in that: The step of obtaining a plurality of segments to be detected within the sliding window includes: For any two adjacent transition data in the sliding window of the target position at any time, in response to the absence of low-level data between the two adjacent transition data, the two adjacent transition data and all high-level data therebetween constitute a segment to be detected.
4. A pharmaceutical production line data collection method according to claim 1, characterized in that: The jump length satisfies: ; In the formula, is the target position at the training time The jump length, is the target position at the training time The number of segments to be detected in the sliding window, is the target position at the training time The sliding window of The length of the segment to be detected, is the target position at the training time The average length of all segments to be detected in the sliding window of is the target position at the training time The number of high-level data in the sliding window, for function, The round-up symbol.
5. A drug production line data collection method according to claim 1, characterized in that: The method for obtaining the vibration vector is: The vibration data of each position on the pharmaceutical packaging production line at each training moment and each transportation moment are obtained, and the time series consisting of all vibration data in the jump window of the target position at each moment is recorded as the vibration vector of the target position at each moment.
6. A drug production line data collection method according to claim 5, characterized in that: The method for obtaining the reference vector is: For the vibration vector at each training moment in each moment, a vibration vector that does not contain abnormal vibration data is recorded as a reference vector.
7. A drug production line data collection method according to claim 1, characterized in that: The abnormal state value satisfies: ; In the formula, The target location at the time of transport The abnormal value of the state, The target location at the time of transport The vibration vector of The target position A reference vector, is the number of reference vectors at the target position, is the natural exponential function, is the cosine similarity function, is the maximum value function.
8. A drug production line data collection method according to claim 1, characterized in that: The step of constructing each to-be-detected segment of the target location within the sliding window at each transport time as a data point of the target location includes: For each segment to be detected, the mean of the photoelectric data of all corresponding transportation moments in the segment to be detected is used as the coordinate of the first dimension, and the mean of the state anomaly values of all corresponding transportation moments in the segment to be detected is used as the coordinate of the second dimension to construct a data point of the target position.
9. A drug production line data collection method according to claim 1, characterized in that: The modified outlier factor satisfies: ; In the formula, The target position The corrected outlier factor for data points is The target position The local outlier factor of the data point is The target position The data points correspond to the length of the segment to be detected. The length of the jump window of the target position at each moment, The target position The data point corresponds to the mean of the state anomaly values of the transportation time corresponding to all the photoelectric data in the section to be detected, is the absolute value symbol.
10. A drug production line data collection method according to claim 1, characterized in that: The collecting of drug production line data according to the corrected local outlier factor includes: For any data point at the target location, in response to the corrected outlier factor of the data point being less than the preset abnormal threshold, the data point is identified as a normal data point, and real-time counting is performed to obtain the drug production quantity at the target location, thereby completing the drug production line data collection.
Citation Information
Patent Citations
Aero-engine data anomaly detection method and system
CN118468199A
Self-adaptive control method for full-automatic packaging equipment based on dynamic data acquisition
CN119329856A
Sign detection device and sign detection method
US20230115206A1