Water affair Internet of Things equipment data edge calculation method and system, medium and equipment
By compressing and filtering video data in edge gateway equipment and building feature matrix, the problem of difficult video data processing in water operations is solved, efficient edge computing and accurate information transmission of video data are realized, and technical support is provided for intelligent water management.
Patent Information
- Application Number
- CN202510586063.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-05-08
AI Technical Summary
The lack of edge computing and processing technology for video data in water service scenarios in the prior art makes it difficult to process video data and cannot effectively reduce the delay and uncertainty of data transmission between water Internet of Things equipment and the water management cloud.
By setting up an edge computing module in the edge gateway device, the video data collected by the water Internet of Things devices are compressed and filtered, the video data is processed in segments, and the feature matrix of the video data is constructed, which is given priority to send to the water management cloud.
It realizes effective compression and processing of video data, reduces the size and transmission delay of video data, improves the reliability and efficiency of data transmission, and provides technical support for intelligent water management.
Smart Images

Figure CN120104348A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water management, and in particular to a method, system, medium and equipment for edge computing of water Internet of Things equipment data. Background Art
[0002] With the increasing shortage of water resources and the severity of water pollution, smart water management has become one of the important means to solve the problem of water resource management and protection. Countless sensors and water IoT devices distributed in various water scenarios can sense and process various data in real time, and transmit information to the water management cloud, so as to achieve accurate management and optimal configuration of water resources. However, there are many types of sensors and video devices set up in water scenarios, and there will be a large amount of multi-type data to be processed. The delay and security of data transmission add uncertainty to the connection between the water management cloud and the water IoT devices, and also lead to the inability to respond in time when safety incidents such as pollution incidents and floods occur. Data edge computing can realize data processing and analysis at the water scenario end, reducing the difficulty of data transmission between water IoT devices and water management cloud. However, in the prior art, edge gateway devices can realize edge computing processing of sensor data, but rarely propose edge processing technology for video data. For video data in water scenarios, it has the characteristics of complex video data elements and large data volume, which also increases the difficulty of edge computing and processing of video data. Therefore, it is urgent to propose a water Internet of Things device data edge computing method, system, medium and equipment for edge computing and processing of video data. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method, system, medium and equipment for edge computing of water conservancy Internet of Things equipment data, which compresses and filters the video data collected by the water conservancy Internet of Things equipment to reduce the data volume of the video data and realizes edge computing and processing of water conservancy video data.
[0004] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is: A water utility IoT device data edge computing method is provided, comprising: Step S1: The water conservancy IoT device transmits the video data to the edge gateway device, which is equipped with an edge computing module, and uses the edge computing module to filter the video data; Step S2: The edge computing module compresses the colors in the frame image according to the frame image in the filtered video data based on the similarity between the pixels in the frame image to obtain compressed video data; Step S3: Calculate the importance of the video data based on the size of the video data before and after compression, and determine the compressed video data to be processed first based on the importance of the video data processed by the edge computing module within the set time period. , and create video data The characteristic matrix ; Step S4: The edge gateway device preferentially transmits the feature matrix It is sent to the water management cloud, which analyzes the feature matrix Get the most important video data collected from water IoT devices during a set period of time.
[0005] Further, step S1 includes: Step S11: The edge gateway device splits the video data into N The similarity between two grayscale frame images is used to split the video data into different video data segments; Step S12: Based on the grayscale frame image in each video data segment, the contour in the frame image is identified using the grayscale value of the pixels in the grayscale frame image, and based on the contour changes between two adjacent frame images, whether they are similar is determined, similar frame images are filtered out, and the length of the video data segment is shortened.
[0006] Furthermore, step S11 includes: Step S111: The edge gateway device splits the video data into N Frame images are processed, and each frame image is grayed to obtain a grayscale frame image, and the grayscale value of each pixel in the grayscale frame image is obtained; Step S112: calculating the similarity between two adjacent grayscale frame images in the time series based on the grayscale values of the pixels in the grayscale frame images; ; in, n is the grayscale frame number, is the pixel coordinate on the grayscale image, For the n The pixel gray value of a grayscale frame image, For the n -1 grayscale frame image pixel grayscale value, L is the size of the grayscale image, Two adjacent grayscale frames n Grayscale frame image n -1 similarity between; Step S113: Obtain N Similarity data between two adjacent grayscale frames in a grayscale frame image , Two adjacent grayscale frames N Grayscale frame image N -1 similarity between; Step S114: Based on the first similarity, traverse the similarities starting from the second similarity in sequence, and calculate the difference between the first similarity and each similarity traversed in sequence ; ; Step S115: Setting the difference threshold ; like , then judge the similarity The corresponding two adjacent grayscale frames n , grayscale image n -1, the image content changes greatly, grayscale image 1 to grayscale image n -1, the video segments have small content differences, converting grayscale frame 1 to grayscale frame n -1 is the video data in the time series range as the first segment of video data to be split; Otherwise, the similarity The corresponding two adjacent grayscale frames n , grayscale image n -1 The video segments between the two have little content change; Step S116: Return to step S114 and calculate the similarity Based on, the remaining similarity data are traversed in sequence, and step S114-step S115 are executed until all the video data are split into different video data segments.
[0007] Further, step S12 includes: Step S121: Based on the grayscale frame image in each video data segment, pixels on the contour boundary are filtered according to the grayscale values of the pixels in the grayscale frame image; When the grayscale value difference between two adjacent pixels satisfy , then determine the pixel i With pixels i -1 is on the contour boundary; i is the number of pixels in the grayscale frame image, Pixel i The pixel coordinates of Pixel i The pixel coordinates are -1, To determine the grayscale difference threshold of the pixel on the contour boundary, Pixel i The pixel gray value, Pixel iA pixel gray value of -1; Otherwise, determine the pixel i With pixels i -1 is not on the contour boundary; Step S122: Calculate the coordinates of the midpoint of the pixel on the contour boundary , u is the number of the midpoint of the pixel; ; Step S123: Obtain the coordinate data of the midpoints of all pixels on the contour boundaries in the frame image. , U is the number of midpoints in the pixel, For the U The coordinates of the midpoint of the pixel; Step S124: From the coordinate data Filter the midpoints of pixels on the same contour boundary to form a set of pixel midpoints of the contour boundary A , pixel midpoint set A The coordinate data of the midpoint of the pixel within satisfies the constraints: ; in, are the pixel midpoint sets A The coordinates of the midpoint between the two pixels, d is the side length of a single pixel, a is the pixel midpoint set A The number of the inner pixel midpoint; Step S125: Set the pixel midpoints A All the pixel midpoints in the image are connected in sequence to form a contour boundary line. The pixel midpoints on the contour boundary line are used as contour points, and the pixel grayscale values of each contour point on the contour boundary line are calculated. ; Step S126: Obtain all contour boundary lines existing in each grayscale frame image in the video data segment, and convert the grayscale frame image of the previous frame in the video data segment into t The contour boundary line inside is projected onto the grayscale image of the next frame t +1, and calculate the grayscale image t +1 The pixel gray value of each contour point on the contour boundary line projected on , Grayscale images t +1 Pixels on both sides of the contour point on the contour boundary line of the inner projection i With pixels i A pixel gray value of -1; Step S127: Based on the grayscale image t +1 and grayscale images tThe contour variation coefficient is calculated based on the pixel grayscale value of the contour point on the corresponding contour boundary line; ; in, S Grayscale image t The number of contour lines on s Number the contour lines. b is the number of contour points on the contour boundary line, is the allowable value of the difference in grayscale value of contour points; Step S128: Setting the threshold of the profile variation coefficient ;like , then the grayscale image is determined t Grayscale frame image t +1 The image contents between them are not similar, so the grayscale image is retained. t Grayscale image t +1; otherwise, determine the grayscale image t Grayscale frame image t +1 The image contents between them are not similar, delete the grayscale image t +1, keep grayscale image t ; Step S129: updating the grayscale frame images in the video data segment, returning to step S126, and executing steps S126-S128, continuing to calculate the contour variation coefficient between the grayscale frame images of two adjacent frames, until all similar grayscale frame images in the video data segment are deleted; Step S1210: restoring the remaining grayscale frame images to frame images, and combining them into filtered video data segments according to the frame sequence between the remaining frame images, and then splicing the filtered video data segments to obtain filtered video data.
[0008] Further, step S2 includes: Step S21: extract the grayscale frame image corresponding to the frame image in the filtered video data, and select similar pixel groups according to the grayscale values of the pixels in the grayscale frame image. The pixels in the pixel group meet the constraint conditions: ; in, u , v are the numbers of any two pixels in the pixel group, c , e is the number of two adjacent pixels in the pixel group, are the pixel coordinates of two adjacent pixels in the pixel cluster, is the error threshold of the pixel gray value in the grayscale frame image; Step S22: Divide the pixels in the grayscale frame image into MPixel groups, calculate the average gray value of each pixel group , m is the number of the pixel group, V is the number of pixels in the pixel cluster, and the pixel cluster m The pixel grayscale values of all pixels in the , for pixel groups m Unify the grayscale values of pixels within; Step S23: After the grayscale values of all pixel groups in the grayscale frame image are unified, a compressed grayscale frame image is formed, and the compressed grayscale frame image is restored to a frame image to form compressed video data.
[0009] Further, step S3 includes: Step S31: Based on the size of the compressed video data K 2 , calculate the importance of video data , K 1 The size of the video data received by the edge gateway device; Step S32: Obtaining importance data of all compressed video data within a set period of time , w is the amount of compressed video data, For the w The importance of compressed video data; Step S33: Filter out importance data The minimum value in , the minimum value Corresponding to compressed video data Prioritize processing and build video data The characteristic matrix ; ; ; in, W For video data The number of frames in For the W The feature matrix of a frame image is is the characteristic matrix of pixel clusters in the frame image, For the M The grayscale value of the pixel group, It is a set of coordinate data of pixels in the pixel group.
[0010] A water utility IoT device data edge computing system is provided to execute the above-mentioned water utility IoT device data edge computing method, which includes: Water affairs Internet of Things equipment, including several water affairs video data collection terminals, which are connected to edge gateway devices through the Internet of Things, and the video data collected by the water affairs video data collection terminals are sent to the edge gateway devices; The edge gateway device is used to receive the video data collected by the water affairs video data collection terminal. The edge gateway device is equipped with an edge computing module, which is used to filter and compress the video data, construct a feature matrix of the video data, and send it to the water affairs management cloud; The water management cloud is used to analyze the feature matrix of video data and obtain video data collected by water IoT devices.
[0011] A computer-readable storage medium is provided for storing a program, and when the program is executed by a processor, the steps of the above-mentioned water Internet of Things device data edge computing method are implemented.
[0012] Provided is a water utility IoT device data edge computing device connected to an edge gateway device, comprising a processor and a memory; The memory stores computer executable instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the above-mentioned water Internet of Things equipment data edge computing method.
[0013] The beneficial effects of the present invention are as follows: the present invention utilizes the feature similarity between pixels in the frame images of the video data to segment the video data, and filters similar frame images in the video data segment, thereby reducing the length of the video data and retaining the effective information in the video data. In addition, it also effectively reduces the color richness of the frame images in the video data, reduces the size of the frame images, and then reduces the size of the video data, thereby achieving compression of the video data. By extracting the feature matrix of the video data and sending it to the water management cloud, the complexity of sending data packets can be effectively reduced, the delay in data transmission between the edge gateway device and the water management cloud can be reduced, and the reliability of data transmission can be increased. It can realize efficient edge computing and accurate information transmission of water video data, providing reliable technical support for intelligent water management. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is the functional block diagram of the water IoT device data edge computing system.
[0015] Figure 2 Schematic diagram of the contour boundary line. DETAILED DESCRIPTION
[0016] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0017] A water service Internet of Things device data edge computing method, comprising: Step S1: The water conservancy IoT device transmits the video data to the edge gateway device, which is provided with an edge computing module, and uses the edge computing module to filter the video data. In this embodiment, the water conservancy IoT device mainly includes water conservancy video data acquisition terminals installed in different water conservancy scenarios, for example, collecting video data of reservoirs, monitoring changes in the shape of reservoir water levels, and obtaining water level change data of reservoirs; collecting video data of flood level changes of flood disasters, and obtaining flood spread data, etc. The edge gateway device serves multiple water conservancy video data acquisition terminals in the water conservancy scenario and performs edge computing services.
[0018] Step S1 specifically includes: Step S11: The edge gateway device splits the video data into N The similarity between two grayscale frame images is used to split the video data into different video data segments. Step S11 specifically includes: Step S111: The edge gateway device splits the video data into N Frame images are processed, and each frame image is grayed to obtain a grayscale frame image, and the grayscale value of each pixel in the grayscale frame image is obtained; Step S112: calculating the similarity between two adjacent grayscale frame images in the time series based on the grayscale values of the pixels in the grayscale frame images; ; in, n is the grayscale frame number, is the pixel coordinate on the grayscale image, For the n The pixel gray value of a grayscale frame image, For the n -1 grayscale frame image pixel grayscale value, L is the size of the grayscale image, Two adjacent grayscale frames n Grayscale frame image n -1 similarity between; Similarity It indicates the similarity between two adjacent grayscale frame images in terms of pixel color expression. The greater the similarity, the smaller the similarity, and vice versa. This is used to express the similarity length of the content of the two frame images.
[0019] Step S113: Obtain N Similarity data between two adjacent grayscale frames in a grayscale frame image , Two adjacent grayscale frames N Grayscale frame image N -1 similarity between; Step S114: Based on the first similarity, traverse the similarities starting from the second similarity in sequence, and calculate the difference between the first similarity and each similarity traversed in sequence ; ; Indicates the difference in the degree of change of the image content of the two video frame nodes. The larger the value is, the greater the difference in the degree of change of the picture content between the two video frame nodes is, which is used to determine whether the video content between the two video frame nodes changes little, and then determine whether they can be used as a video data segment.
[0020] Step S115: Setting the difference threshold , threshold Indicates the maximum value allowed for the difference in similarity between the two video frame nodes, which is used as a criterion for determining whether the video data should be segmented. Greater than threshold When , it means that the image content changes of the two corresponding video frame nodes are greatly different, and the second video frame node is used as a segmentation node to segment the video data; otherwise, it means that the image content changes of the two corresponding video frame nodes are slightly different, and they can be used as a segment of video data; like , then judge the similarity The corresponding two adjacent grayscale frames n , grayscale image n -1, the image content changes greatly, from grayscale image 1 to grayscale image n -1, the video segments have small content differences, converting grayscale frame 1 to grayscale frame n -1 is the first segment of video data to be split, and the grayscale frame image n -1 corresponds to the video frame as the segment node; Otherwise, the similarity The corresponding two adjacent grayscale frames n , grayscale imagen -1 The video segments between the two have little content change; Step S116: Return to step S114 and calculate the similarity Based on, the remaining similarity data are traversed in sequence, and step S114-step S115 are executed until all the video data are split into different video data segments.
[0021] Step S12: Based on the grayscale frame image in each video data segment, the contour in the frame image is identified using the grayscale value of the pixels in the grayscale frame image, and based on the contour changes between two adjacent frame images, whether they are similar is determined, similar frame images are filtered out, and the length of the video data segment is shortened.
[0022] During water level video monitoring, the contour line is mainly the water level line in the reservoir. There will be an obvious difference in color between the water level line and the surrounding mountains. When the water level changes, the flooding depth of the surrounding mountains will also change, which will also cause the contour line of the mountain in the video to change.
[0023] When conducting video monitoring of flood lines, as the flood spreads, the flood lines will move and their outlines will change in the video, which can be used to determine the speed of the flood spread. Similarly, the outlines of mountains and other elements in the video will also change depending on the flood situation.
[0024] Step S12 specifically includes: Step S121: Based on the grayscale frame image in each video data segment, pixels on the contour boundary are filtered according to the grayscale values of the pixels in the grayscale frame image; When the grayscale value difference between two adjacent pixels satisfy , then determine the pixel i With pixels i -1 is on the contour boundary; i is the number of pixels in the grayscale frame image, Pixel i The pixel coordinates of Pixel i The pixel coordinates are -1, The grayscale difference threshold is used to determine whether the pixel is on the contour boundary, and it is used as the judgment standard for the grayscale difference of pixels on both sides of the contour boundary. Pixels i and pixels i A pixel gray value of -1; Otherwise, determine the pixel i With pixels i -1 is not on the contour boundary; Step S122: Calculate the coordinates of the midpoint of the pixel on the contour boundary , uis the number of the midpoint of the pixel; ; Step S123: Obtain the coordinate data of the midpoints of all pixels on the contour boundaries in the frame image. , U is the number of midpoints in the pixel, For the U The coordinates of the midpoint of the pixel; Step S124: From the coordinate data Filter the midpoints of pixels on the same contour boundary to form a set of pixel midpoints of the contour boundary A , pixel midpoint set A The coordinate data of the midpoint of the pixel within satisfies the constraints: ; in, are the pixel midpoint sets A The coordinates of the midpoint between the two pixels, d is the side length of a single pixel, a is the pixel midpoint set A The number of the inner pixel midpoint; Step S125: Set the pixel midpoints A All the pixel midpoints in the image are connected in sequence to form a contour boundary line. The pixel midpoints on the contour boundary line are used as contour points, and the pixel grayscale values of each contour point on the contour boundary line are calculated. ; like Figure 2 As shown in the figure, a schematic diagram of the principle of obtaining the contour boundary line after pixel magnification is provided. In the figure, a square box represents a pixel, and the midpoints of pixels (that is, contour points) on the contour boundary line are screened by the distance difference between adjacent pixels. d and They are located on the same boundary contour.
[0025] Step S126: Obtain all contour boundary lines existing in each grayscale frame image in the video data segment, and convert the grayscale frame image of the previous frame in the video data segment into t The contour boundary line inside is projected onto the grayscale image of the next frame t +1, and calculate the grayscale image t +1 The pixel gray value of each contour point on the contour boundary line projected on , Grayscale images t +1 Pixels on both sides of the contour point on the contour boundary line of the inner projection i With pixels i Gray value of -1; Step S127: Based on the grayscale image t+1 and grayscale images t The contour variation coefficient is calculated based on the pixel grayscale value of the contour point on the corresponding contour boundary line; ; in, S Grayscale image t The number of contour lines on s Number the contour lines. b is the number of contour points on the contour boundary line, is the allowable value of the difference in grayscale value of contour points; Step S128: Setting the threshold of the profile variation coefficient , threshold As a criterion for determining whether the contents of images are similar by the similarity of their contours; like , then the grayscale image is determined t Grayscale frame image t +1 The image contents between them are not similar, so the grayscale image is retained. t Grayscale image t +1; otherwise, determine the grayscale image t Grayscale frame image t +1 The image contents between them are not similar, delete the grayscale image t +1, keep grayscale image t ; Step S129: updating the grayscale frame images in the video data segment, returning to step S126, and executing steps S126-S128, continuing to calculate the contour variation coefficient between the grayscale frame images of two adjacent frames, until all similar grayscale frame images in the video data segment are deleted; Step S1210: restoring the remaining grayscale frame images to frame images, and combining them into filtered video data segments according to the frame sequence between the remaining frame images, and then splicing the filtered video data segments to obtain filtered video data.
[0026] Step S2: The edge computing module compresses the colors in the frame images according to the frame images in the filtered video data based on the similarity between the pixels in the frame images to obtain compressed video data. Step S2 specifically includes: Step S21: extract the grayscale frame image corresponding to the frame image in the filtered video data, and select similar pixel groups according to the grayscale values of the pixels in the grayscale frame image. The pixels in the pixel group meet the constraint conditions: ; in, u , v are the numbers of any two pixels in the pixel group, c ,e is the number of two adjacent pixels in the pixel group, are the pixel coordinates of two adjacent pixels in the pixel cluster, is the error threshold of the pixel gray value in the grayscale frame image; Step S22: Divide the pixels in the grayscale frame image into M Pixel groups, calculate the average gray value of each pixel group , m is the number of the pixel group, V is the number of pixels in the pixel cluster, and the pixel cluster m The pixel grayscale values of all pixels in the , for pixel groups m Unify the grayscale values of pixels within; Step S23: After the pixel grayscale values of all pixel groups in the grayscale frame image are unified, a compressed grayscale frame image is formed, and the compressed grayscale frame image is restored to a frame image to form compressed video data. After the pixel grayscale values are unified, the color complexity of the frame image is reduced on the basis of satisfying the fineness of the image color expression, thereby reducing the size of the video data and reducing the storage space occupied by the video data.
[0027] Step S3: Calculate the importance of the video data based on the size of the video data before and after compression. Based on the importance of the video data processed by the edge computing module within the set time period and the computing power of the edge computing module, the video data within the set time period will be processed in segments, and the most important segment of video data will be selected and sent to the water management cloud, reducing the amount of data sent and determining the compressed video data for priority processing. , and create video data The characteristic matrix Step S3 specifically includes: Step S31: Based on the size of the compressed video data K 2 , calculate the importance of video data , K 1 The size of the video data received by the edge gateway device. The importance level indicates the size change of the video data before and after filtering and compression. The larger the importance level, the more filtered and compressed the video content is, and the simpler the content displayed in the video data is. Conversely, the video data content is richer. Step S32: Obtaining importance data of all compressed video data within a set period of time , w is the amount of compressed video data, For the w The importance of compressed video data; Step S33: Filter out importance data The minimum value in , the minimum value Corresponding to compressed video data Prioritize processing and build video data The characteristic matrix ; ; ; in, W For video data The number of frames in For the W The feature matrix of a frame image is is the characteristic matrix of pixel clusters in the frame image, For the M The grayscale value of the pixel group, It is a set of coordinate data of pixels in the pixel group.
[0028] Step S4: The edge gateway device preferentially transmits the feature matrix It is sent to the water management cloud, which analyzes the feature matrix Get the most important video data collected from water IoT devices during a set period of time.
[0029] like Figure 1 As shown, a water Internet of Things device data edge computing system executes the above-mentioned water Internet of Things device data edge computing method, including: Water affairs Internet of Things equipment, including several water affairs video data collection terminals, which are connected to edge gateway devices through the Internet of Things, and the video data collected by the water affairs video data collection terminals are sent to the edge gateway devices; The edge gateway device is used to receive the video data collected by the water affairs video data collection terminal. The edge gateway device is equipped with an edge computing module, which is used to filter and compress the video data, construct a feature matrix of the video data, and send it to the water affairs management cloud; The water management cloud is used to analyze the feature matrix of video data and obtain video data collected by water IoT devices.
[0030] A computer-readable storage medium is used to store a program, and when the program is executed by a processor, the steps of the above-mentioned water Internet of Things device data edge computing method are implemented. The water Internet of Things device data edge computing method of this embodiment has been described in detail above and will not be repeated here.
[0031] A water service IoT device data edge computing device, connected to an edge gateway device, including a processor and a memory; The memory stores computer executable instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the above-mentioned water Internet of Things device data edge computing method. The water Internet of Things device data edge computing method in this embodiment is consistent with the above-mentioned description and will not be repeated.
[0032] The present invention utilizes the feature similarity between pixels in the frame images of the video data to segment the video data, and filters similar frame images in the video data segment, thereby reducing the length of the video data and retaining the effective information in the video data. In addition, it also effectively reduces the color richness of the frame images in the video data, reduces the size of the frame images, and then reduces the size of the video data, thereby achieving compression of the video data. By extracting the feature matrix of the video data and sending it to the water management cloud, the complexity of sending data packets can be effectively reduced, the delay in data transmission between the edge gateway device and the water management cloud can be reduced, and the reliability of data transmission can be increased. It can realize efficient edge computing and accurate information transmission of water video data, providing reliable technical support for intelligent water management.
Claims
1. A water Internet of Things equipment data edge computing method, characterized in that: include: Step S1: The water IoT device transmits the video data to the edge gateway device, which is equipped with an edge computing module, and uses the edge computing module to filter the video data; Step S2: The edge computing module compresses the colors in the frame image according to the frame image in the filtered video data based on the similarity between the pixels in the frame image to obtain compressed video data; Step S3: Calculate the importance of the video data based on the size of the video data before and after compression, and determine the compressed video data to be processed first based on the importance of the video data processed by the edge computing module within the set time period. , and create video data The characteristic matrix ; Step S4: The edge gateway device preferentially transmits the feature matrix It is sent to the water management cloud, which analyzes the feature matrix Get the most important video data collected from water IoT devices during a set period of time.
2. The water Internet of Things device data edge computing method according to claim 1 is characterized in that: The step S1 comprises: Step S11: The edge gateway device splits the video data into N The similarity between two grayscale frame images is used to split the video data into different video data segments; Step S12: Based on the grayscale frame image in each video data segment, the contour in the frame image is identified using the grayscale value of the pixels in the grayscale frame image, and based on the contour changes between two adjacent frame images, whether they are similar is determined, similar frame images are filtered out, and the length of the video data segment is shortened.
3. The water Internet of Things device data edge computing method according to claim 2 is characterized in that: The step S11 comprises: Step S111: The edge gateway device splits the video data into N Frame images are processed, and each frame image is grayed to obtain a grayscale frame image, and the grayscale value of each pixel in the grayscale frame image is obtained; Step S112: calculating the similarity between two adjacent grayscale frame images in the time series based on the grayscale values of the pixels in the grayscale frame images; ; in, n is the grayscale frame number, is the pixel coordinate on the grayscale image, For the n The pixel gray value of a grayscale frame image, For the n -1 grayscale frame pixel grayscale value, L is the size of the grayscale image, Two adjacent grayscale frames n Grayscale frame image n -1 similarity between; Step S113: Obtain N Similarity data between two adjacent grayscale frames in a grayscale frame image , Two adjacent grayscale frames N Grayscale frame image N -1 similarity between; Step S114: Based on the first similarity, traverse the similarities starting from the second similarity in sequence, and calculate the difference between the first similarity and each similarity traversed in sequence ; ; Step S115: Setting the difference threshold ; like , then judge the similarity The corresponding two adjacent grayscale frames n , grayscale image n -1, the image content changes greatly, grayscale image 1 to grayscale image n -1, the video segments have small content differences, converting grayscale frame 1 to grayscale frame n -1 is the video data in the time series range as the first segment of video data to be split; Otherwise, the similarity The corresponding two adjacent grayscale frames n , grayscale image n -1 The video segments between the two have little content change; Step S116: Return to step S114 and calculate the similarity Based on, the remaining similarity data are traversed in sequence, and step S114-step S115 are executed until all the video data are split into different video data segments.
4. The water Internet of Things device data edge computing method according to claim 3 is characterized in that: The step S12 comprises: Step S121: Based on the grayscale frame image in each video data segment, pixels on the contour boundary are filtered according to the grayscale values of the pixels in the grayscale frame image; When the grayscale value difference between two adjacent pixels satisfy , then determine the pixel i With pixels i -1 is on the contour boundary; i is the number of pixels in the grayscale frame image, Pixel i The pixel coordinates of Pixel i The pixel coordinates are -1, To determine the grayscale difference threshold of the pixel on the contour boundary, Pixel i The pixel gray value, Pixel i A pixel gray value of -1; Otherwise, determine the pixel i With pixels i -1 is not on the contour boundary; Step S122: Calculate the coordinates of the midpoint of the pixel on the contour boundary , u is the number of the midpoint of the pixel; ; Step S123: Obtain the coordinate data of the midpoints of all pixels on the contour boundaries in the frame image. , U is the number of midpoints in the pixel, For the U The coordinates of the midpoint of the pixel; Step S124: From the coordinate data Filter the midpoints of pixels on the same contour boundary to form a set of pixel midpoints of the contour boundary A , pixel midpoint set A The coordinate data of the midpoint of the pixel within satisfies the constraints: ; in, are the pixel midpoint sets A The coordinates of the midpoint between the two pixels, d is the side length of a single pixel, a is the pixel midpoint set A The number of the inner pixel midpoint; Step S125: Set the pixel midpoints A All pixel midpoints in the image are connected in sequence to form a contour boundary line. The pixel midpoints on the contour boundary line are used as contour points, and the pixel grayscale values of each contour point on the contour boundary line are calculated. ; Step S126: Obtain all contour boundary lines existing in each grayscale frame image in the video data segment, and convert the grayscale frame image of the previous frame in the video data segment into t The contour boundary line inside is projected onto the grayscale image of the next frame t +1, and calculate the grayscale frame image t +1 The pixel gray value of each contour point on the contour boundary line projected on , Grayscale images t +1 Pixels on both sides of the contour point on the contour boundary line of the inner projection i With pixels i A pixel gray value of -1; Step S127: Based on the grayscale image t +1 and grayscale images t The contour variation coefficient is calculated based on the pixel grayscale value of the contour point on the corresponding contour boundary line; ; in, S Grayscale image t The number of contour lines on s Number the contour lines. b is the number of contour points on the contour boundary line, is the allowable value of the difference in grayscale value of contour points; Step S128: Setting the threshold of the profile variation coefficient ;like , then the grayscale image is determined t Grayscale frame image t +1 The image contents between them are not similar, so the grayscale image is retained. t Grayscale image t +1; otherwise, determine the grayscale image t Grayscale frame image t +1 The image contents between them are not similar, delete the grayscale image t +1, keep grayscale image t ; Step S129: updating the grayscale frame images in the video data segment, returning to step S126, and executing steps S126-S128, continuing to calculate the contour variation coefficient between the grayscale frame images of two adjacent frames, until all similar grayscale frame images in the video data segment are deleted; Step S1210: restoring the remaining grayscale frame images to frame images, and combining them into filtered video data segments according to the frame sequence between the remaining frame images, and then splicing the filtered video data segments to obtain filtered video data.
5. The water Internet of Things device data edge computing method according to claim 4 is characterized in that: The step S2 comprises: Step S21: extract the grayscale frame image corresponding to the frame image in the filtered video data, and select similar pixel groups according to the grayscale values of the pixels in the grayscale frame image. The pixels in the pixel group meet the constraint conditions: ; in, u , v are the numbers of any two pixels in the pixel group, c , e is the number of two adjacent pixels in the pixel group, are the pixel coordinates of two adjacent pixels in the pixel cluster, is the error threshold of the pixel gray value in the grayscale frame image; Step S22: Divide the pixels in the grayscale frame image into M Pixel groups, calculate the average gray value of each pixel group , m is the number of the pixel group, V is the number of pixels in the pixel cluster, and the pixel cluster m The pixel grayscale values of all pixels in the , for pixel groups m Unify the grayscale values of pixels within; Step S23: After the grayscale values of all pixel groups in the grayscale frame image are unified, a compressed grayscale frame image is formed, and the compressed grayscale frame image is restored to a frame image to form compressed video data.
6. The water Internet of Things device data edge computing method according to claim 5 is characterized in that: The step S3 comprises: Step S31: Based on the size of the compressed video data K 2. Calculate the importance of video data , K 1 is the size of the video data received by the edge gateway device; Step S32: Obtaining importance data of all compressed video data within a set period of time , w is the amount of compressed video data, For the w The importance of compressed video data; Step S33: Filter out importance data The minimum value in , the minimum value Corresponding to compressed video data Prioritize processing and build video data The characteristic matrix ; ; ; in, W For video data The number of frames in For the W The feature matrix of a frame image is is the characteristic matrix of pixel clusters in the frame image, For the M The grayscale value of the pixel group, It is a set of coordinate data of pixels in the pixel group.
7. A water Internet of Things device data edge computing system, executing the water Internet of Things device data edge computing method according to any one of claims 1 to 6, characterized in that: include: A water affairs Internet of Things device, including a plurality of water affairs video data acquisition terminals, wherein the plurality of water affairs video data acquisition terminals are connected to an edge gateway device via the Internet of Things, and video data collected by the water affairs video data acquisition terminals are sent to the edge gateway device; The edge gateway device is used to receive the video data collected by the water affairs video data collection terminal. The edge gateway device is equipped with an edge computing module, which is used to filter and compress the video data, construct a feature matrix of the video data, and send it to the water affairs management cloud; The water management cloud is used to analyze the feature matrix of video data and obtain video data collected by water IoT devices.
8. A computer-readable storage medium for storing a program, characterized in that: When the program is executed by the processor, the steps of the water Internet of Things device data edge computing method described in any one of claims 1-6 are implemented.
9. A water service IoT device data edge computing device, connected to an edge gateway device, characterized in that: including a processor and a memory; The memory stores computer executable instructions; The processor executes the computer execution instructions stored in the memory, so that the processor executes the water Internet of Things device data edge computing method described in any one of claims 1-6.
Citation Information
Patent Citations
Cross-device target detection computing reuse technology for edge intelligent service
CN114998806A
High-definition video image processing method
CN116403137A
Image processing method and apparatus, device, and computer-readable storage medium
US20230222696A1