A video data optimization acquisition method and system based on artificial intelligence

By calculating the communication recovery time of the video acquisition device and setting the interval length and image block size according to the importance of the device, and adjusting the video acquisition frequency and storage method, the problem of affecting video integrity and clarity when the video acquisition device is offline is solved, and high-quality video storage and analysis are achieved.

CN119629299BActive Publication Date: 2025-05-06广州市省信软件有限公司 +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510156670.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-05-06
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

In the prior art, when the video acquisition device is offline, the video acquisition frequency cannot be adjusted according to the device's own characteristics, resulting in the impact of the stored video integrity, clarity and fluency.

Method used

By calculating the estimated value of the communication recovery time of the video acquisition device, setting the interval length and image block size according to the importance of the device, adjusting the video acquisition frequency and storing images per frame to adapt to the available memory of the device and the communication recovery time.

Benefits of technology

When the video acquisition device is offline, by adjusting the video acquisition frequency and compressing the stored video, the integrity, clarity and fluency of the stored video are ensured, which is convenient for subsequent viewing and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629299B_ABST
    Figure CN119629299B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of data acquisition technology, and specifically relates to an artificial intelligence-based video data optimization acquisition method and system, the method comprising: for a video acquisition device associated with a monitoring center: calculating an estimated value of communication recovery time according to maintenance records and geographic locations, setting interval length according to importance and estimated value of communication recovery time, constructing a matrix according to grayscale intervals, setting the size of an image block according to importance, for calculating the amount of data stored for each frame of an image, storing the size of the matrix, the image block, and the amount of data stored for each frame of an image in the device, so that when it is detected that the device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the device, the estimated value of communication recovery time, and the amount of data stored for each frame of an image, and each frame of an image in the acquired video is stored according to the size of the matrix and the image block. The present invention improves the integrity, clarity, and fluency of the stored video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data acquisition technology, and more specifically, to an artificial intelligence-based video data optimization acquisition method and system. Background Art

[0002] When it is detected that the video acquisition device is offline or has a poor signal, the acquired video cannot be transmitted in real time before the maintenance personnel arrive and restore the communication of the video acquisition device. At this time, the acquired video can only be stored in the local storage space of the video acquisition device.

[0003] In the related technology, for example, the Chinese patent document with the authorization announcement number CN116939170B discloses a video monitoring method, a video monitoring server and an encoder device, including: receiving a video source signal and performing preprocessing; performing video encoding compression; transmitting the compressed video data to a remote video monitoring server and performing real-time decoding; performing video data analysis on the server side; making different early warning processing according to the analysis results; a video monitoring server, including a video acquisition module, a video encoding module, a storage management module, a video analysis module, a video transmission module and a monitoring center module; an encoder device, including an input interface module, a video processing module, an encoding engine module, a code stream control module, an output interface module and a control module; the patent automatically detects the impact of the surrounding environment on the clarity of video monitoring through video analysis technology, and makes different early warning processing according to predefined rules.

[0004] In the related art, the video is only compressed to adapt to the limited storage space of the video acquisition device, and it cannot be adjusted according to the characteristics of the video acquisition device itself, which seriously affects the integrity, clarity and smoothness of the stored video, and thus affects subsequent viewing and analysis. Summary of the invention

[0005] In order to solve the above-mentioned technical problem that the video is only compressed to adapt to the limited storage space of the video acquisition device, and cannot be adjusted according to the characteristics of the video acquisition device itself, which seriously affects the integrity, clarity and smoothness of the stored video, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for optimizing video data acquisition based on artificial intelligence, including: for a video acquisition device associated with a monitoring center: calculating an estimated value of the communication recovery time according to the maintenance record and the geographical location of the video acquisition device; setting an interval length according to the importance of the video acquisition device and the estimated value of the communication recovery time, for dividing all grayscale values ​​into multiple grayscale intervals; constructing a matrix according to the grayscale intervals and assigning identifiers to the elements in the matrix, requiring that the local area of ​​each element contains all types of identifiers; setting the size of the image block according to the importance, for calculating the amount of data stored in each frame of the image; storing the size of the matrix, the image block, and the amount of data stored in each frame of the image in the memory space of the video acquisition device, so that when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time, and the amount of data stored in each frame of the image, and storing each frame of the image in the video according to the size of the matrix and the image block, including: dividing the image into multiple image blocks, and forming a pixel pair with every two pixels in the image block; for the first Pixel pairs , when the serial number When the storage composition The grayscale values ​​of two pixels; when When, according to the composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements , according to the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identification is stored.

