Disclosure of Invention
The invention provides a data acquisition method and equipment based on a video file, which are used for accurately acquiring video data of specified time.
In order to achieve the above object, the present invention provides a data acquisition method based on a video file, which is applied in a monitoring system, wherein when a storage device in the monitoring system receives monitoring data from a monitoring device, the storage device stores the monitoring data through the video file, and the method comprises the following steps:
recording identification information, corresponding time information and corresponding storage position information of monitoring equipment corresponding to the monitoring data in a management server of the monitoring system;
the management server receives a request for viewing the monitoring data of the specified monitoring equipment and the specified time from the video client VC;
the management server takes the identification information and the designated time information of the designated monitoring equipment as indexes to query, and sends the queried storage position information to the VC;
and the VC searches corresponding monitoring data from the storage equipment through the storage position information.
The storage position information corresponding to the monitoring data is as follows: the physical position information of the monitoring data in the storage device, or the relative position information of the monitoring data in the video file and the path information of the video file.
The time information corresponding to the monitoring data is as follows: the time when the monitoring device sends the monitoring data, or the time when the storage device receives the monitoring data.
Recording identification information, corresponding time information and corresponding storage location information of the monitoring device corresponding to the monitoring data in a management server of the monitoring system, and specifically comprising:
if the interval between the time information corresponding to the monitoring data and the time information of the monitoring data recorded in the management server last time is not less than the preset time, recording identification information, corresponding time information and corresponding storage position information of monitoring equipment corresponding to the monitoring data in the management server; or,
and if the data quantity between the monitoring data and the monitoring data recorded in the management server last time is not less than a preset value, recording identification information, corresponding time information and corresponding storage position information of the monitoring equipment corresponding to the monitoring data in the management server.
The method further comprises the following steps: and when the video file needs to be deleted, deleting the record corresponding to the video file in the management server.
A management server is applied to a monitoring system, when a storage device in the monitoring system receives monitoring data from a monitoring device, the storage device stores the monitoring data through a video file, and the management server comprises:
the recording module is used for recording the identification information of the monitoring equipment corresponding to the monitoring data, the corresponding time information and the corresponding storage position information;
the receiving module is used for receiving a request for viewing the monitoring data of the specified monitoring equipment and the specified time from the video client VC;
the query module is used for querying by taking the identification information and the designated time information of the designated monitoring equipment as indexes;
and the sending module is used for sending the inquired storage position information to the VC, and the VC searches corresponding monitoring data from the storage equipment through the storage position information.
The storage position information corresponding to the monitoring data is as follows: the physical position information of the monitoring data in the storage device, or the relative position information of the monitoring data in the video file and the path information of the video file.
The time information corresponding to the monitoring data is as follows: the time when the monitoring device sends the monitoring data, or the time when the storage device receives the monitoring data.
The recording module is specifically configured to record identification information, corresponding time information, and corresponding storage location information of the monitoring device corresponding to the monitoring data if an interval between time information corresponding to the monitoring data and time information of the monitoring data recorded last time is not less than a predetermined time; or,
and if the data quantity between the monitoring data and the monitoring data recorded last time is not less than a preset value, recording identification information, corresponding time information and corresponding storage position information of the monitoring equipment corresponding to the monitoring data.
Further comprising: and the deleting module is used for deleting the record corresponding to the video file when the video file needs to be deleted.
Compared with the prior art, the invention has at least the following advantages:
by recording the identification information, the corresponding time information and the corresponding storage position information of the monitoring equipment corresponding to the monitoring data in the management server, when the video data of the specified time of the monitoring equipment needs to be checked, the position information of the video data can be accurately indexed by utilizing the corresponding relation, and the video aiming at the specified time can be played by directly reading the video data of the position information in the video file, so that the video data of the specified time can be accurately obtained, and a large number of video files cannot be caused.
Detailed Description
The invention provides a data acquisition method based on a video file, which is applied to a monitoring system, wherein the monitoring system at least comprises monitoring equipment (such as an encoder and the like), storage equipment (such as an IP SAN and the like), a management server and a VC. The Management server is used for realizing the functions of a current VM (Video Management) server and a DM (Data Management) server, and can also directly deploy the VM server and the DM server according to the actual networking requirements, and a monitoring system directly deploys the VM server and the DM server by referring to a network model schematic diagram in the invention by taking a figure 1 as a reference.
In the invention, in order to realize the data acquisition method based on the video file, index equipment can be also deployed in the monitoring system, and the index equipment can be a functional module (such as an index module) and is integrated on the equipment of the current monitoring system; such as integrating the functions of the index module on the DM server, or on the VM server, or on the storage device; for convenience of description, a single index device is taken as an example in the present invention.
As shown in fig. 2, the method for acquiring data based on video files includes the following steps:
in step 201, a storage device receives monitoring data from a monitoring device. The monitoring device may be a video source, i.e. the monitoring data may be video data, which may also be referred to as video data, since the data is used to play video.
It should be noted that the monitoring device transmits the monitoring data to the storage device in units of frames, that is, the storage device receives the monitoring data in units of frames.
Step 202, the storage device stores the received monitoring data through a video file.
The storage device obtains the start position (i.e. physical address) of the video file, when the video file is empty, writes the data 1 into the start position of the video file for the first frame of received monitoring data (data 1), and sequentially writes the monitoring data (data 2 …) received later onto the video file.
For example, X is the starting physical address of the video recording file, data 1 is written to address X, and the next writing position is updated to X + Y (Y is the size of data 1), and when data 2 of the next frame is received, data 2 is directly written to address X + Y, and so on.
Step 203, the index device obtains the identification information of the monitoring device sending the monitoring data, the time information corresponding to the monitoring data, and the storage location information of the storage device into which the monitoring data is written.
For the monitoring data, the index device may obtain identification information of the monitoring device corresponding to the monitoring data from the monitoring data.
When the storage device stores the monitoring data through the video file, the storage location information may be: the physical location information of the monitoring data in the storage device. Taking data 1 as an example, if data 1 is written into address X, which is the physical location of the storage device, the corresponding monitoring data can be uniquely queried through address X. Or,
the storage location information may also be: the relative position information of the monitoring data in the video file (i.e. the position information of the monitoring data written into the video file), and the path information of the video file. Taking data 2 as an example, if the data 2 is written into an address Y, the address Y is the relative position information of the video file; in addition, for the video file of the storage data 2, the index device can acquire the path information of the video file; the corresponding monitoring data can be uniquely inquired through the address Y and the path of the video file.
The time information corresponding to the monitoring data is as follows: the time when the monitoring device sends the monitoring data, or the time when the storage device receives the monitoring data.
In consideration of the delay condition of data transmission between the monitoring device and the storage device, the time information may be sending time information of data sent by the monitoring device, in which case, the data may carry the time information, and the indexing device obtains the sending time information of the data through the time information carried in the data.
Specifically, the storage device may extract sending time information from the data and send the information to the index device; the sending time information can be absolute time (such as 2011-01-0110: 00:00), and the indexing device determines the absolute time to be the sending time information; the sending time information may be a relative time (i.e., an offset from the previous frame data), and if the time of the previous frame is 2011-01-0110: 00:00 and the relative time is 1s, the indexing device determines that the sending time information is 2011-01-0110: 00: 01.
In consideration of the sending strategy of the monitoring device, the data may not carry time information, and in this case, the time information may be the receiving time information of the data received by the storage device; the storage device directly sends the receiving time information of the received data to the index device.
Step 204, the index device writes the identification information, the corresponding time information, and the corresponding storage location information of the monitoring device corresponding to the monitoring data into the association table of the DM, that is, records the identification information, the corresponding time information, and the corresponding storage location information of the monitoring device corresponding to the monitoring data in the DM.
Setting an association table in a database of the DM, wherein the association table is used for recording time information of monitoring data, storage position information of monitoring data written into a storage device and identification information of the monitoring device sending the monitoring data; taking the storage location information as the relative location information of the monitoring data in the video file and the path information of the video file as an example, when the write strategy is satisfied, the indexing device may write the information corresponding to the monitoring data (i.e., the time information, the relative location information, the path information, and the identification information) into the association table of the database of the DM.
The first method is as follows: and if the interval between the time information corresponding to the current monitoring data and the time information of the last time of writing the monitoring data into the association table is not less than the preset time (such as 1s), the indexing equipment determines that the write strategy is met.
For example, the information of data 1 is written into the association table last time, and the time information of data 1 is time a, then the time information of the monitoring data written into the association table last time is time a; when data 2 is received, if the interval between the time information of the data 2 and the time A is less than 1s, the information of the data 2 is not written into the association table; by analogy, when the data 10 is received, the interval between the time information (time B) of the data 10 and the time a is not less than 1s, the information of the data 10 is written into the association table, at this time, the time information of the monitoring data written into the association table last time is the time B, and so on.
The second method comprises the following steps: if the data quantity between the current monitoring data and the last time the monitoring data is written into the association table is not less than a predetermined value (for example, 100 frames), the indexing device determines that the write strategy is satisfied.
For example, the information of data 1 is written into the association table last time, and if the data 1 is the 1 st frame data, the monitoring data is written into the association table last time and is the 1 st frame data; when receiving the data 2, the data 2 is the 2 nd frame data, the data quantity between the 2 nd frame data and the 1 st frame data is less than 100 frames, and the information of the data 2 is not written into the association table; and so on, when receiving the data 101, the data 101 is 101 th frame data, and the data quantity between the 101 th frame data and the 1 st frame data is not less than 100 frames, the information of the data 101 is written into the association table, and the monitoring data is written into the association table as 101 th frame data last time, and so on.
It should be noted that, for the first frame data stored in the video file, the information of the data needs to be written into the association table, and for the subsequent data, the above-mentioned strategy is adopted to determine whether to write the information of the current data into the association table.
As shown in table 1, the first embodiment is an exemplary case of the association table when the predetermined time is 1s, and the storage location information is the relative location information of the monitoring data in the video file and the path information of the video file.
TABLE 1
Through the condition recorded in the table 1, when the video data of the specified monitoring equipment and the specified time needs to be checked, the position written in by the monitoring data in 1s can be searched, so that the video data of the specified time can be accurately obtained.
Based on the association table recorded in the database of the DM, when the VC needs to check the monitoring data of the specified monitoring device and the specified time, the method may further include the following steps:
in step 205, the VM receives a request for viewing the data at the designated time from the VC, where the request carries the identification information of the monitoring device to which the data to be viewed belongs and the information of the designated time of the data to be viewed.
In step 206, the VM sends the request to the DM. It should be noted that if the functions of the VM and the DM are deployed on the management server, the step need not be executed.
In step 207, the DM queries the association table by using the identification information and the specified time information in the request as indexes, and sends the queried storage location information to the VC through the VM.
For example, when the identification information in the request is camera 1 and the time information is 2011-01-0110: 00:01, the DM queries the association table shown in table 1 (the storage location information is the relative location information and the path information), so as to obtain that the path information of the video file is HD1\ camera01.video and the relative location information is X +1000, and then the DM may send HD1\ camera01.video and X +1000 to the VC through the VM.
And step 208, the VC searches corresponding monitoring data from the storage device through the storage location information. Since the storage location information can uniquely query the corresponding monitoring data, the VC can find the corresponding monitoring data. For example, when the storage location information is the relative location information and the path information, the VC may find the video file from the storage device through the path information, and obtain the monitoring data to be viewed from the video file through the relative location information.
For example, VC finds a video file from the storage device through the path information HD1\ camera01.video, and obtains the data to be viewed from the video file through the position information X +1000, and views the video.
In the invention, when the path of the video file changes (for example, the user moves the position of the video file) or the video file needs to be deleted, the index device updates the corresponding record in the database of the DM.
Specifically, when the path of the video file is changed, the indexing device acquires the changed path of the video file, and replaces the path information of the video file recorded in the association table by the changed path of the video file. For example, when the position of the video file a becomes FilePathB, the index device updates the record corresponding to the video file a in the association table, and updates the current path information to FilePathB.
When the video file needs to be deleted, the index device deletes the record corresponding to the video file in the association table. For example, when the specified video file a needs to be deleted, the association table is queried on the condition of the path information of the video file a, so as to delete the relevant record of the video file a.
Based on the same inventive concept as the above method, the present invention further provides a management server, which is applied in a monitoring system, wherein when a storage device in the monitoring system receives monitoring data from a monitoring device, the storage device stores the monitoring data through a video file, as shown in fig. 3, the management server includes:
the recording module 11 is configured to record identification information of the monitoring device corresponding to the monitoring data, corresponding time information, and corresponding storage location information;
a receiving module 12, configured to receive a request for viewing monitoring data of a specified monitoring device and a specified time from a video client VC;
the query module 13 is configured to query the identifier information and the designated time information of the designated monitoring device as indexes;
and the sending module 14 is configured to send the queried storage location information to the VC, and the VC searches for corresponding monitoring data from the storage device through the storage location information.
The storage position information corresponding to the monitoring data is as follows: the physical position information of the monitoring data in the storage device, or the relative position information of the monitoring data in the video file and the path information of the video file.
The time information corresponding to the monitoring data is as follows: the time when the monitoring device sends the monitoring data, or the time when the storage device receives the monitoring data.
The recording module 11 is specifically configured to record identification information of a monitoring device corresponding to the monitoring data, corresponding time information, and corresponding storage location information if an interval between time information corresponding to the monitoring data and time information of the monitoring data recorded last time is not less than a predetermined time; or,
and if the data quantity between the monitoring data and the monitoring data recorded last time is not less than a preset value, recording identification information, corresponding time information and corresponding storage position information of the monitoring equipment corresponding to the monitoring data.
The management server further includes: and the deleting module 15 is configured to delete the record corresponding to the video file when the video file needs to be deleted.
The modules of the device can be integrated into a whole or can be separately deployed. The modules can be combined into one module, and can also be further split into a plurality of sub-modules.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by hardware, or by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
Those skilled in the art will appreciate that the drawings are merely schematic representations of one preferred embodiment and that the blocks or flow diagrams in the drawings are not necessarily required to practice the present invention.
Those skilled in the art will appreciate that the modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, and may be correspondingly changed in one or more devices different from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
The above-mentioned serial numbers of the present invention are for description only and do not represent the merits of the embodiments.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.