Video storage method and device, equipment and medium
By obtaining user configuration information and generating cloud storage and fragment transfer tasks, the problem of limited local disk capacity of NVR devices is solved, and cloud storage and multi-terminal playback of video data is realized, meeting the multi-dimensional storage needs of users.
Patent Information
- Application Number
- CN202411711909.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
AI Technical Summary
The local disk capacity of existing NVR devices is limited and cannot meet the multi-dimensional video storage needs of users, especially in terms of long-term storage and multi-terminal playback.
By obtaining user configuration information, determine the target video data to be uploaded to the cloud and the target video clips to be transferred, generate and execute cloud storage tasks and clip transfer tasks, and realize cloud storage and multi-terminal playback of video data.
There is no need to expand local storage capacity, which enables cloud storage of video data that users need to store for longer, reduces storage costs, and supports playing video clips that need to be viewed on each terminal device.
Smart Images

Figure CN119544904A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video storage technology, and in particular to a video storage method, device, equipment and medium. Background Art
[0002] NVR (Network Video Recorder) devices can connect to different cameras through the network and receive digital video streams from the cameras. Traditional NVR devices generally support mounting local disks for video storage, but due to the limited capacity of local disks, the usual practice is to overwrite the oldest video after recording is full. The current video storage technology cannot meet the multi-dimensional needs of users. Summary of the invention
[0003] In view of this, the purpose of this application is to provide a video storage method, device, equipment and medium that can meet the multi-dimensional needs of users. The specific solution is as follows:
[0004] In a first aspect, the present application discloses a video storage method, comprising:
[0005] Utilize the local disk of the network video recorder device to store recorded videos;
[0006] Acquire user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine target video data to be uploaded to cloud storage, and the second configuration information is used to determine target video segments to be transferred;
[0007] Generate a cloud storage task based on the first configuration information and generate a segment transfer task based on the second configuration information;
[0008] Executing the cloud storage task, determining target video data from the recorded video, and uploading the target video data to cloud storage;
[0009] The segment transfer task is executed to transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0010] Optionally, the first configuration information includes target area information. Accordingly, executing the cloud storage task, determining target video data from the recorded video, and uploading the target video data to cloud storage includes:
[0011] The cloud storage task is executed, the video data corresponding to the target area information is determined from the recorded video to obtain the target video data, and the target video data is uploaded to the cloud storage.
[0012] Optionally, the second configuration information includes target event information. Accordingly, the executing the segment transfer task to transfer the target video segment in the cloud storage or the local disk according to a preset format so as to be played on each terminal device includes:
[0013] The segment transfer task is executed to transfer the target video segment corresponding to the target event information in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0014] Optionally, after generating the fragment transfer task based on the second configuration information, the method further includes:
[0015] Adding the fragment transfer task to the task queue through the scheduling center;
[0016] Accordingly, the executing the segment transfer task to transfer the target video segment in the cloud storage or the local disk according to a preset format includes:
[0017] The preset working node is used to consume the segment transfer task in the task queue, and the target video segment in the cloud storage or the local disk is transferred according to a preset format.
[0018] Optionally, using a preset working node to consume the segment transfer task in the task queue to transfer the target video segment in the local disk according to a preset format includes:
[0019] The segment transfer task in the task queue is consumed by a preset working node, a streaming address corresponding to the target video segment is obtained, and the target video segment is transferred according to a preset format based on the streaming address.
[0020] Optionally, after transferring the target video clip in the cloud storage or the local disk according to a preset format, the method further includes:
[0021] Putting the response information corresponding to the fragment transfer task into a feedback queue, wherein the response message includes information indicating whether the transfer is successful or failed;
[0022] The response information in the feedback queue is consumed by the scheduling center. When the response information contains information indicating a transfer failure and the number of transfer failures corresponding to the fragment transfer task does not reach a preset threshold, the fragment transfer task is put into the task queue again.
[0023] Optionally, after generating the cloud storage task based on the first configuration information, the method further includes:
[0024] By means of a preset device management system and by using a message queue telemetry transmission long link maintained between the preset device management system and the network video recorder device, the cloud storage task is sent to the network video recorder device;
[0025] Recording the cloud storage task by means of the network video recorder device;
[0026] Accordingly, the executing the cloud storage task, determining the target video data from the recorded video, and uploading the target video data to the cloud storage includes:
[0027] The cloud storage task is performed by the network video recorder device, target video data is determined from the recorded video, and the target video data is uploaded to the cloud storage.
[0028] In a second aspect, the present application discloses a video storage device, comprising:
[0029] A video recording storage module is used to store video recordings using a local disk of a network video recorder device;
[0030] A configuration information acquisition module, in which a user acquires user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine target video data to be uploaded to the cloud storage, and the second configuration information is used to determine target video segments to be transferred;
[0031] A cloud storage task generating module, used to generate a cloud storage task based on the first configuration information;
[0032] A fragment transfer task generating module, used for generating a fragment transfer task based on the second configuration information;
[0033] A cloud storage task execution module, used to execute the cloud storage task, determine target video data from the recorded video, and upload the target video data to cloud storage;
[0034] The segment transfer task execution module is used to execute the segment transfer task and transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0035] In a third aspect, the present application discloses an electronic device, including a memory and a processor, wherein:
[0036] The memory is used to store the computer program;
[0037] The processor is used to execute the computer program to implement the aforementioned video storage method.
[0038] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned video storage method when executed by a processor.
[0039] Through the above scheme, it can be known that the present application provides a video storage method, including: using the local disk of the network video recorder device to store the recorded video; obtaining user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine the target video data to be uploaded to the cloud storage, and the second configuration information is used to determine the target video segment to be transferred; generating a cloud storage task based on the first configuration information and generating a segment transfer task based on the second configuration information; executing the cloud storage task, determining the target video data from the recorded video, and uploading the target video data to the cloud storage; executing the segment transfer task, transferring the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device. .
[0040] It can be seen that the beneficial effects of the present application are: in addition to using the local disk of the network video recorder device to store recorded videos, the target video data can also be stored in the cloud based on the user configuration information, and the target video clips can be transferred in a preset format to support playback on various terminal devices. In this way, not only can the local disk of the network video recorder device be fully stored in the recorded video, but the target video data that users need to store for a longer period of time can also be stored in the cloud without expanding the local storage capacity, thereby reducing costs. In addition, the target video clips that need to be viewed in particular can be transferred for easy viewing and sharing on the terminal device. Through this application, the multi-dimensional needs of users can be met.
[0041] Correspondingly, a video storage device, equipment and readable storage medium provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0043] Figure 1 A flow chart of a video storage method provided in an embodiment of the present application;
[0044] Figure 2 A specific video storage schematic diagram provided for an embodiment of the present application;
[0045] Figure 3 A schematic diagram of the structure of a video storage device provided in an embodiment of the present application;
[0046] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] See also Figure 1 As shown, the embodiment of the present application discloses a video storage method, including:
[0049] Step S11: Utilize the local disk of the network video recorder device to store the recorded video.
[0050] In this embodiment, the user can deploy cameras in multiple areas according to needs. In this embodiment, the NVR device can be used to receive the digital video stream of the camera through the network and use the local disk to store the recorded video.
[0051] In an optional implementation, a user's local video viewing request can be obtained based on a user interaction interface of a preset business system, and the preset business system can send a request to query the current recording status of the NVR device to the device streaming system, and the device streaming system returns the corresponding streaming address, and the preset business system plays back the video based on the streaming address. Among them, the corresponding streaming address can be obtained based on the time point of the video recording to play back the video. The preset business system can be a software system designed based on the business.
[0052] Step S12: Obtain user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine the target video data to be uploaded to the cloud storage, and the second configuration information is used to determine the target video segment to be transferred.
[0053] In this embodiment, configuration information can be obtained based on the user interaction interface of the preset business system. The first configuration information may include target area information, such as cashier area information. In an optional implementation, the first configuration information may also include time period information, such as working hours (8 am to 8 pm). The second configuration information may include target event information, such as cashier abnormal events, which may include cash private collection events.
[0054] Step S13: Generate a cloud storage task based on the first configuration information and generate a segment transfer task based on the second configuration information.
[0055] It can be understood that the cloud storage task is a task of uploading the target video data corresponding to the first configuration information to the cloud storage. The segment transfer task is a task of transferring the target video segment corresponding to the second configuration information.
[0056] Step S14: Execute the cloud storage task, determine the target video data from the recorded video, and upload the target video data to the cloud storage.
[0057] In this embodiment, the cloud storage task can be executed, the video data corresponding to the target area information can be determined from the recorded video to obtain the target video data, and the target video data can be uploaded to the cloud storage. In an optional implementation, the target time period can be determined based on the time period information in the first configuration information, and the video data corresponding to the target area information in the target time period can be determined as the target video data. For example, the video data of the cashier area from 8 am to 8 pm is used as the target video data. In this way, uploading important data that users are concerned about to the cloud storage can obtain longer-term storage, avoid deleting important data when the local disk is full and overwritten, and meet long-term storage needs without increasing the high cost of local disk expansion.
[0058] In an optional implementation, the cloud storage task can be sent to the NVR device by using a preset device management system and a MQTT (Message Queuing Telemetry Transport) long link maintained between the preset device management system and the NVR device; the cloud storage task is recorded by the NVR device; accordingly, the cloud storage task is executed, the target video data is determined from the recorded video, and the target video data is uploaded to the cloud storage, including: executing the cloud storage task by the NVR device, determining the target video data from the recorded video, and uploading the target video data to the cloud storage. MQTT is a lightweight publish / subscribe message transmission protocol. MQTT long connection means that after the two parties establish a connection, the connection will remain open to facilitate the continuous transmission of messages until the connection is explicitly disconnected. Compared with short connections (disconnecting after each data transmission), long connections can reduce the additional overhead caused by connection establishment and closing, and improve data transmission efficiency.
[0059] In an optional implementation, the target video data can be streamed to a streaming S3 storage (i.e., cloud storage), and the file name organization format is two types, SDP class ( / uuid / v2 / Date / DayIndex / Timestamp-0-sdp), BLK class ( / uuid / v2 / Date / DayIndex / Timestamp-SeekStep-blk). SDP (i.e., Session Description Protocol) describes the information data of the stream, and BLK is the real video. SDP binary format: a complete SDP string in the channel stream information RTSP (i.e., Real Time Streaming Protocol) in the NVR; BLK binary format: a set of RTP packets encapsulated in interleaved frames in RTSP Over TCP (i.e., a streaming media transmission method that uses TCP connections to transmit RTSP control commands and RTP (i.e., Real-time Transport Protocol) / RTCP media data), 5000 RTP packets form a group to form a BLK. Wireshark analysis shows that the utilization of raw frame data encapsulated using RTP is reduced by about 1.3%, which meets the requirements. Although the utilization of raw data is slightly sacrificed, a variety of video storage methods are provided, and the video storage cost and video storage time can be balanced, which not only meets the personalized needs of users but also reduces costs and increases efficiency.
[0060] Step S15: Execute the segment transfer task to transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0061] In this embodiment, the clip transfer task can be executed to transfer the target video clip corresponding to the target event information in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device. For example, the video clip corresponding to the cash private collection event is transferred according to a preset format, and the preset format can be understood as a format that can be played on the terminal device. The terminal device includes a mobile terminal and a personal laptop computer, etc. The transferred video address can be shared. In some embodiments, the second configuration information can also include time period information.
[0062] In an optional implementation, the segment transfer task can be added to the task queue through the scheduling center, and the segment transfer task in the task queue can be consumed by a preset working node to transfer the target video segment in the cloud storage or the local disk according to a preset format. The preset working node can be understood as a software component that realizes the functional logic of consuming the segment transfer task in the task queue and transferring the target video segment in the cloud storage or the local disk according to a preset format, and can also be understood as a hardware device running the software component.
[0063] In an optional implementation, a preset working node may be used to consume the segment transfer task in the task queue, obtain a streaming address corresponding to the target video segment, and transfer the target video segment in a preset format based on the streaming address.
[0064] Furthermore, in an optional implementation, after the target video clip in the cloud storage or the local disk is transferred according to a preset format, the embodiment of the present application may also put the response information corresponding to the clip transfer task into a feedback queue, wherein the response message includes information indicating a successful transfer or a failed transfer; the response information in the feedback queue is consumed by the dispatch center, and when the response information includes information indicating a failed transfer, and the number of failed transfers corresponding to the clip transfer task does not reach a preset threshold, the clip transfer task is put into the task queue again. That is, this embodiment can make multiple attempts for a clip transfer task that failed to transfer.
[0065] When the response information includes information indicating successful transfer, in the embodiment of the present application, the response information may also include the address of the target video segment after transfer, and the user may view the target video segment based on the address through the terminal device.
[0066] It can be seen that in addition to using the local disk of the NVR device to store recorded videos, the embodiments of the present application can also store the target video data in the cloud based on the user configuration information and transfer the target video clips in a preset format to support playback on various terminal devices. In this way, not only can the local disk of the NVR device fully store recorded videos, but the target video data that users need to store for a longer period of time can also be stored in the cloud without expanding the local storage capacity, thereby reducing costs. In addition, the target video clips that need to be viewed in particular can be transferred to facilitate viewing and sharing on the terminal device. Through this application, the multi-dimensional needs of users can be met.
[0067] For further information, see Figure 2 As shown, Figure 2A specific video storage diagram provided for the embodiment of the present application. It includes three storage methods: Storage method 1 - NVR clip transfer (that is, the storage process corresponding to the aforementioned clip transfer task); Storage method 2 - NVR cloud storage (that is, the storage process corresponding to the aforementioned cloud storage); Storage method 3: NVR local disk streaming (that is, the storage process corresponding to the aforementioned local disk storage). Among them:
[0068] Storage method 1 - NVR clip transfer, including the following steps:
[0069] Step 101: The user configures the video transfer task through the business system, and the business system sends the transfer task to the transfer scheduling center. The transfer scheduling center first records the transfer task to its own database and assembles the transfer task into the task queue so that the nodes of the Worker group can consume the transfer task in the task queue. Among them, the transfer task can contain the basic information of a clip, such as: device MAC address, start time and end time of saving the video.
[0070] In step 102, the Worker node (i.e., the aforementioned working node) first obtains the streaming address from the device streaming media system (the streaming address may be in FLV, RTSP, or RTMP format depending on the device model), and the Worker node stores the streaming address locally, then calls the GPU transcoding module for transcoding, and finally transfers the transcoded video to the fragment S3 storage pool. After that, the Worker assembles the response message of the transfer task (such as transfer success or transfer failure), and puts the response message into the feedback queue. It should be pointed out that the encoding of some video recorders is H265, which is not particularly friendly to the player, so it is converted to H264. In terms of packaging, M3U8 is more friendly to the mobile terminal, and MP4 is more friendly to the PC terminal, so if you want to transcode, you can transcode it to MP4, FLV, and M3U8. In addition, in this embodiment, both cloud storage and fragment transfer can use the S3 storage pool, but the storage format of fragment transfer is different from that of video cloud storage.
[0071] Among them, the streaming address is obtained by communicating with the device streaming media system, and the device streaming media system is responsible for issuing device instructions and forwarding streaming media data. In the embodiment of the present application, the device streaming media system includes an MMS node (i.e., Media Management System) and a DMS node (i.e., Device Management System), wherein the MMS system is responsible for retrieving the video data stream in the local disk from the NVR device; the DMS system is responsible for communicating with the NVR device and forwarding instructions to the NVR device. If the transfer task is a video recording of private cash collection by a certain NVR device in the first target time period, the information of the target video clip (such as the start and end of the first target time period) is sent to the MMS node through the corresponding working node of the transfer task, and the MMS node communicates with the NVR device through the DMS node, obtains the streaming address of the first target time period corresponding to the corresponding NVR device, and then sends it to the working node that executes the transfer task. The information of the target video clip sent to the MMS node by the working node of the transfer task can also include the MAC address, channel, etc. of the NVR device. That is, the information sent to the MMS is the necessary information for requesting recording, such as the MAC address, channel, time point, etc. of the NVR.
[0072] Step 103, the dispatch center obtains the consumption response message from the feedback queue and uses a callback to notify the business system that the transfer task is completed. If the transfer fails due to other reasons, the dispatch center will save the corresponding transfer task in the database and try 6 times in the next 3 hours. If it still fails, the transfer task will be abandoned and the final result will be reported. Among them, the callback can be understood as an HTTP interface provided by the business system, and the worker calls the HTTP interface after completing the task.
[0073] Furthermore, when the NVR clips transferred by the embodiment are transferred successfully, the service system will obtain the CDN address of the clips after the transfer (that is, the storage address of the transferred clips), and the formats support MP4, FLV and M3U8, which basically support playback on all terminal devices. Users can view and play the target clips through the service system.
[0074] Storage method 2 - NVR cloud storage: The business system sends the command to start NVR cloud storage to the DMS node. The DMS node uses the MQTT long link maintained with the device to send the command to the NVR device. The command carries the cloud storage task. The NVR device records the cloud storage task and performs the NVR cloud storage task when it is in the effective time period of the cloud storage task. The video is streamed to the streaming S3 storage. The file name organization format is two types, SDP type ( / uuid / v2 / Date / DayIndex / Timestamp-0-sdp) and BLK type ( / uuid / v2 / Date / DayIndex / Timestamp-SeekStep-blk). For example, the effective time period can be from 8 am to 8 pm or all day. That is, cloud storage supports all-day storage, and can also be configured to store from 8 am to 8 pm.
[0075] Storage method 3 - NVR local disk streaming: The business system queries the device streaming system (MMS node) for the current recording status of the NVR device. At the time when the recording exists, the streaming address can be obtained from the device streaming system (MMS node) for recording playback.
[0076] Among them, storage mode 1, the transfer format is MP4, FLV or M3U8; storage mode 2, storage is SDP&BLK format; storage mode 3: can be directly extracted and played without transfer. In this embodiment, the video is stored in a hierarchical manner, and the video storage cost and video storage time are balanced to achieve cost reduction and efficiency improvement, and meet the multi-dimensional user needs.
[0077] This embodiment can divide the video storage into three levels for mixed storage according to the importance of the video in different time periods and the subjective choice of the terminal user, thereby reducing the storage cost. NVR cloud storage has high storage cost (cloud object storage), can be cyclically overwritten, and the storage time can be theoretically infinite, supporting event storage. Cyclic overwriting storage means presetting the storage time, and overwriting after the storage time. A relatively long storage time can be set, such as 1 year, 2 years, and 3 years. Event storage in cloud storage is an extended function. When cloud storage does not need to be stored all day, event cloud storage can be selected, which does not conflict with fragment storage. The difference is that cloud storage supports cyclic overwriting, and fragment transfer is a video file in sections, with an independent storage period strategy. The events for fragment transfer include: motion detection, smoking detection, flame detection, crowd detection, mobile phone detection, intrusion detection, smoke detection, etc. NVR local disk storage has low storage cost, and the storage time depends on the size of the local disk and the number of channels, and cyclic overwriting. Clip transfer: You can select clips from the local disk and NVR cloud storage for transfer. It can be stored permanently (you can also configure policy cleanup, such as when a user manually deletes a clip, it is also called policy deletion). It is low-cost and can be shared (static link).
[0078] Since NVR cloud storage is relatively expensive, it is suitable for scenarios that require long-term storage and high security. NVR local disk storage has low cost but limited storage time. If you want to extend the storage time, you need to expand the hardware capacity, which is costly. However, the fragment transfer recording is discontinuous, the recording fragment is short, the storage cost is very low, and the storage time is very long. This embodiment uses fragment transfer for important recordings (in actual applications, the captured events are usually stored, such as cashier anomalies / private collection events, preset alarm event capture and storage), low cost, long storage time, and convenient sharing. For example, the clip duration is about 5 minutes. Special recordings can use NVR cloud storage, which supports ultra-long storage, and the storage environment is safe. It is a safe storage method (in actual applications, it is usually the storage of long-term shooting content in store target areas such as cashier areas during working hours). General recordings use NVR local disk storage, and the cost and storage capacity are relatively balanced (comprehensive storage of daily store videos for users to back up and view).
[0079] The technical means adopted in this embodiment include video encapsulation formats RTSP, RTMP, FLV, MP4, AWS-S3 object storage, streaming protocols RTSP, RTMP, RTP (NVR cloud storage, the upload part requires object storage and streaming protocols), transport layer protocols TCP, KCP, FFmpeg, Nvidia encoder and decoder, message queue. It needs to be combined with other subsystems to run, mainly including: Network Video Recorder (Network Video Recorder is the storage and forwarding part of the network video surveillance system. NVR works with video encoder or network camera to complete the video recording, storage and forwarding functions). Device streaming media system, responsible for device command issuance and streaming media data forwarding. MMS system (responsible for retrieving video data streams from local disks from NVR devices); DMS system (responsible for communicating with NVR devices and forwarding commands to NVR devices).
[0080] Facing the multi-dimensional needs of users, such as: 1. The video clips of subjective concern are very small or multiple, and they need to be stored permanently; 2. There is a high requirement for integrity, and some regulations require a specified recording time (usually in years) and storage in a specified location (private data center). For the first case, the video can be segmented and the target segment can be stored in the cloud space (such as AWS-S3 bucket). In other words, the segment transfer solution is adopted. For the second case, real-time recording is uploaded to the cloud, and the video stream is divided into blocks and stored in the cloud space (such as AWS-S3 bucket), and playback and download operations are supported. The bucket of AWS-S3 protocol is the de facto standard for object storage. Using AWS-S3 protocol to store data can have the greatest flexibility (multi-cloud architecture) and reliability. In other words, the cloud storage solution is adopted. Cloud storage can meet the requirements of long-term storage and storage in the data center specified by the customer.
[0081] The embodiments of the present application are based on the actual situation of users and personalize the hierarchical storage of recorded videos according to the different storage durations and storage privacy requirements (customer's own data center) for users in the recorded videos. Different storage methods can be used according to event information or regional information, etc., and a balanced combination of the video storage cost and the video storage duration can be achieved, which not only meets the personalized needs of users but also achieves cost reduction and efficiency improvement.
[0082] See also Figure 3 As shown, the embodiment of the present application discloses a video storage device, including:
[0083] The video recording storage module 11 is used to store the video recording using the local disk of the network video recorder device;
[0084] Configuration information acquisition module 12, the user acquires user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine the target video data to be uploaded to the cloud storage, and the second configuration information is used to determine the target video segment to be transferred;
[0085] A cloud storage task generating module 13, configured to generate a cloud storage task based on the first configuration information;
[0086] A fragment transfer task generating module 14, configured to generate a fragment transfer task based on the second configuration information;
[0087] A cloud storage task execution module 15, used to execute the cloud storage task, determine target video data from the recorded video, and upload the target video data to cloud storage;
[0088] The segment transfer task execution module 16 is used to execute the segment transfer task and transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0089] In an optional embodiment, the first configuration information includes target area information, and the cloud storage task execution module 15 is specifically used to execute the cloud storage task, determine the video data corresponding to the target area information from the recorded video to obtain target video data, and upload the target video data to cloud storage.
[0090] In an optional embodiment, the second configuration information includes target event information, and accordingly, the segment transfer task execution module 16 is specifically used to: execute the segment transfer task, and transfer the target video segment corresponding to the target event information in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
[0091] Furthermore, the device also includes a scheduling center, which is used to add the fragment transfer task to a task queue;
[0092] Correspondingly, the segment transfer task execution module 16 is specifically used to: utilize a preset working node to consume the segment transfer task in the task queue, and transfer the target video segment in the cloud storage or the local disk according to a preset format.
[0093] In an optional implementation, the segment transfer task execution module 16 is specifically used to: utilize a preset working node to consume the segment transfer task in the task queue, obtain a streaming address corresponding to the target video segment, and transfer the target video segment according to a preset format based on the streaming address.
[0094] Furthermore, the device is also used to place a response message corresponding to the segment transfer task into a feedback queue after the target video segment in the cloud storage or the local disk is transferred according to a preset format, wherein the response message includes information indicating a successful transfer or a failed transfer; and the response information in the feedback queue is consumed by the scheduling center. When the response information includes information indicating a failed transfer, and the number of failed transfers corresponding to the segment transfer task does not reach a preset threshold, the segment transfer task is placed into the task queue again.
[0095] Furthermore, the device also includes a cloud storage task issuing module, which is used to issue the cloud storage task to the network video recorder device through a preset device management system and using a message queue telemetry transmission long link maintained between the preset device management system and the network video recorder device; and record the cloud storage task through the network video recorder device;
[0096] Correspondingly, the cloud storage task execution module 15 is specifically used to: execute the cloud storage task through the network video recorder device, determine the target video data from the recorded video, and upload the target video data to the cloud storage.
[0097] It can be seen that in addition to using the local disk of the network video recorder device to store recorded videos, the embodiments of the present application can also store the target video data in the cloud based on the user configuration information and transfer the target video clips in a preset format to support playback on various terminal devices. In this way, not only can the local disk of the network video recorder device be fully stored in the recorded video, but the target video data that the user needs to store for a longer period of time can also be stored in the cloud without expanding the local storage capacity, thereby reducing costs. In addition, the target video clips that need to be viewed in particular can be transferred to facilitate viewing and sharing on the terminal device. Through this application, the multi-dimensional needs of users can be met.
[0098] See also Figure 4 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program, and the video storage method disclosed in the above embodiment.
[0099] For the specific process of the above-mentioned video storage method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.
[0100] Furthermore, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0101] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0102] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the video storage method disclosed in the aforementioned embodiment.
[0103] For the specific process of the above-mentioned video storage method, reference may be made to the corresponding contents disclosed in the above-mentioned embodiments, which will not be described in detail here.
[0104] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0105] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0106] The above is a detailed introduction to a video storage method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A video storage method, characterized in that: include: Utilize the local disk of the network video recorder device to store recorded videos; Acquire user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine target video data to be uploaded to cloud storage, and the second configuration information is used to determine target video segments to be transferred; Generate a cloud storage task based on the first configuration information and generate a segment transfer task based on the second configuration information; Executing the cloud storage task, determining target video data from the recorded video, and uploading the target video data to cloud storage; The segment transfer task is executed to transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
2. The video storage method according to claim 1, characterized in that: The first configuration information includes target area information. Accordingly, the executing the cloud storage task, determining target video data from the recorded video, and uploading the target video data to cloud storage includes: The cloud storage task is executed, the video data corresponding to the target area information is determined from the recorded video to obtain the target video data, and the target video data is uploaded to the cloud storage.
3. The video storage method according to claim 1, characterized in that: The second configuration information includes target event information. Accordingly, the execution of the segment transfer task to transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device includes: The segment transfer task is executed to transfer the target video segment corresponding to the target event information in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
4. The video storage method according to claim 1, characterized in that: After generating the fragment transfer task based on the second configuration information, the method further includes: Adding the fragment transfer task to the task queue through the scheduling center; Accordingly, the executing the segment transfer task to transfer the target video segment in the cloud storage or the local disk according to a preset format includes: The preset working node is used to consume the segment transfer task in the task queue, and the target video segment in the cloud storage or the local disk is transferred according to a preset format.
5. The video storage method according to claim 4, characterized in that: Using a preset working node to consume the segment transfer task in the task queue to transfer the target video segment in the local disk according to a preset format includes: The segment transfer task in the task queue is consumed by a preset working node, a streaming address corresponding to the target video segment is obtained, and the target video segment is transferred according to a preset format based on the streaming address.
6. The video storage method according to claim 4, characterized in that: After transferring the target video clip in the cloud storage or the local disk according to the preset format, the method further includes: Putting the response information corresponding to the fragment transfer task into a feedback queue, wherein the response message includes information indicating whether the transfer is successful or failed; The response information in the feedback queue is consumed by the scheduling center. When the response information contains information indicating a transfer failure and the number of transfer failures corresponding to the fragment transfer task does not reach a preset threshold, the fragment transfer task is put into the task queue again.
7. The video storage method according to any one of claims 1 to 6, characterized in that: After generating the cloud storage task based on the first configuration information, the method further includes: By means of a preset device management system and by using a message queue telemetry transmission long link maintained between the preset device management system and the network video recorder device, the cloud storage task is sent to the network video recorder device; Recording the cloud storage task by means of the network video recorder device; Accordingly, the executing the cloud storage task, determining the target video data from the recorded video, and uploading the target video data to the cloud storage includes: The cloud storage task is performed by the network video recorder device, target video data is determined from the recorded video, and the target video data is uploaded to the cloud storage.
8. A video storage device, characterized in that: include: A video recording storage module is used to store video recordings using a local disk of a network video recorder device; A configuration information acquisition module, in which a user acquires user configuration information, wherein the user configuration information includes first configuration information and second configuration information, the first configuration information is used to determine target video data to be uploaded to the cloud storage, and the second configuration information is used to determine target video segments to be transferred; A cloud storage task generating module, used to generate a cloud storage task based on the first configuration information; A fragment transfer task generating module, used for generating a fragment transfer task based on the second configuration information; A cloud storage task execution module, used to execute the cloud storage task, determine target video data from the recorded video, and upload the target video data to cloud storage; The segment transfer task execution module is used to execute the segment transfer task and transfer the target video segment in the cloud storage or the local disk according to a preset format so that it can be played on each terminal device.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the video storage method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the video storage method according to any one of claims 1 to 7 is implemented.