[0007] The present invention estimates the communication recovery time of the video acquisition device according to the geographical location of the video acquisition device, and then sets the interval length and the size of the image block according to the importance of the video acquisition device and the estimated value of the communication recovery time, so as to calculate the data volume of each frame of the image stored, so that when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time and the data volume of each frame of the image stored. The present invention adjusts the video acquisition frequency according to the characteristics of the video acquisition device itself, and at the same time, compresses and stores each frame of the image in the video according to the size of the matrix and the image block, so as to ensure the integrity, clarity and fluency of the stored video, which is convenient for subsequent viewing and analysis.

[0008] Preferably, the calculating of the estimated value of the communication recovery time includes: calculating the distance from the monitoring center to the video acquisition device according to the geographical locations of the video acquisition device and the monitoring center; ; According to the distance, multiple reference records are obtained from the maintenance record, and the distance from the monitoring center to the video acquisition device being repaired in the reference record is Within the range, is the distance threshold; calculate the estimated value of the travel time from the monitoring center to the video acquisition device , , is the number of all reference records, , They are respectively from the monitoring center to the The distance and passage time of the video acquisition equipment being repaired in the reference records; the average or median of the repair time of the video acquisition equipment being repaired in all reference records is used as the estimated value of the repair time of the video acquisition equipment ; The estimated value of the communication recovery time of the video acquisition device is .

[0009] Preferably, the step of setting the interval length according to the importance of the video acquisition device and the estimated value of the communication recovery time comprises: determining the interval length according to the importance of the video acquisition device. The value range includes: When the importance of the video acquisition equipment is level 1 to level 4, the interval length The value ranges are , , and ; According to the estimated value of the communication recovery time of the video acquisition device, determine the interval length from the value range , , The length of the interval The left and right boundaries of the value range, is the estimated value of the communication recovery time, , They are the communication recovery time of the video acquisition equipment being repaired in the maintenance record. The minimum and maximum values ​​of To round up.

[0010] The present invention sets the interval length according to the importance of the video acquisition device. For a video acquisition device with a greater importance, the smaller the interval length is, the smaller the loss of the video compression result is, so that the clarity of the video stored in the video acquisition device with a greater importance is better, which is convenient for subsequent viewing and analysis.

[0011] Preferably, the size of the matrix is , is the number of all grayscale intervals, and equal ,scope There are 256 grayscale values ​​in total. is rounded up; the identifier is Integer in the range, ; The size of the local area of ​​each element is , for the matrix with coordinates Element: When the ordinate of the element When it is an even number, the local area of ​​the element is determined by the coordinates in the matrix , , , , , , , The element composition; when the ordinate of the element When it is an odd number, the local area of ​​the element is the coordinates of the matrix , , , , , , , The elemental composition of are the horizontal and vertical coordinates of the element respectively.

[0012] Preferably, the step of setting the size of the image block according to the importance level comprises: when the importance levels of the video acquisition devices are respectively level 1 to level 4, the size of the image block is They are , , and ; , are the length and width of the image block respectively.

[0013] The present invention sets the size of the image block according to the importance of the video acquisition device. For a video acquisition device with a greater importance, the smaller the size of the image block, the smaller the loss of the video compression result, and thus the clarity of the video stored in the video acquisition device with a greater importance is better, which is convenient for subsequent viewing and analysis.

[0014] Preferably, the amount of data stored for each frame of image satisfies the expression: ; In the formula, is the amount of data stored for each frame of image, is the size of each frame image, , are the length and width of each frame image, For each image block size, , are the length and width of each image block, To round up.

[0015] The present invention calculates the amount of data stored in each frame of the image by the size of the image block, so as to adjust the video acquisition frequency in combination with the available memory of the video acquisition device and the estimated value of the communication recovery time, thereby ensuring the integrity and fluency of the stored video and facilitating subsequent viewing and analysis.

[0016] Preferably, the video acquisition frequency satisfies the expression: ; In the formula, The video capture frequency of the video capture device, in frames per second. The available memory of the video capture device, in bits; is the amount of data stored for each frame of image, is the estimated value of the communication recovery time of the video acquisition device, in minutes. is the estimated time it takes to restore communications after converting from minutes to seconds. is the floor function.

[0017] Preferably, the composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements , including: The grayscale interval to which the grayscale value of the first pixel of the two pixels belongs is used as the horizontal coordinate , will form The grayscale interval number to which the grayscale value of the second pixel of the two pixels belongs is used as the vertical coordinate , the coordinates in the matrix are elements, as Corresponding elements .

