Data optimization method of binary sensor and electronic device

By eliminating and merging abnormal deviations in the event set of binary sensors, invalid sensors are filtered out, and sensor data is optimized, thus solving the problem of inaccurate binary sensor data and improving the model's ability to identify faults.

CN122241296APending Publication Date: 2026-06-19STATE GRID HEBEI ELECTRIC POWER CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HEBEI ELECTRIC POWER CO LTD
Filing Date
2025-12-16
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing binary sensor data may contain abnormal signals due to environmental interference and operator errors, affecting the model's ability to identify faults.

Method used

By acquiring the event set of the sensor, removing events with high abnormal deviations, splitting and merging the data, filtering out invalid sensors, and forming a precise target dataset, the data is then optimized using a machine learning model.

Benefits of technology

It improves the reliability and accuracy of sensor data, enhances the model's ability to identify faults, and reduces the impact of noise and anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241296A_ABST
    Figure CN122241296A_ABST
Patent Text Reader

Abstract

This invention provides a data optimization method and electronic device for binary sensors, relating to the field of sensor technology. The method includes: acquiring event sets for each sensor; for any given sensor, determining the abnormal deviation of each triggering event in the sensor's event set, removing abnormal events from the event set to obtain a first corrected event set corresponding to that sensor; based on the first corrected event set, splitting and merging each triggering event in the first corrected event set to obtain a second corrected event set corresponding to that sensor; determining the relationship value between each sensor and the category event set, and identifying invalid sensors based on the relationship value; using the second corrected event sets of all sensors other than invalid sensors as target data. This invention performs anomaly filtering from multiple dimensions, including single-event sudden anomalies, corrected event patterns, and overall sensor anomalies, improving the accuracy and reliability of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of sensor technology, and in particular to a data optimization method and electronic device for a binary sensor. Background Technology

[0002] Power communication equipment rooms handle numerous tasks, including power generation and system maintenance, serving as a crucial foundation for ensuring the safe and reliable operation of the power system. Maintenance of equipment in these rooms typically involves using sensors to collect data in real time and monitor their operational status. Binary sensors are widely used and are primarily deployed at access control points, corridors, equipment switches, and disconnectors. Machine learning models use the information collected by the sensors to calculate the current state of each sensor and the probability of different classifications, determining the presence and type of faults.

[0003] In existing technologies, sensors occasionally generate abnormal signals due to environmental interference; maintenance personnel also inspect equipment in the data center, triggering sensors in different locations during these inspections. However, sometimes, due to forgetfulness or other reasons, some sensors may erroneously trigger for extended periods. All of these phenomena lead to poor sensor data quality. Using this sensor data to train and build models will severely reduce the model's ability to identify faults. Summary of the Invention

[0004] This invention provides a data optimization method and electronic device for binary sensors to solve the problem that inaccurate binary sensor data affects the model's ability to identify faults in the prior art.

[0005] In a first aspect, embodiments of the present invention provide a data optimization method for a binary sensor, comprising: Acquire the event set of each sensor separately; where the event set includes: multiple trigger events; For any given sensor, determine the abnormal deviation of each triggering event in the event set of the sensor, and remove abnormal events in the event set of the sensor according to each abnormal deviation to obtain the first corrected event set corresponding to the sensor; according to the first corrected event set corresponding to the sensor, split and merge each triggering event in the first corrected event set to obtain the second corrected event set corresponding to the sensor. Obtain the category event set, determine the relationship value between each sensor and the category event set, and identify invalid sensors based on the relationship value; use the second correction event set of each sensor other than the invalid sensors as the target data.

[0006] In a second aspect, embodiments of the present invention provide an electronic device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the data optimization method for a binary sensor as described in the first aspect or any possible implementation of the first aspect.

