Electric appliance power utilization safety detection method, server, medium and program product

By periodically collecting current data and combining dynamic thresholds and convolutional neural network models, the passive response problem of arc fault detection in existing technologies has been solved, enabling early detection and accurate warning of arc faults. This approach adapts to different electrical characteristics and improves the reliability and accuracy of detection.

CN122017419APending Publication Date: 2026-05-12BEIJING SANSHENG CAREY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING SANSHENG CAREY TECH CO LTD
Filing Date
2026-02-26
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, arc fault detection can only respond passively after the fault becomes significant, making it difficult to accurately locate and provide early warnings in the early stages of an arc, leading to safety hazards.

Method used

By periodically collecting current data, extracting the period difference value, period median, relative centroid difference, and average period difference value, and combining dynamic threshold judgment and convolutional neural network model, early detection and accurate warning of arc faults can be achieved.

Benefits of technology

It significantly improves the early detection sensitivity and accurate warning capability of arc faults, adapts to different electrical characteristics, reduces false alarms and missed alarms, and improves the reliability and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122017419A_ABST
    Figure CN122017419A_ABST
Patent Text Reader

Abstract

The invention provides an electrical appliance power utilization safety detection method, a server, a medium and a program product, and relates to the technical field of electrical digital data processing. Current data of a plurality of sampling points of a target electric appliance are collected according to a set period, and characteristics such as a period difference value and a period median value are extracted and calculated. After current data of a set number of cycles are obtained, the total number of sampling points is recorded, a difference threshold value of two cycles is determined by combining related characteristics, and the larger value is taken as a target threshold value. And comparing the period difference value with a target threshold value, marking 0 or 1 for the sampling points, and calculating a ratio of the total number of marks to the total number of the sampling points. And if the ratio is not less than the set danger ratio, judging that an electric arc exists, and sending a result to a receiving end. By implementing the method, the early detection sensitivity of the arc fault can be improved, and particularly, the method has stronger recognition capability on hidden dangers which are difficult to capture by a traditional method such as intermittent arc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electrical digital data processing technology, and in particular to a method for electrical safety testing of appliances, a server, media, and program products. Background Technology

[0002] With the widespread use of electrical appliances and the development of intelligent technology, electrical safety issues are becoming increasingly prominent. Arc faults, as one of the main causes of electrical fires, place extremely high demands on early detection due to their insidious and sudden nature.

[0003] In existing technologies, mainstream arc detection relies on traditional hardware protection devices (such as circuit breakers and fuses). These devices trigger protection mechanisms by detecting obvious fault signals such as overcurrent and overvoltage.

[0004] However, existing technologies can only respond passively after an arc fault has formed and caused a significant current anomaly. It is difficult to accurately locate the specific electrical appliance with potential danger in the early stage of an arc (such as an intermittent arc caused by poor contact) and provide early warning. The above limitations result in significant safety hazards in existing solutions, making it difficult to meet the safety needs of diverse electricity use scenarios in modern households. Summary of the Invention

[0005] This application provides a method, server, medium, and program product for detecting electrical safety of appliances, which solves the problem that existing technologies can only passively respond to significant current anomalies and cannot provide early warnings or accurately locate potential dangers, thereby enabling early detection, accurate warnings, and intelligent judgment of electrical safety of appliances.

[0006] In a first aspect, this application provides a method for detecting electrical safety in a server. The method includes: acquiring sampling point data from multiple sampling points in a target electrical appliance at predetermined intervals, and extracting corresponding current data from each sampling point; calculating the period difference value, period median, relative centroid difference, and average period difference value corresponding to each sampling point based on the current data; recording the current total number of sampling points when a predetermined number of current data points within the specified period are acquired; determining a first period difference threshold based on the period median and the relative centroid difference; and determining the average period difference value based on the average period difference value. The second period differential threshold is determined by the value; the larger of the first period differential threshold and the second period differential threshold is determined as the target period differential threshold; it is determined whether the period differential value of each sampling point is greater than or equal to the target period differential threshold; if yes, the sampling point is marked as number 1, otherwise it is marked as number 0; the total number of marks for all sampling points is counted, and the ratio of the total number of marks to the total number of sampling points is calculated; if the ratio is greater than or equal to the set danger ratio, it is determined that an electric arc exists in the set number of periods, and the electric arc detection result is sent to the receiving end.

[0007] By employing the above technical solution, data from multiple sampling points are periodically collected and current characteristics are extracted, providing fundamental data for subsequent analysis. Calculating the period difference value (the absolute value of the current difference between adjacent periods) captures abrupt changes in current, a key indicator of arc faults. The period median reflects the current fluctuation range, while the relative centroid difference reflects harmonic distribution changes; combining these two allows for the identification of current waveform distortion. The average period difference smooths noise interference and enhances feature stability. These complementary features characterize current anomalies from different angles, significantly improving the early detection sensitivity of arc faults, especially for intermittent arcs, which are difficult to detect using traditional methods.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, calculating the period difference value, period median, relative centroid difference, and average period difference value corresponding to each sampling point based on the current data includes: acquiring first current data in each sampling point of a first period and second current data in each sampling point of a second period, wherein the first period and the second period are adjacent; the specific calculation steps for the period difference value are as follows: calculating the difference between the first current data and the corresponding second current data, and taking the absolute value of the difference to obtain the period difference value; the period median value is obtained by calculating the average of the maximum and minimum values ​​of the current data in each period; the specific calculation steps for the relative centroid difference are as follows: calculating the first harmonic centroid value of the first period and the second harmonic centroid value of the second period, calculating the difference between the second harmonic centroid value and the first harmonic centroid value, dividing by the first harmonic centroid value, and taking the absolute value of the result; the average period difference value is obtained by calculating the average of the period difference values ​​of the sampling points in each period.

[0009] By adopting the above technical solution, the characteristic value is calculated in stages to achieve refined extraction of arc features and multi-level feature extraction, forming a three-dimensional monitoring system from the time domain to the frequency domain, so that the characteristics of arc faults can be captured more comprehensively and accurately.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, determining a first period difference threshold based on the period median and the relative centroid difference, and determining a second period difference threshold based on the average period difference, includes: obtaining a first discrimination coefficient and a second discrimination coefficient corresponding to the target electrical appliance through a preset difference coefficient mapping table; calculating the product of the first discrimination coefficient, the period median, and the relative centroid difference to determine the first period difference threshold; and calculating the product of the second discrimination coefficient and the average period difference to determine the second period difference threshold.