[0018] Preferably, the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identifiers include: In the element In the local area, the element , as the first Pixel pairs The corresponding identifier; if the element Not in element In the local area, the element In the local area and element The ID of the element closest to the Pixel pairs The corresponding logo.

[0019] The present invention realizes the storage of each frame image in the video by storing the identifiers corresponding to the pixel pairs. Compared with storing the grayscale values ​​of the two pixels constituting the pixel pairs, the storage identifiers have a smaller amount of data, thereby improving the compression rate of the video compression result, thereby ensuring the integrity and fluency of the stored video.

[0020] In a second aspect, the present invention provides a video data optimization acquisition system based on artificial intelligence, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned video data optimization acquisition method based on artificial intelligence is implemented.

[0021] By adopting the above technical solution, the above-mentioned artificial intelligence-based video data optimization acquisition method is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made based on the memory and the processor for easy use.

[0022] The beneficial effects of the present invention are:

[0023] The present invention estimates the communication recovery time of the video acquisition device according to the geographical location of the video acquisition device, and then sets the interval length and the size of the image block according to the importance of the video acquisition device and the estimated value of the communication recovery time, so as to calculate the data volume of each frame of the image stored, so that when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time and the data volume of each frame of the image stored. The present invention adjusts the video acquisition frequency according to the characteristics of the video acquisition device itself, and at the same time, compresses and stores each frame of the image in the video according to the size of the matrix and the image block, so as to ensure the integrity, clarity and fluency of the stored video, which is convenient for subsequent viewing and analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0025] Figure 1 is a flow chart schematically illustrating a method for optimizing video data acquisition based on artificial intelligence in the present invention;

[0026] Figure 2 is a flow chart schematically showing step S1;

[0027] Figure 3 It is a schematic diagram showing the length of the interval Schematic diagram of the matrix when ;

[0028] Figure 4 It is a schematic diagram showing the length of the interval Schematic diagram of the matrix when ;

[0029] Figure 5 is a flowchart schematically showing step S2. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0031] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0032] The embodiment of the present invention discloses a video data optimization acquisition method based on artificial intelligence, referring to Figure 1 , comprising steps S1-S2:

[0033] When it is detected that the video acquisition device is in an offline state or the signal is poor, the acquired video cannot be transmitted in real time before the maintenance personnel arrive and restore the communication of the video acquisition device. At this time, the acquired video can only be stored in the local storage space of the video acquisition device; the video is only compressed to adapt to the limited storage space of the video acquisition device, and cannot be adjusted according to the characteristics of the video acquisition device itself, which seriously affects the integrity, clarity and fluency of the stored video, and further affects subsequent viewing and analysis; therefore, the present invention sets the interval length and the size of the image block according to the importance of the video acquisition device. When it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time, and the amount of data stored in each frame of the image, and each frame of the image in the video is stored according to the size of the matrix and the image block.

[0034] S1. For a video acquisition device associated with a monitoring center, the size of the matrix and the image block and the amount of data stored in each frame of the image are stored in the memory space of the video acquisition device.

[0035] The relationship between video acquisition equipment and monitoring center is close and complementary. Video acquisition equipment is responsible for capturing real-time images or video streams within the monitoring area, while the monitoring center is responsible for receiving, storing, analyzing and displaying these video data to achieve the purpose of security monitoring and management. Among them, video acquisition equipment includes fixed cameras, spherical cameras, infrared cameras, high-definition cameras, etc., which are used to capture video images.

[0036] The video acquisition device is also equipped with a video encoder, a sensor, a pan-tilt controller, a network switch and a power supply; wherein the video encoder is used to convert analog video signals into digital signals for easy network transmission; the sensor is used to trigger video recording or alarm; the pan-tilt controller is used to control the rotation and zoom of the camera to achieve monitoring of a specific area; in an environment requiring multiple cameras, the network switch is used to connect and transmit video data; the power supply provides stable power for the camera and other equipment.

[0037] See the flowchart of step S1. Figure 2 , including steps S101 to S105, specifically:

[0038] S101. Calculate an estimated value of the communication recovery time of the video acquisition device according to the maintenance record and the geographical location of the video acquisition device.

