[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118042082B - Video time calibration method based on meteorological change in data center station - Google Patents

Video time calibration method based on meteorological change in data center station Download PDF

Info

Publication number
CN118042082B
CN118042082B CN202410200577.0A CN202410200577A CN118042082B CN 118042082 B CN118042082 B CN 118042082B CN 202410200577 A CN202410200577 A CN 202410200577A CN 118042082 B CN118042082 B CN 118042082B
Authority
CN
China
Prior art keywords
snow
rain
time
record
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410200577.0A
Other languages
Chinese (zh)
Other versions
CN118042082A (en
Inventor
易小林
杨红兵
蔡青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei Taiyue Satellite Technology Development Co ltd
Original Assignee
Hubei Taiyue Satellite Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Taiyue Satellite Technology Development Co ltd filed Critical Hubei Taiyue Satellite Technology Development Co ltd
Priority to CN202410200577.0A priority Critical patent/CN118042082B/en
Publication of CN118042082A publication Critical patent/CN118042082A/en
Application granted granted Critical
Publication of CN118042082B publication Critical patent/CN118042082B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

The invention provides a method for calibrating video time based on meteorological changes in a data center station, which relates to the technical field of video calibration and comprises the following steps: acquiring a monitoring video of monitoring equipment, carrying out rain and snow identification and analysis on the monitoring video, collecting the monitoring video containing rain and snow, recording rain and snow information to obtain the rain and snow video, and sequencing the rain and snow video of each monitoring equipment from small to large according to a time stamp to form a rain and snow record set; grouping all the rain and snow record sets according to a grouping method to obtain rain and snow record sets, wherein each rain and snow record set is provided with a grouping sequence number, and the duration time of rain and snow recorded in each set is the same; determining real weather records by using the group sequence numbers of the rain and snow record groups to obtain a weather record set, wherein the weather record set comprises a weather sequence number, weather starting time and weather ending time; and comparing the weather record set with corresponding time in the rain and snow record set through analyzing the weather record set, identifying the problem equipment, and carrying out clock calibration on the problem equipment by using a calibration method to obtain the calibrated monitoring equipment. The invention not only improves the clock accuracy with clock problems, but also provides an effective detection and correction mechanism for the clock problems possibly occurring in the future.

Description

Video time calibration method based on meteorological change in data center station
Technical Field
The invention relates to the technical field of video calibration, in particular to a method for calibrating video time based on meteorological changes in a data center station.
Background
By installing monitoring cameras in public places, traffic channels, important buildings and other places and transmitting video data through a network, the all-around monitoring and management of urban and rural areas is realized.
However, the time-stamping accuracy problem of monitoring devices is a ubiquitous challenge. This is mainly due to the fact that the monitoring device is usually installed in an outdoor environment and is affected by natural conditions, such as temperature changes, humidity and the like, so that the CMOS clock of the device drifts, and the time stamp of the video deviates from the actual time. Such time-stamped deviations can have a serious impact on the analysis and application of the video data. Inaccurate time stamping may cause a time sequence disorder of events, affecting the accurate identification and analysis of the events by the monitoring system. In addition, inaccuracy of the time stamp may also cause errors in data analysis, thereby affecting monitoring and management of rural area safety, traffic, environment, and the like.
Therefore, the problem of accuracy of time marks of monitoring equipment is an important part of development in digital rural areas, and needs to be paid attention to and be effectively solved.
Disclosure of Invention
In view of the above, the present invention provides a method for calibrating video time based on weather changes in a data center, which analyzes weather conditions by monitoring video recorded by a device, mainly focuses on rainfall or snowing and duration thereof, and calculates time offset to clock the video by identifying a problem device.
The technical purpose of the invention is realized as follows:
the invention provides a video time calibration method based on meteorological changes in a data center station, which comprises the following steps:
S1, acquiring monitoring videos of monitoring equipment, carrying out rain and snow identification and analysis on the monitoring videos, collecting the monitoring videos containing rain and snow, recording rain and snow information to obtain rain and snow videos, and sequencing the rain and snow videos of each monitoring equipment from small to large according to time stamps to form a rain and snow record set, wherein each rain and snow record set comprises a monitoring equipment ID, the rain and snow videos, weather types and the rain and snow information, and the rain and snow information comprises a rain and snow start time, a rain and snow duration time and a rain and snow end time;
S2, grouping all the rain and snow record sets according to a grouping method to obtain rain and snow record sets, wherein each rain and snow record set is provided with a grouping sequence number, and the duration time of rain and snow recorded in each set is the same;
s3, determining real weather records by using the group serial numbers of the rain and snow record groups to obtain a weather record set, wherein the weather record set comprises a weather serial number, a weather start time and a weather end time;
S4, comparing the weather record set with corresponding time in the rain and snow record set through analyzing the weather record set, identifying problem equipment, and carrying out clock calibration on the problem equipment by using a calibration method to obtain calibrated monitoring equipment.
Based on the above technical solution, preferably, step S1 includes:
S11, acquiring monitoring videos, dividing the monitoring videos according to corresponding monitoring devices, wherein each monitoring device corresponds to one group of monitoring videos, and sequencing each group of monitoring videos in ascending order according to time stamps from small to large to obtain monitoring devices and monitoring video groups thereof;
s12, selecting a monitoring device, and eliminating night videos in a monitoring video group of the monitoring device;
s13, selecting a monitoring video according to the time stamp;
S14, identifying the current monitoring video by adopting a rain and snow monitoring and identifying algorithm, if rain and snow are detected, classifying the current monitoring video into a rain and snow video, and recording a time point when the rain and snow starts and a time point when the rain and snow ends; otherwise, classifying the video as normal video;
S15, repeating the steps S13-S14 to obtain all the rain and snow videos, and sequencing the rain and snow videos from small to large according to the starting time points of the rain and snow videos to form a starting sequence, wherein each element in the starting sequence comprises a monitoring device ID, the starting time points of the rain and snow and a weather type; ordering the rain and snow video from small to large according to the time point when the rain and snow is finished to form an end sequence, wherein each element in the end sequence comprises a monitoring device ID, the time point when the rain and snow is finished and a weather type;
S16, according to the time proximity, pairing the time of the starting sequence and the time of the ending sequence, and obtaining a rain and snow event record if the pairing is successful, wherein the rain and snow event record comprises a rain and snow starting time, a rain and snow duration time and a rain and snow ending time, and all the rain and snow event records are used as a rain and snow record set of current monitoring equipment;
s17, repeating the steps S12-S16 to obtain a rain and snow record set of all monitoring devices.
On the basis of the above technical solution, preferably, step S16 includes:
s161, judging the number of elements in the starting sequence and the ending sequence, if the number of elements in any sequence is 0, turning to a step S169, otherwise, executing a step S162;
S162, judging whether the number of elements in the starting sequence is 1, if so, executing step S163, and if not, turning to step S164;
S163, taking the element in the starting sequence as a first element, selecting an element closest to the beginning time point of the rain and snow in the first element in the ending sequence as a second element, forming a record by the first element and the second element, wherein the record comprises a monitoring device ID, a weather type, a beginning time of the rain and the snow, an ending time of the rain and the snow and a duration time of the rain and the snow, the beginning time of the rain and the snow is the beginning time point of the rain and the snow in the first element, the ending time of the rain and the snow is the ending time point of the rain and the snow in the second element, taking the record as a rain and snow record set of the monitoring device, and turning to step S169;
S164, setting two variables first and second of a start sequence, setting one variable end of an end sequence, and initializing the first, second and end, wherein the first variable is initialized by using the time recorded by the first record in the start sequence, the second variable is initialized by using the time recorded by the second record in the start sequence, and the end variable is initialized by using the time recorded by the first record in the end sequence;
S165, if first < end and second > end, forming a rain and snow event record by using the first and end, wherein the rain and snow event record comprises a monitoring device ID, a weather type, a rain and snow start time, a rain and snow end time and a rain and snow duration time, the rain and snow start time is first, the rain and snow end time is end, the rain and snow duration time is the difference between the end and the first, and turning to step S167, otherwise, executing step S166;
S166, updating a second variable by using the time of the next record, screening out the record of the time point when the rain and snow starts if the new second is < end, and screening out the record of the time point when the rain and snow ends if the new second is > end;
S167, if the first is used or invalid, updating the first by using the current second, selecting the time of the next record as the second in the starting sequence, selecting the time of the next record to update the end in the ending sequence, and turning to step S165;
s168, repeating the steps S165-S167 until the starting sequence and the ending sequence are traversed;
and S169, finishing pairing to obtain a rain and snow record set.
Based on the above technical solution, preferably, step S1 further includes:
setting a first threshold according to seasonal variations: the first threshold value is 10h in winter and 8h in summer; setting a second threshold to be 5min;
Comparing the duration of the rain and snow in the rain and snow record set with a first threshold value and a second threshold value, and deleting the corresponding rain and snow record if the duration of the rain and snow is greater than the first threshold value or the duration of the rain and snow is less than the second threshold value.
Based on the above technical solution, preferably, step S2 includes:
S21, carrying out primary and secondary ascending sequencing on all the rain and snow record sets according to the ID of the monitoring device and the beginning time of the rain and snow to obtain a first sequence; selecting a rain and snow record set of one monitoring device from the first sequence as a reference set, and selecting the rain and snow record sets of other monitoring devices as a comparison set;
S22, setting an identifier for all elements of the comparison set, wherein the identifier is not grouped; setting a group sequence number N and initializing the value of N to be 1;
s23, setting a reference variable a, selecting a rain and snow record in a reference set, and assigning the duration of the rain and snow record to the reference variable a;
S24, initializing a current packet by using the reference set and the packet sequence number N, wherein elements in the current packet comprise the packet sequence number, the monitoring equipment ID in the reference set, the beginning time of rain and snow, the duration time of rain and snow and the ending time of rain and snow;
S25, selecting one comparison device from the comparison set; setting a comparison variable b, selecting an ungrouped rain and snow record in a rain and snow record set of comparison equipment, and assigning the duration of the rain and snow to the comparison variable b;
s26, setting a time threshold E, if the absolute value of a-b is smaller than the absolute value of E, taking a and b as comparison records of the same group, and executing a step S27, otherwise, returning to the step S25 to select the next ungrouped rain and snow record, and assigning the duration of the rain and snow record to a comparison variable b;
s27, adding the comparison record into the current packet, updating the identification of the comparison record, and updating the non-packet into the already-grouped one;
S28, repeating the steps S25-S27 until all monitoring devices in the comparison set are traversed as comparison devices, and ending the current grouping;
s29 makes n=n+1, and returns to step S23 until all the rain and snow records in the reference set are traversed, resulting in a rain and snow record group.
Based on the above technical solution, preferably, step S2 further includes:
and setting a group filtering threshold value as 5, and if the total number of elements of the group is smaller than the group filtering threshold value, the group is an invalid group, and the group is deleted from the rain and snow record group.
Based on the above technical solution, preferably, step S3 includes:
S31, ordering the rain and snow record groups according to the sequence from the small group sequence number to the large group sequence number to obtain a second sequence;
s32, setting M as a weather sequence number, and selecting a current grouping sequence number in the second sequence to assign to M;
s33, setting a first variable R0, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a first record, and assigning the first record to the first variable R0;
S34, setting a record variable C, and initializing the record variable C to 1;
S35, setting a second variable R1, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a second record, and assigning the second record to the second variable R1, wherein the first record is different from the second record;
s36 if the start time of rain and snow of |r0-the start time of rain and snow of R1| < E, let c=c+1, otherwise, let C unchanged;
S37, repeating the steps S35-S36 until all the rain and snow records except R0 are traversed, and obtaining updated C;
S38, if C is more than 0.5 times of the total number of the rain and snow records corresponding to the current grouping sequence number, adding a first record corresponding to R0 into a weather record set, otherwise, judging whether the rain and snow records corresponding to the current grouping sequence number are all assigned to a first variable R0, if so, executing a step S39, otherwise, returning to a step S33, selecting the next rain and snow record as the first record, and assigning the next rain and snow record to the first variable R0;
s39, repeating the steps S32-S38 until all the group serial numbers are assigned as M, and obtaining a final weather record set.
Based on the above technical solution, preferably, step S4 includes:
S41, analyzing weather starting time and snow starting time according to the weather record set and the snow record set, and identifying a problem equipment set according to a time comparison result;
s42, acquiring video time T generated by all problem devices in the problem device set, and calculating clock offset delta T i, interval day offset delta T Partition board and later day offset delta T Rear part (S) of the problem devices, wherein i represents the ith rainy and snowy weather:
if the video time T falls on the day of rainy and snowy weather, the video time is calibrated by using the corresponding clock offset delta T i;
If the video time T is earlier than the first rainy and snowy weather, calibrating the video time by using the offset delta T 1 of the first rainy and snowy weather;
If the video time T is between two rainy and snowy days and is not the rainy and snowy days, the video time is calibrated by using the interval day offset delta T Partition board ;
If the video time T is after the last rainy or snowy weather, calibrating the video time by using the backward day offset delta T Rear part (S) ;
if the problem device has only one rain and snow record, the monitoring video corresponding to the problem device is calibrated by using the offset delta T 1 of the rain and snow record.
On the basis of the above technical solution, preferably, step S41 includes:
S411 sets variables V and B0, selects one weather record according to elements in the weather record set, assigns the weather serial number to the variable V, and assigns the weather starting time to the variable B0;
s412, in the rain and snow record set, acquiring the rain and snow records with the same grouping sequence number as V, and classifying the records into a first set;
S413, setting a variable B1, selecting one rain and snow record in the first set, and assigning the beginning time of the rain and snow in the rain and snow record to the variable B1;
S414 if the I B0-B1I < E, the clock of the corresponding monitoring equipment is normal, otherwise, a new problem equipment record is created and added into the problem equipment set;
s415 repeats steps S413-S414, traversing all the rain and snow records in the first set;
S416, repeating the steps S411-S415, traversing all weather records in the weather record set to obtain a problem device set.
On the basis of the above technical solution, preferably, step S42 includes:
S421, sequencing the problem equipment set according to the main and secondary ascending sequences of the ID of the monitoring equipment and the beginning time of the snow and rain, numbering according to the sequence to obtain a problem equipment sequence, and calculating the clock offset delta T i of each problem equipment;
S422, selecting one problem device from the sequence of problem devices;
S423 judges whether the number of the rain and snow records of the problem equipment is equal to 1, if so, the time stamp of the monitoring video is updated by increasing the delta T 1 value for the monitoring video generated by the problem equipment so as to calibrate the video time, and the step S427 is carried out, otherwise, the step S424 is executed;
S424, selecting a monitoring video from the monitoring videos of the problem equipment, and recording the starting time of the monitoring video, namely video time t;
S425 judges whether the video time T is on the same day as the time T i recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by adding the clock offset delta T i, if not, whether the video time T is between the time T i and T i+1 recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by using the interval day offset delta T Partition board , if not, whether the video time T is before the time of the first rain and snow record T 1, if yes, the time stamp of the monitoring video is updated by using the offset delta T 1, and if not, the time stamp of the monitoring video is updated by using the later day offset delta T Rear part (S) ;
s426 repeats steps S424-S425 until all monitoring videos of the problem device are traversed;
S427, repeating steps S422-S426 until all problem devices in the sequence of problem devices are traversed;
and S428, completing clock calibration to obtain the calibrated monitoring equipment.
Compared with the prior art, the method has the following beneficial effects:
(1) The method and the device can accurately record the beginning time, the duration time and the ending time of the rain and the snow by identifying and analyzing the rain and snow information in the monitoring video. According to the information, by combining a grouping method and a weather record set, accurate time calibration of the monitoring equipment can be realized, and the time of the monitoring equipment is ensured to be synchronous with actual weather change. The time of the monitoring equipment is calibrated, so that the management efficiency and accuracy of the monitoring equipment can be improved;
(2) According to the invention, by adopting a rain and snow monitoring and identifying algorithm, the rain and snow situation in a monitoring video can be automatically identified, the identification efficiency of rain and snow events is improved, the starting time and the ending time of the rain and snow events can be accurately paired through the time pairing method in the step S16, the accurate rain and snow event record is obtained, and monitoring equipment possibly having problems can be identified through analysis of a rain and snow record set, so that clock calibration is carried out on the equipment, and the reliability of monitoring data is improved;
(3) According to the invention, all the rain and snow record sets are sequenced according to the ID of the monitoring device and the beginning time of the rain and snow, and are compared and grouped, so that the data can be well integrated and organized, a time threshold E is set, rain and snow events with similar duration can be identified and classified into the same group, similar rain and snow event data can be found and integrated, and the similar rain and snow event records can be classified into the same group by a comparison grouping method, so that the data management and organization can be optimized;
(4) According to the method, the weather record and the rain and snow record are analyzed, the problem equipment set with time offset is identified, and the clock offset is calculated and applied according to different conditions to calibrate the time of the monitoring video, so that the accuracy and consistency of the monitoring data are ensured; and different calibration modes are adopted according to different conditions, for example, a proper offset is selected for calibration according to the relation between video time and the recording time of rain and snow, so that the calibration process is more flexible and accurate.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of step S1 in the embodiment of the invention;
FIG. 3 is a flowchart of step S16 in an embodiment of the present invention;
FIG. 4 is a schematic flow chart of step S2 in the embodiment of the invention;
FIG. 5 is a flowchart of step S3 in an embodiment of the present invention;
Fig. 6 is a schematic flow chart of step S4 in the embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will clearly and fully describe the technical aspects of the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, are intended to fall within the scope of the present invention.
As shown in fig. 1, the present invention provides a method for calibrating video time based on meteorological changes in a data center, comprising the following steps:
S1, acquiring monitoring videos of monitoring equipment, carrying out rain and snow identification and analysis on the monitoring videos, collecting the monitoring videos containing rain and snow, recording rain and snow information to obtain rain and snow videos, and sequencing the rain and snow videos of each monitoring equipment from small to large according to time stamps to form a rain and snow record set, wherein each rain and snow record set comprises a monitoring equipment ID, the rain and snow videos, weather types and the rain and snow information, and the rain and snow information comprises a rain and snow start time, a rain and snow duration time and a rain and snow end time;
S2, grouping all the rain and snow record sets according to a grouping method to obtain rain and snow record sets, wherein each rain and snow record set is provided with a grouping sequence number, and the duration time of rain and snow recorded in each set is the same;
s3, determining real weather records by using the group serial numbers of the rain and snow record groups to obtain a weather record set, wherein the weather record set comprises a weather serial number, a weather start time and a weather end time;
S4, comparing the weather record set with corresponding time in the rain and snow record set through analyzing the weather record set, identifying problem equipment, and carrying out clock calibration on the problem equipment by using a calibration method to obtain calibrated monitoring equipment.
The invention provides a time calibration method based on meteorological changes. The weather conditions are analyzed by the video recorded by the monitoring equipment by applying an identification algorithm, and rainfall or snowing and the duration time are mainly concerned. Assuming uniform precipitation patterns at the same time in the area, devices with inaccurate time recordings can be identified from these data. Then, the historical video data is corrected by calculating the time offset.
The duration of any one rain or snow in a localized area is a different feature. A weather identification algorithm is introduced first to identify the beginning and end of rainfall or snowing in each monitored recorded video, and to acquire a device time stamp and analyze the duration. A plurality of weather records are formed for each device: including weather type (rainfall or snowing), start time, end time, duration. Through comparative analysis, the weather changes of different devices with the same duration and precipitation amount can be classified into the same weather changes, and the fact that the devices record the same rain or snow is indicated. Also, since the clocks of most devices are accurate, the actual start and stop times of precipitation are deduced from these data. By means of the method, the clock of the device is judged to be in problem, and therefore time calibration of the device in question is needed.
Specifically, in an embodiment of the present invention, step S1 includes:
S11, acquiring monitoring videos, dividing the monitoring videos according to corresponding monitoring devices, wherein each monitoring device corresponds to one group of monitoring videos, and sequencing each group of monitoring videos in ascending order according to time stamps from small to large to obtain monitoring devices and monitoring video groups thereof;
s12, selecting a monitoring device, and eliminating night videos in a monitoring video group of the monitoring device;
s13, selecting a monitoring video according to the time stamp;
S14, identifying the current monitoring video by adopting a rain and snow monitoring and identifying algorithm, if rain and snow are detected, classifying the current monitoring video into a rain and snow video, and recording a time point when the rain and snow starts and a time point when the rain and snow ends; otherwise, classifying the video as normal video;
S15, repeating the steps S13-S14 to obtain all the rain and snow videos, and sequencing the rain and snow videos from small to large according to the starting time points of the rain and snow videos to form a starting sequence, wherein each element in the starting sequence comprises a monitoring device ID, the starting time points of the rain and snow and a weather type; ordering the rain and snow video from small to large according to the time point when the rain and snow is finished to form an end sequence, wherein each element in the end sequence comprises a monitoring device ID, the time point when the rain and snow is finished and a weather type;
S16, according to the time proximity, pairing the time of the starting sequence and the time of the ending sequence, and obtaining a rain and snow event record if the pairing is successful, wherein the rain and snow event record comprises a rain and snow starting time, a rain and snow duration time and a rain and snow ending time, and all the rain and snow event records are used as a rain and snow record set of current monitoring equipment;
s17, repeating the steps S12-S16 to obtain a rain and snow record set of all monitoring devices.
Step S16 includes:
s161, judging the number of elements in the starting sequence and the ending sequence, if the number of elements in any sequence is 0, turning to a step S169, otherwise, executing a step S162;
S162, judging whether the number of elements in the starting sequence is 1, if so, executing step S163, and if not, turning to step S164;
S163, taking the element in the starting sequence as a first element, selecting an element closest to the beginning time point of the rain and snow in the first element in the ending sequence as a second element, forming a record by the first element and the second element, wherein the record comprises a monitoring device ID, a weather type, a beginning time of the rain and the snow, an ending time of the rain and the snow and a duration time of the rain and the snow, the beginning time of the rain and the snow is the beginning time point of the rain and the snow in the first element, the ending time of the rain and the snow is the ending time point of the rain and the snow in the second element, taking the record as a rain and snow record set of the monitoring device, and turning to step S169;
S164, setting two variables first and second of a start sequence, setting one variable end of an end sequence, and initializing the first, second and end, wherein the first variable is initialized by using the time recorded by the first record in the start sequence, the second variable is initialized by using the time recorded by the second record in the start sequence, and the end variable is initialized by using the time recorded by the first record in the end sequence;
S165, if first < end and second > end, forming a rain and snow event record by using the first and end, wherein the rain and snow event record comprises a monitoring device ID, a weather type, a rain and snow start time, a rain and snow end time and a rain and snow duration time, the rain and snow start time is first, the rain and snow end time is end, the rain and snow duration time is the difference between the end and the first, and turning to step S167, otherwise, executing step S166;
S166, updating a second variable by using the time of the next record, screening out the record of the time point when the rain and snow starts if the new second is < end, and screening out the record of the time point when the rain and snow ends if the new second is > end;
S167, if the first is used or invalid, updating the first by using the current second, selecting the time of the next record as the second in the starting sequence, selecting the time of the next record to update the end in the ending sequence, and turning to step S165;
s168, repeating the steps S165-S167 until the starting sequence and the ending sequence are traversed;
and S169, finishing pairing to obtain a rain and snow record set.
Step S1 further includes:
setting a first threshold according to seasonal variations: the first threshold value is 10h in winter and 8h in summer; setting a second threshold to be 5min;
Comparing the duration of the rain and snow in the rain and snow record set with a first threshold value and a second threshold value, and deleting the corresponding rain and snow record if the duration of the rain and snow is greater than the first threshold value or the duration of the rain and snow is less than the second threshold value.
Referring to fig. 2, a specific example is described as follows:
Step 1, sorting video packets according to equipment: firstly, acquiring a large amount of video data from a data center station, and grouping according to respective monitoring equipment; second, each set of data is ordered in ascending order according to the video time stamp. After this process is completed, step 2 is entered.
Step 2, selecting one device: when monitoring equipment is selected, if the operation is initial operation, equipment with smaller ID serial number is preferentially selected; if the operation is not the first operation, the next equipment with the sequence number following the previous equipment is sequentially selected for operation, and the step 3 is entered after the completion.
Step 3, video at night: this embodiment only analyzes daytime video. This is because night videos often affect the accuracy of rain detection due to insufficient light. Setting a threshold value, and if the threshold value is exceeded, judging that the night video is night video and eliminating the night video. After completion, step 4 is entered.
Step 4, selecting the next video in sequence: selecting one video according to the ascending sequence of the time stamps of the videos, and if the video is initially operated, selecting the first video; if not, the next video immediately preceding is selected in time order. After completion, step 5 is entered.
Step 5, identifying the beginning of rainfall: in order to detect rainfall conditions in the video, a raindrop monitoring and identifying technology of machine vision is adopted. The technology can accurately judge whether raindrops appear or not, and the same method is also suitable for monitoring snowflakes. In the present embodiment, attention is paid to determining whether rainfall has occurred by a raindrop recognition algorithm. If no raindrops are detected for a period of time (e.g., 5 seconds) of the video, and the presence of raindrops is continuously detected for a subsequent period of time, it is determined that rainfall starts. At this time, a time stamp at which the raindrop was first detected is recorded as a time point at which rainfall starts, and this record is saved. In this way, a record of the onset of rainfall in all videos is generated. After this process is completed, all records are arranged in ascending order of time stamp, forming a start sequence. Each element of the sequence includes a device ID, time, weather type information, where the weather type is rainfall. The sequence provides for the generation of the set of rainfall recordings of step 8. After completion, step 6 is entered.
Step 6, identifying the end of rainfall: and 5, introducing machine vision, judging whether rainfall is finished or not, and judging the standard: raindrops are continuously detected for a period of time (e.g., 5 seconds) of the video, and raindrops are continuously not detected for a subsequent period of time, then it is determined that the rainfall is finished. At this time, a time stamp at which no raindrop was detected for the first time is recorded as a time point at which rainfall ends. After this process is completed, all records are arranged in ascending order of time stamp, forming an end sequence. Each element of the sequence includes a device ID, time, weather type information. The sequence also provides for the generation of the set of rainfall recordings of step 8. After completion, step 7 is entered.
Step 7, whether the video identification is finished: judging whether all video files are subjected to rainfall recognition, if so, entering a step 8, otherwise, entering a step 4, and continuing to recognize.
Step 8, generating a device rainfall record set: and pairing the time of the beginning sequence and the ending sequence according to the time proximity by utilizing the rainfall beginning sequence and the ending sequence recorded by the equipment, so as to form a complete rainfall event record.
In this embodiment, the implementation process of step 8 is shown in fig. 3, and the sub-process includes:
Substep 1) checks if 2 sequence elements are zero: and judging the element numbers in the starting sequence and the ending sequence, if any element in the starting sequence is zero, indicating that the rainfall condition recorded by the equipment is 0, and failing to generate a weather record set of the equipment, and entering a step sub-step 15. Otherwise, go to substep 2).
Substep 2) checking if the number of start sequence elements is 1: judging whether the number of elements in the starting sequence is 1, if so, entering a substep 3); otherwise, enter substep 4).
Substep 3) forming a record set: in the end sequence, a record is found from the end sequence that is closest to the start time in the start sequence. The device ID, weather type, start time, end time, duration, where start time is the time of the start sequence, end time is the time in the end sequence, duration is the difference between end time and start time in seconds. And forming the set of device records from the record. After completion the sub-step 13) is entered.
Substep 4) initializing variables first and second: the first and second variables are initialized with the time recorded in the first 2 records of the start sequence, and substep 5 is entered after completion.
Substep 5) initializing a variable end: initializing a variable end with the time of the first record of the end sequence, and entering substep 6 after completion.
Substep 6) judging that first < end and second > end: since the time series of rainfall starts is arranged in ascending order, it is determined whether a certain start time point (first) and end time point (end) can be paired to form a complete rainfall event record by using this characteristic. If the condition is met, the first and end can be used for forming a rainfall record, and the substep 7 is entered; otherwise, the rainfall record cannot be formed, and the substep 8 is entered).
Substep 7) forming this device weather record: a weather record is constructed by using the first and end. There is a device ID, weather type, start time, end time, duration in the record. The start time is first, the end time is end, and the duration is the difference between end and first in seconds. And finally, adding the record into the rainfall record set of the equipment, and entering a substep 9 after finishing.
Substep 8) determining second < end: when comparing the rainfall start time first and the end time end to form a rainfall record, it is determined whether the next start time second is earlier than the current end time (end). If second is earlier than end, the record of this start time point should be excluded, substep 9 is entered); conversely, if end is earlier than second, the recording of this end time point should be excluded, and substep 12 is entered. This mismatch is caused by the night video having been filtered out before the video analysis.
Substep 9) whether the start sequence is traversed: it is determined whether the start sequence has been traversed. If yes, go to sub-step 13); otherwise, substep 10) is entered.
Substep 10) first=second: to this step, it is explained that first has been used or invalidated, and first is updated with second, and substep 11 is entered after completion.
Sub-step 11) update second with the next record: in the start sequence, the time of the next record is selected as second. After completion the sub-step 12) is entered.
Substep 12) whether the end sequence is traversed: it is determined whether the end sequences have been traversed. If yes, go to sub-step 13; otherwise, substep 14) is entered.
Substep 13) proposes a recording of too long or too short duration: in processing rainfall data, it is desirable to screen out those exceptionally long rainfall recordings. Typically, rainfall does not last for an extremely long time, which may result in some rainfall recordings showing abnormal durations due to filtering out night videos. Although certain rainfall events may last for a long time, the duration is primarily relied upon to make the determination during device calibration. Thus, different continuous rainfall thresholds are set according to seasonal variations: typically 10 hours in winter and 8 hours in summer. Likewise, it is also desirable to filter out those records that are abnormally short, typically with a threshold of less than 5 minutes. This is because the image recognition algorithm may generate short false positives, and in particular, in a short-time rainfall event that is actually present, the participation of error data is more unavoidable. After completion the sub-step 15) is entered.
Substep 14) update end with the next record: in the ending sequence, selecting the next time record to update end, entering a substep 6 after finishing, and continuously judging whether the weather record is met.
Substep 15) ends: indicating that a set of all rainfall recordings in the plant has been generated.
Ending the sub-flow, indicating that step8 ends, and then proceeding to step 9.
Step 9, whether all devices traverse: judging whether all videos of the equipment are subjected to rainfall recognition, and generating an equipment rainfall record set, if so, entering a step 10; otherwise, go to step 2.
Step 10, completing video analysis: this step indicates that all video analysis has been completed for all devices within a local area and provides raw data for generating a real weather record.
Specifically, in an embodiment of the present invention, step S2 includes:
S21, carrying out primary and secondary ascending sequencing on all the rain and snow record sets according to the ID of the monitoring device and the beginning time of the rain and snow to obtain a first sequence; selecting a rain and snow record set of one monitoring device from the first sequence as a reference set, and selecting the rain and snow record sets of other monitoring devices as a comparison set;
S22, setting an identifier for all elements of the comparison set, wherein the identifier is not grouped; setting a group sequence number N and initializing the value of N to be 1;
s23, setting a reference variable a, selecting a rain and snow record in a reference set, and assigning the duration of the rain and snow record to the reference variable a;
S24, initializing a current packet by using the reference set and the packet sequence number N, wherein elements in the current packet comprise the packet sequence number, the monitoring equipment ID in the reference set, the beginning time of rain and snow, the duration time of rain and snow and the ending time of rain and snow;
S25, selecting one comparison device from the comparison set; setting a comparison variable b, selecting an ungrouped rain and snow record in a rain and snow record set of comparison equipment, and assigning the duration of the rain and snow to the comparison variable b;
s26, setting a time threshold E, if the absolute value of a-b is smaller than the absolute value of E, taking a and b as comparison records of the same group, and executing a step S27, otherwise, returning to the step S25 to select the next ungrouped rain and snow record, and assigning the duration of the rain and snow record to a comparison variable b;
s27, adding the comparison record into the current packet, updating the identification of the comparison record, and updating the non-packet into the already-grouped one;
S28, repeating the steps S25-S27 until all monitoring devices in the comparison set are traversed as comparison devices, and ending the current grouping;
s29 makes n=n+1, and returns to step S23 until all the rain and snow records in the reference set are traversed, resulting in a rain and snow record group.
Step S2 further includes:
and setting a group filtering threshold value as 5, and if the total number of elements of the group is smaller than the group filtering threshold value, the group is an invalid group, and the group is deleted from the rain and snow record group.
Referring to fig. 4, a specific example is described as follows:
Step 1, sequencing: and D, carrying out ascending order on all the equipment rainfall sets in the step one according to the equipment numbers and the starting time. After completion, step 2 is entered.
Step 2, setting reference and comparison sets: among all the equipment inspection sets, a rainfall set of one equipment is selected as a reference set. If there are multiple devices whose number of set elements is the same, a set with a smaller device number is selected as a reference set, and the other sets are comparison sets. The non-reference sets are identically categorized as comparison sets. After completion, step 3 is entered.
Step 3, adding a mark for the comparison set: and (4) adding a mark for all elements of the comparison set, setting the mark as ungrouped, and entering step 4 after finishing.
Step 4, setting a grouping variable n=1: the packet variable N is initialized with an initialization value of 1. This variable records mainly the number of weather packets. After completion, step 5 is entered.
Step 5, setting a reference variable a=duration in the next record: in the reference set, a record is selected and its duration is assigned to the reference variable a. If the operation is performed for the first time, selecting a first record of the reference set; if not, the next record is selected for which the assignment operation has not been performed. After completion, step 6 is entered.
Step 6, initializing the grouping sequence: this grouping is initialized with the currently selected reference set record and grouping variables. The grouping element includes a grouping sequence number N, a device number in the current reference set record, a start time, an end time, and a duration. After completion, step 7 is entered.
Step 7, selecting the next comparison device: selecting one comparison device from the comparison set, and if the operation is performed for the first time, selecting a first device of the comparison set; if not, the next device that has not been selected is selected. After completion, the process proceeds to step 8.
Step 8, setting a duration of time for which the comparison variable b=the next record and is identified as not being grouped: among the rainfall sets of the currently selected contrast devices, a record is selected that has not been included in any group. If the first such operation is performed on the device, selecting a first ungrouped record in the rainfall set of the device; if this has already been done, the next ungrouped record immediately following it should be selected. The duration of this record is then assigned to variable b. After completion, step 9 is entered.
Step 9, |a-b| < E: it is determined whether the difference between the reference variable a and the comparison variable b is less than the threshold E. Typically, the threshold E is set at 10 seconds. If yes, the same rainfall is recorded in the reference record and the comparison record, and the rainfall is divided into the same group, and the step 10 is carried out; otherwise, the rainfall is not the same, and the step 8 is entered, and the search needs to be continued.
Step 10, adding the packet to the comparison record: adding the currently selected comparison record into the group, wherein the group element comprises a group number N, a device number in the current comparison set record, a start time, an end time and a duration. After completion, the process proceeds to step 11.
Step 11, updating the record identifier: updating the identification of the current comparison record, updating the ungrouped state into the grouped state, and entering step 12 after the completion.
Step 12, whether all the comparison devices traverse: judging whether all the comparison devices traverse, if so, entering a step 13, and continuing to judge the next group; otherwise, the step 7 is entered, and the comparison of other comparison devices is continued.
Step 13, n=n+1: indicating that the current packet has ended, the need to increase the packet needs and set the next packet sequence number. After completion step 14 is entered.
Step 14, whether traversing with reference to the set: it is determined whether all reference sets have been traversed. If yes, the step 15 is entered according to the completion of the grouping; otherwise, go to step 5 and proceed to grouping.
Step 15, filtering data with few packets: there is at least one record for each group of packets, but there may be machine vision misrecognitions that require less data to be filtered. The grouping filter threshold is set to 5, if the total number of grouping elements is less than the grouping filter threshold. The invalid packet is identified and all data for the packet is deleted.
Specifically, in an embodiment of the present invention, step S3 includes:
S31, ordering the rain and snow record groups according to the sequence from the small group sequence number to the large group sequence number to obtain a second sequence;
s32, setting M as a weather sequence number, and selecting a current grouping sequence number in the second sequence to assign to M;
s33, setting a first variable R0, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a first record, and assigning the first record to the first variable R0;
S34, setting a record variable C, and initializing the record variable C to 1;
S35, setting a second variable R1, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a second record, and assigning the second record to the second variable R1, wherein the first record is different from the second record;
s36 if the start time of rain and snow of |r0-the start time of rain and snow of R1| < E, let c=c+1, otherwise, let C unchanged;
S37, repeating the steps S35-S36 until all the rain and snow records except R0 are traversed, and obtaining updated C;
S38, if C is more than 0.5 times of the total number of the rain and snow records corresponding to the current grouping sequence number, adding a first record corresponding to R0 into a weather record set, otherwise, judging whether the rain and snow records corresponding to the current grouping sequence number are all assigned to a first variable R0, if so, executing a step S39, otherwise, returning to a step S33, selecting the next rain and snow record as the first record, and assigning the next rain and snow record to the first variable R0;
s39, repeating the steps S32-S38 until all the group serial numbers are assigned as M, and obtaining a final weather record set.
Referring to fig. 5, a specific example is described as follows:
step 1, acquiring a weather sequence number set: and according to the packet data obtained in the second step, arranging the packet sequence numbers according to ascending order, thereby generating a weather sequence number set only comprising sequence number information. After completion, step 2 is entered.
Step 2, setting M as the next sequence number: a value is assigned to the weather sequence number M. If the first setting is made, the value of M should be the first record in the set of weather sequence numbers; if not for the first time, M should take the next record after the current value in the set. After completion, step 3 is entered.
Step 3, set r0=next record: in the specified sequence number packet, a record is selected to initialize the R0 variable. If the assignment is the first time, then assign R0 to the first record of the packet; if a subsequent assignment is made, the next record in the packet immediately following the previous record should be selected to update R0. After completion, step 4 is entered.
Step 4 sets c=1: the variable C records how many times the same record number. Here set to c=1. After completion, step 5 is entered.
Step 5 sets r1=next record: in the selected sequence number packet, a record other than R0 is selected to set the R1 variable. If the setting is performed for the first time, selecting a first record different from R0 and assigning the first record to R1; if not the first time, the next record in the packet immediately preceding record is selected to update R1 without repeating with R0. After completion, step 6 is entered.
Start time of step 6|r0-start time of R1| < E: e represents the time threshold E in step S2, which is set to a value of 10 seconds. The difference between the start times of R0 and R1 recordings needs to be compared. If the time difference is smaller than E, judging that the two times are the same, and entering a step 7; otherwise, the two times are considered to be different, and step 8 is performed.
Step 7, c=c+1: for a self-increment of 1 for C, this indicates that the same record number is incremented by 1, and step 8 is entered after completion.
Step 8, whether all records of the packet except R0 are traversed: it is determined whether all records except R0 have been traversed. If yes, go to step 9; otherwise, go to step 5 and continue the traversal.
Step 9, judging the total number of rain and snow records corresponding to the current packet sequence number of C > 0.5: c is used to determine if the time for most of the devices is the same. If yes, go to step 10; otherwise, step 11 is entered to indicate that the R0 time is not the same as most of the equipment time, and this record is problematic.
Step 10, adding R0 to the weather set: the record of R0 is deemed to represent the rainy weather record, which is added to the weather collection. The weather set has a weather sequence M, a start time and an end time, but no equipment number, and the process goes to step 12 after the completion.
Step 11, whether all records of the packet are traversed: it is determined whether the R0 variable has been assigned to the packet and hence to the record. If the weather record is not found, the step 12 is entered; otherwise, go to step 3, continue to find new record assignment from the group record to R0.
Step 12, whether all weather sequence numbers are traversed: it is determined whether all weather sequence numbers have been traversed. If the steps are all traversed, the step 13 is carried out; otherwise, enter step 2, continue to choose the next weather serial number.
Step 13, filtering weather data: if there are multiple rainfall recordings on the same day, only the recording with the longest duration should be kept, and all other weather recordings for that day removed. Such screening measures are intended to prevent the occurrence of zero denominator when time-calibrating a faulty device.
Specifically, in an embodiment of the present invention, step S4 includes:
S41, analyzing weather starting time and snow starting time according to the weather record set and the snow record set, and identifying a problem equipment set according to a time comparison result;
s42, acquiring video time T generated by all problem devices in the problem device set, and calculating clock offset delta T i, interval day offset delta T Partition board and later day offset delta T Rear part (S) of the problem devices, wherein i represents the ith rainy and snowy weather:
if the video time T falls on the day of rainy and snowy weather, the video time is calibrated by using the corresponding clock offset delta T i;
If the video time T is earlier than the first rainy and snowy weather, calibrating the video time by using the offset delta T 1 of the first rainy and snowy weather;
If the video time T is between two rainy and snowy days and is not the rainy and snowy days, the video time is calibrated by using the interval day offset delta T Partition board ;
if the video time T is located after the last rainy and snowy weather, calibrating the video time later by using the later date offset delta T;
if the problem device has only one rain and snow record, the monitoring video corresponding to the problem device is calibrated by using the offset delta T 1 of the rain and snow record.
Step S41 includes:
S411 sets variables V and B0, selects one weather record according to elements in the weather record set, assigns the weather serial number to the variable V, and assigns the weather starting time to the variable B0;
s412, in the rain and snow record set, acquiring the rain and snow records with the same grouping sequence number as V, and classifying the records into a first set;
S413, setting a variable B1, selecting one rain and snow record in the first set, and assigning the beginning time of the rain and snow in the rain and snow record to the variable B1;
S414 if the I B0-B1I < E, the clock of the corresponding monitoring equipment is normal, otherwise, a new problem equipment record is created and added into the problem equipment set;
s415 repeats steps S413-S414, traversing all the rain and snow records in the first set;
S416, repeating the steps S411-S415, traversing all weather records in the weather record set to obtain a problem device set.
Step S42 includes:
S421, sequencing the problem equipment set according to the main and secondary ascending sequences of the ID of the monitoring equipment and the beginning time of the snow and rain, numbering according to the sequence to obtain a problem equipment sequence, and calculating the clock offset delta T i of each problem equipment;
S422, selecting one problem device from the sequence of problem devices;
S423 judges whether the number of the rain and snow records of the problem equipment is equal to 1, if so, the time stamp of the monitoring video is updated by increasing the delta T 1 value for the monitoring video generated by the problem equipment so as to calibrate the video time, and the step S427 is carried out, otherwise, the step S424 is executed;
S424, selecting a monitoring video from the monitoring videos of the problem equipment, and recording the starting time of the monitoring video, namely video time t;
S425 judges whether the video time T is on the same day as the time T i recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by adding the clock offset delta T i, if not, whether the video time T is between the time T i and T i+1 recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by using the interval day offset delta T Partition board , if not, whether the video time T is before the time of the first rain and snow record T 1, if yes, the time stamp of the monitoring video is updated by using the offset delta T 1, and if not, the time stamp of the monitoring video is updated by using the later day offset delta T Rear part (S) ;
s426 repeats steps S424-S425 until all monitoring videos of the problem device are traversed;
S427, repeating steps S422-S426 until all problem devices in the sequence of problem devices are traversed;
and S428, completing clock calibration to obtain the calibrated monitoring equipment.
In this embodiment, for the calibration time on the day of rainfall or snowing, the calculation formula of Δt i is as follows:
ΔTi=Ti-ti
Wherein: deltat i represents the calibration value required for a device with a time error during the ith precipitation event (whether rainfall or snowing). Here, T i refers to the exact time (whether beginning or ending) of the ith precipitation event actually occurring, while T i is the time (again, whether beginning or ending) recorded by the wrong device in the same precipitation event. It should be noted in particular that if T i refers to the point in time when precipitation ends, then the corresponding T i should also refer to the precipitation end time recorded by the device.
For the calibration time of the problematic equipment in non-precipitation weather, the calculation formula Δt Partition board is as follows:
Wherein: delta T Partition board represents the amount of time calibration that needs to be performed for a clock-error device between the ith and the (i + 1) th rainfall or snowing events. The ceil function here is used to convert the time difference in seconds into a rounded up number of days. Deltat i refers to the time difference that the problematic equipment needs to correct for in the ith precipitation event. Similarly, ΔT i+1 refers to the time difference that the device needs to correct for in the (i+1) th precipitation event. And t i represents the time (whether beginning or ending) of the ith precipitation event recorded by the device. t refers to the video time recorded by the device between precipitation events.
For time calibration after the last rainfall or snowing, the calculation formula Δt Rear part (S) is as follows:
Delta T Rear part (S) represents the amount of time calibration that needs to be performed for a device with clock errors after the last rainfall or snowfall. Deltat N refers to the time difference that the problematic equipment needs to correct in the last precipitation event. Similarly, ΔT N-1 refers to the time difference that the device needs to correct in the penultimate precipitation event. And t N represents the time (whether beginning or ending) of the last precipitation event recorded by the device. And t refers to the video time of the device after the last precipitation.
For only a single such rainfall or snowfall recording, deltat 1 is used to calibrate its time stamp of video generation. In addition, for the equipment with a plurality of records, if the time stamp is before the first rainfall or snowing occurs, the delta T 1 value corresponding to the first rainfall or snowing moment is adopted for unified calibration.
A specific calibration flow is shown in fig. 6, which in one embodiment is as follows:
Step 1, initializing V and B0 with the next weather record: according to the options in the weather set of step S3, one weather record is selected and its group number is stored in variable V and the start time is stored in variable B0. If it is the first choice, the record will be the first weather record; if not the first selection, a next record in the weather collection is selected that is immediately the previous record. After completion, step 2 is entered.
Step 2, obtaining a grouping set: and obtaining a packet set with the packet sequence number equal to V from the packet total set finally obtained in the second step by using the variable V. After completion, step 3 is entered.
Step3, setting b1=start time of next record: selecting a packet record from the packets in the step 2, and assigning the start time of the record to B1. If it is the first choice, the record will be the first packet record; if not the first selection, a next record in the set of packets is selected that is immediately the previous record. After completion, step 4 is entered.
Step 4, |b0-b1| < E: e is the time threshold in step S2. It is determined whether the difference between the weather start time and the start time recorded by the device is less than a threshold. If yes, judging that the clock of the equipment is normal, and entering a step 6; otherwise, step 5 is entered.
Step 5, generating a problem device record and forming a set: a new problem device record is created which should contain the following information: weather sequence number, weather start time, weather end time, problem device number, device start time, device end time, and duration. After this record is completed, it is added to a collection that aggregates all the device records that are problematic. After completion, step 6 is entered.
Step 6, whether all records of the packet are traversed: it is determined whether all records in the sequence number V packet set have been traversed. If the steps are all traversed, the step 9 is carried out; otherwise, go to step 3 and continue to find the next question.
Step 7, whether all weather sets are traversed: it is determined whether all weather data has been traversed. If the steps are all traversed, the step 8 is carried out; otherwise, enter step1, continue looking for the next weather record.
Step 8, sorting the grouping of the problem devices: the records of the problem devices are grouped according to the respective device numbers. Next, inside these packets, the device start time orders the ascending order of records within the packets. After completion, step 9 is entered.
Step 9, calculate each record Δt i: delta T i is formulated where i refers to the number of each device packet order, with special attention not being paid to the weather number. T i is the weather start time and T i is the device start time. After completion, the process proceeds to step 10.
Step 10, selecting the next problem device: a problem device number is selected from the list of problem devices. If it is the first choice, the problem device will be the first record; if not the first selection, a next record is selected that is immediately the previous record. After completion, the process proceeds to step 11.
Step 11, the number of problem device set records=1: it is determined whether the set data of the problem device=1. If yes, the problem device only records one weather record. If yes, go to step 12; otherwise, step 13 is entered.
Step 12, update all clocks of the device with Δt 1: for video generated by the problem device, the timestamp of the video is updated by increasing the ΔT 1 value. The specific operation is to add a duration of Δt 1 to the original timestamp of each video, so as to calibrate the time, and it should be noted that the value of Δt 1 may be positive or negative. After completion step 22 is entered.
Step 13, obtaining a video time t of the device: a video is selected from the video set recorded by the problematic equipment, and the start time of the video is recorded, usually by using the timestamp of the first frame of the video, and is denoted as t. After completion step 14 is entered.
Step 14, whether t is the same day as the record t i of the problem device: it is determined whether t is the same day as a certain record t i of the problem device. If yes, the video records the information of the raining day, and the step 15 is entered; otherwise, step 16 is entered.
Step 15, update all clocks of the video with Δt i: the timestamp of the video is updated by increasing the Δt i value. The time is calibrated by adding the delta T i duration to the original timestamp of this video. After completion, the process proceeds to step 21.
Step 16, whether t is between 2 rainfall events: it is determined whether t is between t i and t i+1 in the set of problem devices. If yes, go to step 17; otherwise, step 18 is entered.
Step 17, calculate Δt Partition board and update the video clock: deltat Partition board is calculated by a formula and the timestamp of the video is updated with its value. The time is calibrated by adding the delta T Partition board duration to the original timestamp of this video. After completion, the process proceeds to step 21.
Step 18, whether t is prior to the 1 st rainfall: it is determined whether t is before the time of the first record t 1. If yes, go to step 19; otherwise, it is implicit here that t is entered after the last recording, step 20.
Step 19, update the video clock with Δt 1: the timestamp of the video is updated with deltat 1. The time is calibrated by adding the delta T 1 duration to the original timestamp of this video. After completion, the process proceeds to step 21.
Step 20, calculate Δt Rear part (S) and update the video clock: deltat Rear part (S) is calculated by a formula and the timestamp of the video is updated with its value. The time is calibrated by adding the delta T Rear part (S) duration to the original timestamp of this video. After completion, the process proceeds to step 21.
Step 21, whether the device traverses all videos: it is determined whether all videos of the device in the data center have been traversed. If yes, go to step 22; otherwise, step 13 is entered.
Step 22, whether all problem devices have traversed: it is determined whether all problem devices have traversed. If yes, go to step 23; otherwise, step 10 is entered.
Step 23, video calibration is completed: video calibration of all problematic devices is completed.
The invention not only improves the clock accuracy of the clock problem, but also provides an effective detection and correction mechanism for the clock problem possibly occurring in the future by carrying out clock calibration on the problem equipment through the process.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (6)

