A method and system for preventing cross-talk between photoelectric sensors
By establishing a unified time axis and window segmentation technology, the problem of signal interference in complex environments of traditional photoelectric sensors has been solved, enabling accurate signal differentiation and stable detection, and enhancing anti-interference capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-20
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional photoelectric sensors are susceptible to interference in complex environments, leading to signal aliasing, false locking, or missed detection. They are difficult to accurately determine the source of signals under high-density deployment conditions and lack the ability to adapt to non-periodic or sudden interference.
By acquiring the voltage sampling values and sampling timestamps of the photoelectric sensor, a unified time axis is established, point-by-point discrimination and window division are performed, pulse overlap rate is calculated, pulse occurrence times within independent windows are extracted, and continuity discrimination and merging are performed to eliminate interference records and establish a pulse record without mutual interference.
It enables effective differentiation of photoelectric sensor signals in complex environments, improves detection accuracy and stability, and enhances anti-interference capabilities.
Smart Images

Figure CN122237646A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of anti-interference technology, and in particular to a method and system for preventing mutual interference between photoelectric sensors. Background Technology
[0002] The field of anti-interference technology for photoelectric sensors involves systematic methods for detecting the presence or location information of targets using light emitting and receiving devices. Its core aspects include multi-source emission control, optical signal propagation path management, and signal discrimination mechanisms at the receiving end. This is a fundamental method for multi-sensor collaborative operation achieved through timing control at the transmitting end, specific frequency modulation of the optical signal, and synchronous demodulation and identification at the receiving end. This ensures that each sensing unit possesses distinguishable optical signal characteristics in the same spatial environment. Traditional methods for preventing mutual interference between photoelectric sensors involve using fixed-frequency modulation emission, duty cycle control of light emission, and extraction of corresponding frequency signals at the receiving end through a lock-in amplifier circuit when multiple sensors are operating simultaneously. This is combined with a time-division driving method where the transmitting end sequentially activates the light-emitting devices at preset time intervals, thereby differentiating the optical signals from different sensors.
[0003] Traditional methods rely on fixed-frequency modulation and preset timing cycles for signal differentiation. In actual operation, these methods are easily affected by ambient reflected light, equipment aging, or installation deviations, leading to aliasing of signals at the receiving end, making reliable separation difficult using a single frequency characteristic. While duty cycle control and time-division driving can reduce some conflicts, time overlap may still occur when multiple devices are operating close to their operating state simultaneously, causing false locking or missed detections during the phase-locked signal extraction process. For example, when the distance between multiple workstations on a conveyor line is shortened, the overlap of adjacent transmission cycles occurs frequently, making it difficult for the receiving end to accurately determine the source. In addition, this type of method focuses on transmitter control and lacks fine-grained analysis capabilities for changes in the receiver signal morphology. When external interference exhibits aperiodic or sudden characteristics, the fixed demodulation mechanism cannot adapt in time, resulting in decreased detection stability. At the same time, the lack of utilization of historical timing continuity means that transient abnormal signals may be mistaken for valid results, or the real signal may be fragmented due to partial obstruction, thus affecting the accuracy of subsequent control decisions. In complex optical environments or high-density deployment conditions, this can easily lead to false triggering or missed triggering problems. Summary of the Invention
[0004] To achieve the above objectives, the present invention employs the following technical solution: a method for preventing mutual interference between photoelectric sensors, comprising the following steps. S1: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveying station within the corresponding sampling period, and write the sampling points into a unified time axis according to the detection channel to obtain the channel timing table; S2: According to the channel timing table, the trigger voltage threshold is called to judge the voltage sampling value of the detection channel point by point, and the judgment results are sorted in order according to the time slices corresponding to the light emission cycle to generate a channel occupancy sequence. S3: Based on the channel occupancy sequence, the window is divided according to the sampling period. The coincidence of the pulse occurrence time of the detection channel within the same window is judged, the pulse overlap rate is calculated, and the window corresponding to the overlap rate threshold is marked as an interference window. The remaining windows are marked as independent windows. The collection is completed according to the detection channel to obtain the channel isolation window set. S4: Extract the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, perform continuity judgment on the corresponding time segments of adjacent windows, and merge them according to the detection channel order to obtain the channel pulse segment table; S5: Call the channel pulse segment table to mark the occurrence time, window number, and conveying station number of the detection channel pulse, write the marked pulse record into the output queue, and establish a non-interference pulse record.
[0005] As a further embodiment of the present invention, the channel timing table includes a channel identifier index, a time axis scale sequence, and a sampling voltage mapping set; the channel occupancy sequence includes a pulse state code set, a periodic segment label set, and an occupancy flag sequence; the channel isolation window set includes a window category identifier set, an overlap rate distribution set, and a channel affiliation index; the channel pulse segment table includes segment start and end time pairs, segment continuity markers, and a channel correspondence set; the interference-free pulse record includes a workstation association identifier, a window number label, and a pulse time sequence set.
[0006] As a further aspect of the present invention, the point-by-point discrimination compares the voltage sample value corresponding to adjacent sampling timestamps with the trigger voltage threshold and records the direction of change when crossing the trigger voltage threshold. The sampling timestamp at which the trigger voltage threshold is first crossed within the time slice corresponding to the emission cycle is taken as the pulse occurrence time.
[0007] As a further aspect of the present invention, the window is divided according to an integer multiple of the sampling period, wherein the integer multiple is a natural number between 2 and 5; the pulse overlap rate is obtained by statistically analyzing the ratio of the number of times the time difference between the occurrence times of pulses from different detection channels within the same window is less than a preset time tolerance to the total number of pulses within the window, wherein the preset time tolerance is 1 to 3 times the interval between adjacent sampling timestamps.
[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveyor station within the corresponding sampling period, sort the equipment voltage sequence according to the timestamp, perform consistency verification on the time interval, interpolate and fill in the missing time positions to form a continuous time index sequence, and obtain a unified sampling time sequence matrix. S102: Based on the unified sampling time series matrix, the detection channel identifier parameter is called to perform channel mapping processing on the unified sampling time series matrix, the voltage value sequence is reorganized and arranged according to the channel number, and the consistency check is performed on the multi-channel data at the same time index position to construct the multi-channel voltage data arrangement structure and obtain the channel voltage correlation matrix; S103: Based on the channel voltage correlation matrix, call the unified time axis index to perform time alignment processing on the channel voltage values, establish an index mapping relationship between the channel number and the timestamp, and perform sequence standardization processing on the overall data structure to form a standardized time and channel correspondence structure, thus obtaining the channel time series table.
[0009] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: According to the channel timing table, the trigger voltage threshold is called to distinguish the voltage sampling value of the detection channel point by point. The voltage value at the time index position is compared with the trigger voltage threshold. The discrimination result is converted into a state identifier sequence and arranged continuously according to the timestamp order to form a time-ordered state distribution structure, thus obtaining the voltage discrimination state sequence. S202: Based on the voltage discrimination state sequence, the light emission cycle time parameter is called to perform segmented mapping processing on the timestamp sequence, the continuous time index is divided into the corresponding light emission cycle time slice, and the state identifiers in the same time slice are merged and sorted to form a periodic segment state combination structure, and a periodic segment state set is obtained. S203: Based on the set of periodic segment states, the time slice sequence index is called to perform sequential reorganization processing on the segment states, the state identifiers are serialized and arranged according to the time slice order of the emission period, and a correspondence structure between time slices and state identifiers is established to obtain the channel placeholder sequence.
[0010] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the channel occupancy sequence, the window is divided according to the sampling period, the time index is mapped to the corresponding sampling period window, the status identifiers in the window are aggregated and organized, the position of the detection channel pulse is extracted and a corresponding relationship structure is established to form a pulse distribution representation in the window, and a window pulse distribution set is obtained; S302: Based on the set of window pulse distributions, perform overlap discrimination on the pulse occurrence times of the detection channels within the same window, call the pulse position relationship for overlap matching, calculate the pulse overlap rate, compare the pulse overlap rate with the overlap rate threshold, form a window classification status identifier structure, and obtain a window interference classification identifier set; S303: Based on the window interference classification identifier set, the data of windows identified as interference windows and independent windows are aggregated according to the detection channels, and the window classification results are arranged in order according to the channel index to construct the channel-window correspondence structure and obtain the channel isolation window set.
[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Extract the pulse occurrence time within the independent window of the detection channel according to the channel isolation window set, filter the time index corresponding to the independent window, and perform time-series mapping processing on the pulse occurrence position of the detection channel to form a pulse time distribution structure divided by channel, and obtain the channel pulse time set; S402: Based on the channel pulse time set, the continuity of the corresponding time segments of adjacent windows is determined, the pulse occurrence positions under adjacent time indices are matched for continuity, and the determination is performed according to the time interval relationship to form a continuous segment identification structure and obtain a pulse continuous segment identification set. S403: Based on the pulse continuous segment identifier set, the merging process is completed according to the detection channel order. The continuous segment identifiers are reorganized according to the channel index execution order, and a channel-pulse segment correspondence structure is established to obtain the channel pulse segment table.
[0012] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Call the channel pulse segment table to mark the pulse occurrence time, window number, and conveying station number of the detection channel, perform index matching between the pulse occurrence time and the window number, and map the conveying station number to the corresponding time position to form a multi-dimensional identifier association structure and obtain a pulse multi-dimensional identifier set; S502: Based on the pulse multidimensional identifier set, perform filtering processing on the records corresponding to the interference window, match and compare the window identifier with the interference window mark, perform confirmation processing on the independent window associated data, retain the independent window associated data, form the filtered identifier data structure, and obtain the filtered pulse identifier set; S503: Based on the set of filtered pulse identifiers, write the identifier data into the output queue in chronological order, and arrange them according to the channel index execution order to establish a correspondence structure between channels and pulse records, thereby obtaining pulse records without mutual interference.
[0013] A system for preventing mutual interference between photoelectric sensors, comprising: The signal acquisition module acquires the voltage sampling values and sampling timestamps of the photoelectric sensor, the light emitter, the photosensitive detector and the conveying station during the corresponding sampling period, and writes the sampling points into a unified time axis according to the detection channel to obtain the channel timing table. The threshold discrimination module calls the trigger voltage threshold according to the channel timing table to discriminate the voltage sampling value of the detection channel point by point, and organizes the discrimination results in order according to the time slices corresponding to the emission cycle to generate a channel occupancy sequence. The overlap assessment module divides the window according to the sampling period based on the channel occupancy sequence, judges the overlap of the pulse occurrence time of the detection channel within the same window, calculates the pulse overlap rate, marks the window that exceeds the overlap rate threshold as an interference window, marks the remaining windows as independent windows, and completes the aggregation according to the detection channel to obtain the channel isolation window set; The window merging module extracts the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, performs continuity judgment on the corresponding time segments of adjacent windows, and completes the merging according to the detection channel order to obtain the channel pulse segment table; The output annotation module calls the channel pulse segment table to annotate the occurrence time, window number, and conveying station number of the detection channel pulse, and writes the annotated pulse record into the output queue to establish a non-interference pulse record.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by aligning multi-channel sampling data with a unified time axis, signals from different sources have a consistent timing reference, reducing discrimination errors caused by asynchrony. Based on window division and pulse overlap rate calculation, interference and independent signals are effectively distinguished. By continuously merging adjacent time segments, effective signals form a complete trajectory, avoiding fragmentation. Combining position and time annotations and removing interference records, the output results have higher accuracy and stability, enhancing the anti-interference capability under complex working conditions. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention; Figure 7 This is a system module diagram of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a method for preventing mutual interference between photoelectric sensors, comprising the following steps: S1: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveying station within the corresponding sampling period, and write the sampling points into a unified time axis according to the detection channel to obtain the channel timing table; S2: Based on the channel timing table, the trigger voltage threshold is called to judge the voltage sampling value of the detection channel point by point, and the judgment results are sorted in order according to the time slices corresponding to the emission cycle to generate the channel occupancy sequence; S3: Based on the channel occupancy sequence, the window is divided according to the sampling period. The pulse occurrence time of the detection channel within the same window is judged to be coincident. The pulse overlap rate is calculated. The window that exceeds the overlap rate threshold is marked as an interference window, and the remaining windows are marked as independent windows. The collection is completed according to the detection channel to obtain the channel isolation window set. S4: Extract the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, perform continuity judgment on the corresponding time segments of adjacent windows, and merge them according to the detection channel order to obtain the channel pulse segment table; S5: Call the channel pulse segment table to mark the occurrence time, window number, and conveying station number of the detection channel pulse, write the marked pulse record into the output queue, and establish a non-interference pulse record.
[0020] The channel timing table includes a channel identifier index, a time axis scale sequence, and a sampled voltage mapping set; the channel occupancy sequence includes a pulse state code set, a periodic segment label set, and an occupancy flag sequence; the channel isolation window set includes a window category identifier set, an overlap rate distribution set, and a channel affiliation index; the channel pulse segment table includes segment start and end time pairs, segment continuity markers, and a channel correspondence set; and the non-interference pulse record includes a workstation association identifier, a window number label, and a pulse time sequence set.
[0021] Please see Figure 2 The specific steps of S1 are as follows: S101: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveyor station within the corresponding sampling period, sort the equipment voltage sequence according to the timestamp, perform consistency verification on the time interval, interpolate and fill in the missing time positions to form a continuous time index sequence, and obtain a unified sampling time sequence matrix. The raw records generated by the photoelectric sensor, emitter, photodetector, and conveyor station within the same sampling period are sequentially written as timestamp, sampled object number, and voltage value. A two-level sorting process is then performed, first by the last three digits of milliseconds, then by the last three digits of microseconds. After sorting, the time interval between adjacent records is checked item by item. During implementation, the sampling interval is set to 0.2 milliseconds, the continuous sampling period is set to 120 milliseconds, and a single channel should obtain 600 time positions. Records with adjacent time differences falling between 0.18 milliseconds and 0.22 milliseconds are directly retained, while positions with a difference greater than 0.22 milliseconds are marked as missing points. Taking a component transfer record at a certain conveying station as an example, the emitter has continuous voltage values at 12.000 ms, 12.200 ms, and 12.400 ms. The photodetector is missing at 12.600 ms and subsequently recovers to 2.84 volts at 12.800 ms. Therefore, the uniform increment between the 2.76 volts at 12.400 ms and the 2.84 volts at 12.800 ms is taken, and 2.80 volts are added at 12.600 ms. For missing values at the beginning, the first valid value is directly used; for missing values at the end, the last valid value is used. Records with more than 5 consecutive missing values are marked separately and removed from the example section of this embodiment. The power supply voltage is set to 24V, falling within the common 10V to 30V power supply range for industrial photoelectric sensors. The full-scale analog sampling input range is 0V to 10V, consistent with the common voltage range for industrial analog inputs. Furthermore, with a 0.2ms sampling interval, the interval between each sampling point is less than the 0.5ms response time of the disclosed device, allowing subsequent pulse edges to still be recorded at multiple points. After the above processing, a continuous time index sequence of length 600 is generated for the four types of sampling objects, resulting in a unified sampling time series matrix. The publicly available specifications for industrial photoelectric sensors show a 10V to 30V power supply, a 0.5ms response time, and a common 0V to 10V range for industrial analog inputs.
[0022] Table 1. Example of a unified sampling time series As shown in Table 1, the table provides the continuous time segments before and after interpolation that can directly proceed to subsequent permutation operations. The photodetector voltage at the 12.600 ms position is the result of the overwrite, and all subsequent segments use this type of continuous time index as a common reference.
[0023] S102: Based on the unified sampling time series matrix, the detection channel identifier parameter is called to perform channel mapping processing on the device sampling sequence, the voltage value sequence is reorganized and arranged according to the channel number, and the consistency check is performed on the multi-channel data at the same time index position to construct the multi-channel voltage data arrangement structure and obtain the channel voltage correlation matrix; Each column of the aforementioned unified sampling time series matrix is rewritten according to the pre-registered detection channel identifier order into a fixed arrangement of Channel 1, Channel 2, Channel 3, and Channel 4. Channel 1 corresponds to the photoelectric sensor, Channel 2 to the emitter, Channel 3 to the photodetector, and Channel 4 to the conveyor station. During reconstruction, the four voltage values corresponding to time index 12.000 milliseconds are read first, and then written to the four channel positions in the same row. Subsequently, the data is written downwards in 12.200 milliseconds, 12.400 milliseconds, etc. If any row is missing a channel value, the continuous index table in S101 is first checked to see if the corresponding time position has been filled in. If not, the value of the same channel from the previous moment is immediately written to the row and a missing measurement mark is added. When performing consistency verification on multi-channel data at the same time index position, it is first checked whether the four channels share the same timestamp, and then it is checked whether the channel numbers are duplicated. Taking 12.400 milliseconds in Table 1 as an example, after recombination, channel 1 is 0.47 volts, channel 2 is 4.99 volts, channel 3 is 2.76 volts, and channel 4 is 1.18 volts. If channel 3 is mistakenly written to the position of channel 2 during a certain acquisition, it will be backfilled to channel 3 according to the channel identification table, and the original position of channel 2 will be restored to 4.99 volts. During implementation, two abnormal row judgment conditions are set: one is inconsistent timestamps, and the other is duplicate channel numbers in the same row. When the proportion of abnormal rows in a 120-millisecond sampling segment exceeds 2%, that period will not be included in subsequent calculations. In this calculation, after rearranging 600 rows of records, no duplicate channels appeared, and the number of rows with consistent timestamps reached 600 rows, resulting in a channel voltage correlation matrix arranged in a fixed order according to channel numbers. Subsequent segments are processed directly using the row positions corresponding to the time and the column positions corresponding to the channels in this matrix.
[0024] S103: Based on the channel voltage correlation matrix, call the unified time axis index to perform time alignment processing on the channel voltage values, establish an index mapping relationship between the channel number and the timestamp, and perform sequence normalization processing on the overall data structure to form a standardized time-channel correspondence structure, thus obtaining the channel time series table; Read rows 1 to 600 of the channel voltage correlation matrix, mapping the row numbers to a unified time axis index, and then mapping the column numbers to the detection channel numbers, forming a double-index table with time first and channel second. During processing, first rewrite row 1 to correspond to channels 1 to 4 at 12.000 milliseconds, then rewrite row 2 to correspond to channels 1 to 4 at 12.200 milliseconds, and so on until row 600 is completed. Sequential standardization is performed in three steps: first, checking if the timestamps are strictly incremental; second, checking if all four channels are completely written under each timestamp; and third, checking if the number of records for each channel within the entire segment is 600. For example, the row containing 12.600 milliseconds, after processing, yields channel 1 voltage 0.46 volts, channel 2 voltage 4.97 volts, channel 3 voltage 2.80 volts, and channel 4 voltage 1.19 volts. This row is directly treated as the four-channel comparison item at the same time during subsequent discrimination. A final check is performed on the sequence standardization results. Subtracting the start time from the timestamp of the first row yields 0 milliseconds, and subtracting the start time from the timestamp of the 600th row yields 119.8 milliseconds. Both of these, along with the aforementioned 0.2 millisecond sampling interval, correspond to 600 positions, which is consistent with the number of positions. If a channel is found to have fewer than 600 records, the missing positions are traced back. If the number of missing records does not exceed 3, the already supplemented data is used, and no new time point is generated. If the number of missing records exceeds 3, the entire segment is discarded. In this embodiment, 600 records are retained for each of the four channels, forming a standardized time-channel correspondence structure, resulting in a channel time sequence table. The subsequent referencing method of this table is fixed as follows: the state determination of any time slice reads the detection value only from channel 3 under the same time index, while channels 2 and 4 continue to serve as the association reference between the emission cycle and the workstation position.
[0025] Please see Figure 3 The specific steps of S2 are as follows: S201: According to the channel timing table, the trigger voltage threshold is called to judge the voltage sampling value of the detection channel point by point. The voltage value at the time index position is compared with the trigger voltage threshold. The judgment result is converted into a state identifier sequence, which is continuously arranged according to the timestamp order to form a time-ordered state distribution structure, and the voltage judgment state sequence is obtained. The system reads 600 voltage samples from channel 3 in chronological order from the channel timing table, then compares them point by point using the trigger voltage threshold. Values reaching or exceeding the threshold are marked as "1", while values below the threshold are marked as "0". The threshold is not directly taken as the median, but is determined based on the measured voltage range of the same conveyor line under both no-load and component-passing conditions. In practice, 30 points are first taken under no-load conditions, with a measured range of 0.32V to 0.58V, followed by 30 points under stable blocking conditions, with a measured range of 2.61V to 3.08V. The midpoint between the upper limit of no-load (0.58V) and the lower limit of blocking (2.61V) is then written as 1.60V, and tightened by 0.20V towards the higher value, forming a 1.80V trigger voltage threshold. The reason for using this value is that the aforementioned photodetector can operate in a 1.8V to 5.0V power supply environment in low-voltage power supply applications. Its output configuration is affected by the downstream interface, and the low-level and high-level distributions within the actual sampling segment are clearly separated. Therefore, after writing 1.80V into the discrimination condition, background fluctuations below 1.80V no longer enter the pulse state. Taking the six points in Table 1 as an example, 0.36V, 0.40V, and 0.41V are all written as "0", and 2.76V, 2.80V, and 2.84V are all written as "1", thus obtaining a local state segment of 0, 0, 1, 1, 1, 0. After performing the same operation on 600 points, a total of 74 "1" states and 526 "0" states are obtained. The timestamps of the 74 "1" states are then written sequentially to form a time-ordered state distribution structure, resulting in the voltage discrimination state sequence. The actual value of this threshold is determined within the constraints of device power supply and analog interface. Industrial analog interfaces commonly have inputs of 0V to 10V, while the publicly available power supply range for photosensitive front-end devices is 1.8V to 5.0V.
[0026] Table 2 Key Parameter Test Setting Table See Table 2, which lists the key parameters directly called in subsequent sections. The number of sections that pass the judgment is based on the sample sections whose manual review records match the output records. All subsequent examples will use the values from Table 2.
[0027] S202: Based on the voltage discrimination state sequence, the light emission cycle time parameter is called to perform segmented mapping processing on the timestamp sequence, divide the continuous time index into the corresponding light emission cycle time slice, and merge and organize the state identifiers within the same time slice to form a periodic segment state combination structure, and obtain the periodic segment state set. 600 consecutive time indices are mapped to emission cycle time slices. In implementation, the high-level plateau is first identified from the emitter voltage sequence of channel 2. The time difference between adjacent emission start points is measured to be consistently around 2.0 milliseconds, and the emission cycle time parameter is then written as 2.0 milliseconds. Since the sampling interval is 0.2 milliseconds, each emission cycle corresponds to 10 time points. Therefore, starting from the start time of 12.000 milliseconds, the period from 12.000 milliseconds to 13.800 milliseconds is designated as the first cycle segment, the period from 14.000 milliseconds to 15.800 milliseconds as the second cycle segment, and so on. During merging, not all 10 state bits are directly retained. Instead, three items are recorded for each time slice: the total number of "1" states within that slice, the position of the first occurrence of "1", and the position of the last occurrence of "1". Taking the segment containing the aforementioned local state segments 0, 0, 1, 1, 1, 0 as an example, if the complete state of the 10 points in this segment is 0, 0, 1, 1, 1, 0, 0, 0, 0, then the segment state combination is written as "high state 3 times, first position 3rd point, last position 5th point". After mapping all 600 points, a total of 60 periodic segment state sets are obtained. The setting process of the emission period time parameter in Table 2 is derived from the comparison of 30 sample segments. After mapping 1.6 milliseconds, 2.0 milliseconds, 2.4 milliseconds, and 2.8 milliseconds respectively, and comparing them with the manually labeled emission beat, the 2.0 millisecond scheme is completely aligned with the manually labeled 27 out of 30 segments. The remaining 3 segments only show a segment boundary offset of 1 sampling point. Therefore, this embodiment uses 2.0 milliseconds. After obtaining the periodic segment state set, each segment has three data items: time slice number, number of high states within the slice, and start and end positions within the slice, providing a unified segment granularity for subsequent sequential reorganization.
[0028] S203: Based on the set of periodic segment states, the time slice sequence index is called to perform sequential reorganization processing on the segment states, the state identifiers are serialized and arranged according to the time slice order of the emission period, and a correspondence structure between time slices and state identifiers is established to obtain the channel placeholder sequence. The aforementioned 60 periodic state segments are rearranged into a sequential order based on their time-slice numbers. The state information within each time-slice is compressed into placeholder identifiers. Compression rules are applied in three levels: an empty slot identifier is used when the number of high-state states within a slice is 0; a single-pulse placeholder identifier is used when the number of high-state states within a slice is between 1 and 3 and the distance between the first and last positions does not exceed two sampling points; and an extended placeholder identifier is used when the number of high-state states within a slice is greater than 3 or the distance exceeds two sampling points. For example, a slice with "3 high-state occurrences, first position at point 3, last position at point 5" is written as a single-pulse placeholder. If another slice has a state distribution of 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, then the number of high-state occurrences is 5, the first position is point 2, and the last position is point 6, thus it is written as an extended placeholder. During reassembly, a one-to-one correspondence between time-slices and state identifiers is established simultaneously: the first slice corresponds to slice number 1, the second slice to slice number 2, and so on up to slice number 60. In the example, after reassembly of 60 segments, there were 46 empty slots, 11 single-pulse slots, and 3 extended slots. Segment sequential indices can only be written incrementally from 1 to 60, and back-insertion or skipping is not allowed. If a segment number is missing, the end time of the previous segment is checked against the start time of the next segment to determine if a missing segment exists; no missing segments were found in this sample. After sequential reassembly, a channel slot sequence of length 60 is formed. Segments 8, 9, and 10 show consecutive single-pulse slots, segment 24 shows an extended slot, and segment 25 is empty. This set of adjacent relationships is carried over to the next stage of sampling window division. The channel slot sequence is expressed as segment number first, slot category second, and intra-segment position appended at the end; subsequent window processing directly reads these three items.
[0029] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the channel occupancy sequence, the window is divided according to the sampling period. The time index is mapped to the corresponding sampling period window, and the status identifiers within the window are aggregated and organized. The location of the detection channel pulse is extracted and a corresponding relationship structure is established to form a pulse distribution representation within the window, thus obtaining the window pulse distribution set. The sampling period window length was set to 8.0 milliseconds, and the value was determined according to the 30 sample experiments in Table 2. Since the single emission period is 2.0 milliseconds, every 4 time slices were assigned to one window, and a total of 15 windows were formed by 60 time slices. When dividing, slices 1 to 4 were assigned to window 1, slices 5 to 8 were assigned to window 2, and so on until slices 57 to 60 were assigned to window 15. The state aggregation within the window no longer used the voltage value, but extracted the occurrence position of single pulse occupation or extended occupation within the slice and wrote it as the pulse distribution within the window. Taking window 2 as an example, if slice 5 is empty, slice 6 is single pulse occupation, slice 7 is empty, and slice 8 is single pulse occupation, then the pulse distribution of window 2 is written as "the 2nd sub-slice appears once, and the 4th sub-slice appears once"; if all 4 sub-slices in window 6 have extended occupation, then it is written as "the 1st to 4th sub-slices occupy consecutively". The single-pulse occupant obtained in the previous section, after being incorporated into this section, falls into the 4th sub-segment of window 2; the single-pulse occupant of the 9th segment falls into the 1st sub-segment of window 3; and the single-pulse occupant of the 10th segment falls into the 2nd sub-segment of window 3. The pulse occurrence time must also be noted within each window. Specifically, the sub-segment start time is added to the 0.2 millisecond offset corresponding to the first high-state position within the segment; for example, if the start time of segment number 8 is 26.000 milliseconds and the first position is point 3, then the corresponding time is written as 26.400 milliseconds. After aggregation, pulse distribution sets are obtained for all 15 windows, including 8 windows with pulses and 7 windows without pulses, providing window-granular data for the next segment's overlap determination.
[0030] Table 3. Window Pulse Distribution and Classification Results As shown in Table 3, windows 2, 3 and 11 are subsequently retained as independent windows, window 6 enters the interference removal link, and window 7 only retains the number and does not enter the pulse segment splicing.
[0031] S302: Based on the window pulse distribution set, perform overlap discrimination on the pulse occurrence time of the detection channel within the same window, call the pulse position relationship for overlap matching, calculate the pulse overlap rate, compare the pulse overlap rate with the overlap rate threshold, form a window classification status identifier structure, and obtain a window interference classification identifier set; First, project the occurrence times of all pulses within the same window onto a unified 8.0-millisecond window coordinate system. Then, compare whether the coverage intervals of any two pulses overlap. The coverage interval is 0.6 milliseconds wide for single-pulse occupancy and 1.2 milliseconds wide for extended occupancy. The width value is calculated based on the aforementioned 0.2-millisecond sampling interval and the on-chip high-state length. The textual calculation of the overlap rate is performed in the following order: first, calculate the time length of overlap between two coverage intervals; then, calculate the total coverage length after merging the two coverage intervals; finally, divide the former by the total coverage length formed by the former and the non-overlapping part to obtain the pulse overlap rate. Taking window 6 in Table 3 as an example, if the first sub-segment pulse covers 52.2 ms to 53.4 ms and the second sub-segment pulse covers 53.0 ms to 54.2 ms, the overlap is 0.4 ms, and the total coverage length is 2.0 ms, resulting in an overlap rate of 20%. If the third and fourth sub-segments are superimposed to form a continuous overlap, the total overlap rate increases to 42%, which is higher than the 35% threshold determined in Table 2. Therefore, window 6 is designated as an interference window. The 35% threshold in Table 2 is taken from seven groups of experiments: 20%, 25%, 30%, 35%, 40%, 45%, and 50%. Among the 30 samples, the number of segments with consistent manual verification for the 35% scheme was 28, which is higher than the other groups. After classifying the 15 windows, there were 2 interference windows, 6 independent windows, and 7 empty windows in this example, forming a window interference classification identifier set. This result corresponds one-to-one with Table 3. Windows with an overlap rate of 35% or higher will not be subsequently included in the continuous pulse segment splicing.
[0032] S303: Based on the window interference classification identifier set, the data of the windows identified as interference windows and independent windows are aggregated according to the detection channels, and the window classification results are arranged in order according to the channel index to construct the channel-window correspondence structure and obtain the channel isolation window set; A placeholder analysis was performed on the detection channels. During data aggregation, 15 windows were sequentially written under channel 3. Independent windows, interference windows, and empty windows were then arranged into independent sequences based on their time sequence. Specifically, windows 2, 3, and 11 were written into the independent window sequence, windows 6 and 12 into the interference window sequence, and the remaining pulseless windows into the empty window sequence. During aggregation, a correspondence between window numbers and time ranges was established simultaneously. For example, window 2 corresponds to 20.000 ms to 27.800 ms, window 3 to 28.000 ms to 35.800 ms, and window 6 to 52.000 ms to 59.800 ms. If adjacent windows are one independent and one interfering, they are kept in their respective sequences and cannot be spliced across sequences. If there is an empty window between two independent windows, the empty window only retains its number and does not participate in subsequent pulse continuity discrimination. Taking the previous results as an example, windows 2 and 3 are both independent windows, adjacent in time, and are written as "Independent Window 2, Independent Window 3"; window 6 is an interference window and is written separately into the interference sequence. After aggregation, a channel isolation window set is formed, consisting of 6 independent windows, 2 interfering windows, and 7 empty windows. In this embodiment, the function of this set is only to split the data flow. Subsequent pulse time extraction only reads the independent window sequence, while the interfering window sequence only retains the number and time range for comparison when filtering records.
[0033] Please see Figure 5 The specific steps of S4 are as follows: S401: Extract the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, filter the time index corresponding to the independent window, and perform time-series mapping processing on the pulse occurrence position of the detection channel to form a pulse time distribution structure divided by channel, and obtain the channel pulse time set; First, read the window number, then read the first high-state position of the corresponding time slice within that window. Add the window start time, sub-slice start time, and intra-slice position offset sequentially to write the pulse occurrence time. Taking window 2 as an example, the window start time is 20.000 milliseconds, the second sub-slice start time is 22.000 milliseconds, and the first high-state position within the slice is the 3rd point, corresponding to a 0.4 millisecond offset. Therefore, the first pulse time is written as 26.400 milliseconds. Since the first high-state position of the fourth sub-slice in window 2 is the 3rd point, the second pulse time is written as 30.400 milliseconds. Looking at window 3, if the first high-state position of the first sub-slice is the 3rd point and the first high-state position of the second sub-slice is the 2nd point, then the two pulse times are written as 28.400 milliseconds and 30.200 milliseconds respectively. After performing the same operation on all independent windows, this example extracted 11 pulse moments, written in channel 3 order as 26.400 ms, 30.400 ms, 32.400 ms, 34.200 ms, 90.600 ms, etc. An additional time validity check was added during the extraction process: if any pulse moment fell outside the corresponding window's time range, the initial position within the chip was immediately checked for errors. No out-of-bounds moments were found in this embodiment. This resulted in a pulse moment distribution structure divided by channel, yielding a channel pulse moment set. This set only retains the moment records from independent windows; any pulse moments from interference windows are not included in this result.
[0034] S402: Based on the channel pulse time set, the continuity of the corresponding time segments of adjacent windows is determined, the pulse occurrence positions under adjacent time indices are matched for continuity, and the determination is performed according to the time interval relationship to form a continuous segment identification structure and obtain a pulse continuous segment identification set; The discrimination is not directly determined by the window number, but rather by first calculating the time interval between two adjacent pulse moments, and then comparing it with the upper limit of the continuous time interval. In Table 2, this upper limit is set to 1.0 millisecond, derived from five sets of experiments at 0.6 milliseconds, 0.8 milliseconds, 1.0 milliseconds, 1.2 milliseconds, and 1.4 milliseconds. Of the 30 samples, 24 segments were manually verified to be consistent at the 1.0 millisecond setting. Taking the aforementioned moments as an example, the difference between 30.400 milliseconds and 32.400 milliseconds is 2.0 milliseconds, which is greater than 1.0 millisecond, and is therefore written as discontinuous; the difference between 32.400 milliseconds and 34.200 milliseconds is 1.8 milliseconds, also written as discontinuous. If 26.400 milliseconds and 27.200 milliseconds appear in a sample, the interval between them is 0.8 milliseconds, which is less than 1.0 millisecond, and is written as a continuous pair. After judging 11 pulse moments sequentially, this example shows 2 sets of continuous pairs and 8 sets of discontinuous pairs. The format for identifying consecutive segments is "start pulse time, end pulse time, number of windows spanned". For example, a consecutive pair formed by 26.400 ms and 27.200 ms is written as "26.400 ms to 27.200 ms, spanning 1 window". When a single pulse does not form a consecutive pair with adjacent times, it is written as "single-point segment". After all judgments are completed, a set of pulse consecutive segment identifiers is obtained, including 2 consecutive segments and 7 single-point segments. The window number obtained in the previous section is retained as an appendix to facilitate subsequent sorting by dual indexes of channel and window during merging.
[0035] S403: Based on the pulse continuous segment identifier set, the merging process is completed according to the detection channel order. The continuous segment identifiers are reorganized according to the channel index execution order, and a channel-pulse segment correspondence structure is established to obtain the channel pulse segment table. First, arrange the consecutive segments first, then the single-point segments, both in ascending order of their start time. Taking this example, if the consecutive segments are 26.400 ms to 27.200 ms and 54.200 ms to 55.000 ms, and the single-point segments are 30.400 ms, 32.400 ms, 34.200 ms, and 90.600 ms respectively, arrange the consecutive segments first, then the single-point segments, both in ascending order of their start time. In this example, the merged result would be: line 1: 26.400 ms to 27.200 ms; line 2: 54.200 ms to 55.000 ms; line 3: 30.400 ms; line 4: 32.400 ms; line 5: 34.200 ms; line 6: 90.600 ms. When establishing the correspondence between channels and pulse segments, in addition to writing channel 3, the source window number must also be written. For example, the first row is the boundary between source window 2 and window 3, and the fifth row is the boundary between source window 10 and window 11. If a continuous segment crosses an interference window, the segment will not be merged; this is not the case in this example. To prevent the segment order from being disordered, a full table check is performed after merging to verify that the start time of each row is later than the end time or single-point time of the previous row; if it is earlier than the previous row, the positions are swapped and the check is repeated. After processing, a channel pulse segment table is obtained, which has 9 records, and the records are segment type, start time, end time, and source window number. In the next stage, this table will not repeat the calculation of pulse times, but will be directly used as the annotation object in the process of corresponding window numbers and workstation numbers.
[0036] Please see Figure 6 The specific steps of S5 are as follows: S501: Call the channel pulse segment table to mark the pulse occurrence time, window number, and conveying station number of the detection channel, perform index matching between the pulse occurrence time and the window number, and map the conveying station number to the corresponding time position to form a multi-dimensional identifier association structure and obtain a pulse multi-dimensional identifier set; Read the 9 rows of records in the channel pulse segment table, and label the pulse occurrence time, window number, and conveyor station number of each row. The window number is directly taken from the previous result, and the conveyor station number is read from the conveyor station voltage sequence corresponding to channel 4 and then written. During implementation, first set the station discrimination intervals for the channel 4 voltage sequence: 0.90V to 1.30V is written as station 1, 1.90V to 2.30V as station 2, and 2.90V to 3.30V as station 3. These three intervals are obtained through field calibration, with a 1.0V interval between the center values of each interval and an allowable deviation of 0.20V. Taking the aforementioned segment from 26.400ms to 27.200ms as an example, the channel 4 voltage is stable between 1.18V and 1.21V during this time period, so the station number is written as 1; the single-point segment at 90.600ms corresponds to a channel 4 voltage of 2.96V, so the station number is written as 3. Each record in the multidimensional identifier association structure is written as "start time, end time or single point time, window number, conveying station number, and segment type". If a segment spans two station discrimination intervals, the station number with the higher time proportion is written, and the secondary station number is listed as a separate note. No cross-station segments appeared in this sample. After annotation, a pulse multidimensional identifier set is obtained, in which 9 records all have three types of indices: time, window, and station. Subsequent screening only requires comparing the window number with the interference window mark.
[0037] S502: Based on the pulse multidimensional identifier set, perform filtering processing on the records corresponding to the interference window, match and compare the window identifier with the interference window mark, perform confirmation processing on the independent window associated data, retain the independent window associated data, form the filtered identifier data structure, and obtain the filtered pulse identifier set; The screening process first reads windows 6 and 12 from the interference window sequence, then compares the window numbers of the nine pulse multidimensional identifier records one by one. If a window number matches the interference window number, the entire record is removed. If a record spans two windows, and either window belongs to an interference window, the entire record is also removed. For example, if record 5 originates from window 6, it is directly deleted; if record 7 originates from the boundary between window 11 and window 12, it is also deleted because it contains interference window 12. The remaining records after screening are then checked for completeness of workstation numbers. In this case, workstation 1 has 4 records, workstation 2 has 2, and workstation 3 has 1. Screening is not based solely on fragment type; both continuous fragments and single-point fragments are subject to the same comparison rule, regardless of their order. To verify the consistency between the screening threshold and the aforementioned window classification, windows 2 and 3 from the remaining records are compared to Table 3. Their pulse overlap rates are 12% and 18%, respectively, both below 35%, so they are retained. Window 6 has an overlap rate of 42%, above 35%, so it is removed. After completion, a set of filtered pulse identifiers is formed, consisting of 7 records, all originating from independent windows. Compared to the aforementioned channel pulse segment table, the number of records in this set is reduced from 9 to 7. The 2 missing records correspond to the source records of the interference windows, and the subsequent output queue only receives these 7 retained results.
[0038] S503: Based on the set of filtered pulse identifiers, write the identifier data into the output queue in chronological order, and arrange them according to the channel index execution order to establish a correspondence structure between channels and pulse records, thereby obtaining pulse records without mutual interference; First, compare the start time or single-point time of the 7 records. The earliest record is queued first, and the latest record is queued last. If two records have the same time, the record corresponding to the smaller window number is written first. In this example, the 7 retained records are written in chronological order as 26.400 ms to 27.200 ms, 30.400 ms, 32.400 ms, 34.200 ms, 54.200 ms to 55.000 ms, 90.600 ms, and one subsequent segment. Since this embodiment only involves one output chain of the detection channel, all channel indices are written under channel 3 and do not intersect with other channels. Each record in the output queue is written with 6 items: detection channel number, pulse start time, pulse end time or single-point time, window number, conveyor station number, and record attributes. If it is a single-point segment, the same time value is repeatedly written at the end time position, leaving no empty entries. After writing, the number of output records, time increment relationship, and workstation number coverage are counted. This time, there are 7 output records, all with increasing time, and workstation numbers covering 3 workstations (1 to 3). Comparing this result with the original number of 6 independent window records, it can be seen that one independent window produced 2 valid pulse records. Therefore, the output is not simply equivalent to the number of windows, but is determined by the number of actual pulse segments within each independent window. Thus, interference-free pulse records are obtained. If subsequent upper-level processes need to read these records, they can be extracted one by one according to the queue order.
[0039] Please see Figure 7 A system for preventing mutual interference between photoelectric sensors, comprising: The signal acquisition module acquires the voltage sampling values and sampling timestamps of the photoelectric sensor, the light emitter, the photosensitive detector and the conveying station during the corresponding sampling period, and writes the sampling points into a unified time axis according to the detection channel to obtain the channel timing table. The threshold discrimination module calls the trigger voltage threshold according to the channel timing table to discriminate the voltage sampling value of the detection channel point by point, and organizes the discrimination results in order according to the time slice corresponding to the emission cycle to generate a channel placeholder sequence. The overlap assessment module divides the window according to the sampling period based on the channel occupancy sequence, judges the overlap of the pulse occurrence time of the detection channel within the same window, calculates the pulse overlap rate, marks the window that exceeds the overlap rate threshold as the interference window, and marks the remaining windows as independent windows. The window is collected according to the detection channel to obtain the channel isolation window set. The window merging module extracts the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, performs continuity judgment on the corresponding time segments of adjacent windows, and completes the merging according to the detection channel order to obtain the channel pulse segment table; The output annotation module calls the channel pulse segment table to annotate the occurrence time, window number, and conveying station number of the detection channel pulses, and writes the annotated pulse records into the output queue to establish a non-interference pulse record.
[0040] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method of preventing cross-talk between photoelectric sensors, characterized by, Includes the following steps: S1: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveying station within the corresponding sampling period, and write the sampling points into a unified time axis according to the detection channel to obtain the channel timing table; S2: According to the channel timing table, the trigger voltage threshold is called to judge the voltage sampling value of the detection channel point by point, and the judgment results are sorted in order according to the time slices corresponding to the light emission cycle to generate a channel occupancy sequence. S3: Based on the channel occupancy sequence, the window is divided according to the sampling period. The coincidence of the pulse occurrence time of the detection channel within the same window is judged, the pulse overlap rate is calculated, and the window corresponding to the overlap rate threshold is marked as an interference window. The remaining windows are marked as independent windows. The collection is completed according to the detection channel to obtain the channel isolation window set. S4: Extract the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, perform continuity judgment on the corresponding time segments of adjacent windows, and merge them according to the detection channel order to obtain the channel pulse segment table; S5: Call the channel pulse segment table to mark the occurrence time, window number, and conveying station number of the detection channel pulse, write the marked pulse record into the output queue, and establish a non-interference pulse record.
2. The method of claim 1, wherein, The channel timing table includes a channel identifier index, a time axis scale sequence, and a sampling voltage mapping set; the channel placeholder sequence includes a pulse state encoding set, a period segment label set, and a placeholder flag sequence; the channel isolation window set includes a window category identifier set, an overlap rate distribution set, and a channel affiliation index. The channel pulse segment table includes segment start and end time pairs, segment continuity markers, and a channel correspondence set; the interference-free pulse record includes workstation association identifiers, window number labels, and a pulse time series set.
3. The method of claim 1, wherein: The point-by-point discrimination compares the voltage sample value corresponding to adjacent sampling timestamps with the trigger voltage threshold and records the direction of change when crossing the trigger voltage threshold. The sampling timestamp at which the trigger voltage threshold is first crossed within the time slice corresponding to the emission cycle is taken as the pulse occurrence time.
4. The method of claim 1, wherein: The window is divided according to an integer multiple of the sampling period, where the integer multiple is a natural number between 2 and 5; the pulse overlap rate is obtained by statistically analyzing the ratio of the number of times the time difference between the occurrence times of pulses from different detection channels within the same window is less than a preset time tolerance to the total number of pulses within the window, where the preset time tolerance is 1 to 3 times the interval between adjacent sampling timestamps.
5. The method of claim 1, wherein, The specific steps of S1 are as follows: S101: Obtain the voltage sampling values and sampling timestamps of the photoelectric sensor, emitter, photodetector and conveyor station within the corresponding sampling period, sort the equipment voltage sequence according to the timestamp, perform consistency verification on the time interval, interpolate and fill in the missing time positions to form a continuous time index sequence, and obtain a unified sampling time sequence matrix. S102: Based on the unified sampling time series matrix, the detection channel identifier parameter is called to perform channel mapping processing on the unified sampling time series matrix, the voltage value sequence is reorganized and arranged according to the channel number, and the consistency check is performed on the multi-channel data at the same time index position to construct the multi-channel voltage data arrangement structure and obtain the channel voltage correlation matrix; S103: Based on the channel voltage correlation matrix, call the unified time axis index to perform time alignment processing on the channel voltage values, establish an index mapping relationship between the channel number and the timestamp, and perform sequence standardization processing on the overall data structure to form a standardized time and channel correspondence structure, thus obtaining the channel time series table.
6. The method of claim 1, wherein, The specific steps of S2 are as follows: S201: According to the channel timing table, the trigger voltage threshold is called to distinguish the voltage sampling value of the detection channel point by point. The voltage value at the time index position is compared with the trigger voltage threshold. The discrimination result is converted into a state identifier sequence and arranged continuously according to the timestamp order to form a time-ordered state distribution structure, thus obtaining the voltage discrimination state sequence. S202: Based on the voltage discrimination state sequence, the light emission cycle time parameter is called to perform segmented mapping processing on the timestamp sequence, the continuous time index is divided into the corresponding light emission cycle time slice, and the state identifiers in the same time slice are merged and sorted to form a periodic segment state combination structure, and a periodic segment state set is obtained. S203: Based on the set of periodic segment states, the time slice sequence index is called to perform sequential reorganization processing on the segment states, the state identifiers are serialized and arranged according to the time slice order of the emission period, and a correspondence structure between time slices and state identifiers is established to obtain the channel placeholder sequence.
7. The method of claim 1, wherein the method further comprises: The specific steps for S3 are as follows: S301: Based on the channel occupancy sequence, the window is divided according to the sampling period, the time index is mapped to the corresponding sampling period window, the status identifiers in the window are aggregated and organized, the position of the detection channel pulse is extracted and a corresponding relationship structure is established to form a pulse distribution representation in the window, and a window pulse distribution set is obtained; S302: Based on the set of window pulse distributions, perform overlap discrimination on the pulse occurrence times of the detection channels within the same window, call the pulse position relationship for overlap matching, calculate the pulse overlap rate, compare the pulse overlap rate with the overlap rate threshold, form a window classification status identifier structure, and obtain a window interference classification identifier set; S303: Based on the window interference classification identifier set, the data of windows identified as interference windows and independent windows are aggregated according to the detection channels, and the window classification results are arranged in order according to the channel index to construct the channel-window correspondence structure and obtain the channel isolation window set.
8. The method of claim 1, wherein, The specific steps of S4 are as follows: S401: Extract the pulse occurrence time within the independent window of the detection channel according to the channel isolation window set, filter the time index corresponding to the independent window, and perform time-series mapping processing on the pulse occurrence position of the detection channel to form a pulse time distribution structure divided by channel, and obtain the channel pulse time set; S402: Based on the channel pulse time set, the continuity of the corresponding time segments of adjacent windows is determined, the pulse occurrence positions under adjacent time indices are matched for continuity, and the determination is performed according to the time interval relationship to form a continuous segment identification structure and obtain a pulse continuous segment identification set. S403: Based on the pulse continuous segment identifier set, the merging process is completed according to the detection channel order. The continuous segment identifiers are reorganized according to the channel index execution order, and a channel-pulse segment correspondence structure is established to obtain the channel pulse segment table.
9. The method of claim 1, wherein, The specific steps of S5 are as follows: S501: Call the channel pulse segment table to mark the pulse occurrence time, window number, and conveying station number of the detection channel, perform index matching between the pulse occurrence time and the window number, and map the conveying station number to the corresponding time position to form a multi-dimensional identifier association structure and obtain a pulse multi-dimensional identifier set; S502: Based on the pulse multidimensional identifier set, perform filtering processing on the records corresponding to the interference window, match and compare the window identifier with the interference window mark, perform confirmation processing on the independent window associated data, retain the independent window associated data, form the filtered identifier data structure, and obtain the filtered pulse identifier set; S503: Based on the set of filtered pulse identifiers, write the identifier data into the output queue in chronological order, and arrange them according to the channel index execution order to establish a correspondence structure between channels and pulse records, thereby obtaining pulse records without mutual interference.
10. A system for preventing cross-talk between photosensors, the system comprising: The system is used to implement the method for preventing mutual interference of photoelectric sensors as described in any one of claims 1-9, the system comprising: The signal acquisition module acquires the voltage sampling values and sampling timestamps of the photoelectric sensor, the light emitter, the photosensitive detector and the conveying station during the corresponding sampling period, and writes the sampling points into a unified time axis according to the detection channel to obtain the channel timing table. The threshold discrimination module calls the trigger voltage threshold according to the channel timing table to discriminate the voltage sampling value of the detection channel point by point, and organizes the discrimination results in order according to the time slices corresponding to the emission cycle to generate a channel occupancy sequence. The overlap assessment module divides the window according to the sampling period based on the channel occupancy sequence, judges the overlap of the pulse occurrence time of the detection channel within the same window, calculates the pulse overlap rate, marks the window that exceeds the overlap rate threshold as an interference window, marks the remaining windows as independent windows, and completes the aggregation according to the detection channel to obtain the channel isolation window set; The window merging module extracts the pulse occurrence time within the independent window of the detection channel based on the channel isolation window set, performs continuity judgment on the corresponding time segments of adjacent windows, and completes the merging according to the detection channel order to obtain the channel pulse segment table; The output annotation module calls the channel pulse segment table to annotate the occurrence time, window number, and conveying station number of the detection channel pulse, and writes the annotated pulse record into the output queue to establish a non-interference pulse record.