[0039] Specifically, for a video acquisition device associated with a monitoring center, the distance from the monitoring center to the video acquisition device is calculated based on the geographical locations of the video acquisition device and the monitoring center, and is recorded as , the distance is in kilometers or kilometres; multiple reference records are obtained from the maintenance records based on the distance, and the distance from the monitoring center to the video acquisition device Only similar maintenance records are of reference significance. Therefore, the distance from the monitoring center to the video acquisition device under maintenance in the reference record is Within the range, is the distance threshold, and the specific value of the distance threshold can be set according to the actual application scenario and requirements. Its value range is , whose unit is kilometer or kilometer, the present invention sets the distance threshold Set to 5.

[0040] Among them, the monitoring center records and stores multiple maintenance records, each maintenance record contains the serial number of the video acquisition device being maintained, the maintenance date, the geographical location of the video acquisition device being maintained, the travel time from the monitoring center to the video acquisition device being maintained, and the maintenance time of the video acquisition device being maintained; wherein the units of the travel time and the maintenance time are both minutes.

[0041] Further, based on the travel time in all reference records, the travel time from the monitoring center to the video acquisition device is estimated to obtain the estimated value of the travel time from the monitoring center to the video acquisition device. ; Estimate the maintenance time of the video acquisition device according to the maintenance time of the video acquisition device being repaired in all reference records, and obtain the estimated value of the maintenance time of the video acquisition device The estimated value of the communication recovery time of the video acquisition device is the sum of the estimated value of the travel time from the monitoring center to the video acquisition device and the estimated value of the maintenance time of the video acquisition device. ,Right now .

[0042] Among them, the estimated value of the travel time from the monitoring center to the video acquisition device is Satisfies the expression:

[0043] ;

[0044] In the formula, is the estimated travel time from the monitoring center to the video acquisition device, is the number of all reference records, , They are respectively from the monitoring center to the The distance and duration of the video acquisition equipment being repaired in the reference records, is the distance from the monitoring center to the video acquisition device, For the monitoring center to The speed of the video acquisition equipment being repaired in the reference record.

[0045] In one embodiment, the average of the maintenance durations of the video acquisition devices being repaired in all reference records is used as the estimated maintenance duration of the video acquisition devices. In another embodiment, the median of the maintenance time of the video acquisition device being repaired in all reference records is used as the estimated value of the maintenance time of the video acquisition device. .

[0046] S102: setting the interval length according to the importance of the video acquisition device and the estimated value of the communication recovery time.

[0047] When the video captured by the video acquisition device is a grayscale video, each frame of the video is a grayscale image, and the grayscale value of the pixel in the grayscale image ranges from ; When the video captured by the video acquisition device is a color video, each frame of the video is an RGB image, then each frame contains three channels of images, namely, the image of the red (R) channel, the image of the green (G) channel, and the image of the blue (B) channel. The image of each channel can be regarded as a grayscale image, and the grayscale value of the pixel in each channel image ranges from .

[0048] Specifically, the gray value range is , and record the interval length as ; When all gray values ​​are divided into gray intervals, the interval length The larger the value is, the greater the loss of the video compression result is, resulting in worse quality of the video stored in the video acquisition device, but the corresponding compression ratio of the video compression result is greater, thereby causing the video acquisition device to store more videos; therefore, the present invention sets the interval length according to the importance of the video acquisition device and the estimated value of the communication recovery time, including:

[0049] 1. Determine the interval length based on the importance of the video acquisition equipment The value range of .

[0050] Among them, the importance of video acquisition equipment can be set according to its attributes and installation location, which helps to prioritize in terms of resource allocation, monitoring management and emergency response, including: determining which areas are key areas, such as entrances and exits, valuables storage areas, crowded areas, etc., and increasing the importance of video acquisition equipment in these areas accordingly; setting the importance of video acquisition equipment according to the security risk level of the area, and video acquisition equipment in high-risk areas should have a higher priority; therefore, the importance of video acquisition equipment is divided into: level, is a fixed value, and the specific value can be set according to the actual application scenario and requirements; in this embodiment , that is, the importance of video acquisition equipment is divided into 4 levels.

[0051] Specifically, the greater the importance of the video acquisition device, the longer the interval Therefore, when the importance of the video acquisition device is level 1, the interval length The value range is ; When the importance of the video acquisition device is level 2, the interval length The value range is ; When the importance of the video acquisition device is level 3, the interval length The value range is ; When the importance of the video acquisition device is level 4, the interval length The value range is .

[0052] It should be noted that, for a video acquisition device with a greater degree of importance, the quality of the stored video is required to be better, and therefore, the degree of loss of the video compression result is required to be smaller; in summary, for a video acquisition device with a greater degree of importance, the interval length The smaller.