[0011] By adopting the above technical solution and utilizing a preset differential coefficient mapping table, specific first and second discrimination coefficients are matched for different electrical appliance characteristics to achieve "personalized" threshold settings. The first periodic differential threshold combines the period median and the relative centroid difference, and is sensitive to waveform distortion; the second periodic differential threshold is based on the average value of the periodic differences, focusing on the overall fluctuation trend. Taking the larger value of the two as the target threshold can avoid the limitations of a single threshold and adaptively adjust the detection sensitivity under different operating conditions: for electrical appliances with large waveform changes, the focus is on distortion characteristics; for electrical appliances with frequent fluctuations, the focus is on trend characteristics, ultimately achieving accurate detection of arc faults in various electrical appliances.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the first and second discriminant coefficients corresponding to the target electrical appliance are obtained through a preset differential coefficient mapping table. The method for constructing the differential coefficient mapping table includes: recording the critical moments when all electrical appliances generate arcs during multiple tests on different electrical appliances at different power levels, and the experimental period difference value of these critical moments. , median of the experimental period Experimental relative centroid difference and the average difference between the experimental period Calculate the discrimination coefficients of different electrical appliances at the critical moment. The specific calculation formulas include: ; ;in It is the first discriminant coefficient. This is the second discriminant coefficient.

[0013] By employing the above technical solution, a differential coefficient mapping table was constructed based on critical experimental data, enabling precise calibration of the threshold parameters. By recording the critical moments and corresponding characteristic values ​​of arc generation in different electrical appliances at different power levels, specific first and second discrimination coefficients were calculated. This calibration method based on actual fault data deeply couples the discrimination coefficients with the arc fault characteristics of the electrical appliances.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after determining that an arc exists within the set number of cycles if the ratio is greater than or equal to a set danger ratio, the method further includes: obtaining a historical arc event feature data table, which includes at least the sampling point sequence number, and the cycle difference value, average cycle difference value, cycle median value, relative centroid difference, and timestamp recorded for each sampling point; obtaining a historical arc event label table, which includes at least the start sequence number of the sampling point within each cycle, the end sequence number of the sampling point, and a label indicating whether the sampling point is an arc event; using the multidimensional feature data from the historical arc event feature data table as input data, and the data from the historical arc event label table as output data, training the model through a convolutional neural network to obtain an arc determination model.

[0015] By employing the above technical solution and training a convolutional neural network model with historical data, intelligent confirmation of arc faults was achieved. A historical arc event feature data table provides multi-dimensional feature inputs (period difference values, median values, etc.), while a label table annotates real fault cases; together, they constitute a complete training dataset. The convolutional neural network automatically extracts the nonlinear relationships between features, learning deep patterns of arc faults. Compared to traditional threshold-based judgment, this model has stronger generalization ability: it can identify arc characteristics under complex operating conditions, distinguish between normal fluctuations and fault signals, and reduce false alarms; it also has higher sensitivity to early, weak arcs, improving detection reliability. This data-driven intelligent model overcomes the limitations of single threshold-based judgment, achieving accurate classification of arc faults.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after determining the existence of an electric arc within the set number of cycles, the method further includes: inputting the feature data of each sampling point within the set number of cycles into the electric arc determination model to determine a first electric arc label; if the first electric arc label is true, then issuing an electric arc warning.

[0017] By adopting the above technical solution, after threshold judgment confirms the presence of an electric arc, further verification is achieved through an arc determination model, forming a dual-layer guarantee of "coarse screening + fine judgment": threshold judgment quickly identifies obvious anomalies, while model verification eliminates misjudgments under complex operating conditions. When the model outputs the first arc label as "yes," an early warning is immediately issued to ensure timely handling of high-risk arcs. This intelligent verification mechanism significantly improves the reliability of the early warning, especially in modern home environments with multiple electrical appliances and high interference, reducing false alarms caused by normal current fluctuations and making the early warning system more practical.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of calculating the ratio of the total number of tags to the total number of sampling points, the method further includes: if the ratio is less than the danger ratio, inputting the feature data of each of the sampling points within the set number of periods into the arc determination model to determine a second arc tag; if the second arc tag is positive, issuing a suspected arc warning; obtaining the user's arc confirmation result; if the arc confirmation result is a false alarm, adding the feature data to the historical arc event feature data table and updating the tag of the corresponding sampling point in the historical arc event tag table; and training the updated historical arc event feature data table and the historical arc event tag table using a convolutional neural network to update the arc determination model.

[0019] By adopting the above technical solution, the dynamic learning mechanism enables the system's detection capabilities to continuously evolve. When the threshold judgment is not met but the model identifies a suspected electric arc, an early warning is issued and user feedback is collected, forming a closed-loop optimization: if the user confirms a false alarm, the feature data is added to the negative samples to update the training set; if it is confirmed to be an electric arc, positive samples are added. Through continuous iterative training, the model gradually learns more arc features in more complex scenarios, improving its ability to identify edge cases.

[0020] In a second aspect, this application provides a server comprising: one or more processors and a memory; the memory being coupled to the one or more processors, the memory being used to store computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the server to perform the methods described in the first aspect and any possible implementation thereof.

[0021] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on a server, cause the server to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, this application provides a computer program product that, when run on a server, causes the server to perform the method described in the first aspect and any possible implementation thereof.

[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By employing a technique that involves periodically collecting current data and extracting multi-dimensional features such as period difference and period median, combined with dynamic threshold judgment and danger ratio statistics, the problem of accurately identifying intermittent arcs in the arc initiation stage in existing technologies is effectively solved, thereby achieving sensitive capture and accurate early warning of early arc faults in electrical appliances.

[0024] 2. By adopting a technique that uses a preset differential coefficient mapping table to determine the specific discrimination coefficient for each electrical appliance, and combines the median of the period, the relative centroid difference, and the average value of the period difference to construct a dual threshold, and taking the larger value as the target threshold, the problem of poor adaptability and easy false alarms and missed alarms of the single threshold in the existing technology is effectively solved. Thus, personalized adaptation for arc fault detection of different electrical appliances is realized, and the reliability and accuracy of detection are improved.

[0025] 3. By using multi-dimensional feature data and label data of historical arc events as training sets and training a convolutional neural network to obtain an arc determination model, the problem of relying on a single parameter to make judgments in existing technologies is difficult to cope with complex power consumption scenarios. This enables intelligent identification and accurate classification of arc faults, and improves the system's generalization ability and detection accuracy in diverse scenarios. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating an electrical safety testing method for appliances in this application. Figure 2 This is an example diagram of a model training sample for the electrical appliance safety detection method in the embodiments of this application; Figure 3 This is a schematic diagram of the physical device structure of a server in an embodiment of this application. Detailed Implementation

[0027] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0029] For ease of understanding, the method provided in this implementation is described in process below. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating an electrical safety testing method for electrical appliances in an embodiment of this application.