[0007] This invention provides a data optimization method and electronic device for a binary sensor. The data optimization method for the binary sensor includes: acquiring event sets for each sensor; wherein the event set includes multiple trigger events; for any given sensor, determining the abnormal deviation degree of each trigger event in the event set of that sensor, and removing abnormal events from the event set of that sensor based on each abnormal deviation degree to obtain a first corrected event set corresponding to that sensor; splitting and merging each trigger event in the first corrected event set according to the first corrected event set corresponding to that sensor to obtain a second corrected event set corresponding to that sensor; acquiring a category event set, and determining the relationship value between each sensor and the category event set, and identifying invalid sensors based on the relationship value; using the second corrected event sets of all sensors other than invalid sensors as target data. This invention performs anomaly filtering from three dimensions: single-event sudden anomaly, corrected event pattern, and overall sensor anomaly, solving problems such as noise, anomalies, and failures in multi-sensor data, improving data reliability and accuracy, and providing a stable and reliable foundation for subsequent data applications. Attached Figure Description

[0008] Figure 1 This is a flowchart illustrating the implementation of a data optimization method for a binary sensor provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the data optimization device for a binary sensor provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0009] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0010] See Figure 1 The document illustrates a flowchart of a data optimization method for a binary sensor provided in an embodiment of the present invention, which is described in detail below: The data optimization method for the aforementioned binary sensor includes: S101: Acquire the event set of each sensor respectively; wherein, the event set includes: multiple trigger events; For each individual sensor, collect its valid trigger records over a period of time. For example, a trigger event may include: trigger time, end time, sensor number, and sensor signal value; the trigger time is the time when the signal is first detected, the end time is the duration of that signal's duration, the sensor number is the sensor's identifier, and the sensor signal value is the physical quantity detected by the sensor. For example, for an access control sensor, the trigger events might be: 8:00, 8:02, No. 1, 1.

[0011] S102: For any sensor, determine the abnormal deviation of each triggering event in the event set of the sensor, and remove abnormal events in the event set of the sensor according to each abnormal deviation to obtain the first corrected event set corresponding to the sensor; according to the first corrected event set corresponding to the sensor, split and merge each triggering event in the first corrected event set to obtain the second corrected event set corresponding to the sensor. This application first performs sudden anomaly elimination of single sensor events based on the degree of abnormal deviation, removing events that were not triggered during normal periods; further, it splits and merges each triggering event to avoid long events obscuring details.

[0012] In one possible implementation, S102 may include: S1021: Merge the time-continuous trigger events in the event set of this sensor; Original triggering events may be split into multiple short, sequential events due to sensor sampling mechanisms or slight signal fluctuations, resulting in the same physical process being broken down into multiple short events. This application integrates these short, sequential triggering events into a complete, sequential event, thus avoiding fragmented clustering caused by excessive splitting of the same process during subsequent clustering.

[0013] S1022: Map the merged trigger events to a one-dimensional time coordinate system; wherein the time coordinate system cycles through time; Many sensor monitoring scenarios have time periodicity. Therefore, mapping events to a cyclic time coordinate system (such as a time axis with a 24-hour period) can make similar events within the same period overlap or be adjacent on the time axis. This allows clustering algorithms to accurately capture periodically repeating events and avoid misjudging normal events as abnormal ones due to the dispersed distribution caused by time periodicity.

[0014] S1023: Determine the optimal number of clusters, and cluster each triggered event after mapping according to the optimal number of clusters to obtain multiple event groups; Specifically, the triggered events can be clustered sequentially according to different numbers of groups, and the sum of squared errors for each cluster under different numbers of groups can be calculated. The sum of squared errors of the fewest groups and the sum of squared errors of the most groups can be connected to form a straight line. The difference between the sum of squared errors of each number of groups and the corresponding sum of squared errors on the straight line can be calculated. The group with the largest difference is taken as the optimal number of groups for clustering.

[0015] S1024: If the number of triggered events in an event group is not less than the preset number, then mark the event group as a large group; S1025: If the number of triggered events in an event group is less than the preset number, then the event group is marked as a small group; The event categories are divided into "large groups" and "small groups" based on the number of events. Essentially, this defines the boundary between "normal events" and "niche events" based on the data distribution patterns. "Large groups" correspond to "high-frequency recurring normal events," while "small groups" correspond to "low-frequency events." By quantifying the prevalence of normal events through a pre-set quantity, a clear classification benchmark is provided for subsequent calculations of anomaly deviations, avoiding biases caused by subjective judgment.