[0053] 2. Determine the interval length from the range of values ​​based on the estimated value of the communication recovery time of the video acquisition device.

[0054] Specifically, the larger the estimated value of the communication recovery time of the video acquisition device, the longer the interval length The larger the interval, the longer Satisfies the expression:

[0055] , The length of the interval The left and right boundaries of the value range, is the estimated value of the communication recovery time, , They are the communication recovery time of the video acquisition equipment being repaired in the maintenance record. The minimum and maximum values ​​of To round up.

[0056] The communication recovery time of the video acquisition device under repair is equal to the sum of the passage time of the video acquisition device under repair and the repair time of the video acquisition device under repair.

[0057] It should be noted that the larger the estimated value of the communication recovery time of the video acquisition device, the larger the amount of video data that the video acquisition device needs to store, and therefore, the higher the compression rate of the video compression result is required; in summary, for the video acquisition device with a larger estimated value of the communication recovery time, the interval length The bigger.

[0058] It should be further explained that the present invention sets the interval length according to the importance of the video acquisition device. For a video acquisition device with a greater importance, the smaller the interval length is, the smaller the loss of the video compression result is, and thus the clarity of the video stored in the video acquisition device with a greater importance is better, which is convenient for subsequent viewing and analysis.

[0059] S103, dividing all grayscale values ​​into multiple grayscale intervals according to the interval length; constructing a matrix according to the grayscale intervals and assigning identifiers to the elements in the matrix, requiring that the local area of ​​each element contains all types of identifiers.

[0060] Specifically, according to the interval length The range All grayscale values ​​in are divided into multiple grayscale intervals, ranging There are 256 grayscale values ​​in total, so the number of all grayscale intervals obtained by division is equal , To round up.

[0061] Among them, The grayscale interval is , is the minimum function, and through Ensure that the right edge of the last grayscale interval does not exceed 255. .

[0062] For example, when the interval length When, according to the interval length The range All gray values ​​in are divided into Grayscale intervals, respectively , , , , , , , , , , , , , , , ; When the interval length When, according to the interval length The range All gray values ​​in are divided into Grayscale intervals, respectively , , , , , , , , .

[0063] Furthermore, according to the number of all grayscale intervals , construct a size The horizontal coordinates of the elements in the matrix and the vertical coordinate The value range of ,in, is the number of all grayscale intervals.

[0064] Furthermore, an identifier is assigned to each element in the matrix, requiring that the local region of each element contains all types of identifiers, where the identifier is Integers in the range, therefore, there are Different types of identification; in this embodiment, ; where the size of the local area of ​​each element is , that is, the local area of ​​each element contains the common elements, and the method for obtaining the local area of ​​the element is: for the coordinates in the matrix Elements of are the horizontal and vertical coordinates of the element respectively. The method to obtain the local area of ​​the element in the matrix is: when the vertical coordinate of the element When it is an even number, the local area of ​​the element is determined by the coordinates in the matrix , , , , , , , The element composition; when the ordinate of the element When it is an odd number, the local area of ​​the element is the coordinates of the matrix , , , , , , , element composition.

[0065] For example, when the interval length When , the schematic diagram of the matrix is ​​as follows Figure 3 As shown, the range of values ​​of the horizontal and vertical coordinates of the elements in the matrix is , and the coordinates are given as The local area and coordinates of the elements are The local area of ​​the elements; when the interval length When , the schematic diagram of the matrix is ​​as follows Figure 4 As shown, the range of values ​​of the horizontal and vertical coordinates of the elements in the matrix is , and the coordinates are given as The local area and coordinates of the elements are The local area of ​​the element.

[0066] S104: setting the size of the image block according to the importance, and calculating the amount of data stored in each frame of the image according to the size of the image block.

[0067] Specifically, the larger the size of the image block, the greater the loss of the video compression result, resulting in worse quality of the video stored in the video acquisition device, but the corresponding compression rate of the video compression result is greater, thereby causing the video acquisition device to store more videos; therefore, the present invention determines the size of the image block according to the importance of the video acquisition device, including: recording the size of the image block as , , are the length and width of the image block, respectively. The greater the importance of the video acquisition device, the smaller the size of the image block. Therefore, when the importance of the video acquisition device is level 1, the size of the image block for ; When the importance of the video acquisition device is level 2, the size of the image block for ; When the importance of the video acquisition device is level 3, the size of the image block for ; When the importance of the video acquisition device is level 4, the size of the image block for .

[0068] In other embodiments, the size of the image block It can be set according to the actual application scenario and requirements, but it requires and At least one of them is even.