[0030] S101. Acquire sampling point data of multiple sampling points in the target electrical appliance at set intervals, and extract the corresponding current data from each sampling point data. Here, "set period" refers to the time interval preset by the server for data collection, used to periodically acquire the power consumption information of the target appliance. "Target appliance" refers to the specific electrical equipment being monitored, such as refrigerators, air conditioners, microwave ovens, etc., which can be flexibly specified according to monitoring needs. "Sampling point" refers to the specific time point at which the current waveform is discretized and collected within a period. A period usually contains multiple sampling points (such as 128) to completely reconstruct the current waveform. "Sampling point data" refers to the raw electrical signal data collected at each sampling point, which may contain various information such as current, voltage, and noise. "Current data" refers to the numerical value reflecting the magnitude of the current extracted from the sampling point data, which is the core basis for subsequent feature calculations and arc judgment.

[0031] As long as the target appliance is in operation and the server monitoring function is enabled, it will continue to execute according to the set cycle. Typical application scenarios include home electricity safety management (such as monitoring the TV in the living room and the electric oven in the kitchen), electricity monitoring in small commercial buildings (such as the cash register equipment and lighting system in shops), and monitoring of specific equipment in industrial low-voltage distribution networks.

[0032] In detail, the server first triggers a data acquisition command according to a preset "set period" (e.g., 20 milliseconds). Taking monitoring an air conditioner in a home scenario as an example, data acquisition devices deployed in the air conditioner's power supply circuit (such as smart sockets, circuit sensors, and multimeters) will perform multiple discrete samplings of the current waveform within each period, forming "sampling point data with multiple sampling points"—for example, one period contains 128 sampling points, each sampling point corresponding to the raw electrical signal (including current, voltage, and other information) at a certain moment. This sampling point data is transmitted to the server via wired (e.g., Ethernet) or wireless (e.g., Wi-Fi, ZigBee) methods. After receiving the sampling point data, the server extracts the "current data" corresponding to each sampling point (e.g., the current values ​​of the 128 sampling points are 3.2A, 3.3A, ..., 3.5A respectively).

[0033] In some embodiments, the acquisition and extraction of target electrical appliance current data can be achieved in multiple ways: Optionally, acquisition can be achieved through a smart socket, with the following steps: 1. The smart socket has a built-in current sensor that acquires the raw electrical signal of the target electrical appliance at a set period (e.g., 20ms) to generate sampling point data containing 128 sampling points; 2. The smart socket packages the sampling point data through a wireless module (e.g., Bluetooth), adds a timestamp, and sends it to the gateway, which then forwards it to the server; 3. After receiving the data, the server calls a parsing algorithm to parse the data packet, extracts the current value of each sampling point, and stores it in the database.

[0034] S102. Calculate the period difference value, period median, relative centroid difference, and average period difference value corresponding to each sampling point based on the current data. Among them, "period difference" refers to the absolute value of the difference in current data between corresponding sampling points in two adjacent periods, used to reflect the degree of abrupt change in the current waveform between adjacent periods. For example, if the current at the 5th sampling point in period n is 4A and the current at the 5th sampling point in period (n+1) is 6A, then the period difference value at that sampling point is |6-4|=2A; "period median" refers to the average of the maximum and minimum values ​​of current data within a single period, used to reflect the overall amplitude range of the current in that period; "relative centroid difference" refers to the relative change in the harmonic centroid values ​​between adjacent periods, used to reflect... The changes in harmonic components in the current waveform are calculated using the formula "Σ(frequency × amplitude) / Σ amplitude". If the harmonic centroid value is 50Hz in the nth period and 55Hz in the (n+1)th period, then the relative centroid difference is |(55-50) / 50|=0.1. The "average value of period difference" refers to the arithmetic mean of the period difference values ​​at the same sampling point within multiple consecutive periods. It is used to reflect the overall trend of the current waveform change. For example, if the period difference values ​​of a certain sampling point for 10 periods are 2A, 3A, ..., 5A, then the average value is the average value of the period difference.

[0035] After the server obtains the current data for each cycle, it performs real-time calculations for each sampling point—the calculation of feature values ​​is triggered whenever new cycle data is received. Its application scenarios cover all low-voltage distribution network scenarios that require the identification of electric arcs through current features, because the generation of an electric arc causes anomalies in the current waveform in both the time domain (abrupt changes) and the frequency domain (harmonic variations), and these four feature values ​​precisely capture these anomalies from different dimensions.

[0036] In detail, the four eigenvalues ​​are calculated according to the following logic: Calculating the period difference: The server first groups the current data by period (e.g., period 1, period 2, ..., period n), then iterates through each sampling point (e.g., points 1 to 128), subtracting the current data at the same sampling point in adjacent periods (e.g., period n and period (n+1)), and taking the absolute value as the period difference for that sampling point. For example, if the current at the 10th sampling point in period 3 is 5.2A and the current at the 10th sampling point in period 4 is 7.8A, then the period difference for that sampling point is |7.8 - 5.2| = 2.6A. This calculation effectively captures sudden current changes caused by electric arcs—under normal circumstances, the current changes gradually between adjacent periods, resulting in a small period difference; when an electric arc occurs, the changes are drastic, and the difference increases significantly.

[0037] Calculating the periodic median: For a single period (e.g., the nth period), the server iterates through the current data of all sampling points within that period, finds the maximum and minimum values, calculates their average, and takes the absolute value as the periodic median for all sampling points within that period. For example, if the maximum current data in the 5th period is 9.5A and the minimum is 1.5A, then the periodic median for all sampling points in that period is (9.5 + 1.5) / 2 = 5.5A. The periodic median reflects the overall amplitude level of the current. Poor contact caused by an electric arc may cause a sudden increase or decrease in the current amplitude, thus changing the periodic median.