[0016] S1026: Determine the degree of abnormal deviation of each triggering event based on the tag type of the event group to which each triggering event belongs; This application determines the degree of abnormal deviation based on the characteristics of the marker type and time itself, which can accurately distinguish between "low-frequency normal events" and "high-frequency abnormal events" and reduce the misjudgment rate.

[0017] In one possible implementation, S1026 includes: 1. For any given trigger event, if the event group to which the trigger event belongs is a large group, calculate the similarity between the trigger event and the event group to which it belongs, and use this as the similarity coefficient of the trigger event; if the event group to which the trigger event belongs is a small group, calculate the similarity between the trigger event and each large group corresponding to the sensor, and use the largest similarity as the similarity coefficient; based on the similarity coefficient, combine with the first formula to obtain the abnormal deviation degree of the trigger event; The first formula may include:

[0018] in, The abnormal deviation of this triggering event. The similarity coefficient, This represents the number of triggering events in the event group to which the triggering event belongs. This represents the total number of trigger events under the corresponding sensor, and this trigger event is the [number]th [event]. Triggering events of individual sensors.

[0019] Specifically, calculating the similarity between the triggering event and its event group, as the similarity coefficient of the triggering event, can include: Calculate the similarity between the triggering event and the cluster center of the event group it belongs to, and use this similarity coefficient as the triggering event's similarity coefficient.

[0020] To avoid misjudgments caused by a one-size-fits-all approach, the normality of large-group events stems from their consistency with the mainstream events within the same group. Therefore, calculating the similarity between an event and its large group is sufficient to reflect whether it deviates from the normal mainstream. The low frequency of small-group events results in fewer samples and weaker feature representativeness within the group. Calculating only intra-group similarity might misclassify highly similar, occasional normal events as abnormal. Therefore, it's necessary to correlate multiple large groups from corresponding sensors to calibrate similarity using a more comprehensive sample base, reducing misjudgments in small-sample scenarios. Simultaneously, to ensure the comparability of deviations between large and small groups, considering the different trigger frequencies of each sensor, abnormal deviations are normalized and mapped to the same numerical range, providing high-quality input for subsequent threshold selection.

[0021] S1027: Sort the various abnormal deviations and determine the abnormal threshold; S1028: Triggering events with an abnormal deviation less than the abnormal threshold are treated as abnormal events and removed to obtain the first set of correction events corresponding to the sensor.

[0022] Instead of a fixed threshold, the abnormal threshold is adaptively determined by the degree of abnormal deviation. This can be adapted to the data characteristics of different sensors and different scenarios, accurately filter out and remove extreme abnormal events that deviate too far from the normal distribution, so that the first corrected event set not only removes noise and extreme anomalies, but also retains the integrity and authenticity of the data.

[0023] Specifically, in one possible implementation, S1027 may include: 1. Sort the abnormal deviations in ascending order and calculate the difference between any two adjacent abnormal deviations. 2. Take the larger of the two abnormal deviations with the largest difference as the abnormal threshold.

[0024] The further the sensor trigger deviates from the normal concentrated triggering period, the higher the degree of abnormality of the event and the lower the abnormal factor value. Therefore, the abnormal deviation of normal events is usually concentrated in a higher range, while the deviation of true abnormal events will be significantly lower than the normal range (forming a clear discontinuity from the normal range), and the maximum difference corresponds precisely to this discontinuity location. Therefore, this application sorts the various abnormal deviations, captures the natural discontinuities in the distribution of abnormal deviations, and uses the larger abnormal deviations (normal events) at the discontinuities as the abnormal threshold, thereby improving the objectivity, accuracy, and scenario adaptability of abnormal event removal.

[0025] Next, time events are split and merged to prevent long events from obscuring details. For example, if a door is opened but not closed, the trigger time and end time span a long period. Essentially, these should be two separate events, but they are treated as a single event.