[0069] It should be noted that the present invention sets the interval length and the size of the image block according to the importance of the video acquisition device. For a video acquisition device with a greater importance, the smaller the interval length and the size of the image block, the smaller the loss of the video compression result, and thus the clarity of the video stored in the video acquisition device with a greater importance is better, which is convenient for subsequent viewing and analysis.

[0070] The resolutions of common video capture devices include 1920px×960px (i.e. 960P), 1920px×1080px (i.e. 1080P), 3840px×2160px (i.e. 4K ultra-high definition), etc. px (pixel) is the smallest image unit, where the former represents the length of each frame in the captured video, and the latter represents the width of each frame in the captured video. The product of the two is the resolution of each frame in the captured video. For example, in 3840px×2160px, 3840 represents the length of each frame, and 2160 represents the width of each frame.

[0071] When each frame of the video is stored according to the size of the matrix and the image block, the image is divided into multiple image blocks according to the size of the image block. Then the number of all image blocks in each frame is equal to , is the size of each frame image, , are the length and width of each frame image respectively. Every two pixels in the image block form a pixel pair. Then the number of all pixel pairs in each image block is equal to , for the Pixel pairs , , when the serial number When the storage composition The grayscale values ​​of the two pixels are , then each gray value needs to be bit binary number storage, so the storage composition The amount of data of the grayscale values ​​of the two pixels is equal to 16, that is, the data that stores the grayscale values ​​of the first The amount of data on the grayscale values ​​of two pixels in a pixel pair is equal to 16; When When storing The corresponding identifier, since the value range of the identifier is ,and , each identifier needs to be Therefore, the storage of the binary number is The amount of data corresponding to the identifiers of the other pixel pairs outward from the pixel point is equal to 3, and the number of other pixel pairs outward from the first pixel point is equal to ; Therefore, the number of blocks stored in one image is equal to .

[0072] In summary, the amount of data stored in each frame of image is equal to the number of all image blocks in each frame of image multiplied by the number of image blocks stored, and the amount of data stored in each frame of image satisfies the expression:

[0073] ;

[0074] In the formula, is the amount of data stored for each frame of image, is the size of each frame image, , are the length and width of each frame image, For each image block size, , are the length and width of each image block respectively, and the number of all image blocks in each frame is equal to , the number of all pixel pairs in each image block is equal to , To round up.

[0075] S105 , storing the size of the matrix and the image block and the amount of data stored in each frame of the image in the memory space of the video acquisition device.

[0076] Specifically, the size of the matrix and image blocks and the amount of data stored in each frame of the image are stored in the memory space of the video acquisition device; in addition, the memory space of the video acquisition device also stores information such as code, log information and the serial number of the video acquisition device, and the code includes but is not limited to the code for calculating the video acquisition frequency and the code for storing each frame of the video.

[0077] S2. When it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time, and the amount of data stored in each frame of the image, and each frame of the image in the video is stored according to the size of the matrix and the image block.

[0078] It should be noted that when it is detected that the video acquisition device is in a communication offline state, the acquired video cannot be transmitted before the maintenance personnel arrive and restore the communication of the video acquisition device. At this time, the acquired video can only be stored in the local storage space of the video acquisition device. Since the storage space of the video acquisition device is limited, in order to retain the video during the period of device offline as completely as possible, the present invention adjusts the video acquisition frequency according to the available memory of the video acquisition device, the estimated value of the communication recovery time, and the amount of data stored in each frame of the image, and acquires the video according to the video acquisition frequency. At the same time, each frame of the image in the video is compressed and stored according to the size of the matrix and the image block, thereby ensuring the smoothness and quality of the video.

[0079] See the flowchart of step S2. Figure 5 , including step S201 to step S202, specifically:

[0080] S201, calculating and adjusting the video acquisition frequency according to the available memory of the video acquisition device, the estimated value of the communication recovery time, and the amount of data stored in each frame of the image.

[0081] The smallest unit for storing information in memory is bit (Binary Digits, bit), which can store one binary number, that is, 0 or 1, and is the smallest storage unit; and storage units are generally expressed in B (Byte), KB (Kilobyte), MB (Megabyte, abbreviated as "M"), GB (Gigabyte, also known as "Gigabyte"), TB (Trilionbyte, trillion bytes, terabyte), etc. The conversion relationship between them is: 1B=8bit; 1KB=1024; 1MB=1024KB; 1GB=1024MB; 1TB=1024GB.

[0082] Specifically, when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is calculated and adjusted according to the ratio of the available memory of the video acquisition device to the estimated value of the communication recovery time and the amount of data stored in each frame of the image, including: converting the size of the available memory of the video acquisition device into bits and recording it as , then the video acquisition frequency satisfies the expression:

[0083] ;

[0084] In the formula, The video capture frequency of the video capture device, in frames per second. The available memory of the video capture device, in bits; is the amount of data stored for each frame of image, is the estimated value of the communication recovery time of the video acquisition device, in minutes. is the estimated time it takes to restore communications after converting from minutes to seconds. is the floor function.

[0085] It should be noted that the present invention estimates the communication recovery time of the video acquisition device according to the geographical location of the video acquisition device, and then sets the interval length and the size of the image block according to the importance of the video acquisition device and the estimated value of the communication recovery time, so as to calculate the amount of data stored in each frame of the image, so that when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device, the estimated value of the communication recovery time and the amount of data stored in each frame of the image. The present invention adjusts the video acquisition frequency according to the characteristics of the video acquisition device itself, and at the same time, compresses and stores each frame of the image in the video according to the size of the matrix and the image block, so as to ensure the integrity, clarity and fluency of the stored video, which is convenient for subsequent viewing and analysis.

[0086] S202: Capture video according to the video acquisition frequency, and store each frame of the video according to the size of the matrix and the image block.

[0087] Specifically, the video is collected according to the video collection frequency, and the size of each frame image in the video is ,and , are the length and width of each frame image respectively; each frame image is evenly divided into multiple sizes of The image block, , are the length and width of each image block respectively, then the number of all image blocks obtained is equal to , is rounded up; every two pixels in the image block form a pixel pair, then the number of all pixel pairs in each image block is equal to ; Among them, for the two pixels that constitute a pixel pair, in one embodiment, the two pixels are two adjacent pixels in the same row in the image, and in another embodiment, the two pixels are two adjacent pixels in the same column in the image.

[0088] Furthermore, according to the size of the matrix and the image block, when storing each frame of the video, all pixel pairs in any image block are stored, wherein for the first Pixel pairs , when the serial number When the storage composition The grayscale values ​​of two pixels; when When, according to the composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements , according to the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identification is stored.

[0089] Among them, the composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements , including: The grayscale interval to which the grayscale value of the first pixel of the two pixels belongs is used as the horizontal coordinate , will form The grayscale interval number to which the grayscale value of the second pixel of the two pixels belongs is used as the vertical coordinate , the coordinates in the matrix are elements, as Corresponding elements .

[0090] Among them, the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identifiers include: In the element In the local area, the element , as the first Pixel pairs The corresponding identifier; if the element Not in element In the local area, the element In the local area and element The ID of the element closest to the Pixel pairs The corresponding logo.

[0091] It should be noted that since the amount of data for storing the grayscale values ​​of two pixels constituting a pixel pair is equal to 16, and the amount of data for storing the identifier corresponding to a pixel pair is equal to 3, the present invention stores the identifier corresponding to the pixel pair, and the amount of data for storing the identifier is smaller than that for storing the grayscale values ​​of the two pixels constituting the pixel pair, thereby improving the compression rate of the video compression result, thereby ensuring the integrity and smoothness of the stored video.

[0092] An embodiment of the present invention also discloses an artificial intelligence-based video data optimization acquisition system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an artificial intelligence-based video data optimization acquisition method according to the present invention is implemented.

[0093] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0094] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0095] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A video data optimization acquisition method based on artificial intelligence, characterized in that: include: For video acquisition devices associated with the monitoring center: Calculate an estimate of the communication restoration time based on the maintenance records and the geographic location of the video acquisition device; The interval length is set according to the importance of the video acquisition device and the estimated value of the communication recovery time, so as to divide all grayscale values ​​into multiple grayscale intervals; a matrix is ​​constructed according to the grayscale intervals and identifiers are assigned to the elements in the matrix, requiring that the local area of ​​each element contains all types of identifiers; the size of the image block is set according to the importance, so as to calculate the amount of data stored in each frame of the image; The size of the matrix and the image block and the amount of data stored for each frame of the image are stored in the memory space of the video acquisition device, so that when it is detected that the video acquisition device is in a communication offline state, the video acquisition frequency is adjusted according to the available memory of the video acquisition device and the estimated value of the communication recovery time and the amount of data stored for each frame of the image, and each frame of the image in the video is stored according to the size of the matrix and the image block, including: dividing the image into a plurality of image blocks, and forming a pixel pair with every two pixels in the image block; For Pixel pairs , when the serial number When the storage composition The grayscale values ​​of two pixels; when When, according to the composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements , according to the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identification is stored.