[0038] Calculating the relative centroid difference: The server first performs a Fourier transform on the current data for each cycle to obtain the frequency and amplitude of each harmonic. Then, it calculates the harmonic centroid value for each cycle using the formula "Harmonic centroid value = Σ(frequency × amplitude) / Σ amplitude". Next, it subtracts the harmonic centroid values ​​of adjacent cycles (e.g., the nth cycle and the (n+1)th cycle), divides the difference by the harmonic centroid value of the previous cycle, and takes the absolute value to obtain the relative centroid difference. For example, if the harmonic centroid value for the 2nd cycle is 50Hz and for the 3rd cycle is 53Hz, then the relative centroid difference is |(53-50) / 50| = 0.06. Electric arcs cause distortion in the current waveform, altering the harmonic components and consequently changing the harmonic centroid value. Therefore, the relative centroid difference effectively captures these changes.

[0039] Calculating the average period difference: For each sampling point, the server collects the period difference values ​​for multiple consecutive periods (e.g., 10 periods) and calculates the arithmetic mean as the average period difference for that sampling point. For example, if the period difference values ​​for 10 periods at a sampling point are 2A, 2.5A, 3A, ..., 4A, and the average value is 3A, then the average period difference for that sampling point is 3A. This calculation can smooth out fluctuations in the period difference value caused by random factors and more accurately reflect the overall trend of current changes—a large average value may indicate that the electric arc is still present.

[0040] These four characteristic values ​​characterize the current from four dimensions: time-domain abrupt change (period difference value), amplitude range (period median), frequency-domain change (relative centroid difference), and overall trend (period difference average value), providing a comprehensive basis for subsequent arc judgment.

[0041] S103. When a set number of current data points within the current cycle are obtained, record the current total number of sampling points. Here, "the set number of cycles" refers to the total number of cycles preset by the server for one arc detection, such as 10 cycles. This setting needs to be based on the time distribution of arc characteristics—arcs usually last for multiple cycles, and single-cycle data is easily interfered with. "Total number of sampling points" refers to the total number of sampling points included in the set number of cycles. The calculation formula is "set number of cycles × number of sampling points per cycle", for example, 10 cycles × 128 sampling points / cycle = a total of 1280 sampling points.

[0042] This step marks the end of a phase of data acquisition. It is executed when the server accumulates a set number of cycles—for example, if the system is set to 10 cycles as a judgment unit, this step is triggered immediately after the server acquires the current data for the 10th cycle. Its application scenarios cover all situations requiring comprehensive judgment of arcs using multi-cycle data. This is because current fluctuations in a single cycle may be caused by accidental factors (such as the instant an appliance starts up), while multi-cycle data can more accurately reflect the continuity characteristics of the arc (e.g., intermittent arcs caused by poor contact will show abnormalities over multiple cycles).

[0043] In detail, after starting the detection, the server initializes a cycle counter with an initial value of 0. Each time a complete cycle of current data is acquired (e.g., the current values ​​of 128 sampling points), the counter increments by 1, and the data for that cycle is stored in the buffer. When the counter reaches a set number of cycles (e.g., 10), the server stops counting in the current phase and begins calculating the total number of sampling points: it reads the system's preset number of sampling points per cycle (e.g., 128), calculates the total number using the formula "Total number of sampling points = Set number of cycles × Number of sampling points per cycle" (e.g., 10 × 128 = 1280), and stores this value in a designated variable in memory.

[0044] The core purpose of recording the total number of sampling points is to provide a benchmark for subsequent steps (such as calculating the ratio of the total number of markers to the total number of sampling points in S108). This ratio reflects the proportion of abnormal sampling points in the total sample, avoiding inconsistencies in judgment standards due to different numbers of cycles or sampling points. For example, if the number of cycles is set to 10 and the total number of sampling points is fixed at 1280, then regardless of the type of electrical appliance being tested, the "proportion of abnormal points" will be used as the basis for judgment, ensuring a consistent standard.

[0045] In addition, before recording the total number of sampling points, the server verifies the periodic data in the cache: checking for data loss (e.g., only 100 sampling points were collected in a certain period) or data anomalies (e.g., the current value exceeds the rated range of the appliance by more than 10 times). If a problem is found, a supplementary sampling mechanism will be triggered (e.g., re-collecting the data for that period) or the abnormal period will be removed (and logged) to ensure that the periodic data used for calculation is complete and valid, thereby guaranteeing the accuracy of the total number of sampling points.

[0046] S104. Determine the first period difference threshold based on the period median and the relative centroid difference, and determine the second period difference threshold based on the period average value. Among them, the "first cycle difference threshold" refers to the threshold calculated by combining the cycle median, relative centroid difference, and first discriminant coefficient, used to measure whether the cycle difference value reaches an abnormal level due to changes in current amplitude and harmonics. The "second cycle difference threshold" refers to the threshold calculated by combining the average value of the cycle difference and the second discriminant coefficient, used to measure whether the cycle difference value exceeds the normal range of the overall trend. The "first discriminant coefficient" and "second discriminant coefficient" are proportional coefficients specific to the target electrical appliance, derived from a preset difference coefficient mapping table, reflecting the electrical appliance's sensitivity to arc characteristics. For example, the first discriminant coefficient of an air conditioner is 0.5, and the second discriminant coefficient is 1.2. The "difference coefficient mapping table" is a database table that stores the discriminant coefficients of different electrical appliances, constructed based on a large amount of arc experimental data.

[0047] After obtaining the median period, relative centroid difference, and average period difference for each sampling point, two thresholds are immediately calculated. Its application scenarios cover all situations requiring adjustments to detection standards based on the characteristics of different electrical appliances. Because the normal current characteristics of different appliances vary significantly (e.g., microwave ovens have large current fluctuations, while table lamps have stable current), fixed thresholds can easily lead to misjudgments (e.g., misjudging the normal fluctuations of a microwave oven as an electric arc), while dynamic thresholds can achieve "personalized" judgments.

[0048] In detail, the server first needs to obtain the discrimination coefficients corresponding to the target appliance: by querying a preset "differential coefficient mapping table" (which stores the first discrimination coefficient thh1 and the second discrimination coefficient thh2 with the appliance type as the key), the server extracts the corresponding coefficients based on the currently detected "target appliance" type (such as "air conditioner"). For example, in the mapping table, thh1=0.5 and thh2=1.2 for air conditioner; and thh1=0.3 and thh2=0.8 for table lamp.