[0026] In one possible implementation, the triggering event may include: trigger time, end time, sensor number, and sensor signal value; S102 may include: S1029: Each trigger event in the first correction event set corresponding to the sensor is split into two trigger events according to the trigger time and the end time, and the same flag is set for the two trigger events. The sensor signal value in the trigger event containing the end time in the two trigger events is inverted. The original triggering event is essentially a "time interval event." Directly performing time series analysis on interval events can easily lead to outlier judgment biases due to the "ambiguity of interval coverage." After splitting, it can be directly adapted to the analysis logic of the sliding window method. The same marker ensures that the two node events after splitting can be accurately associated, and the inversion of the signal value makes the two node events form a logical correspondence of "trigger-termination".

[0027] S10210: The sliding window method is used to merge the various trigger events to obtain the second correction event set corresponding to the sensor.

[0028] In one possible implementation, S10210 includes: 1. Let k=1; 2. Sort the triggering events according to time to form a triggering event sequence; 3. For the first triggering event in the triggering event sequence, take that first triggering event as the window starting point; 4. Starting from the beginning of the window, select a preset number of trigger events sequentially to form a window event set; 5. Calculate the correlation coefficients between the window start point and each other triggered event in the window event set; 6. If there is a triggering event with a correlation coefficient greater than the first correlation threshold, add it to the kth group, and take each triggering event with a correlation coefficient greater than the first correlation threshold as a new window starting point. Jump to the step of selecting a preset number of triggering events sequentially from the window starting point to form a window event set and continue execution until there are no triggering events greater than the first correlation threshold in each window event set. 7. If there is no triggering event with a correlation coefficient greater than the first correlation threshold, then add the starting point of the window to the kth outlier group; 8. Remove all trigger events that have been added to the kth group and the kth outgroup from the trigger event sequence, and reorder the remaining trigger events according to time to form a new trigger event sequence; 9. Set k=k+1 and jump to the first triggering event in the triggering event sequence. Continue executing the steps that use the first triggering event as the starting point of the window until the triggering event sequence is empty. For any group, merge the triggering events with the same mark in the group. 10. The triggering events in each merged group and the triggering events in each outgroup form the second corrected event set.

[0029] It should be noted that k is used to represent the number of iterations. The kth group and the kth outgroup generated in each iteration may be empty. These empty sets need to be deleted to form the second correction event set.

[0030] If any event within the window (the first triggering event) has a correlation coefficient exceeding a threshold with at least one other event, it indicates a high degree of correlation between the two, classifying them as the same type of event. This application aggregates temporally continuous and strongly correlated triggering events into groups, effectively identifying the inherent relationships between events and avoiding interference from isolated events. Furthermore, outgroup classification accurately separates independent triggering events without strong correlation, ensuring the accuracy of event set classification. Through iterative filtering, deletion of processed events, and reordering, the event sequence is gradually simplified. Finally, events with the same label are merged to compress redundant information, forming a concise and ordered second corrected event set. This application uses temporal sorting and sliding window truncation to limit the local time range, avoiding erroneous merging of events across time periods or long time intervals, thus improving data accuracy.

[0031] In one possible implementation, calculating the correlation coefficients between each pair of triggered events within the current window may include: (1) For any two trigger events in the current window, determine the spatial correlation between the two trigger events based on the deployment location of the sensors corresponding to the two trigger events; determine the event correlation between the two trigger events based on the distance between the records of the two trigger events; determine the temporal correlation between the two trigger events based on the trigger time or end time of the two trigger events; multiply the spatial correlation, event correlation and temporal correlation to obtain the correlation coefficient between the two trigger events.

[0032] Spatial correlation is highest when two sensors are located in the same area; as distance increases, spatial correlation decreases between sensors located in different areas. Therefore, the spatial correlation between two triggering events is determined based on the sensor deployment locations.

[0033] The closer the records are to each other between two sensor events, the higher the correlation value, and vice versa. Therefore, event correlation is determined based on the distance between records.

[0034] The closer the times of two sensor events, the higher the temporal correlation, and vice versa. Therefore, temporal correlation is determined based on trigger time or end time.

[0035] By multiplying the correlations across multiple dimensions, we can overcome the limitations of a single dimension and cover the "physical essence + data characteristics + temporal patterns" of sensor monitoring. The correlation results are more in line with the actual scenario, and the "one-vote veto" screening significantly reduces the false correlation rate.

[0036] S103: Obtain the category event set, determine the relationship value between each sensor and the category event set, and determine the invalid sensor based on the relationship value; take the second correction event set of each sensor other than the invalid sensor as the target data;

[0037] The category event set includes multiple category events; each category event includes a start time, end time, and category name; the category name in the category event corresponds to the category name used in machine learning classification. Finally, based on the correlation between sensors and category events, sensor data that is useless for subsequent machine learning classification is removed—this is the second correction event set of invalid sensors—thus saving system resources.

[0038] In one possible implementation, S103 may include: S1031: Obtain category events within a preset proportion of time period from the category event set to form a category subset; S1032: Select each trigger event that overlaps with the preset proportion time period from the second correction event set corresponding to each sensor to form a sensor event subset corresponding to each sensor; S1033: Determine the relationship values ​​between each sensor and each category of events based on the classification subset and each sensor event subset.

[0039] For example, the trigger duration and frequency of different sensors in each category of events are statistically analyzed, and the relationship matrix between each sensor and each category of events is obtained by normalization based on the frequency of different sensors and different categories.

[0040] This application filters category events and trigger events within a preset proportion of time periods, controls the sample size of category events, improves computational efficiency, and then calculates the matching degree between the sensor and the category events.

[0041] In one possible implementation, S103 may include: S1034: If a first sensor exists and the relationship values ​​between the first sensor and each category of events are all less than the second association threshold, then the first sensor is considered an invalid sensor. The first sensor can be any one of the sensors.

[0042] The relationship values ​​between the first sensor and all categories of events in the system are calculated to determine whether it is helpful for subsequent machine learning classification. If the relationship values ​​between the sensor and each event are lower than the second association threshold, it means that the sensor has basically no data contribution to each category of events. In this case, the sensor with no practical value is removed to reduce the redundancy of subsequent data processing and avoid meaningless data interfering with event judgment.

[0043] Finally, this application can also determine historical sensor feature groups based on the current number of sensors, accurately reflecting the recent triggering state of each sensor, and providing reliable historical data support for subsequent event correlation analysis, invalid sensor location, etc.

[0044] For example, when a sensor is recently triggered, the characteristic value of the corresponding sensor is set to 1, and the rest are set to 0; if no sensor is triggered at the current time, the characteristic value set to 1 gradually decays to 0 over time; if the characteristic value set to 1 has not decayed to 0, and another sensor is triggered, the characteristic value that has not decayed to 0 is directly set to 0, and the characteristic value of the newly triggered sensor is set to 1.

[0045] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0046] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0047] Figure 2 A schematic diagram of the data optimization device for a binary sensor provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below: like Figure 2 As shown, the data optimization device for the binary sensor includes: The data acquisition module 21 is used to acquire the event sets of each sensor respectively; wherein, the event set includes: multiple trigger events; The first correction module 22 is used to determine the abnormal deviation degree of each triggering event in the event set of any sensor, and remove abnormal events in the event set of the sensor according to each abnormal deviation degree to obtain the first correction event set corresponding to the sensor; and split and merge each triggering event in the first correction event set according to the first correction event set corresponding to the sensor to obtain the second correction event set corresponding to the sensor. The second correction module 23 is used to acquire the category event set, determine the relationship value between each sensor and the category event set, and determine the invalid sensor based on the relationship value; and take the second correction event set of each sensor other than the invalid sensor as the target data.

[0048] In one possible implementation, the first correction module 22 may include: The time merging unit is used to merge time-continuous trigger events from the event set of the sensor. The mapping unit is used to map the merged triggering events to a one-dimensional time coordinate system; wherein the time coordinate system is cyclic in time; Clustering units are used to determine the optimal number of clusters and to cluster the mapped triggering events according to the optimal number of clusters to obtain multiple event groups; The first marking unit is used to mark the event group as a large group if the number of triggering events in the event group is not less than a preset number. The second marking unit is used to mark the event group as a small group if the number of triggering events in the event group is less than a preset number. The deviation calculation unit is used to determine the abnormal deviation of each triggering event according to the tag type of the event group to which each triggering event belongs; The threshold determination unit is used to sort the various abnormal deviations and determine the abnormal threshold. An anomaly rejection unit is used to reject triggering events with an anomaly deviation less than the anomaly threshold as anomaly events, thereby obtaining the first set of correction events corresponding to the sensor.

[0049] In one possible implementation, the threshold determination unit can be specifically used for: 1. Sort the abnormal deviations in ascending order and calculate the difference between any two adjacent abnormal deviations. 2. Take the larger of the two abnormal deviations with the largest difference as the abnormal threshold.

[0050] In one possible implementation, the deviation calculation unit may include: 1. For any given trigger event, if the event group to which the trigger event belongs is a large group, calculate the similarity between the trigger event and the event group to which it belongs, and use this as the similarity coefficient of the trigger event; if the event group to which the trigger event belongs is a small group, calculate the similarity between the trigger event and each large group corresponding to the sensor, and use the largest similarity as the similarity coefficient; based on the similarity coefficient, combine with the first formula to obtain the abnormal deviation degree of the trigger event; The first formula may include:

[0051] in, The abnormal deviation of this triggering event. The similarity coefficient, This represents the number of triggering events in the event group to which the triggering event belongs. This represents the total number of trigger events under the corresponding sensor, and this trigger event is the [number]th [event]. Triggering events of individual sensors.

[0052] In one possible implementation, the triggering event may include: trigger time, end time, sensor number, and sensor signal value; the first correction module 22 may include: The event splitting unit is used to split each trigger event in the first corrected event set corresponding to the sensor into two trigger events according to the trigger time and the end time, set the same flag for the two trigger events, and invert the sensor signal value in the trigger event containing the end time in the two trigger events; The event merging unit is used to merge the various triggering events using the sliding window method to obtain the second corrected event set corresponding to the sensor.

[0053] In one possible implementation, the event merging unit can be specifically used for: 1. Let k=1; 2. Sort the triggering events according to time to form a triggering event sequence; 3. For the first triggering event in the triggering event sequence, take that first triggering event as the window starting point; 4. Starting from the beginning of the window, select a preset number of trigger events sequentially to form a window event set; 5. Calculate the correlation coefficients between the window start point and each other triggered event in the window event set; 6. If there is a triggering event with a correlation coefficient greater than the first correlation threshold, add it to the kth group, and take each triggering event with a correlation coefficient greater than the first correlation threshold as a new window starting point. Jump to the step of selecting a preset number of triggering events sequentially from the window starting point to form a window event set and continue execution until there are no triggering events greater than the first correlation threshold in each window event set. 7. If there is no triggering event with a correlation coefficient greater than the first correlation threshold, then add the starting point of the window to the kth outlier group; 8. Remove all trigger events that have been added to the kth group and the kth outgroup from the trigger event sequence, and reorder the remaining trigger events according to time to form a new trigger event sequence; 9. Set k=k+1 and jump to the first triggering event in the triggering event sequence. Continue executing the steps that use the first triggering event as the starting point of the window until the triggering event sequence is empty. For any group, merge the triggering events with the same mark in the group. 10. The triggering events in each merged group and the triggering events in each outgroup form the second corrected event set.

[0054] In one possible implementation, the correlation coefficients between each pair of triggered events within the current window are calculated, including: (1) For any two trigger events in the current window, determine the spatial correlation between the two trigger events based on the deployment location of the sensors corresponding to the two trigger events; determine the event correlation between the two trigger events based on the distance between the records of the two trigger events; determine the temporal correlation between the two trigger events based on the trigger time or end time of the two trigger events; multiply the spatial correlation, event correlation and temporal correlation to obtain the correlation coefficient between the two trigger events.

[0055] In one possible implementation, the category event set may include multiple category events; the category events include: start time, end time, and category name; the second correction module 23 may include: The first subset determination unit is used to obtain category events within a preset proportion of time period from the category event set to form a category subset; The second subset determination unit is used to filter out each trigger event that overlaps with the preset proportion time period from the second correction event set corresponding to each sensor, and form a sensor event subset corresponding to each sensor. The relationship value determination unit is used to determine the relationship value between each sensor and each category of events based on the classification subset and each sensor event subset.

[0056] In one possible implementation, the second correction module 23 may include: An invalid sensor determination unit is used to determine the first sensor as an invalid sensor if a first sensor exists and the relationship values ​​between the first sensor and each category of events are all less than a second association threshold. The first sensor can be any one of the sensors.

[0057] Figure 3 This is a schematic diagram of the electronic device 3 provided in an embodiment of the present invention. Figure 3As shown, the electronic device 3 of this embodiment includes a processor 30 and a memory 31. The memory 31 stores a computer program 32. When the processor 30 executes the computer program 32, it implements the steps in the various method embodiments described above. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the various device embodiments described above.

[0058] For example, computer program 32 may be divided into one or more modules / units, which are stored in memory 31 and executed by processor 30 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 32 in electronic device 3.

[0059] Electronic device 3 may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 3 may also include input / output devices, network access devices, buses, etc.

[0060] The processor 30 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0061] The memory 31 can be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 31 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. Furthermore, the memory 31 can include both internal and external storage units of the electronic device 3. The memory 31 is used to store the computer program 32 and other programs and data required by the electronic device 3. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0062] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.

[0063] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.

[0064] This invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.

[0065] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0066] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

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

Claims

1. A method for data optimization of a binary sensor, characterized in that, include: The event sets of each sensor are acquired separately; wherein, the event sets include: multiple trigger events; For any given sensor, determine the abnormal deviation of each triggering event in the event set of the sensor, and remove abnormal events from the event set of the sensor according to each abnormal deviation to obtain the first corrected event set corresponding to the sensor; based on the first corrected event set corresponding to the sensor, split and merge each triggering event in the first corrected event set to obtain the second corrected event set corresponding to the sensor. Obtain a set of category events, determine the relationship value between each sensor and the set of category events, and identify invalid sensors based on the relationship value; use the second correction event set of each sensor other than the invalid sensors as target data.

2. The method of data optimization for a binary sensor of claim 1, wherein, The process of determining the abnormal deviation degree of each triggering event in the event set of the sensor, and removing abnormal events from the event set of the sensor according to each abnormal deviation degree to obtain the first corrected event set corresponding to the sensor, includes: Merge time-sequential trigger events from the event set of this sensor; The merged trigger events are mapped to a one-dimensional time coordinate system; wherein the time coordinate system is cyclic in time; Determine the optimal number of clusters, and cluster the mapped triggering events according to the optimal number of clusters to obtain multiple event groups; If the number of triggering events in the event group is not less than a preset number, then the event group is marked as a large group; If the number of triggering events in the event group is less than the preset number, then the event group is marked as a small group; Determine the degree of abnormal deviation for each triggering event based on the tag type of the event group to which each triggering event belongs; Sort the various abnormal deviations and determine the abnormal threshold; Triggering events with an abnormal deviation less than the abnormal threshold are identified as abnormal events and removed to obtain the first set of correction events corresponding to the sensor.

3. The method of data optimization for a binary sensor of claim 2, wherein, The step of sorting the various abnormal deviations and determining the abnormal threshold includes: Sort the abnormal deviations in ascending order and calculate the difference between each pair of adjacent abnormal deviations. The larger of the two abnormal deviations with the largest difference is taken as the abnormal threshold.