1. A method for calibrating video time based on meteorological changes in a data center, comprising the steps of:
S1, acquiring monitoring videos of monitoring equipment, carrying out rain and snow identification and analysis on the monitoring videos, collecting the monitoring videos containing rain and snow, recording rain and snow information to obtain rain and snow videos, and sequencing the rain and snow videos of each monitoring equipment from small to large according to time stamps to form a rain and snow record set, wherein each rain and snow record set comprises a monitoring equipment ID, the rain and snow videos, weather types and the rain and snow information, and the rain and snow information comprises a rain and snow start time, a rain and snow duration time and a rain and snow end time;
S2, grouping all the rain and snow record sets according to a grouping method to obtain rain and snow record sets, wherein each rain and snow record set is provided with a grouping sequence number, and the duration time of rain and snow recorded in each set is the same;
s3, determining real weather records by using the group serial numbers of the rain and snow record groups to obtain a weather record set, wherein the weather record set comprises a weather serial number, a weather start time and a weather end time;
s4, comparing the weather record set with corresponding time in a rain and snow record set through analyzing the weather record set, identifying problem equipment, and carrying out clock calibration on the problem equipment by using a calibration method to obtain calibrated monitoring equipment;
the step S2 comprises the following steps:
S21, carrying out primary and secondary ascending sequencing on all the rain and snow record sets according to the ID of the monitoring device and the beginning time of the rain and snow to obtain a first sequence; selecting a rain and snow record set of one monitoring device from the first sequence as a reference set, and selecting the rain and snow record sets of other monitoring devices as a comparison set;
S22, setting an identifier for all elements of the comparison set, wherein the identifier is not grouped; setting a group sequence number N and initializing the value of N to be 1;
s23, setting a reference variable a, selecting a rain and snow record in a reference set, and assigning the duration of the rain and snow record to the reference variable a;
S24, initializing a current packet by using the reference set and the packet sequence number N, wherein elements in the current packet comprise the packet sequence number, the monitoring equipment ID in the reference set, the beginning time of rain and snow, the duration time of rain and snow and the ending time of rain and snow;
S25, selecting one comparison device from the comparison set; setting a comparison variable b, selecting an ungrouped rain and snow record in a rain and snow record set of comparison equipment, and assigning the duration of the rain and snow to the comparison variable b;
s26, setting a time threshold E, if the absolute value of a-b is smaller than the absolute value of E, taking a and b as comparison records of the same group, and executing a step S27, otherwise, returning to the step S25 to select the next ungrouped rain and snow record, and assigning the duration of the rain and snow record to a comparison variable b;
s27, adding the comparison record into the current packet, updating the identification of the comparison record, and updating the non-packet into the already-grouped one;
S28, repeating the steps S25-S27 until all monitoring devices in the comparison set are traversed as comparison devices, and ending the current grouping;
S29, enabling N=N+1, and returning to the step S23 until all the rain and snow records in the reference set are traversed, so as to obtain a rain and snow record group;
the step S4 includes:
S41, analyzing weather starting time and snow starting time according to the weather record set and the snow record set, and identifying a problem equipment set according to a time comparison result;
s42, acquiring video time T generated by all problem devices in the problem device set, and calculating clock offset delta T i, interval day offset delta T Partition board and later day offset delta T Rear part (S) of the problem devices, wherein i represents the ith rainy and snowy weather:
if the video time T falls on the day of rainy and snowy weather, the video time is calibrated by using the corresponding clock offset delta T i;
If the video time T is earlier than the first rainy and snowy weather, calibrating the video time by using the offset delta T 1 of the first rainy and snowy weather;
If the video time T is between two rainy and snowy days and is not the rainy and snowy days, the video time is calibrated by using the interval day offset delta T Partition board ;
If the video time T is after the last rainy or snowy weather, calibrating the video time by using the backward day offset delta T Rear part (S) ;
If the problem equipment has only one rain and snow record, calibrating the monitoring video corresponding to the problem equipment by using the offset delta T 1 of the rain and snow record;
Step S41 includes:
S411 sets variables V and B0, selects one weather record according to elements in the weather record set, assigns the weather serial number to the variable V, and assigns the weather starting time to the variable B0;
s412, in the rain and snow record set, acquiring the rain and snow records with the same grouping sequence number as V, and classifying the records into a first set;
S413, setting a variable B1, selecting one rain and snow record in the first set, and assigning the beginning time of the rain and snow in the rain and snow record to the variable B1;
S414 if the I B0-B1I < E, the clock of the corresponding monitoring equipment is normal, otherwise, a new problem equipment record is created and added into the problem equipment set;
s415 repeats steps S413-S414, traversing all the rain and snow records in the first set;
s416, repeating the steps S411-S415, and traversing all weather records in the weather record set to obtain a problem equipment set;
Step S42 includes:
S421, sequencing the problem equipment set according to the main and secondary ascending sequences of the ID of the monitoring equipment and the beginning time of the snow and rain, numbering according to the sequence to obtain a problem equipment sequence, and calculating the clock offset delta T i of each problem equipment;
S422, selecting one problem device from the sequence of problem devices;
S423 judges whether the number of the rain and snow records of the problem equipment is equal to 1, if so, the time stamp of the monitoring video is updated by increasing the delta T 1 value for the monitoring video generated by the problem equipment so as to calibrate the video time, and the step S427 is carried out, otherwise, the step S424 is executed;
S424, selecting a monitoring video from the monitoring videos of the problem equipment, and recording the starting time of the monitoring video, namely video time t;
S425 judges whether the video time T is on the same day as the time T i recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by adding the clock offset delta T i, if not, whether the video time T is between the time T i and T i+1 recorded by the rain and snow of the problem equipment, if yes, the time stamp of the monitoring video is updated by using the interval day offset delta T Partition board , if not, whether the video time T is before the time of the first rain and snow record T 1, if yes, the time stamp of the monitoring video is updated by using the offset delta T 1, and if not, the time stamp of the monitoring video is updated by using the later day offset delta T Rear part (S) ;
s426 repeats steps S424-S425 until all monitoring videos of the problem device are traversed;
S427, repeating steps S422-S426 until all problem devices in the sequence of problem devices are traversed;
s428, clock calibration is completed, and calibrated monitoring equipment is obtained;
For calibration time on the day of rainfall or snowing, the calculation formula of Δt i is as follows:
ΔTi=Ti-ti
Wherein: Δt i represents the calibration value required for the device with time error in the ith precipitation event, T i refers to the exact time of the ith precipitation event actually occurring, T i is the time recorded by the device with time error in the same precipitation event, if T i refers to the point in time when precipitation ends, then the corresponding T i refers to the precipitation end time recorded by the device,
For the calibration time of the problematic equipment in non-precipitation weather, the calculation formula Δt Partition board is as follows:
Wherein: delta T Partition board represents the amount of time calibration that needs to be performed for a clock-error device between the i and i +1 precipitation or snowing events, the ceil function is used to convert the time difference in seconds to a rounded up number of days, delta T i is the time difference that the problematic device needs to correct in the i precipitation event, delta T i+1 is the time difference that the device needs to correct in the i +1 precipitation event, T i represents the time of the i precipitation event recorded by the device, T is the video time recorded by the device between the two precipitation events,
For time calibration after the last rainfall or snowing, the calculation formula Δt Rear part (S) is as follows:
Delta T Rear part (S) represents the amount of time calibration needed for a device with clock error after the last precipitation or snowing, delta T N represents the time difference that the problematic device needs to correct in the last precipitation event, delta T N-1 represents the time difference that the device needs to correct in the penultimate precipitation event, T N represents the time of the last precipitation event recorded by the device, and T represents the video time of the device after the last precipitation event.
2. A method of calibrating video time based on meteorological variations in a data center as claimed in claim 1, wherein step S1 comprises:
S11, acquiring monitoring videos, dividing the monitoring videos according to corresponding monitoring devices, wherein each monitoring device corresponds to one group of monitoring videos, and sequencing each group of monitoring videos in ascending order according to time stamps from small to large to obtain monitoring devices and monitoring video groups thereof;
s12, selecting a monitoring device, and eliminating night videos in a monitoring video group of the monitoring device;
s13, selecting a monitoring video according to the time stamp;
S14, identifying the current monitoring video by adopting a rain and snow monitoring and identifying algorithm, if rain and snow are detected, classifying the current monitoring video into a rain and snow video, and recording a time point when the rain and snow starts and a time point when the rain and snow ends; otherwise, classifying the video as normal video;
S15, repeating the steps S13-S14 to obtain all the rain and snow videos, and sequencing the rain and snow videos from small to large according to the starting time points of the rain and snow videos to form a starting sequence, wherein each element in the starting sequence comprises a monitoring device ID, the starting time points of the rain and snow and a weather type; ordering the rain and snow video from small to large according to the time point when the rain and snow is finished to form an end sequence, wherein each element in the end sequence comprises a monitoring device ID, the time point when the rain and snow is finished and a weather type;
S16, according to the time proximity, pairing the time of the starting sequence and the time of the ending sequence, and obtaining a rain and snow event record if the pairing is successful, wherein the rain and snow event record comprises a rain and snow starting time, a rain and snow duration time and a rain and snow ending time, and all the rain and snow event records are used as a rain and snow record set of current monitoring equipment;
s17, repeating the steps S12-S16 to obtain a rain and snow record set of all monitoring devices.
3. A method of calibrating video time based on meteorological variations in a data center as claimed in claim 2, wherein step S16 comprises:
s161, judging the number of elements in the starting sequence and the ending sequence, if the number of elements in any sequence is 0, turning to a step S169, otherwise, executing a step S162;
S162, judging whether the number of elements in the starting sequence is 1, if so, executing step S163, and if not, turning to step S164;
S163, taking the element in the starting sequence as a first element, selecting an element closest to the beginning time point of the rain and snow in the first element in the ending sequence as a second element, forming a record by the first element and the second element, wherein the record comprises a monitoring device ID, a weather type, a beginning time of the rain and the snow, an ending time of the rain and the snow and a duration time of the rain and the snow, the beginning time of the rain and the snow is the beginning time point of the rain and the snow in the first element, the ending time of the rain and the snow is the ending time point of the rain and the snow in the second element, taking the record as a rain and snow record set of the monitoring device, and turning to step S169;
S164, setting two variables first and second of a start sequence, setting one variable end of an end sequence, and initializing the first, second and end, wherein the first variable is initialized by using the time recorded by the first record in the start sequence, the second variable is initialized by using the time recorded by the second record in the start sequence, and the end variable is initialized by using the time recorded by the first record in the end sequence;
S165, if first < end and second > end, forming a rain and snow event record by using the first and end, wherein the rain and snow event record comprises a monitoring device ID, a weather type, a rain and snow start time, a rain and snow end time and a rain and snow duration time, the rain and snow start time is first, the rain and snow end time is end, the rain and snow duration time is the difference between the end and the first, and turning to step S167, otherwise, executing step S166;
S166, updating a second variable by using the time of the next record, screening out the record of the time point when the rain and snow starts if the new second is < end, and screening out the record of the time point when the rain and snow ends if the new second is > end;
S167, if the first is used or invalid, updating the first by using the current second, selecting the time of the next record as the second in the starting sequence, selecting the time of the next record to update the end in the ending sequence, and turning to step S165;
s168, repeating the steps S165-S167 until the starting sequence and the ending sequence are traversed;
and S169, finishing pairing to obtain a rain and snow record set.
4. A method of calibrating video time based on meteorological variations in a data center as claimed in claim 3, wherein step S1 further comprises:
setting a first threshold according to seasonal variations: the first threshold value is 10h in winter and 8h in summer; setting a second threshold to be 5min;
Comparing the duration of the rain and snow in the rain and snow record set with a first threshold value and a second threshold value, and deleting the corresponding rain and snow record if the duration of the rain and snow is greater than the first threshold value or the duration of the rain and snow is less than the second threshold value.
5. The method for calibrating video time based on meteorological changes in a data center according to claim 1, wherein step S2 further comprises:
and setting a group filtering threshold value as 5, and if the total number of elements of the group is smaller than the group filtering threshold value, the group is an invalid group, and the group is deleted from the rain and snow record group.
6. A method of calibrating video time based on meteorological variations in a data center as claimed in claim 1, wherein step S3 comprises:
S31, ordering the rain and snow record groups according to the sequence from the small group sequence number to the large group sequence number to obtain a second sequence;
s32, setting M as a weather sequence number, and selecting a current grouping sequence number in the second sequence to assign to M;
s33, setting a first variable R0, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a first record, and assigning the first record to the first variable R0;
S34, setting a record variable C, and initializing the record variable C to 1;
S35, setting a second variable R1, selecting one rain and snow record from a rain and snow record group corresponding to the current grouping sequence number as a second record, and assigning the second record to the second variable R1, wherein the first record is different from the second record;
s36 if the start time of rain and snow of |r0-the start time of rain and snow of R1| < E, let c=c+1, otherwise, let C unchanged;
S37, repeating the steps S35-S36 until all the rain and snow records except R0 are traversed, and obtaining updated C;
S38, if C is more than 0.5 times of the total number of the rain and snow records corresponding to the current grouping sequence number, adding a first record corresponding to R0 into a weather record set, otherwise, judging whether the rain and snow records corresponding to the current grouping sequence number are all assigned to a first variable R0, if so, executing a step S39, otherwise, returning to a step S33, selecting the next rain and snow record as the first record, and assigning the next rain and snow record to the first variable R0;
s39, repeating the steps S32-S38 until all the group serial numbers are assigned as M, and obtaining a final weather record set.
CN202410200577.0A 2024-02-23 2024-02-23 Video time calibration method based on meteorological change in data center station Active CN118042082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410200577.0A CN118042082B (en) 2024-02-23 2024-02-23 Video time calibration method based on meteorological change in data center station

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410200577.0A CN118042082B (en) 2024-02-23 2024-02-23 Video time calibration method based on meteorological change in data center station