[0049] Then, based on the feature values ​​calculated by S102 and the extracted discriminant coefficients, the server calculates two thresholds respectively: The first-cycle differential threshold is calculated using the formula: "First-cycle differential threshold = First discrimination coefficient × Period median × Relative centroid difference". Here, the period median reflects the current amplitude range, and the relative centroid difference reflects harmonic variations. The product of these two values ​​comprehensively reflects the degree of abnormality in both amplitude and harmonics. Multiplying this by the first discrimination coefficient (an appliance-specific sensitivity coefficient) yields the threshold suitable for that appliance. For example, if the period median of an air conditioner sampling point is 10A, the relative centroid difference is 0.3, and thh1 = 0.5, then the first threshold is 0.5 × 10 × 0.3 = 1.5A. This means that for air conditioners, when the period differential value is ≥ 1.5A, there may be a risk of arcing due to amplitude and harmonic variations.

[0050] The second periodic differential threshold is calculated using the formula: "Second periodic differential threshold = Second discriminant coefficient × Average periodic differential value". The average periodic differential value reflects the overall trend of current change. Multiplying this by the second discriminant coefficient (which reflects the sensitivity of the appliance to trend changes) yields a threshold based on the overall trend. For example, if the average periodic differential value at a sampling point of an air conditioner is 2A and thh2 = 1.2, then the second threshold is 1.2 × 2 = 2.4A. This means that for an air conditioner, when the periodic differential value is ≥ 2.4A, there may be a risk of arcing due to abnormal overall trend.

[0051] The differential coefficient mapping table is constructed based on extensive experiments: arc simulation experiments are conducted on various electrical appliances at different power levels. The experimental period difference value b, the median period c, the relative centroid difference d, and the average period difference e are recorded at the critical moment of arc generation during the process from no arc to arc generation. The discrimination coefficients are calculated using the formulas "thh1=b / (c×d)" and "thh2=b / e" to ensure that the coefficients accurately reflect the characteristic sensitivity of the electrical appliance under the critical arc state. For example, in the experiment on a microwave oven, at the critical moment b=8A, c=20A, d=0.4, e=5A, then thh1=8 / (20×0.4)=1, thh2=8 / 5=1.6. These coefficients are stored in the mapping table for use during testing.

[0052] S105. The larger of the first period difference threshold and the second period difference threshold is determined as the target period difference threshold. The “target period difference threshold” refers to the larger value selected from the first period difference threshold and the second period difference threshold, which is used as the final standard to judge whether the period difference value is abnormal. For example, when the first threshold is 1.5A and the second threshold is 2.4A, the target threshold is 2.4A.

[0053] This step is a key step in threshold integration, and its application scenarios cover all scenarios that require strict screening of abnormal sampling points. This is because the judgment of electric arc needs to meet the abnormality of two dimensions: "amplitude + harmonics" and "overall trend". Taking the larger value as the target threshold can ensure that only the period difference value that exceeds the standard of both dimensions is identified as abnormal, thereby reducing misjudgment (such as avoiding misjudging the single-dimensional fluctuation when the appliance starts as an electric arc).

[0054] In detail, the server stores the first period difference threshold and the second period difference threshold calculated by S104 as two variables (such as th1 and th2), and then executes the comparison logic: if th1>th2, then the target period difference threshold = th1; if th2>th1, then the target period difference threshold = th2; if th1=th2, then the target threshold is equal to that value.

[0055] S106. Determine whether the period difference value at each sampling point is greater than or equal to the target period difference threshold. Here, "each sampling point" refers to all discrete current data points collected within a set number of cycles, such as 1280 sampling points for 10 cycles, with each point corresponding to the current characteristics at a specific moment.

[0056] If the value is greater than or equal to the target period difference threshold, then proceed to step S107. If the difference is less than the target periodicity threshold, then proceed to step S108.

[0057] S107. If so, mark the sampling point as the number 1; The "digit 1" is used to mark sampling points where the period difference value is greater than or equal to the target period difference threshold, indicating that there is an abnormal current change at that point, which may be related to an electric arc.

[0058] Based on the judgment result of S106, the server digitally marks each sampling point: if a sampling point is judged to be abnormal (period difference value ≥ target threshold), then 1 is stored in the corresponding position in the marking array.

[0059] S108. If not, mark the sampling point as the number 0; The "digit 0" is used to mark sampling points where the period difference value is less than the target threshold, indicating that the current change at that point is normal.

[0060] If a sample is determined to be normal, a 0 is stored at the corresponding position in the marker array. The correspondence between the marker array and the sampling point is maintained by "cycle number + sampling point sequence number". For example, marker array index 0 corresponds to the first sampling point of the first cycle, index 127 corresponds to the 128th sampling point of the first cycle, index 128 corresponds to the first sampling point of the second cycle, and so on. This structured storage facilitates the subsequent tracing of the specific location of anomalies. For example, consecutive 1s in the marker array can locate the cycle range of the arc concentration.

[0061] S109. Count the total number of tags for all sampling points and calculate the ratio of the total number of tags to the total number of sampling points; Among them, "total number of marks" refers to the total number of 1s in the mark array, reflecting the total number of abnormal sampling points within the set number period. For example, if 512 out of 1280 sampling points are marked as 1, then the total number of marks is 512. "Total number of sampling points" is the total number of sampling points recorded by S103 within the set number period, such as 10 periods × 128 points / period = 1280. "Ratio" is the quotient of the total number of marks and the total number of sampling points, used to quantify the proportion of outliers in the total sample, such as 512 / 1280 = 0.4 (40%).

[0062] This step reflects the overall degree of current anomaly by statistically analyzing the proportion of outliers, which is the core basis for determining the existence of an electric arc. It is applicable to all scenarios where an arc needs to be identified through a proportional threshold. A single outlier may be caused by noise, but when the proportion reaches a certain threshold, it is more likely to be a real electric arc (an electric arc can cause anomalies at multiple sampling points). The server first counts the total number of markers: iterating through the marker array and accumulating the elements with a value of 1. For example, by iterating through 1280 elements using a loop, the total number of markers is 1024. The statistical process can utilize built-in functions in programming languages ​​(such as `sum()`) to improve efficiency, especially suitable for scenarios with large-scale sampling points. Subsequently, the server calculates the ratio: dividing the total number of markers by the total number of sampling points, and retaining 2-4 decimal places. For example, with a total of 1024 markers and a total of 1280 sampling points, the ratio is 1024 / 1280 = 0.8 (80%). The significance of the ratio lies in eliminating the influence of differences in the total number of sampling points, and unifying the judgment criteria for different detection cycles and different electrical appliances. For example, 80% of the abnormalities in 1280 sampling points over 10 cycles and 80% of the abnormalities in 2560 sampling points over 20 cycles both reflect the same degree of abnormality.

[0063] S110. If the ratio is greater than or equal to the set danger ratio, then it is determined that an electric arc exists within the set number of cycles, and the electric arc detection result is sent to the receiving end.

[0064] Among them, the "hazard ratio" is the critical proportion preset by the server to judge the existence of an electric arc, such as 0.8 (80%), which is set based on a large amount of electric arc experiment data (statistics show that the proportion of abnormal points during the occurrence of an electric arc is usually ≥80%); the "electric arc detection result" is a report containing information such as the detection time, target electrical appliance, proportion of abnormal points, and electric arc determination result; the "receiving end" is the device or platform that receives the result, such as the user's mobile phone APP, home intelligent gateway, property monitoring system, etc.

[0065] Specifically, the server first reads the preset hazard ratio (such as 0.8) and compares the ratio calculated in S109 with it: If the ratio ≥ hazard ratio: It is determined that there is an electric arc within the set number of cycles, and a detection result containing the following information is generated: detection time (such as 2023-10-01 10:00), target electrical appliance (such as "living room air conditioner"), set number of cycles (such as 10), proportion of abnormal points (such as 80%), electric arc determination result ("there is an electric arc"), and recommended measures (such as "immediately cut off the power supply for inspection").

[0066] If the ratio < hazard ratio: It is determined that there is no electric arc, and the result generated includes the detection time, target electrical appliance, proportion of abnormal points (such as 10%), and determination result ("no electric arc").

[0067] After generating the result, the server sends the result to the receiving end through the corresponding communication method: for the user APP, push notifications are used; for the home gateway, the local area network protocol (such as MQTT) is used; for the property platform, the HTTP interface is used. Sensitive information (such as the location of the electrical appliance) needs to be encrypted in the sent content to ensure data security.

[0068] For the situation where there is an electric arc, the server will also trigger linkage operations: record the electric arc event in the historical database (for model training), control the intelligent socket to cut off the power (user authorization required), and start the sound and light alarm (such as connecting the alarm device). For example, when an electric arc is detected in the air conditioner, in addition to notifying the user, the power supply of the air conditioner is automatically cut off to prevent a fire.

[0069] In this embodiment, by periodically collecting current data from multiple sampling points of the target electrical appliance and extracting multi-dimensional features such as period difference value, period median, relative centroid difference, and average period difference, combined with dynamic threshold (determining dual thresholds based on period median, relative centroid difference, and average period difference and taking the larger value), hazard ratio statistics, and intelligent model verification (an arc determination model trained by a convolutional neural network), it is possible to capture the characteristics of the arc initiation stage from multiple dimensions in the time and frequency domains. By adapting dynamic thresholds to the characteristics of different electrical appliances to reduce misjudgments, and by combining multi-cycle data statistics and intelligent model dual verification to improve detection reliability, it effectively solves the problems of existing technologies that can only passively respond to significant current anomalies, cannot accurately identify intermittent arcs in the arc initiation stage, and are difficult to provide early warning and location. Thus, it realizes sensitive capture, accurate early warning, and intelligent handling of early arc faults in electrical appliances, meeting the safety needs of diverse electricity use scenarios in modern households.

[0070] In some embodiments, to further address the lack of effective automatic monitoring algorithms that result in insufficient early warning capabilities for electrical safety issues, a pre-defined model is used to enhance real-time data stream analysis capabilities, continuously monitor current waveforms, and trigger an early warning mechanism immediately once potential arc generation signs are detected during the characteristic value calculation and judgment process, thereby improving the real-time performance and effectiveness of the early warning.

[0071] Specifically, during the data preparation phase of model building, the server first needs to acquire and verify the "Historical Arc Event Feature Data Table." This table is not static data but is continuously updated as new arc events are discovered. When S109 confirms the existence of an arc, the server automatically writes the period difference value, median period value, and other features of each sampling point in the event, along with the corresponding sampling point sequence number and timestamp, into the feature data table. For example, if an arc event occurs within 10 cycles and contains 1280 sampling points, the feature value of each sampling point (such as a period difference value of 2.5A and a median period value of 10A) will be recorded one by one, with timestamps accurate to the millisecond level to reflect the real-time nature of the arc occurrence. Simultaneously, the server verifies the newly written data: checking whether the feature values ​​are within a reasonable range (e.g., the period difference value will not exceed 5 times the rated current of the electrical appliance), and whether the timestamps are continuous (to avoid sequence errors caused by data transmission delays). If any anomalies are found, manual review is triggered to ensure the authenticity and reliability of the original data input into the model. At the same time, the server needs to synchronously update the "Historical Arc Event Tag Table." For newly identified arc events, a new record is added to the label table: an "Event ID" uniquely identifies the event; "Start Sampling Point Number" and "End Sampling Point Number" define the event range (e.g., "1-1" to "10-128" represents all sampling points from period 1 to period 10); and the "Is it an arc event?" label is set to "Yes". In addition, to balance positive and negative samples in the training data (avoiding the model being only sensitive to arc events), the label table also includes a large number of "non-arc event" records—these records come from sampling point data under normal power consumption scenarios, and are labeled "No." Their number is typically 3-5 times that of arc event samples to ensure the model's generalization ability. For example, current data during normal operation of an air conditioner in a home, and instantaneous fluctuation data of a table lamp switch, are labeled as "non-arc events" and stored in the label table. It is worth noting that the feature data table and the label table are linked through the "Sampling Point Number Range" to ensure that each feature value corresponds to an accurate label, avoiding data misalignment (e.g., mistakenly associating arc event features with non-arc labels).

[0072] For specific examples, please refer to... Figure 2 , Figure 2 This is an example diagram of a model training sample for the electrical safety detection method for electrical appliances in the embodiments of this application.

[0073] Figure 2 (a) shows the historical arc event feature data table. Each row of this table corresponds to the feature data of a sampling point, where the "Sampling Point ID" serves as the primary key to uniquely identify each sampling point. The columns "Period Difference Value b", "Period Median c", "Relative Centroid Difference d", and "Period Difference Average e" store the feature values ​​corresponding to each sampling point, respectively. The "Timestamp" column records the specific time when the data for that sampling point was collected.

[0074] Figure 2 (b) shows the historical arc event label table, which is used to label arc events. The "Event ID" serves as the primary key to uniquely identify each arc event; the "Start Sampling Point ID" and "End Sampling Point ID" indicate the start and end sampling point ranges of the feature data corresponding to the arc event in the "Arc Event Feature Data Table"; and the "Is it an Arc Event?" column explicitly indicates whether the event is an arc event.

[0075] During the model training phase, the server takes multi-dimensional feature data from the feature data table as input and "whether it is an electric arc event" from the label table as output, and trains it using a convolutional neural network. The specific training process requires multiple rounds of iterative optimization. First, the server preprocesses the input data: standardizing the feature values ​​(e.g., mapping the period difference value to the 0-1 interval to eliminate the influence of different electrical current levels), sorting the sampling points in chronological order (ensuring the CNN can capture temporal features), and dividing the training set and validation set in a 7:3 ratio (the training set is used for model learning, and the validation set is used for performance evaluation). For example, out of 1000 electric arc event data points, 700 are used for training and 300 for validation; non-electric arc event data are also divided in the same ratio. Next, the CNN network structure is designed: the input layer dimension is (number of sampling points, number of features), such as (1280, 4) which represents 1280 sampling points, each containing 4 features; the convolutional layer has 32 filters with a kernel size of 3 (each sliding window contains 3 sampling points), and the activation function is ReLU (to handle non-linear features); the pooling layer uses max pooling to reduce the data dimension while retaining key features; the fully connected layer has 256 neurons, and finally outputs a probability between 0 and 1 through the sigmoid activation function (the closer to 1, the more likely it is to be an electric arc event).

[0076] During training, the server dynamically adjusts parameters: the learning rate is initially set to 0.001, and is halved if the validation set accuracy decreases; the loss function uses binary cross-entropy (suitable for binary classification problems); the number of iterations is determined by an early stopping mechanism—training stops when the validation set accuracy does not improve for 5 consecutive iterations to avoid overfitting (e.g., the model only remembers the features of the training data and cannot recognize new arc events). For example, if a model reaches 98.5% validation set accuracy after 30 iterations and no longer improves, training stops at this point, and the current model parameters are saved.

[0077] During the model output phase, the trained arc detection model is deployed into the detection system to assist in subsequent arc identification. The core value of this model lies in overcoming the limitations of traditional threshold-based detection: for edge cases that are difficult to identify using threshold-based methods (such as arcs with a period difference value slightly below the target threshold but significantly abnormal harmonic characteristics), the model can provide accurate judgments based on similar patterns in historical data. For example, in an arc event of a new type of small household appliance, the period difference value is 2.3A (the target threshold is 2.4A), but the relative centroid difference reaches 0.35 (far exceeding the normal range). Traditional threshold-based detection would miss this, while the arc detection model, by learning the arc characteristics of similar appliances, would output a probability of 0.98, classifying it as an arc event.

[0078] In some embodiments, after the server determines the presence of an electric arc through traditional threshold judgment (such as a danger ratio meeting the standard), it can perform secondary verification and precise early warning. Specifically, the server first organizes the feature data of all sampling points within a "set number of cycles"—for example, 1280 sampling points for 10 cycles. Each sampling point contains data such as cycle difference value b=9.5, cycle median c=21.3, relative centroid difference d=0.30, and average cycle difference e=10.5. This data is arranged in chronological order to form a multi-dimensional feature matrix (e.g., 1280 rows × 4 columns) to ensure that the model can capture the temporal changes of features (e.g., the sudden change trend of cycle difference value when an electric arc occurs). Subsequently, the server inputs the feature data into the "electric arc determination model". This model is trained based on a feature data table and label table of historical electric arc events. It extracts local features (e.g., changes in cycle difference value of 3 consecutive sampling points) through convolutional layers and integrates global trends (e.g., fluctuations in relative centroid difference value throughout the cycle) through fully connected layers, finally outputting the "first electric arc label". For example, if the model identifies a high match between the current feature data and typical patterns of historical arc events (b in 8-12, c in 20-22, d in 0.28-0.32, e in 10-11), it outputs the label "Yes". If the first arc label is "Yes", the server immediately triggers the "arc warning" mechanism. The warning method adapts to the scenario: in a home scenario, a message "There is a potential arc hazard in the living room air conditioner, please disconnect the power immediately for inspection" is pushed through a mobile APP, and a voice prompt is issued in conjunction with a smart speaker; in a commercial scenario, an alarm signal is sent to the property monitoring platform, and an on-site sound and light alarm (such as flashing red warning lights + buzzer) is triggered. The core value of this step lies in building a dual defense line of "traditional threshold judgment + intelligent model verification": traditional methods quickly identify obvious anomalies, while the model learns complex patterns in historical data to filter out misjudgments caused by appliance startup, load changes, etc., and is especially accurate in judging intermittent arcs (features appear and disappear).

[0079] In some embodiments, there may be "marginal cases" of electricity use—for example, a minor contact malfunction in a household electric iron, where the percentage of abnormal sampling points may only be 60% (below the 80% danger ratio), but features such as cycle difference and relative centroid difference already exhibit typical arc patterns. In such cases, the following method is needed to capture these potential risks. Specifically, after the ratio calculated in S109 is less than the danger ratio, the server does not directly determine "no arc," but instead organizes the feature data of all sampling points within the cycle (such as the b, c, d, and e values ​​of 1280 sampling points over 10 cycles) into a structured input (such as a 1280×4 feature matrix) and inputs it into the arc determination model. This model captures local correlations between features through convolutional layers (such as the fluctuation trend of b values ​​and the synchronous change of d values ​​in 5 consecutive sampling points), integrates global features (such as the stability of c values ​​throughout the cycle) through fully connected layers, and finally outputs a second arc label. For example, a slight contact malfunction in a rice cooker causes the period difference value 'b' to fluctuate between 6 and 9 (below the traditional threshold of 10), but the relative centroid difference 'd' remains stable at 0.29-0.31 (close to the typical value for an electric arc). The model learns from historical data the pattern of "slightly low 'b' but unusually stable 'd'" and outputs a second electric arc label as "yes." A suspected electric arc warning is then issued. If the second electric arc label is "yes," the server triggers a different notification mechanism than the "confirmed electric arc warning." After receiving the suspected warning, the user can provide feedback on the actual situation through the terminal: if the plug is found to be loose (indicating an electric arc), click "Electric Arc Exists" in the app; if the device is confirmed to be operating normally (e.g., a misjudgment), click "False Alarm." The server records the feedback time, user action, and corresponding feature data, forming an "event-feedback" association record. For example, when a user reports a "false alarm," the server automatically associates the 1280 sampling point features of the event, labeling negative samples for subsequent model optimization. If the user confirms a "false alarm," the server will write the feature data for that period into the historical arc event feature data table one by one: the sampling point sequence number is recorded in the format of "period-sequence number" (e.g., "1-1" to "10-128"), and the values ​​of b, c, d, and e, as well as the timestamp, are stored synchronously; at the same time, a new record is added to the historical arc event label table, with the "starting sampling point sequence number" set to "1-1", the "ending sequence number" set to "10-128", and the "whether it is an arc event" label set to "no". If the user confirms "an arc exists", the label is set to "yes", and it is added to the positive sample. This update ensures that the data table always contains the latest real cases, providing a reliable basis for model training.