4. The data optimization method for a binary sensor according to claim 3, characterized in that, The step of determining the abnormal deviation degree of each triggering event based on the label type of the event group to which each triggering event belongs includes: For any given triggering event, if the event group to which the triggering event belongs is a large group, then the similarity between the triggering event and the event group to which it belongs is calculated, and this similarity coefficient is used as the similarity coefficient of the triggering event; if the event group to which the triggering event belongs is a small group, then the similarity between the triggering event and each large group corresponding to the sensor is calculated separately, and the largest similarity is used as the similarity coefficient; based on the similarity coefficient, the abnormal deviation degree of the triggering event is obtained in combination with the first formula; The first formula includes: in, The abnormal deviation of this triggering event. The similarity coefficient is... This represents the number of triggering events in the event group to which the triggering event belongs. This represents the total number of trigger events under the corresponding sensor, and this trigger event is the [number]th [event]. Triggering events of individual sensors.

5. The data optimization method for a binary sensor according to any one of claims 1 to 4, characterized in that, The triggering event includes: trigger time, end time, sensor number, and sensor signal value; the step of splitting and merging each triggering event in the first corrected event set corresponding to the sensor to obtain the second corrected event set corresponding to the sensor includes: Each trigger event in the first correction event set corresponding to the sensor is split into two trigger events according to the trigger time and the end time, and the same flag is set for the two trigger events. The sensor signal value in the trigger event containing the end time in the two trigger events is inverted. The sliding window method is used to merge the various trigger events to obtain the second set of correction events corresponding to the sensor.

6. The data optimization method for a binary sensor according to claim 5, characterized in that, The sliding window method is used to merge the various triggering events to obtain the second correction event set corresponding to the sensor, including: Let k=1; The triggering events are sorted by time to form a triggering event sequence; For the first triggering event in the triggering event sequence, the first triggering event is taken as the window starting point; Starting from the beginning of the window, a preset number of trigger events are selected sequentially to form a window event set; Calculate the correlation coefficients between the window start point and each of the other triggered events in the window event set; If there is a triggering event with a correlation coefficient greater than the first correlation threshold, then add it to the kth group, and take each triggering event with a correlation coefficient greater than the first correlation threshold as a new window starting point, jump to the step of selecting a preset number of triggering events sequentially from the window starting point to form a window event set and continue to execute until there are no triggering events greater than the first correlation threshold in each window event set; If there is no triggering event with a correlation coefficient greater than the first correlation threshold, then the starting point of the window is added to the kth outlier group; Each triggering event that was added to the k-th group and the k-th outgroup is removed from the triggering event sequence, and the remaining triggering events are reordered according to time to form a new triggering event sequence; k=k+1, and jump to the first trigger event in the trigger event sequence, and continue to execute the step of using the first trigger event as the starting point of the window until the trigger event sequence is empty; for any group, merge the trigger events with the same mark in the group; The triggered events in each merged group and the triggered events in each outgroup form the second corrected event set.

7. The data optimization method for a binary sensor according to claim 6, characterized in that, The calculation of the correlation coefficients between each pair of triggered events within the current window includes: For any two trigger events within the current window, the spatial correlation between the two trigger events is determined based on the deployment location of the sensors corresponding to the two trigger events; the event correlation between the two trigger events is determined based on the distance between the records of the two trigger events; the temporal correlation between the two trigger events is determined based on the trigger time or end time of the two trigger events; the spatial correlation, the event correlation, and the temporal correlation are multiplied together to obtain the correlation coefficient between the two trigger events.

8. The data optimization method for a binary sensor according to any one of claims 1 to 4, characterized in that, The category event set includes multiple category events; each category event includes: start time, end time, and category name; determining the relationship values ​​between each sensor and the category event set includes: Obtain category events within a preset proportion of time periods from the category event set to form a category subset; Each trigger event that overlaps with the preset proportion time period is selected from the second correction event set corresponding to each sensor to form a sensor event subset corresponding to each sensor; Based on the aforementioned classification subsets and each sensor event subset, the relationship values ​​between each sensor and each category of event are determined.

9. The data optimization method for a binary sensor according to claim 8, characterized in that, The step of determining invalid sensors based on the relationship value includes: If a first sensor exists, and the relationship values ​​between the first sensor and each category of events are all less than the second association threshold, then the first sensor is considered an invalid sensor. The first sensor can be any one of the sensors.

10. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the data optimization method for a binary sensor as described in any one of claims 1 to 9.