Publications (2)

Publication Number Publication Date
CN118042082A CN118042082A (en) 2024-05-14
CN118042082B true CN118042082B (en) 2024-08-20

Family

ID=90998019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410200577.0A Active CN118042082B (en) 2024-02-23 2024-02-23 Video time calibration method based on meteorological change in data center station

Country Status (1)

Country Link
CN (1) CN118042082B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117915138B (en) * 2024-01-08 2024-06-25 湖北泰跃卫星技术发展股份有限公司 Video time calibration method in data center station

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442216A (en) * 2013-08-22 2013-12-11 中国电子科技集团第三十八研究所 Monitoring video time calibration device and calibration method thereof
CN111756465A (en) * 2020-05-19 2020-10-09 武汉东智科技股份有限公司 Method for detecting abnormal time synchronization of video monitoring equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5940004B2 (en) * 2013-03-04 2016-06-29 株式会社ドッドウエル ビー・エム・エス Camera monitoring system and camera monitoring method
US10321208B2 (en) * 2015-10-26 2019-06-11 Alpinereplay, Inc. System and method for enhanced video image recognition using motion sensors
JP6648730B2 (en) * 2017-05-09 2020-02-14 オムロン株式会社 Control device, time stamp correction method and program
CN109391799B (en) * 2017-08-14 2020-09-04 杭州海康威视数字技术股份有限公司 Monitoring video synchronization method and device and video acquisition equipment
CN112149670A (en) * 2020-09-25 2020-12-29 武汉大学 Automatic timing method for social security video
CN115913441B (en) * 2023-01-09 2023-05-23 北京智芯微电子科技有限公司 Clock frequency offset joint estimation method and initial frequency offset calibration method for multimode communication module
CN116939306A (en) * 2023-07-25 2023-10-24 苏州科达科技股份有限公司 Method, system, equipment and storage medium for displaying timing of monitoring video

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442216A (en) * 2013-08-22 2013-12-11 中国电子科技集团第三十八研究所 Monitoring video time calibration device and calibration method thereof
CN111756465A (en) * 2020-05-19 2020-10-09 武汉东智科技股份有限公司 Method for detecting abnormal time synchronization of video monitoring equipment