2. The video data optimization acquisition method based on artificial intelligence according to claim 1 is characterized in that: The calculating of the estimated value of the communication recovery time comprises: Calculate the distance from the monitoring center to the video acquisition device based on the geographical location of the video acquisition device and the monitoring center ; According to the distance, multiple reference records are obtained from the maintenance record, and the distance from the monitoring center to the video acquisition device being repaired in the reference record is Within the range, is the distance threshold; Calculate the estimated travel time from the monitoring center to the video acquisition device , , is the number of all reference records, , They are respectively from the monitoring center to the The distance and passage time of the video acquisition equipment being repaired in the reference records; the average or median of the repair time of the video acquisition equipment being repaired in all reference records is used as the estimated value of the repair time of the video acquisition equipment ; The estimated value of the communication recovery time of the video acquisition device is .

3. The video data optimization acquisition method based on artificial intelligence according to claim 1 is characterized in that: The step of setting the interval length according to the importance of the video acquisition device and the estimated value of the communication recovery time comprises: Determine the interval length based on the importance of the video acquisition device The value range includes: When the importance of the video acquisition equipment is level 1 to level 4, the interval length The value ranges are , , and ; Determine the interval length from the range of values ​​based on the estimated value of the communication recovery time of the video acquisition device , , The length of the interval The left and right boundaries of the value range, is the estimated value of the communication recovery time, , They are the communication recovery time of the video acquisition equipment being repaired in the maintenance record. The minimum and maximum values ​​of To round up.

4. The video data optimization acquisition method based on artificial intelligence according to claim 1 is characterized in that: The size of the matrix is , is the number of all grayscale intervals, and equal ,scope There are 256 grayscale values ​​in total. is rounded up; the identifier is Integer in the range, ; The size of the local area of ​​each element is , for the matrix with coordinates Element: When the ordinate of the element When it is an even number, the local area of ​​the element is determined by the coordinates in the matrix , , , , , , , The element composition; when the ordinate of the element When it is an odd number, the local area of ​​the element is the coordinates of the matrix , , , , , , , The elemental composition of are the horizontal and vertical coordinates of the element respectively.

5. The method for optimizing video data acquisition based on artificial intelligence according to claim 1, characterized in that: The step of setting the size of the image block according to the importance comprises: When the importance of the video acquisition device is level 1 to level 4, the size of the image block They are , , and ; , are the length and width of the image block respectively.

6. The method for optimizing video data acquisition based on artificial intelligence according to claim 1, characterized in that: The amount of data stored for each frame of image satisfies the expression: ; In the formula, is the amount of data stored for each frame of image, is the size of each frame image, , are the length and width of each frame image, For each image block size, , are the length and width of each image block, To round up.

7. The method for optimizing video data acquisition based on artificial intelligence according to claim 1, characterized in that: The video acquisition frequency satisfies the expression: ; In the formula, The video capture frequency of the video capture device, in frames per second. The available memory of the video capture device, in bits; is the amount of data stored for each frame of image, is the estimated value of the communication recovery time of the video acquisition device, in minutes. is the estimated time it takes to restore communications after converting from minutes to seconds. is the floor function.

8. The method for optimizing video data acquisition based on artificial intelligence according to claim 1, characterized in that: The composition The grayscale interval to which the grayscale values ​​of the two pixels belong is determined in the matrix Corresponding elements ,include: Will form The grayscale interval to which the grayscale value of the first pixel of the two pixels belongs is used as the horizontal coordinate , will form The grayscale interval number to which the grayscale value of the second pixel of the two pixels belongs is used as the vertical coordinate , the coordinates in the matrix are elements, as Corresponding elements .

9. The method for optimizing video data acquisition based on artificial intelligence according to claim 1, characterized in that: According to the element With The elements corresponding to the pixel pairs The positional relationship of the local area is determined The corresponding identifiers include: If the element In the element In the local area, the element , as the first Pixel pairs The corresponding identifier; if the element Not in element In the local area, the element In the local area and element The ID of the element closest to the Pixel pairs The corresponding logo.

10. A video data optimization acquisition system based on artificial intelligence, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an artificial intelligence-based video data optimization acquisition method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • A video monitoring method, a video monitoring server and an encoder device

    CN116939170B

  • Video storage and backup method thereof

    CN107547817A

  • Binary image-based official document security management and verification method and system

    CN117668919A