[0080] In this embodiment, the arc determination model gradually adapts to diverse power consumption scenarios through a cycle of "model capturing edge cases - user feedback calibration - data iteration optimization": it can identify potential arcs that traditional thresholds miss, and reduce misjudgments of normal power consumption fluctuations through user feedback.

[0081] The server in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference]. Figure 3 This is a schematic diagram of the physical device structure of a server in an embodiment of this application.

[0082] It should be noted that, Figure 3 The server structure shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0083] like Figure 3 As shown, the server includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303, such as performing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.

[0084] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0085] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0086] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0088] Specifically, the server in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the electrical safety detection method for electrical appliances provided in the above embodiment.

[0089] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the server described in the above embodiments; or it may exist independently and not assembled into the server. The storage medium carries one or more computer programs that, when executed by a processor of the server, cause the server to implement the electrical safety detection method for electrical appliances provided in the above embodiments.

[0090] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application 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 scope of the technical solutions of the embodiments of this application.

[0091] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0092] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for detecting electrical safety in electrical appliances, applied to servers, characterized in that, The method includes: The sampling data of multiple sampling points in the target electrical appliance are acquired at set intervals, and the corresponding current data is extracted from each sampling point data. Calculate the period difference value, period median, relative centroid difference, and average period difference value corresponding to each sampling point based on the current data; When the current data within the set number of cycles is acquired, the total number of current sampling points is recorded. A first period difference threshold is determined based on the period median and the relative centroid difference, and a second period difference threshold is determined based on the average period difference. The larger of the first period difference threshold and the second period difference threshold is determined as the target period difference threshold; Determine whether the period difference value at each sampling point is greater than or equal to the target period difference threshold; If yes, then mark the sampling point as the number 1; otherwise, mark the sampling point as the number 0. Count the total number of tags for all the sampling points, and calculate the ratio of the total number of tags to the total number of sampling points; If the ratio is greater than or equal to the set danger ratio, it is determined that an electric arc exists within the set number of cycles, and the arc detection result is sent to the receiving end.

2. The method according to claim 1, characterized in that, The step of calculating the period difference value, period median, relative centroid difference, and average period difference value corresponding to each sampling point based on the current data includes: Acquire the first current data in each sampling point of the first cycle and the second current data in each sampling point of the second cycle, wherein the first cycle and the second cycle are adjacent; The specific calculation steps for the period difference value are as follows: Calculate the difference between the first current data and the corresponding second current data, and take the absolute value of the difference to obtain the period difference value; The median value of the period is obtained by calculating the average of the maximum and minimum values ​​of the current data within each period and taking the absolute value. The specific calculation steps for the relative centroid difference are as follows: Calculate the centroid value of the first harmonic in the first cycle and the centroid value of the second harmonic in the second cycle. Calculate the difference between the centroid value of the second harmonic and the centroid value of the first harmonic, divide it by the centroid value of the first harmonic, and take the absolute value of the result. The average period difference is obtained by calculating the average of the period difference values ​​of the sampling points within each period.

3. The method according to claim 1, characterized in that, The step of determining a first period difference threshold based on the period median and the relative centroid difference, and determining a second period difference threshold based on the average period difference, includes: The first and second discriminant coefficients corresponding to the target electrical appliance are obtained through a preset differential coefficient mapping table; The product of the first discrimination coefficient, the median of the period, and the difference in the relative centroid is calculated to determine the first period difference threshold; The product of the second discrimination coefficient and the average value of the period difference is determined as the second period difference threshold.

4. The method according to claim 3, characterized in that, The method for obtaining the first and second discriminant coefficients corresponding to the target electrical appliance through a preset differential coefficient mapping table includes: Record the critical moments when electric arcs occur in all electrical appliances during multiple tests at different power levels, as well as the experimental period difference values ​​of these critical moments. , median of the experimental period Experimental relative centroid difference and the average difference between the experimental period ; Calculate the discrimination coefficients of different electrical appliances at the critical moment. The specific calculation formulas include: , ,in It is the first discriminant coefficient. It is the second discriminant coefficient.

5. The method according to claim 1, characterized in that, If the ratio is greater than or equal to a set danger ratio, then after determining the presence of an arc within the set number of cycles, the method further includes: Obtain a historical arc event feature data table, which includes at least the sampling point number, and the period difference value, average period difference value, median period value, relative centroid difference, and timestamp recorded for each sampling point; Obtain a historical arc event tag table, which includes at least the start number of the sampling point in each period, the end number of the sampling point, and a tag indicating whether the sampling point is an arc event. Using the multidimensional feature data from the historical arc event feature data table as input data and the data from the historical arc event label table as output data, a convolutional neural network is used for training to obtain an arc determination model.

6. The method according to claim 1, characterized in that, After determining the step of determining the presence of an electric arc within the set number of cycles, the method further includes: The feature data of each sampling point within the specified number of periods are input into the arc determination model to determine the first arc label; If the first arc tag is yes, then an arc warning is issued.

7. The method according to claim 1 or 3, characterized in that, After the step of calculating the ratio of the total number of markers to the total number of sampling points, the method further includes: If the ratio is less than the danger ratio, then the feature data of each of the sampling points within the set number of the period are input into the arc determination model to determine the second arc label; If the second arc tag is yes, a suspected arc warning is issued; Obtain the user's arc confirmation result; If the arc confirmation result is a false alarm, the feature data is added to the historical arc event feature data table, and the label of the corresponding sampling point in the historical arc event label table is updated. The updated historical arc event feature data table and the historical arc event label table are trained on a convolutional neural network to update the arc determination model.

8. A server, characterized in that, The server includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the server to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the server, the server causes the server to perform the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on the server, the server performs the method as described in any one of claims 1-7.