Also Published As

Publication number Publication date
CN118042082A (en) 2024-05-14

Similar Documents

Publication Publication Date Title
CN118042082B (en) Video time calibration method based on meteorological change in data center station
KR102126577B1 (en) A Monitoring System of Photovoltaic Generation Using Multi-channel Module Sensors
CN108268901B (en) Method for discovering environmental monitoring abnormal data based on dynamic time bending distance
CN105046959B (en) Urban Travel Time extracting method based on Dual-window shiding matching mechanism
CN106571040B (en) Suspicious vehicle confirmation method and equipment
CN115080555A (en) Method, system and medium for distinguishing outliers by acquiring population data based on signaling
CN116522156A (en) Equipment state data analysis system and method based on energy management platform
CN116451554A (en) Power grid weather risk prediction method considering multiple weather factors
KR102475291B1 (en) Method and system for calculating the optimal time for asset maintenance and management through the facility residual life prediction algorithm
CN115454981A (en) Data cleaning and marking method and system for meteorological data of Antarctic device
CN111914493B (en) System and method for simulating service life of LED street lamp
CN116882662B (en) Smart park management method, device, management system and storage medium
CN117033935B (en) Prediction method of rainfall characteristic under statistics and monitoring based on Bayesian fusion
CN111966952A (en) Leaf area index data filtering method
CN112345972A (en) Power failure event-based power distribution network line transformation relation abnormity diagnosis method, device and system
CN118071039A (en) Air conditioner maintenance data supervision method and system based on artificial intelligence
CN117421310A (en) Power quality data cleaning method based on data link
CN115207909A (en) Method, device, equipment and storage medium for identifying platform area topology
CN117037525A (en) Method for identifying traffic signal lamp by fusing multi-source data
CN116259173A (en) D-S evidence theory-based multi-detection mode traffic event fusion method
CN118190051A (en) Fault detection method and device and computer readable storage medium
CN116132262A (en) Intelligent network-connected automobile-oriented data real-time monitoring and alarming system and method
CN110233967B (en) Mold template image generation system and method
CN110018111B (en) Method for predicting mirror frosting of Antarctic astronomical telescope
US10509968B2 (en) Data fusion based safety surveillance system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant