Meter box electricity larceny prevention detection method and system
By correcting the spatial coordinates and comparing the temporal grayscale of the metering box image, and combining it with the component layout benchmark, the problem of accuracy in identifying electricity theft in metering boxes under complex environments was solved, and efficient electricity theft monitoring and maintenance response were achieved.
Patent Information
- Application Number
- CN202610605992.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-06
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies struggle to accurately identify true structural damage signals in metering boxes in complex outdoor environments, leading to frequent false and missed detections of electricity theft, which affects the reliability of electricity theft monitoring and the efficiency of operation and maintenance.
By generating image analysis instructions, images of the metering box at different times are obtained. Spatial coordinate correction is performed based on the fixed structure reference of the box. The temporal grayscale trajectory is extracted and compared with the normal distribution of background grayscale. The position mapping comparison is performed in combination with the layout benchmark of the metering box components. Structural change data is generated and anomaly judgment is performed.
It achieves high signal-to-noise ratio extraction of candidate change regions for electricity theft behavior in complex outdoor environments, improving the accuracy of electricity theft identification. Furthermore, by combining component layout constraints with historical dynamic benchmarks, it avoids misjudgments due to environmental disturbances, ensuring the stability of meter box anti-theft monitoring and the efficiency of operation and maintenance response.
Smart Images

Figure CN122453780A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power equipment condition monitoring technology, and in particular to a method and system for detecting electricity theft from meter boxes. Background Technology
[0002] With the advancement of smart grid construction, the number of metering boxes in distribution substations is rapidly increasing, highlighting the growing demand for anti-theft monitoring in long-term outdoor operating environments. Image monitoring methods, with their advantages of being non-contact, visual, and traceable, are widely used in the field of metering box status sensing. Conventional image monitoring methods typically employ a differential comparison strategy, comparing pixel-level values of metering box images collected at different times and determining the presence of structural damage based on the magnitude of the difference.
[0003] Conventional differential comparison strategies treat pixel differences in images at different times as equally valid, failing to incorporate the inherent physical topological constraints of the metering box or establish a mechanism to distinguish between environmental interference and actual deformation. In long-term outdoor operating environments, factors such as changes in illumination cycles, sensor response drift, lens contamination, and minor movements of the camera bracket can cause random pixel fluctuations at any location in the image. These fluctuations exhibit a non-uniform spatial distribution and a temporal characteristic of intertwined sporadic and continuous events. When electricity theft is only carried out on localized areas such as seals, hinges, and terminal covers, the resulting pixel changes are limited in scope and amplitude, making them difficult to effectively distinguish from large-area environmental disturbances using a single differential truncation at the numerical level.
[0004] Therefore, existing technologies have the problem of difficulty in accurately identifying real structural damage signals from complex environmental interference, resulting in both false detections and missed detections in electricity theft detection, which affects the reliability of electricity theft prevention monitoring and the efficiency of operation and maintenance. Summary of the Invention
[0005] In view of the aforementioned problems, this application is hereby filed.
[0006] Therefore, this application provides a method and system for detecting electricity theft in metering boxes, which can solve the problems mentioned in the background art.
[0007] To solve the above-mentioned technical problems, this application provides the following technical solution: Firstly, this application provides a method for detecting electricity theft in a metering box, including: Based on the metering box operation monitoring request, an image analysis command is generated and sent to the image processing terminal to obtain metering box images at different times provided by the image processing terminal. Based on the fixed structure of the box, spatial coordinate correction is performed on the metering box images at different times to obtain aligned image data. Based on the aligned image data, perform temporal grayscale trajectory extraction, compare the temporal grayscale trajectory with the normal grayscale distribution of the background, extract pixels with non-overlapping fluctuation patterns and aggregate them into a set of difference pixels to obtain candidate change data; The candidate change data is compared with the layout reference of the metering box components by position mapping, and a set of pixel regions that conform to the spatial connection relationship is extracted to obtain structural change data. The structural change data is then sent to the monitoring and judgment terminal. Receive the anomaly determination result generated by the monitoring and determination terminal based on the structural change data.
[0008] Preferably, the spatial coordinate correction of the metering box images at different times based on the box's fixed structure reference is performed to obtain aligned image data, including: Retrieve the reference outline of the metering box and extract the coordinate set of the corner points in the reference outline of the metering box; Identify the set of structural corner points in the metering box images at different times, and calculate the position transformation parameters between the set of structural corner points and the set of corner point coordinates; Based on the position transformation parameters, coordinate translation and rotation operations are performed on the metering box images at different times to obtain spatially aligned images; Extract local rectangular regions from the spatially aligned image, calculate the average gray value of each local rectangular region, and adjust each average gray value to the standard gray range to obtain the aligned image data.
[0009] Preferably, the step of comparing the temporal grayscale trajectory with the normal grayscale distribution of the background, extracting pixels with non-overlapping fluctuation patterns and aggregating them into a set of difference pixels to obtain candidate change data includes: The aligned image data are stacked in chronological order of acquisition time, and the grayscale value sequence of the same pixel position at different times is extracted. Based on the grayscale value sequence, frequency statistics are performed, and the grayscale interval with the highest frequency of occurrence is extracted as the normal distribution of background grayscale. The grayscale value sequence is compared with the normal grayscale distribution of the background to extract abnormal grayscale trajectories whose shapes do not overlap. Based on the abnormal grayscale trajectory, adjacent pixels are connected and labeled to generate the candidate change data containing independently changing regions.
[0010] Preferably, the step of comparing the temporal grayscale trajectory with the normal grayscale distribution of the background, extracting pixels with non-overlapping fluctuation patterns and aggregating them into a set of difference pixels to obtain candidate change data further includes: Extract pixel grayscale transition points from the aligned image data and combine them to form edge detail difference data; Based on the edge detail difference data, isolated point statistics are performed to generate the device noise distribution range; The edge detail difference data is compared with the device noise distribution range by contour comparison, and the noise contour data that overlaps are removed, while the residual contour data that does not overlap are retained. Based on the residual contour data, positional deviation statistics are performed to generate a positional deviation distribution map, and the positional deviation distribution map is converted into the candidate change data.
[0011] Preferably, after performing adjacent pixel connectivity marking on the abnormal grayscale trajectory to generate the candidate change data containing independently changing regions, the method further includes: Extract the boundary coordinates of each independent change region from the candidate change data; Calculate the spatial interval between each independent changing region based on the boundary coordinates, and generate an adjacency list; The independent change regions are merged according to the adjacency list, and the spatially adjacent independent change regions are integrated into a set of merged change regions; Extract the center coordinates and the number of pixels covered by the fused change region set, and update the fused change region set with the candidate change data.
[0012] Preferably, the step of comparing the candidate change data with the layout reference of the metering box components through position mapping, and extracting a set of pixel regions that conform to the spatial connection relationship to obtain structural change data includes: Retrieve the layout specifications for the metering box components and extract the relative positional relationships of the standard components recorded in the layout specifications for the metering box components. Extract the center coordinates of each independent change region from the candidate change data, compare the center coordinates with the relative position of the standard component, and generate a position matching sequence. The positional matching degree sequence is sorted in descending order of numerical value. The target region set corresponding to the target positional matching degree sequence with the highest sorted position is extracted, and the target region set is marked as the structural change data.
[0013] Preferably, the step of comparing the candidate change data with the layout reference of the metering box components to extract a set of pixel regions that conform to the spatial connection relationship to obtain structural change data further includes: Extract the outer contour lines of each independent change region from the candidate change data, and call the standard component shape library of the metering box; The outer contour line is overlapped and compared with the standard contour line in the standard component shape library of the metering box, and the area ratio of the overlapping area is calculated. Establish a table showing the correspondence between the area ratio of overlapping regions and the structural credibility level; Based on the correspondence table, the independent change regions are converted into labeled regions carrying structural confidence levels, and the structural change data is output.
[0014] Preferably, receiving the anomaly determination result generated by the monitoring and determination terminal based on the structural change data includes: Extract the marked regions from the structural change data and count the total number of pixels covered by the marked regions; Retrieve the historical operating status file of the metering box and extract the range of the number of reference coverage pixels under the standard operating conditions recorded in the historical operating status file of the metering box. The total number of covered pixels is compared with the range of the reference number of covered pixels to extract abnormal coverage data that deviates from the reference range. The abnormal overlay data is bound to the current time timestamp to generate the abnormal determination result.
[0015] Preferably, after generating the anomaly determination result, the method further includes: Analyze the spatial coordinates in the anomaly determination result and retrieve the meter box component coding index table; The spatial location coordinates are compared with the meter box component code index table to determine the target component code; The target component code is combined with the abnormal coverage data to generate a structured alarm message; The structured alarm message is pushed to the operation and maintenance management terminal to obtain the abnormal status reporting record.
[0016] Secondly, this application also provides a meter box anti-theft detection system, including: The coordinate correction module generates an image analysis command based on the metering box operation monitoring request and sends it to the image processing terminal. It obtains metering box images at different times provided by the image processing terminal, and performs spatial coordinate correction on the metering box images at different times based on the fixed structure reference of the box to obtain aligned image data. The difference extraction module performs temporal grayscale trajectory extraction based on the aligned image data, compares the temporal grayscale trajectory with the normal grayscale distribution of the background, extracts pixels with non-overlapping fluctuation patterns and aggregates them into a set of difference pixels to obtain candidate change data. The mapping and comparison module performs position mapping and comparison between the candidate change data and the layout benchmark of the metering box components, extracts the set of pixel regions that conform to the spatial connection relationship, obtains the structural change data, and sends the structural change data to the monitoring and judgment terminal. The anomaly determination module receives the anomaly determination result generated by the monitoring and determination terminal based on the structural change data.
[0017] Thirdly, a storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program is used to implement the first aspect of the present invention and various methods that may be involved in the first aspect.
[0018] Implementing this application will have the following beneficial effects: 1. This application extracts corner coordinate sets from the baseline contour map of the metering box to perform spatial coordinate correction, and calculates the average gray value of the local rectangular area to map to the standard gray range. Considering both geometric offset compensation and local photometric equalization, aligned image data is constructed. The aligned images are layered according to a time sequence to extract gray value sequences. Based on the shape comparison between the sequence shape and the normal gray value distribution of the background, continuous deformation trajectories are extracted. Discrete pixel clusters are integrated into independent change regions through adjacent pixel connectivity marking and spatial interval fusion processing. Through joint spatiotemporal dimension correction and morphological continuity filtering, instantaneous illumination abrupt changes and inherent sensor noise are effectively removed. This solves the problem of pixel difference results exhibiting multiple solutions and uncertainty due to the submergence of real minute structural changes by non-uniform environmental noise, achieving stable extraction of high signal-to-noise ratio candidate change regions and improving the accuracy of preliminary identification of electricity theft in complex outdoor environments.
[0019] 2. This application extracts the relative positional relationships of standard components from the metering box component layout specifications for position comparison, and calculates the overlap area ratio of the outer contour lines by calling the standard component shape library. Considering both physical topological constraints and geometric conformity, a structural reliability level correspondence is established. The total number of pixels covered by the marked area carrying the reliability level is compared numerically with the range of baseline covered pixels in the metering box's historical operating status archive. The abnormal coverage level is determined based on the magnitude of the deviation from the range, and a structured alarm message is generated by binding a timestamp. Through the joint determination of component layout constraints and historical dynamic benchmarks, the defect of randomly interfering pixels being misjudged as structural damage under the fixed difference truncation strategy is avoided. This solves the problem of easy missed detection of local minor deformations and easy false detection of large-area environmental disturbances, achieving graded anomaly determination and accurate component positioning, ensuring the stability and maintenance response efficiency of the metering box anti-theft monitoring in long-term outdoor operating environments. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is an overall flowchart of the anti-theft detection method for metering boxes involved in this application; Figure 2 This is an application environment diagram of the meter box anti-theft electricity detection method involved in this application; Figure 3 This is a schematic diagram of the overall structure of the meter box anti-theft electricity detection system involved in this application; Figure 4 This is a diagram of the computer equipment used in the metering box anti-theft electricity detection method involved in this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0023] In one exemplary embodiment, such as Figure 1 As shown, a method for detecting electricity theft in a metering box is provided, including: S1: Based on the metering box operation monitoring request, generate image analysis instructions and send them to the image processing terminal to obtain metering box images at different times provided by the image processing terminal. Based on the fixed structure reference of the box, perform spatial coordinate correction on the metering box images at different times to obtain aligned image data. S1. Based on the metering box operation monitoring request, generate an image analysis command and send it to the image processing terminal to obtain metering box images at different times provided by the image processing terminal. Based on the fixed structure of the box, perform spatial coordinate correction on the metering box images at different times to obtain aligned image data.
[0024] In some embodiments, step S1 (performing spatial coordinate correction on metering box images at different times based on the box fixing structure reference to obtain aligned image data) includes S11 to S14: S11, retrieve the reference outline of the metering box and extract the coordinate set of the corner points in the reference outline of the metering box.
[0025] It should be noted that the metrology box baseline profile represents the complete geometric shape of the metrology box in its standard factory installation state. The corner coordinate set records the precise two-dimensional coordinates of the box's edge transitions. In long-term outdoor operating environments, the camera bracket may experience micron-level displacement due to wind or thermal expansion and contraction, causing pixel shifts in images of the same physical location at different times. Extracting the corner coordinate set allows the establishment of a geometric reference benchmark unaffected by environmental interference, providing fixed spatial anchor points for coordinate correction.
[0026] S12, identify the set of structural corner points in the metering box images at different times, and calculate the position transformation parameters between the set of structural corner points and the set of corner point coordinates.
[0027] It should be noted that the projection of the metering box outline onto the image plane will tilt due to minor adjustments in the shooting angle at different times. The structural corner point set is identified from the current image using an edge extraction algorithm, reflecting the actual imaging position at the current moment. The position transformation parameters are composed of the lateral offset distance, longitudinal offset distance, and rotation angle difference between the structural corner point set and the corner point coordinate set. The parameter calculation process is entirely derived based on the matching relationship of the internal geometric features of the image, avoiding correction interruptions caused by external sensor failures.
[0028] S13, based on the position transformation parameters, perform coordinate translation and rotation operations on the metering box images at different times to obtain spatially aligned images.
[0029] It's easy to understand that the position transformation parameters directly guide the pixel matrix rearrangement process. Coordinate translation shifts the image pixel grid by corresponding offset distances along the horizontal and vertical axes, while rotation resamples pixels around the image center point according to the rotation angle difference. Spatial image alignment eliminates geometric misalignment caused by slight viewpoint shifts, enabling physical overlap of metering box images acquired at different times at the pixel grid level. This processing method solves the problem of insufficient alignment accuracy caused by traditional methods relying solely on manual alignment, providing a strict spatial consistency prerequisite for pixel-level comparison.
[0030] S14, extract local rectangular regions from the spatially aligned image, calculate the average gray value of each local rectangular region, adjust each average gray value to the standard gray range, and obtain the aligned image data.
[0031] Furthermore, the local rectangular regions cover the spatially aligned image according to a fixed grid division rule. The sum of pixel gray levels within the local rectangular regions is calculated, and the sum of pixel gray levels is numerically divided equally based on the total number of pixels contained in the local rectangular regions to obtain the average gray level of each local rectangular region.
[0032] Furthermore, the lower and upper limits of the standard grayscale range are determined based on the reflectance range of the metering box's metal casing under standard meteorological conditions. Those skilled in the art can select the range based on the average annual solar radiation intensity of the actual installation location. The process of adjusting each average grayscale value to the standard grayscale range constructs a complete grayscale mapping branch: When the average gray value is less than the lower limit of the standard gray range, and the difference between the average gray value and the lower limit is in the first deviation range, the average gray value is determined to be in a slightly dark area offset region. Dark area gradient compensation operation is performed, and a compensation gain curve is generated based on the difference range. The average gray value is then mapped to the reference range along the compensation gain curve. When the average gray value is less than the lower limit of the standard gray range and the difference is in the second deviation range, the average gray value is determined to be in a severely dark area offset region. The dark area reference locking operation is performed, the average gray value is directly replaced with the lower limit of the standard gray range, and it is marked as an environmental noise interference point. When the average gray value is equal to the lower limit of the standard gray range, it is determined that the average gray value is in the critical state of the dark area, and the boundary steady state preservation operation is performed to directly output the original average gray value. When the average gray value is between the lower limit and the upper limit of the standard gray value range, it is determined that the average gray value belongs to the reference lighting area, and gray value steady state preservation operation is performed to directly output the original average gray value. When the average gray value is equal to the upper limit of the standard gray value range, it is determined that the average gray value is in the critical state of the bright area, and the boundary steady state preservation operation is performed to directly output the original average gray value. When the average gray value is greater than the upper limit of the standard gray value range, and the difference between the average gray value and the upper limit value is in the first deviation range, the average gray value is determined to be in the slightly bright area offset area. A bright area gradient attenuation operation is performed, and an attenuation suppression curve is generated based on the difference range. The average gray value is then mapped to the reference range along the attenuation suppression curve. When the average gray value is greater than the upper limit of the standard gray range and the difference is in the second deviation range, the average gray value is determined to be in a severely bright area offset region. A bright area reference locking operation is performed, the average gray value is directly replaced with the upper limit of the standard gray range, and it is marked as an environmental noise interference point.
[0033] It should be noted that the boundary values between the first and second deviation intervals are determined based on the reflection threshold of the metering box surface material to sudden light changes. Those skilled in the art can perform the actual division based on the dynamic range of the camera's sensor. The dark area gradient compensation operation and the bright area gradient attenuation operation employ nonlinear mapping functions. The curvature of the mapping function is set according to the difference magnitude; the larger the difference magnitude, the smoother the curvature change, thus preserving the subtle structural edge gradients caused by electricity theft. The dark area reference locking operation and the bright area reference locking operation directly truncate extreme offset values to prevent artifacts from occurring in the differential calculation due to local strong light or deep shadows. The boundary steady-state preservation operation and the grayscale steady-state preservation operation maintain the original numerical output, avoiding the participation of normal pixels within the reference interval in redundant mapping calculations.
[0034] It's easy to understand that in long-term outdoor operating environments, cloud movement and lens contamination can cause non-uniformly distributed illumination shifts in space. Traditional global linear stretching amplifies both the pixel differences corresponding to actual structural changes and large-area illumination drift, leading to multiple solutions in the difference results. This solution divides environmental disturbances into a baseline interval, a first deviation interval, and a second deviation interval, processing them according to their degree of deviation. Mildly shifted regions retain gradient change characteristics, ensuring that edge information corresponding to actual structural changes is not smoothed out; severely shifted regions implement baseline locking and mark interference points, directly eliminating the participation of extreme environmental noise. Aligning image data eliminates non-uniform illumination shifts while fully preserving the structural consistency differences of key parts of the metering box, providing a high signal-to-noise ratio pixel baseline for extracting candidate change data, fundamentally solving the technical problem of minute structural changes being submerged by environmental noise.
[0035] S2: Perform temporal grayscale trajectory extraction based on the aligned image data, compare the temporal grayscale trajectory with the normal grayscale distribution of the background, extract pixels with non-overlapping fluctuation patterns and aggregate them into a set of difference pixels to obtain candidate change data; S2, perform temporal grayscale trajectory extraction based on the aligned image data, compare the temporal grayscale trajectory with the normal grayscale distribution of the background, extract pixels with non-overlapping fluctuation patterns and aggregate them into a set of difference pixels to obtain candidate change data.
[0036] In some embodiments, step S2 (performing temporal grayscale trajectory extraction based on aligned image data, comparing the temporal grayscale trajectory with the background grayscale normal distribution, extracting pixels with non-overlapping fluctuation patterns and converging them into a set of difference pixels to obtain candidate change data) includes S21 to S24: S21, the aligned image data are stacked in chronological order of acquisition time, and the grayscale value sequence of the same pixel position at different times is extracted.
[0037] It should be noted that a single static image can only reflect the instantaneous pixel state and cannot distinguish between sudden changes in illumination and physical structural damage. By cascading aligned image data along the time axis, pixel values at the same spatial coordinates form a continuous trajectory of change over time. This processing method transforms two-dimensional spatial pixel differences into a three-dimensional spatiotemporal data stream, providing a data foundation for subsequently distinguishing between transient environmental disturbances and persistent structural deformations. The cascading process strictly follows the timestamps output by the image acquisition device to ensure that the continuity of the time axis is not affected by network transmission delays.
[0038] S22, perform frequency statistics based on the grayscale value sequence, and extract the grayscale interval with the highest frequency as the background grayscale normal distribution.
[0039] It should be noted that the outdoor metering box is located in a fixed position for extended periods, and the reflectivity of the box surface material remains stable. Within the continuous data acquisition window, pixel values affected by cloud cover or lens dust will only fluctuate briefly at specific moments, while pixel values reflecting the true state of the box will remain stable most of the time. Frequency statistics are performed on the grayscale value sequence to automatically filter out occasional lighting interference. The grayscale interval with the highest frequency is extracted as the background grayscale normal distribution, ensuring that the reference value originates from the most stable physical state over time, avoiding misjudging transient shadows or reflections as the background reference. The statistical window length for frequency statistics is determined based on the typical weather change cycle of the metering box's environment; those skilled in the art can select the appropriate window based on local meteorological data.
[0040] S23, compare the shape of the grayscale numerical sequence with the normal grayscale distribution of the background, and extract the abnormal grayscale trajectories whose shapes do not overlap.
[0041] It's easy to understand that shape comparison focuses on the morphological characteristics of the temporal fluctuation curve, rather than the absolute grayscale difference at a single moment. The comparison process constructs a complete morphological determination branch: When the fluctuation curve of the grayscale value sequence completely coincides with the baseline curve of the normal distribution of grayscale in the background on the time axis, the grayscale value sequence is determined to belong to a stable background trajectory, and data removal operation is performed. When the fluctuation curve of the grayscale value sequence deviates from the baseline curve of the normal distribution of background grayscale in a local period, and the duration of the deviation does not reach the duration limit, the grayscale value sequence is determined to be an instantaneous interference trajectory. Data smoothing and filtering operation is performed to replace the values of the deviation period with adjacent stable values and then reincorporate them into the baseline curve. When the fluctuation curve of the grayscale value sequence deviates from the baseline curve of the normal distribution of grayscale in a local period and the duration of the deviation reaches the duration limit, the grayscale value sequence is determined to be a continuous deformation trajectory. An abnormal feature extraction operation is performed, and the pixel coordinates and offset amplitude of the deviation period are recorded as abnormal grayscale trajectories with non-overlapping shapes.
[0042] The duration limit is determined based on the physical operation time required to carry out the electricity theft, and those skilled in the art can select it according to the enclosure protection level and the time required for typical destructive actions. Through morphological comparison, transient disturbances such as brief light flickering and lens dust obstruction are clearly distinguished from the continuous structural displacement caused by electricity theft. Abnormal grayscale trajectories with non-overlapping shapes retain only pixel changes with temporal continuity, fundamentally cutting off the interference path of environmental noise in the temporal dimension and solving the problem of multiple solutions that traditional difference methods cannot distinguish between transient disturbances and true deformation.
[0043] S24, based on the abnormal grayscale trajectory, adjacent pixels are connected and labeled to generate candidate change data containing independent change regions.
[0044] Specifically, connectivity marking employs a four-directional scanning rule. Starting from the first pixel coordinate in the abnormal grayscale trajectory, the scan extends in four adjacent directions: up, down, left, and right. When pixel coordinates belonging to the same abnormal grayscale trajectory exist in adjacent directions, these adjacent pixel coordinates are included in the same connectivity group. When no abnormal pixel coordinates exist in adjacent directions or the scan path encounters background pixel coordinates, the current branch scan terminates. The total number of pixel coordinates within each connectivity group is counted, and groups whose total number of pixel coordinates reaches the connectivity threshold are marked as independent change regions. The coordinate sets of all independent change regions together constitute candidate change data. The connectivity threshold is determined based on the ratio between image resolution and the typical damage size of the metrology box; those skilled in the art can select it according to actual detection accuracy requirements.
[0045] Furthermore, after step S24 (which involves marking adjacent pixels for connectivity based on the abnormal grayscale trajectory to generate candidate change data containing independently changing regions), steps S241 to S244 are also included: S241, extract the boundary coordinates of each independent change region in the candidate change data.
[0046] It should be noted that boundary coordinates record the precise spatial extent of independently varying regions on the image plane. The extraction process traverses all pixel coordinates within the independently varying regions, selecting the coordinates of points immediately adjacent to background pixels in the four directions (up, down, left, and right). The generation of boundary coordinates transforms the discrete set of pixels into a closed contour with well-defined geometric boundaries, providing a precise measurement benchmark for subsequent spatial interval calculations.
[0047] S242, calculate the spatial interval between each independent changing region based on the boundary coordinates, and generate an adjacency list.
[0048] It should be noted that image sensor noise or localized uneven illumination can break down originally continuous, minute structural deformations into multiple discrete pixel clusters. Spatial interval calculation is obtained by measuring the minimum Euclidean distance between the boundary pixels of adjacent independent variation regions. The calculation process constructs a complete interval determination branch: When the spatial interval is less than the interval determination threshold, the adjacent independent change regions are determined to belong to the fracture structure block, and the connectivity identifier is recorded in the adjacency list. When the spatial interval equals the interval determination threshold, the gradient direction consistency parameter at the fracture boundary is extracted. When the gradient direction consistency parameter is higher than the direction matching limit, the connectivity identifier is recorded in the adjacency list. When the gradient direction consistency parameter is lower than the direction matching limit, the isolation identifier is recorded in the adjacency list. When the spatial interval is greater than the interval determination threshold, the adjacent independent change areas are determined to be independent physical components, and the isolation identifier is recorded in the adjacency list.
[0049] The interval determination threshold is based on the assembly tolerance of the metering box components and the image sampling density, and those skilled in the art can select it according to the actual installation process precision. The directional alignment limit is determined based on the maximum allowable deflection angle of the structural edge in the normal direction. The adjacency list fully records the spatial association status between each independent change area, providing clear data guidance for subsequent fragment block fusion.
[0050] S243, Merge independent change regions according to the adjacency list, and integrate spatially adjacent independent change regions into a set of merged change regions.
[0051] It should be noted that electricity theft typically manifests as cutting off seals, prying open cabinet doors, or shifting terminal covers. These operations create continuous but minute contour shifts in the image. Fixed threshold differentials will cut the continuous contour into isolated pixels, leading to multiple solutions and uncertainty. By using an adjacency list to guide the boundary stitching of regions with spatial intervals below the judgment threshold, the continuity of the physical contour interrupted by noise is restored.
[0052] S244, extract the center coordinates and the number of pixels covered by the fused change region set, and update the fused change region set with candidate change data.
[0053] It is easy to understand that the generation of the fused change region set allows discrete pixel clusters to re-aggregate into structural blocks with well-defined geometric shapes. The center coordinates and the number of covered pixels provide accurate spatial anchors and quantization benchmarks for subsequent structural consistency determination. The updated candidate change data directly eliminates isolated noise points, ensuring that the dataset input to subsequent steps contains only potential deformation regions with physical continuity.
[0054] In some other embodiments, step S2 (performing temporal grayscale trajectory extraction based on aligned image data, comparing the temporal grayscale trajectory with the background grayscale normal distribution, extracting pixels with non-overlapping fluctuation patterns and converging them into a set of difference pixels to obtain candidate change data) further includes A1 to A4: A1 extracts pixel grayscale transition points from the aligned image data and combines them into edge detail difference data.
[0055] It should be noted that pixel grayscale jump points represent the boundary locations where the grayscale values of adjacent pixels in an image undergo abrupt changes. The extraction process involves scanning and aligning image data along both the horizontal and vertical directions, recording the coordinate positions where the grayscale difference between adjacent pixels exceeds a baseline change. This baseline change is determined based on the background noise level of the image sensor under standard lighting conditions, and can be selected by those skilled in the art based on actual device parameters. All recorded jump coordinate positions are spatially projected and combined to generate edge detail difference data. This edge detail difference data focuses on the geometric contours of the metering box structure's edges, avoiding interference from large areas of uniform illumination in the difference calculation, and providing high-contrast feature input for subsequent noise filtering.
[0056] A2, based on the edge detail difference data, performs isolated point statistics to generate the device noise distribution range.
[0057] It should be noted that imaging sensors generate fixed-pattern noise and shot noise in low-light or high-gain modes. This type of noise manifests as isolated short lines or random spots in edge detection, lacking continuous spatial extension features. Isolated point statistics traverse all connected blocks in the edge detail difference data, calculating the pixel count and perimeter of each connected block. When the pixel count of a connected block is lower than the isolated number benchmark and the perimeter does not reach the length limit, the connected block is determined to be inherent device noise, and its spatial coordinates are included in the device noise distribution range. The isolated number benchmark and length limit are determined based on the typical noise size of the sensor model, and those skilled in the art can select them according to the actual imaging quality. The device noise distribution range completely covers the sensor interference area present in the image at the current moment, providing an accurate noise mask for subsequent contour comparison and preventing subsequent steps from misjudging sensor hardware defects as external structural damage.
[0058] A3 compares the edge detail difference data with the device noise distribution range to remove overlapping noise contour data and retain the non-overlapping residual contour data.
[0059] Contour comparison constructs a complete overlap determination branch: When the contour of the edge detail difference data completely coincides with the standard noise contour of the device noise distribution range, the edge detail difference data is determined to be inherent noise of the sensor and a full removal operation is performed. When the contour shape of the edge detail difference data coincides with the standard noise contour part of the device noise distribution range, the pixel coordinates of the overlapping part and the non-overlapping part are extracted. The pixel coordinates of the overlapping part are subjected to noise filtering operation, and the pixel coordinates of the non-overlapping part are retained as structural edge features. The two parts are combined to generate residual contour data. When the contour shape of the edge detail difference data does not coincide with the standard noise contour of the device noise distribution range, the edge detail difference data is determined to belong to the real physical boundary, and a full retention operation is performed to directly output it as residual contour data.
[0060] The profile comparison branch ensures that sensor noise is accurately stripped away while avoiding the accidental deletion of the true structural edges of the metering chamber. The residual profile data retains only deformation boundaries with clear physical orientation, providing high-purity input for subsequent positional deviation statistics.
[0061] A4. Based on the residual contour data, perform positional deviation statistics to generate a positional deviation distribution map, and then convert the positional deviation distribution map into candidate change data.
[0062] It's easy to understand that the residual contour data records the edge positions of key parts of the metering box at the current moment. Position deviation statistics compare the residual contour data point-by-point with historical baseline edge coordinates, calculating the displacement amplitude of each edge point in the normal direction. The displacement amplitude values are mapped to the corresponding pixel positions in a two-dimensional image coordinate system, generating a position deviation distribution map. The position deviation distribution map visually represents the degree of deformation in each structural region using grayscale levels; the greater the deformation amplitude, the higher the grayscale value of the corresponding region in the distribution map. The position deviation distribution map is directly converted into candidate change data, allowing subsequent structural consistency judgment to directly read deformation amplitude and spatial location information. This processing method transforms discrete pixel jump points into a continuous spatial deformation field, effectively solving the technical problem of minute structural changes being submerged by environmental noise under complex lighting conditions, providing a stable and reliable quantitative basis for anomaly detection.
[0063] S3. The candidate change data is compared with the layout benchmark of the metering box components by position mapping, and the set of pixel regions that conform to the spatial connection relationship is extracted to obtain the structural change data. The structural change data is then sent to the monitoring and judgment terminal.
[0064] In some embodiments, step S3 is implemented using a location mapping comparison path, including S31 to S33: S31, retrieve the layout specification of the metering box components, and extract the relative positional relationships of the standard components recorded in the layout specification of the metering box components.
[0065] It should be noted that the internal structure of the metrology box has a fixed geometric topology during factory assembly. The relative distances between the seal mounting position, the door hinge base, the edge of the terminal block cover, and the frame of the transparent observation window remain constant in physical space. During long-term outdoor operation, dust obstruction or lens smudges may cause random pixel differences at any location in the image. Referencing the metrology box component layout specifications introduces prior physical constraints. The relative positions of standard components provide a coordinate offset benchmark for each key component under standard installation conditions, providing a reference for subsequently eliminating physically meaningless random noise areas and avoiding misjudging discrete pixel differences caused by environmental disturbances as structural damage.
[0066] S32, extract the center position coordinates of each independent change region in the candidate change data, compare the center position coordinates with the relative position of the standard component, and generate a position matching degree sequence.
[0067] It should be noted that the center position coordinates represent the geometric centroid of the independently changing region on the image plane. Position comparison is performed by calculating the Euclidean distance deviation between the center position coordinates and the corresponding reference coordinates of the standard component in their relative positional relationship. The position comparison process constructs a complete deviation determination branch: When the Euclidean distance deviation is less than the position tolerance limit, the center position coordinates are determined to belong to the high matching region, and the highest matching value is recorded in the position matching degree sequence. When the Euclidean distance deviation is equal to the position tolerance limit, the edge expansion radius of the independent variation area is extracted. When the edge expansion radius covers the reference coordinates of the corresponding component, a medium matching value is recorded in the position matching degree sequence. When the edge expansion radius does not cover the reference coordinates of the corresponding component, a low matching value is recorded in the position matching degree sequence. When the Euclidean distance deviation is greater than the position tolerance limit, the center position coordinates are determined to belong to the low matching region, and the lowest matching value is recorded in the position matching degree sequence.
[0068] The permissible position limits are determined based on the manufacturing and assembly tolerances of the metrology box and the image pixel sampling accuracy. Those skilled in the art can select the appropriate limits according to the actual device resolution. This branch determines the entire range of distance deviation values, ensuring that all areas with varying degrees of offset receive corresponding quantitative evaluation, thus avoiding the accidental deletion of effective deformation areas due to a single truncation operation.
[0069] S33, sort the positional fit sequence in descending order of numerical value, extract the target region set corresponding to the target positional fit sequence with the highest sorted position, and mark the target region set as structural change data.
[0070] It's easy to understand that descending order prioritizes preserving independent regions of variation corresponding to high-matching values. The process of extracting the target position match sequence with the highest ranking constructs a complete extraction decision branch: When the number of records in the positional matching sequence is greater than or equal to the set retention number, the independent change regions corresponding to the set retention number values with the highest sorting position are extracted to form the target region set. When the number of records in the location matching sequence is less than the set retention number and the number of records is greater than zero, extract the independent variation regions corresponding to all record values to form a target region set; When the number of records in the positional matching sequence is zero, it is determined that there are no pixel regions that meet the spatial connection relationship at the current time, and an empty set is generated as the target region set.
[0071] The number of retained components is determined based on the number of key monitoring parts of the metering box, allowing those skilled in the art to select them according to actual inspection priorities. By sorting and extracting branches, regions conforming to the inherent physical topology of the metering box are filtered out from the candidate change data. Electricity theft is typically targeted at specific components, and the resulting pixel changes inevitably fall near the relative positions of standard components. This processing method effectively filters randomly distributed environmental noise and illumination artifacts in the background, resolving the issues of multiple solutions and uncertainty in pixel-level difference results, and providing the monitoring and judgment end with structural change data with clear physical orientation.
[0072] S4 receives the anomaly determination result generated by the monitoring and determination end based on the structural change data.
[0073] In some embodiments, step S4 (receiving the anomaly determination result generated by the monitoring and determination end based on structural change data) includes S41 to S44: S41, extract the marked regions from the structural change data and count the total number of pixels covered by the marked regions.
[0074] It should be noted that the marked area carries a structural reliability level identifier, representing potential deformation blocks after screening through location mapping comparison or shape contour comparison. Statistically counting the total number of pixels covered by the marked area quantifies the spatial impact range of structural changes in the metering box at the current moment. Seal cutting, door prying, or terminal cover displacement caused by electricity theft will form continuous pixel clusters on the image; the total number of pixels covered directly reflects the physical scale of such destructive behavior. This statistical process traverses all pixel coordinates within the marked area, accumulating the effective pixel count, avoiding the inclusion of isolated noise points or discontinuous edges in the calculation, ensuring that the quantification result only represents structural deformations with physical continuity.
[0075] S42, retrieve the historical operating status file of the metering box, and extract the range of the number of reference coverage pixels under the standard operating status recorded in the historical operating status file of the metering box.
[0076] It should be noted that the historical operating status archive of the metering box is obtained based on the accumulation of detection records of similar boxes during periods without abnormal events. The range of the number of reference coverage pixels under standard operating conditions is extracted from the distribution interval of statistical values for each time period in the historical archive. The extraction process constructs a complete range determination branch: When the number of records in the historical running status archive is greater than or equal to the minimum sample size, calculate the arithmetic mean and standard deviation of all record values. Subtract twice the standard deviation from the arithmetic mean to obtain the lower limit of the baseline coverage pixel range, and add twice the standard deviation to the arithmetic mean to obtain the upper limit of the baseline coverage pixel range. When the number of records in the historical running status archive is less than the minimum sample size but greater than zero, the minimum value among all recorded values is extracted as the lower limit of the baseline coverage pixel range, and the maximum value among all recorded values is extracted as the upper limit of the baseline coverage pixel range. When the number of records in the historical operation status archive is zero, the factory standard parameter table of the metering box is called, and the theoretical background pixel count recorded in the standard parameter table is used as the lower and upper limits of the baseline coverage pixel count range.
[0077] The minimum sample size is determined based on the minimum data volume calculated from the statistical confidence interval, and those skilled in the art can select it according to the actual sample accumulation rate in the actual testing scenario. This branch judgment fully covers all scenarios with sufficient, insufficient, and missing historical data, ensuring that the benchmark range has reasonable reference value at different operational stages and avoiding the invalidation of the judgment benchmark due to sample scarcity.
[0078] S43, compare the total number of covered pixels with the range of reference covered pixels using numerical sequences, and extract abnormal coverage data that deviates from the reference range.
[0079] It's easy to understand that numerical sequence alignment focuses on the relative position of the current statistical value to the historical baseline interval, rather than the absolute value at a single moment. The alignment process constructs a complete deviation determination branch: When the total number of covered pixels is less than the lower limit of the baseline number of covered pixels, it is determined that the spatial influence range of the current structural change area is lower than the historical normal fluctuation level. A low coverage anomaly marking operation is performed, and the difference between the total number of covered pixels and the lower limit value is recorded as abnormal coverage data. When the total number of covered pixels is equal to the lower limit of the range of the baseline number of covered pixels, it is determined that the current structural change area is in a low coverage critical state, the boundary steady state recording operation is performed, and the total number of covered pixels is directly output as normal coverage data. When the total number of covered pixels is between the lower limit and the upper limit of the range of the base number of covered pixels, it is determined that the current structural change area belongs to the base fluctuation range, and the normal state maintenance operation is performed to generate an empty set as abnormal coverage data. When the total number of covered pixels is equal to the upper limit of the baseline number of covered pixels, the current structural change area is determined to be in a high coverage critical state. Boundary steady-state recording operation is performed, and the total number of covered pixels is directly output as normal coverage data. When the total number of covered pixels exceeds the upper limit of the baseline number of covered pixels, it is determined that the spatial influence range of the current structural change area exceeds the historical normal fluctuation level. A high coverage anomaly marking operation is performed, and the difference between the total number of covered pixels and the upper limit value is recorded as abnormal coverage data.
[0080] This branch determines the entire range of values for complete coverage numerical comparison. Low-coverage anomaly marking targets concealed electricity theft behaviors such as partially missing seals or minor pry marks; these behaviors cause fewer pixel changes but have a clear physical orientation. High-coverage anomaly marking targets significant damage behaviors such as wide-open cabinet doors or overall displacement of terminal covers; these behaviors cause a larger number of pixel changes with concentrated spatial distribution. By performing interval-based judgment, pure numerical differences are transformed into anomaly level identifiers with business meaning, solving the problem of the ambiguity of traditional fixed threshold strategies in distinguishing between minor deformations and environmental noise.
[0081] S44 binds the abnormal overlay data to the current time stamp field to generate an abnormal judgment result.
[0082] Specifically, the field binding operation combines the numerical content, spatial coordinates, and current timestamp of the abnormally covered data into a structured data record. The current timestamp is determined based on the standard time signal output by the image acquisition device, ensuring that the time reference is synchronized with the global clock of the metering box operation monitoring system. The generated anomaly determination result includes five core fields: anomaly type identifier, spatial location coordinates, number of covered pixels, deviation magnitude, and time of occurrence. This structured record provides complete data support for subsequent operation and maintenance alarms, manual review, and historical tracing, avoiding the information loss problem caused by traditional methods that only output Boolean alarm signals.
[0083] It should be noted that in long-term outdoor operating environments, sudden changes in lighting, lens contamination, or bird obstruction can cause random pixel differences at any location in the image. Traditional differential strategies treat such environmental disturbances the same as actual structural damage, leading to both false positives and false negatives. This solution establishes a dynamic benchmark range by retrieving historical operating status archives, placing the current statistical values within the historical distribution over time for relative evaluation. Only when the total number of covered pixels deviates from the historical normal fluctuation range is it determined to be abnormal coverage data. This processing method effectively filters out sporadic environmental interference, ensuring that the anomaly detection results only reflect real structural deformations with temporal and spatial continuity. The generation of anomaly detection results directly supports the development of differentiated processing procedures at the monitoring and judgment end. High-risk anomalies trigger immediate alarms, while low-risk anomalies are included in the observation queue, fundamentally improving the identification accuracy and operational stability of anti-theft detection in complex outdoor environments.
[0084] In some other embodiments, step S4 (receiving the anomaly determination result generated by the monitoring and determination end based on the structural change data) further includes B1 to B3: B1, analyze the spatial location coordinates in the anomaly determination result and retrieve the meter box component code index table.
[0085] It should be noted that the spatial location coordinates record the precise geometric center of the abnormal coverage data on the image plane. The component coding index table of the metering box is retrieved to obtain the coordinate search range for key components such as seals, hinges, terminal covers, and observation windows. The component coding index table divides the spatial range according to component type and installation orientation, providing a mapping basis for subsequent precise location of the abnormality. This parsing process transforms abstract pixel coordinates into component identifiers with business meaning, avoiding the inefficiency of traditional methods that only output image coordinates, requiring maintenance personnel to manually compare with drawings.
[0086] B2. Perform a range search between the spatial location coordinates and the meter box component code index table to determine the target component code.
[0087] It should be noted that range retrieval is accomplished by determining whether the spatial coordinates fall within the coordinate retrieval range of a component in the component coding index table. The retrieval process constructs a complete matching decision branch: When the spatial location coordinates fall within the coordinate retrieval range of a single component, the abnormal coverage data is determined to belong to the deformation of an independent component, and the code identifier of that component is determined as the target component code. When the spatial location coordinates fall into the intersection of the coordinate retrieval intervals of multiple components, the structural credibility level of each candidate component is extracted, and the component code with the highest structural credibility level is determined as the target component code. When the spatial location coordinates do not fall within the coordinate retrieval range of any component, the abnormal coverage data is determined to be background area interference, and an unknown component code identifier is generated as the target component code.
[0088] This branch determines the complete coverage of all scenarios for coordinate matching. Deformation of individual components corresponds to targeted electricity theft such as seal cutting or door prying; deformation of multiple overlapping components corresponds to systemic anomalies such as overall enclosure displacement or camera shift; and background interference corresponds to environmental noise such as leaf projection or bird obstruction. Through hierarchical matching, spatial coordinates are transformed into component codes with clear maintenance indications, providing accurate input for subsequent differentiated handling.
[0089] B3 combines the target component code with the abnormal coverage data to generate a structured alarm message, and pushes the structured alarm message to the operation and maintenance management terminal to obtain the abnormal status reporting record.
[0090] It's easy to understand that structured alarm messages contain six core fields: target component code, anomaly type identifier, number of covered pixels, deviation magnitude, occurrence time, and spatial coordinates. The process of pushing the message to the operation and maintenance management terminal uses standard communication protocols to ensure that the alarm information is not tampered with or lost during transmission. Anomaly reporting records are stored in the metering box operation monitoring database, forming a traceable historical alarm archive. This processing method directly maps pixel-level differences to business-level alarms. After receiving the alarm message, operation and maintenance personnel can directly locate the abnormal component and formulate a handling plan, avoiding the inefficient process of manually comparing images and drawings required by traditional methods. This fundamentally improves the engineering implementation capability and operation and maintenance response efficiency of anti-theft electricity detection.
[0091] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0092] Based on the same inventive concept, this application also provides a meter box anti-theft electricity detection system. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more meter box anti-theft electricity detection system embodiments provided below can be found in the limitations of the meter box anti-theft electricity detection method above, and will not be repeated here.
[0093] In one exemplary embodiment, such as Figure 3 As shown, a metering box anti-theft detection system is provided, including: The coordinate correction module generates image analysis instructions based on the metering box operation monitoring request and sends them to the image processing terminal. It obtains metering box images at different times provided by the image processing terminal, performs spatial coordinate correction on the metering box images at different times based on the fixed structure reference of the box, and obtains aligned image data. The difference extraction module performs temporal grayscale trajectory extraction based on the aligned image data, compares the temporal grayscale trajectory with the normal grayscale distribution of the background, extracts pixels with non-overlapping fluctuation patterns and aggregates them into a set of difference pixels to obtain candidate change data. The mapping and comparison module compares the candidate change data with the layout benchmark of the metering box components, extracts the set of pixel regions that conform to the spatial connection relationship, and obtains the structural change data, which is then sent to the monitoring and judgment terminal. The anomaly detection module receives the anomaly detection results generated by the monitoring and detection end based on structural change data.
[0094] Reference Figure 2 The metering box anti-theft detection method provided in this application is applied to a distributed architecture including a terminal, server, and data storage system. The operation and maintenance management terminal, portable inspection equipment, and IoT gateway device serve as front-end acquisition and interaction nodes, establishing a data connection with the server via network communication. The IoT gateway device acquires monitoring images from the metering box at different times and transmits the image data to the image processing module on the server. The server performs spatial coordinate correction on the acquired images based on the fixed structure reference of the box to obtain aligned image data. Then, it generates candidate change data through temporal grayscale trajectory extraction and morphological comparison, and further combines this with the metering box component layout benchmark for position mapping comparison to obtain structural change data. The data storage system centrally stores the metering box benchmark outline diagram, component layout specifications, standard component shape library, historical operating status archives, and component coding index table, providing benchmark references and historical evidence for spatial correction, position comparison, and anomaly judgment. The server sends the structural change data to the monitoring and judgment terminal for anomaly judgment, and finally feeds back the anomaly judgment result to the operation and maintenance management terminal, forming a complete closed-loop monitoring process from image acquisition and data processing to anomaly alarm.
[0095] Each module in the aforementioned meter box anti-theft electricity detection system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0096] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for detecting electricity theft in the metering box. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0097] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0098] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0099] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0100] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0101] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0102] 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. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0103] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0104] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for detecting electricity theft in a metering box, characterized in that, include: Based on the metering box operation monitoring request, an image analysis command is generated and sent to the image processing terminal to obtain metering box images at different times provided by the image processing terminal. Based on the fixed structure of the box, spatial coordinate correction is performed on the metering box images at different times to obtain aligned image data. Based on the aligned image data, perform temporal grayscale trajectory extraction, compare the temporal grayscale trajectory with the normal grayscale distribution of the background, extract pixels with non-overlapping fluctuation patterns and aggregate them into a set of difference pixels to obtain candidate change data; The candidate change data is compared with the layout reference of the metering box components by position mapping, and a set of pixel regions that conform to the spatial connection relationship is extracted to obtain structural change data. The structural change data is then sent to the monitoring and judgment terminal. Receive the anomaly determination result generated by the monitoring and determination terminal based on the structural change data.
2. The method for detecting electricity theft from a metering box as described in claim 1, characterized in that, The spatial coordinate correction of the metering box images at different times, based on the fixed structure of the box, is performed to obtain aligned image data, including: Retrieve the reference outline of the metering box and extract the coordinate set of the corner points in the reference outline of the metering box; Identify the set of structural corner points in the metering box images at different times, and calculate the position transformation parameters between the set of structural corner points and the set of corner point coordinates; Based on the position transformation parameters, coordinate translation and rotation operations are performed on the metering box images at different times to obtain spatially aligned images; Extract local rectangular regions from the spatially aligned image, calculate the average gray value of each local rectangular region, and adjust each average gray value to the standard gray range to obtain the aligned image data.
3. The method for detecting electricity theft from a metering box as described in claim 1, characterized in that, The step involves comparing the temporal grayscale trajectory with the normal grayscale distribution of the background, extracting pixels with non-overlapping fluctuation patterns, and aggregating them into a set of difference pixels to obtain candidate change data, including: The aligned image data are stacked in chronological order of acquisition time, and the grayscale value sequence of the same pixel position at different times is extracted. Based on the grayscale value sequence, frequency statistics are performed, and the grayscale interval with the highest frequency of occurrence is extracted as the normal distribution of background grayscale. The grayscale value sequence is compared with the normal grayscale distribution of the background to extract abnormal grayscale trajectories whose shapes do not overlap. Based on the abnormal grayscale trajectory, adjacent pixels are connected and labeled to generate the candidate change data containing independently changing regions.
4. The method for detecting electricity theft from a metering box as described in claim 1, characterized in that, The step of comparing the temporal grayscale trajectory with the normal grayscale distribution of the background, extracting pixels with non-overlapping fluctuation patterns and aggregating them into a set of difference pixels to obtain candidate change data, further includes: Extract pixel grayscale transition points from the aligned image data and combine them to form edge detail difference data; Based on the edge detail difference data, isolated point statistics are performed to generate the device noise distribution range; The edge detail difference data is compared with the device noise distribution range by contour comparison, and the noise contour data that overlaps are removed, while the residual contour data that does not overlap are retained. Based on the residual contour data, positional deviation statistics are performed to generate a positional deviation distribution map, and the positional deviation distribution map is converted into the candidate change data.
5. The method for detecting electricity theft from a metering box as described in claim 3, characterized in that, After performing adjacent pixel connectivity marking on the abnormal grayscale trajectory to generate the candidate change data containing independently changing regions, the method further includes: Extract the boundary coordinates of each independent change region from the candidate change data; Calculate the spatial interval between each independent changing region based on the boundary coordinates, and generate an adjacency list; The independent change regions are merged according to the adjacency list, and the spatially adjacent independent change regions are integrated into a set of merged change regions; Extract the center coordinates and the number of pixels covered by the fused change region set, and update the fused change region set with the candidate change data.
6. The method for detecting electricity theft from a metering box as described in claim 4, characterized in that, The step of comparing the candidate change data with the layout reference of the metering box components through position mapping, and extracting a set of pixel regions that conform to the spatial connection relationship, yields structural change data, including: Retrieve the layout specifications for the metering box components and extract the relative positional relationships of the standard components recorded in the layout specifications for the metering box components. Extract the center coordinates of each independent change region from the candidate change data, compare the center coordinates with the relative position of the standard component, and generate a position matching sequence. The positional matching degree sequence is sorted in descending order of numerical value. The target region set corresponding to the target positional matching degree sequence with the highest sorted position is extracted, and the target region set is marked as the structural change data.
7. The method for detecting electricity theft from a metering box as described in claim 5, characterized in that, The step of comparing the candidate change data with the layout reference of the metering box components to extract a set of pixel regions that conform to the spatial connection relationship to obtain structural change data also includes: Extract the outer contour lines of each independent change region from the candidate change data, and call the standard component shape library of the metering box; The outer contour line is overlapped and compared with the standard contour line in the standard component shape library of the metering box, and the area ratio of the overlapping area is calculated. Establish a table showing the correspondence between the area ratio of overlapping regions and the structural credibility level; Based on the correspondence table, the independent change regions are converted into labeled regions carrying structural confidence levels, and the structural change data is output.
8. The method for detecting electricity theft from a metering box as described in claim 6, characterized in that, The receipt of the anomaly determination result generated by the monitoring and determination terminal based on the structural change data includes: Extract the marked regions from the structural change data and count the total number of pixels covered by the marked regions; Retrieve the historical operating status file of the metering box and extract the range of the number of reference coverage pixels under the standard operating conditions recorded in the historical operating status file of the metering box. The total number of covered pixels is compared with the range of the reference number of covered pixels to extract abnormal coverage data that deviates from the reference range. The abnormal overlay data is bound to the current time timestamp to generate the abnormal determination result.
9. The method for detecting electricity theft from a metering box as described in claim 8, characterized in that, After generating the anomaly determination result, the process further includes: Analyze the spatial coordinates in the anomaly determination result and retrieve the meter box component coding index table; The spatial location coordinates are compared with the meter box component code index table to determine the target component code; The target component code is combined with the abnormal coverage data to generate a structured alarm message; The structured alarm message is pushed to the operation and maintenance management terminal to obtain the abnormal status reporting record.
10. A metering box anti-theft detection system, employing the metering box anti-theft detection method as described in any one of claims 1 to 9, characterized in that, include: The coordinate correction module generates an image analysis command based on the metering box operation monitoring request and sends it to the image processing terminal. It obtains metering box images at different times provided by the image processing terminal, and performs spatial coordinate correction on the metering box images at different times based on the fixed structure reference of the box to obtain aligned image data. The difference extraction module performs temporal grayscale trajectory extraction based on the aligned image data, compares the temporal grayscale trajectory with the normal grayscale distribution of the background, extracts pixels with non-overlapping fluctuation patterns and aggregates them into a set of difference pixels to obtain candidate change data. The mapping and comparison module performs position mapping and comparison between the candidate change data and the layout benchmark of the metering box components, extracts the set of pixel regions that conform to the spatial connection relationship, obtains the structural change data, and sends the structural change data to the monitoring and judgment terminal. The anomaly determination module receives the anomaly determination result generated by the monitoring and determination terminal based on the structural change data.