WO2018077266A1 - Breakpoint-resume transmission method and device for surveillance video - Google Patents

Breakpoint-resume transmission method and device for surveillance video Download PDF

Info

Publication number
WO2018077266A1
WO2018077266A1 PCT/CN2017/108359 CN2017108359W WO2018077266A1 WO 2018077266 A1 WO2018077266 A1 WO 2018077266A1 CN 2017108359 W CN2017108359 W CN 2017108359W WO 2018077266 A1 WO2018077266 A1 WO 2018077266A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
breakpoint
time
download
target
Prior art date
Application number
PCT/CN2017/108359
Other languages
French (fr)
Chinese (zh)
Inventor
王智勇
Original Assignee
杭州海康威视系统技术有限公司
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 杭州海康威视系统技术有限公司 filed Critical 杭州海康威视系统技术有限公司
Publication of WO2018077266A1 publication Critical patent/WO2018077266A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Definitions

  • the present application relates to the field of monitoring security, and in particular to a method and device for a breakpoint transmission of a surveillance video.
  • monitoring equipment is widely used in various public places to monitor on-site safety.
  • monitoring equipment is generally installed in various shopping malls and office buildings.
  • the early monitoring equipment is generally a closed-circuit monitoring system, which includes a front-end camera device, a back-end host device, and a display.
  • the front-end camera device collects the live image and transmits it to the back-end host device, and simultaneously displays the monitoring video through the display.
  • the client can establish a connection with the monitoring device through the network, watch the monitoring video in real time, and download the monitoring video stored by the monitoring device.
  • the client sends the start time and the end time of the monitoring video to be downloaded to the corresponding monitoring device, and the monitoring device codes the corresponding monitoring video from the start time to the end time.
  • the stream is returned to the client, and the client saves the code stream to complete the download.
  • the start time of the surveillance video requested by the client is 8:00 am on September 15, 2016, and the end time is 10:00 am on September 15, 2016. Then the monitoring equipment will be at 8:00 am on September 15, 2016.
  • the surveillance video stream during the 10:00 am is sent to the client.
  • the client needs to restart the download from the beginning of the surveillance video, and cannot continue to download from the interrupted location, which will result in a lot of waste of time and traffic, especially in the In some environments with limited bandwidth, it takes more time.
  • the embodiment of the present application discloses a method and a device for continuously transmitting a breakpoint of a surveillance video, which are used to solve the present problem.
  • the technical solutions are as follows:
  • the embodiment of the present application provides a method for a resume transmission of a surveillance video, which is applied to a client, and the method includes:
  • the download instruction carries a start time and an end time of the target surveillance video to be downloaded
  • breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
  • the video stream is received and saved.
  • the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time includes:
  • the determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint time of the target monitoring video including:
  • the timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
  • the determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint time of the target monitoring video including:
  • the time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  • the method further includes:
  • the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
  • the step of splicing the searched partial monitoring video with the downloaded video file of the current breakpoint resuming includes:
  • the video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  • the step of splicing the searched partial monitoring video with the downloaded video file of the current breakpoint resuming includes:
  • the method before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video, the method further includes:
  • the downloading instruction further carries device information.
  • the method further includes:
  • the embodiment of the present application further provides a device for monitoring a video recording point, which is applied to a client, and the device includes:
  • a download instruction module configured to obtain a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
  • a breakpoint identification determining module configured to determine whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, The breakpoint identifier is: recorded when the monitoring video downloading process ends abnormally;
  • Downloading a breakpoint time determination module configured to determine a download breakpoint moment of the target surveillance video according to the part of the monitored video recorded;
  • Downloading a breakpoint time sending module configured to send the download breakpoint time, the end time to a target monitoring device that stores the target surveillance video, so that the target monitoring device records the target surveillance video from the Transmitting a video stream from the breakpoint moment to the end moment to the client;
  • the video stream receiving module is configured to receive and save the video stream.
  • the breakpoint identifier determining module includes:
  • the search unit has been downloaded to search for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
  • the download breakpoint time determination module includes:
  • An image determining unit configured to determine a last I frame image of the part of the monitored video records when the target monitoring video is a standard code stream;
  • a first download breakpoint time determining unit configured to determine a timestamp corresponding to the last I image as a download breakpoint time, or a first preset duration before a timestamp corresponding to the last I image The moment is determined as the download breakpoint moment.
  • the download breakpoint time determination module includes:
  • a duration determining unit configured to determine a video duration of the part of the monitored video recording when the target monitoring video is a non-standard code stream, and add the starting time to the video duration
  • the second download breakpoint time determining unit is configured to determine the time obtained by the addition calculation as the download breakpoint time, or determine the time of the second preset duration before the time calculated by the addition as the download breakpoint time.
  • the device further includes:
  • the file splicing module is configured to splicing the part of the monitored video records and the video files downloaded by the resume of the current breakpoint after the end of the resume of the breakpoint.
  • the file splicing module includes:
  • a first image determining unit configured to: when the target monitoring video is a standard code stream, determine image data of a last I frame image of the found partial monitoring video;
  • a second image determining unit configured to determine, from an image frame of a third preset duration from the beginning of the downloaded video file of the current breakpoint, the last frame of the monitored video with the found portion The same I frame image as the image data of the I frame image;
  • a first file splicing unit configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same I frame image position.
  • the file splicing module includes:
  • a first converting unit configured to: when the target monitoring video is a non-standard code stream, The image data of the last fourth preset duration of the found part of the surveillance video is converted into binary data;
  • a second conversion unit configured to convert the image data of the fifth preset duration of the downloaded video file that is downloaded by the current breakpoint into binary data
  • a data determining unit configured to determine, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration
  • a first file splicing unit configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
  • the device further includes:
  • the download interruption number judging module is configured to determine, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number before searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein The breakpoint identifier corresponds to the number of download interruptions;
  • the downloading instruction further carries device information.
  • the device further comprises:
  • a target monitoring device determining module configured to determine, according to the device information, a target monitoring device that stores the target monitoring video, before sending the downloading breakpoint time and the ending time to a target monitoring device that stores the target monitoring video .
  • the embodiment of the present application further provides an electronic device, which is applicable to a breakpoint transmission of a surveillance video, where the electronic device includes:
  • the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered;
  • the memory is for storing executable program code;
  • the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
  • the download instruction carries a start of a target surveillance video to be downloaded Time and end time;
  • breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
  • the video stream is sent to the electronic device;
  • the video stream is received and saved.
  • an embodiment of the present application further provides an application, where the application is used to perform a breakpoint retransmission method of the above surveillance video at runtime.
  • the embodiment of the present application further provides a storage medium, which is used for storing an application, and the application is used to execute a breakpoint continuous transmission method of the above surveillance video during operation.
  • the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the currently downloaded part corresponding to the target surveillance video according to the start time.
  • Monitoring the video and determining a download breakpoint time of the target surveillance video according to the part of the monitored video, and then sending the download breakpoint time and the end time to a target monitoring device storing the target surveillance video, And causing the target monitoring device to send the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receive and save the video code stream.
  • FIG. 1 is a flowchart of a method for continuously transmitting a breakpoint of a surveillance video according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a file splicing manner corresponding to a video file of a standard code stream according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a file splicing manner corresponding to a video file of a non-standard code stream according to an embodiment of the present disclosure
  • FIG. 4 is a schematic structural diagram of a device for maintaining a breakpoint of a surveillance video according to an embodiment of the present application.
  • the downloading time and the traffic are saved in order to save the downloading of the monitoring video after the downloading of the monitoring video is interrupted.
  • the embodiment of the present application provides a method and a device for stopping the transmission of the monitoring video.
  • a method for continuously transmitting a breakpoint of a surveillance video is applied to a client, and includes the following steps:
  • the method provided by the embodiment of the present application is applied to a client, and the client can establish a wired or wireless connection with the monitoring device to perform data transmission.
  • the wireless connection may be a connection method such as a WIFI connection or a cellular mobile network (the system may be 3G, 4G, etc.).
  • the client can obtain the download instruction of the user, and can also obtain the download instruction when the preset download rule is met.
  • the client can also obtain the download instruction through other existing methods, which is not specifically limited herein, wherein the download The command generally carries the start time and the end time of the target surveillance video to be downloaded.
  • the user enters the target monitoring video to be downloaded at the client to start at 2016.
  • the end time is 14:30 on September 15th, 2016, then the client can get the start time of the carrier as 10:10 on September 15, 2016, and the end time is 2016.
  • the client can also obtain the download command when the preset download rule is met.
  • the preset rule can be: download the surveillance video from 8:00 to 10:00 every day at 12 noon, then the client is at 12 noon every day. It is possible to obtain a download instruction that the carrying start time is 8 o'clock on the day and the end time is 10 o'clock on the day.
  • the client After the client obtains the above download command, in order to determine whether the target monitoring video to be downloaded is a download interruption recording, it may be determined whether there is a breakpoint identifier corresponding to the start time and the end time carried by the download instruction.
  • the breakpoint identifier is recorded when an abnormal end occurs during the download of the surveillance video, that is, in the process of downloading the surveillance video, if a download interruption occurs due to human or network reasons, the client You can record the breakpoint ID. Further, if the client determines that there is a breakpoint identifier corresponding to the start time and the end time carried by the download instruction, it indicates that the target surveillance video to be downloaded has been interrupted during the download process, that is, the target to be downloaded.
  • the surveillance video is the download interruption video.
  • the target monitoring video to be downloaded is not the download interruption video. It can be understood that if the target surveillance video to be downloaded is not the download interruption video, the client can download the target surveillance video to be downloaded from the start time carried by the download instruction.
  • the client may further search for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time. Since a user generally does not download the surveillance video with the same time period, that is, the start time of the target surveillance video is generally different, the client can record the corresponding start time of the surveillance video when downloading a surveillance video.
  • the manner of searching for the downloaded partial surveillance video may be:
  • the number of users of the client may be multiple, and multiple users may download the same monitoring video at the beginning of the time. If the same monitoring video at the beginning of the moment is interrupted during the downloading process, the client is based on the starting moment.
  • searching for the currently downloaded part of the surveillance video corresponding to the target surveillance video some of the currently downloaded partial surveillance recordings may be found, and the breakpoints of the currently downloaded partial surveillance video of these searches may not be at the target. Monitor the start and end of the recording.
  • the client when downloading a surveillance video, the client can record the identification information corresponding to the start time and the end time of the surveillance video, such as the default file name, so as to ensure the breakpoint time of the part of the surveillance video that is found. It is between the start time and the end time of the target surveillance video to ensure the accuracy of the search and avoid affecting the subsequent steps.
  • the client may also associate the breakpoint identifier with the currently downloaded partial surveillance video when the breakpoint identifier is recorded, so that the currently downloaded portion can be found after the breakpoint identifier is determined. It is reasonable to monitor the video.
  • the client may further detect whether there is already a start time carried by the download instruction. The surveillance video corresponding to the end time, if it exists, will not be repeated.
  • the client may determine whether there is already a monitoring video corresponding to the start time and the end time carried by the download instruction by searching for a default file corresponding to the start time and the end time. It is also possible to determine whether there is already a monitoring video corresponding to the start time and the end time carried by the download instruction by recording the complete download identifier, that is, downloading the target surveillance video corresponding to the download instruction corresponding to the download instruction.
  • the client can record one with the The complete download identifier corresponding to the target surveillance video, when the client detects the complete download identifier, it indicates that the target surveillance video has been completely downloaded, and there is no need to re-download, further saving download time and traffic.
  • the client After finding the part of the surveillance video, the client can determine the download breakpoint time of the target surveillance video according to the part of the surveillance video that is found.
  • the manner of determining the download breakpoint time of the target surveillance video may include:
  • the timestamp corresponding to the last I picture frame is determined as the download breakpoint time, or the time of the first preset time period before the timestamp corresponding to the last I frame is determined as the download breakpoint time.
  • the types of the above standard code streams mainly include h.264, h.265, MPEG-4, etc.
  • the client can determine the last I frame in the part of the monitored video that is found.
  • the image it can be understood that the last I frame image is the one I frame image closest to the tail in the part of the surveillance video.
  • the method for determining the last I frame image in the part of the surveillance video is an image processing method commonly used in the field, and those skilled in the art can perform specific operations according to factors such as the code stream type of the part of the surveillance video. This will not be explained in detail.
  • the client may determine the timestamp corresponding to the last I frame image as the download breakpoint time. For example, the timestamp corresponding to the timestamp of the last I-frame image is 9:20:5, 10, 10 milliseconds on September 15, 2016, so the client can place 9:20 on September 15, 2016. 10 milliseconds is determined as the download breakpoint moment.
  • the client may also determine the time of the first preset duration before the time stamp corresponding to the last I frame image as the download breakpoint time, where
  • the first preset duration may be determined by a person skilled in the art according to the type of the code stream of the target monitoring video and the duration of the partial monitoring video, and is not limited herein, for example, may be 3 seconds, 5 seconds, or the like.
  • the manner of determining the download breakpoint time of the target surveillance video may include:
  • the time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  • the client can determine the video duration of the part of the surveillance video by any existing method, and then add the start time and the duration of the video, and determine the time calculated by the addition as the download breakpoint. time.
  • the video duration of this part of the surveillance video is 50 minutes
  • the starting time is 10:10 on September 15, 2016, then the download breakpoint is 11:00 on September 15, 2016.
  • the time of the second preset duration before the time calculated by the addition may be determined as the download breakpoint time, wherein the second preset duration may be It is determined by a person skilled in the art according to factors such as the length of the partial surveillance video, and is not specifically limited herein, and may be, for example, 3 seconds, 5 seconds, or the like.
  • S104 Send the download breakpoint time and the end time to a target monitoring device that stores the target surveillance video, so that the target monitoring device records the target surveillance video from the download breakpoint moment to the The video stream of the end time is sent to the client;
  • the download breakpoint time and the end time may be sent to the target monitoring device storing the target surveillance video, so that the target monitoring device can receive the download breakpoint time and
  • the recorded code stream of the target surveillance video from the download breakpoint time to the end time is sent to the client, and the breakpoint transmission of the target surveillance video is realized, instead of restarting from the start time to the The video stream at the end time is sent to the client, saving a lot of download time and traffic.
  • the client After receiving the video stream sent by the target monitoring device, the client saves the video stream to complete the download of the target surveillance video.
  • the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the target monitor according to the start time. Recording a part of the currently downloaded partial surveillance video corresponding to the video, and determining a download breakpoint time of the target surveillance video according to the found partial surveillance video, and then transmitting the download breakpoint time and the ending time to storing the Target monitoring device of the target monitoring video, so that the target monitoring device sends the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receives and saves the video Code stream.
  • the target surveillance video download is interrupted and downloaded again, the resume transmission is resumed from the download breakpoint time, and the downloading time and the traffic volume can be saved without re-downloading from the start time of the target surveillance video.
  • the client in order to ensure the integrity and accuracy of the target monitoring video of the final download, and avoid data loss and redundancy, after the end of the resume transmission, the client can find the data.
  • Some of the surveillance videos that have arrived are spliced with the video files downloaded from this resume.
  • the method for splicing the partial surveillance video that is found and the video file downloaded by the current resume may include:
  • the video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  • the client can determine the image data 230 of the last I frame image of the portion of the monitored video 210 that is found. Then, the client may determine, from the image frame data 240 of the third preset duration starting from the download of the downloaded video file 220 at the current breakpoint, the last I frame image of the partial surveillance video 210 that is found above.
  • the image data 230 has the same image data (indicated by the same image data in the figure), and further determines the same number of images in the video file 220 downloaded from this resume. According to the corresponding I frame image.
  • the third preset duration may be determined by a person skilled in the art according to the searched partial surveillance video 210 and the duration of the video file 220 downloaded by the current resume, the type of the code stream, and the like. It is not specifically limited, and may be, for example, 5 seconds or 6 seconds.
  • the manner of determining the image data 230 of the last I frame image and the video file 220 downloaded from the resume of the current breakpoint are determined to be the same as the image data 230 of the last I frame image.
  • the manner of the I frame image corresponding to the image data is the image processing mode adopted in the art, and those skilled in the art can perform the code stream of the downloaded video file 210 and the downloaded video file 220 according to the found partial video recording 210. The type and other factors operate, and will not be specified here.
  • the client After determining the image data 230 of the last I frame image and the I frame image corresponding to the same image data of the last I frame image data 230 in the video file 220 downloaded by the current breakpoint, The client can splicing the downloaded video file 220 and the found partial surveillance video 210 at the position 250 of the same I-frame image to obtain the spliced partial surveillance video 260.
  • the method for splicing the part of the monitored video and the video file downloaded by the current resume may include:
  • the client can convert the image data of the last fourth preset duration of the found partial surveillance video 310 into binary data 330. Then, the client can convert the image data of the fifth preset duration from the start of the downloaded video file 320 to the binary data 340.
  • the fourth preset duration and the fifth preset duration may be determined by a person skilled in the art according to factors such as the partial surveillance video 310 found and the duration of the video file 320 downloaded by the current breakpoint.
  • the fourth preset duration may be 2 seconds or the like, and the fifth preset duration may be 5 seconds or 6 seconds, and the like.
  • the foregoing method for converting image data into binary data is a data processing method adopted by the field, and those skilled in the art can perform the video downloaded according to the partial monitoring video 310 and the downloaded video of the current breakpoint.
  • the image data of the file 320 is operated and the like, and will not be specifically described herein.
  • the client can convert the binary data converted from the data 340 of the fifth preset duration. Determining the same binary data (in the figure represented by the same binary data) as the data conversion binary data 330 of the fourth preset duration, and continuing to download the downloaded video file 320 and the found partial monitoring The video 310 is spliced at the same position 350 of the binary data to obtain a spliced partial surveillance video 360.
  • the method may further include:
  • the client can record the breakpoint identifier corresponding to the number of download interruptions when the breakpoint identifier is recorded, so that the number of download interruptions can be determined by the breakpoint identifier, thereby determining the number of download interruptions. Whether it exceeds the preset number of times. It should be noted that the preset number of times may be determined by a person skilled in the art according to factors such as network conditions, for example, may be 10 times, etc., and is not specifically limited herein.
  • the client can continue to perform the search for the target surveillance video according to the above start time.
  • the client Corresponding to the currently downloaded part of the monitoring video recording step, resume the breakpoint.
  • the download instruction may further carry the device information, in order to conveniently determine the target monitoring device.
  • the method may further include:
  • the client may establish a connection with the target monitoring device, and send the downloading breakpoint time and ending time to the target monitoring device.
  • the device information generally includes an IP address, port information, a user name, and password information corresponding to the target monitoring device.
  • the embodiment of the present application further provides a device for maintaining a video recording breakpoint.
  • a device for monitoring video recording is provided.
  • a breakpoint continuous transmission device for monitoring video is applied to a client, and the device includes:
  • the download instruction obtaining module 410 is configured to obtain a download instruction
  • the download instruction carries a start time and an end time of the target surveillance video to be downloaded.
  • the breakpoint identifier determining module 420 is configured to determine whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, search for the target surveillance video according to the start time Some of the surveillance videos that have been downloaded;
  • the breakpoint identifier is recorded when the monitoring video is abnormally ended during the downloading process.
  • the download breakpoint determination module 430 is configured to determine a download breakpoint moment of the target surveillance video according to the found partial surveillance video;
  • Downloading a breakpoint time sending module 440 configured to send the download breakpoint time and the end time to a target monitoring device that stores the target monitoring video, so that the target monitoring device selects the target monitoring video Transmitting a video code stream from the download breakpoint moment to the end moment to the client;
  • the video stream receiving module 450 is configured to receive and save the video stream.
  • the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the target monitor according to the start time. Recording a part of the currently downloaded partial surveillance video corresponding to the video, and determining a download breakpoint time of the target surveillance video according to the found partial surveillance video, and then transmitting the download breakpoint time and the ending time to storing the Target monitoring device of the target monitoring video, so that the target monitoring device sends the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receives and saves the video Code stream.
  • the target surveillance video download is interrupted and downloaded again, the resume transmission is resumed from the download breakpoint time, and the downloading time and the traffic volume can be saved without re-downloading from the start time of the target surveillance video.
  • the breakpoint identifier determining module 420 may include:
  • the search unit (not shown) has been downloaded for searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
  • the download breakpoint time determination module 430 may include:
  • An image determining unit (not shown), configured to determine a last I frame image of the part of the monitored video records when the target monitoring video is a standard code stream;
  • a first download breakpoint time determining unit (not shown) for determining a timestamp corresponding to the last I image as a download breakpoint time, or a time corresponding to the last I image The time at which the first preset duration is before the stamp is determined as the download breakpoint moment.
  • the download breakpoint time determination module 430 may include:
  • a duration determining unit (not shown), configured to determine a video duration of the part of the monitored video records when the target monitoring video is a non-standard stream, and add the starting time to the video duration Calculation
  • a second download breakpoint time determining unit (not shown) for determining the time obtained by the addition calculation as the download breakpoint time, or determining the time of the second preset duration before the time calculated by the addition as the download Breakpoint moment.
  • the device may further include:
  • the file splicing module (not shown) is configured to splicing the found partial monitoring video with the downloaded video file of the current breakpoint after the end of the resume.
  • the file splicing module may include:
  • a first image determining unit (not shown), configured to determine image data of a last I frame image of the found partial monitoring video when the target monitoring video is a standard code stream;
  • a second image determining unit (not shown) for determining the portion to be found from the image frame of the third preset duration starting from the download of the downloaded video file by the current breakpoint The same I frame image of the image data of the last I frame image of the surveillance video;
  • a first file splicing unit (not shown), configured to perform the current video file downloaded by the current resume and the partial video surveillance video at the same I frame image position splice.
  • the file splicing module may include:
  • a first conversion unit (not shown), configured to convert image data of the last fourth preset duration of the found partial surveillance video into binary when the target surveillance video is a non-standard code stream Data
  • a second conversion unit (not shown) for converting the image data of the fifth preset duration of the downloaded video file of the current breakpoint conversion into binary data
  • a data determining unit (not shown), configured to determine, from the binary data converted by the data of the fifth preset duration, binary data that is the same as the binary data of the fourth preset duration data conversion;
  • a first file splicing unit (not shown), configured to splicing the downloaded video file of the current breakpoint and the found partial monitoring video at the same binary data position .
  • the device further includes:
  • the download interruption number judging module may be configured to determine the number of download interruptions according to the breakpoint identifier before searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time. Whether the preset number of times exceeds, wherein the breakpoint identifier corresponds to the number of download interruptions;
  • the downloading instruction may further carry device information.
  • the device may further comprise:
  • a target monitoring device determining module (not shown), configured to determine, according to the device information, before storing the downloading breakpoint time and the ending time to storing the target monitoring device of the target monitoring video Target monitoring device for target surveillance video.
  • an electronic device which is suitable for monitoring resume transmission of a video recording, and the electronic device includes:
  • the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered;
  • the memory is for storing executable program code;
  • the processor runs the program corresponding to the executable program code by reading executable program code stored in the memory, Used to perform the following steps:
  • the download instruction carries a start time and an end time of the target surveillance video to be downloaded
  • breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
  • the video stream is sent to the electronic device;
  • the video stream is received and saved.
  • the electronic device may exist in various forms including, but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor , a hard disk , a memory , a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the electronic device can resume the transmission from the download breakpoint when the target monitoring video download is interrupted, and does not need to re-download from the start time of the target surveillance video, which can save a large amount. Download time and traffic.
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the performing the searching for the target according to the start time
  • the steps of monitoring the video recording corresponding to the currently downloaded part of the surveillance video may include:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a standard code stream, the executed
  • the determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint of the target surveillance video may include:
  • the timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, when the target monitoring video is a non-standard code stream, And determining, according to the part of the monitoring video that is found, the step of downloading the breakpoint of the target surveillance video, which may include:
  • the time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  • the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, and the executed method may further include:
  • the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a standard code stream, the executed
  • the step of splicing the part of the monitored video recording with the video file downloaded by the current breakpoint may include:
  • the video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a non-standard code stream, is executed.
  • the step of splicing the part of the monitored video recording with the downloaded video file of the current resume download may include:
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the performing the searching for the target according to the start time
  • the step of monitoring the video corresponding to the currently downloaded part of the surveillance video may further include:
  • the downloading instruction may further carry device information.
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the executing the downloading breakpoint time and the ending time to store the target Before the step of monitoring the target monitoring device of the video, the method may further include:
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the application further provides an application program for performing the monitoring video breakpoint retransmission method provided by the embodiment of the present application at runtime.
  • the monitoring video breakpoint resume transmission method includes:
  • the download instruction carries a start time and an end time of the target surveillance video to be downloaded
  • breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
  • the video stream is received and saved.
  • the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time may include:
  • the step of determining a download breakpoint moment of the target surveillance video according to the part of the monitored video recording may include:
  • the timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
  • the step of determining a download breakpoint time of the target surveillance video according to the part of the monitored video records that is found may include :
  • the time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  • the method further includes:
  • the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
  • the target monitoring video is a standard code stream
  • the part of the monitored video recording and the video file downloaded by the current breakpoint are filed.
  • the step of splicing may include:
  • the video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  • the target monitoring video is a non-standard code stream
  • the part of the monitored video recording is spliced with the video file downloaded by the current resume.
  • the steps can include:
  • the method may further include:
  • the downloading instruction may further carry device information.
  • the method may further include:
  • a storage medium is further provided, where the storage medium is used to execute the monitoring video breakpoint retransmission method provided by the embodiment of the present application at runtime.
  • the monitoring video breakpoint resume transmission method includes:
  • the download instruction carries a start time and an end time of the target surveillance video to be downloaded
  • breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
  • the video stream is received and saved.
  • the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time may include:
  • the step of determining a download breakpoint moment of the target surveillance video according to the part of the monitored video recording may include:
  • the timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
  • the step of determining a download breakpoint time of the target surveillance video according to the part of the monitored video records that is found may include :
  • the time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  • the method may further include:
  • the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
  • Steps can include:
  • the video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  • the step of splicing the part of the monitored video recorded and the video file downloaded by the resume of the current breakpoint may include:
  • the method may further include:
  • the downloading instruction may further carry device information.
  • the method may further include:
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Abstract

Disclosed in the embodiments of the present application are a breakpoint-resume transmission method and device for a surveillance video, applied to a client. The method comprises: obtaining a download instruction; determining whether the breakpoint identifier exists, which corresponds to a start time and an end time carried in the download instruction; if so, according to the start time, finding part of a surveillance video presently being downloaded, corresponding to a target surveillance video; according to said surveillance video part, determining the download breakpoint time of the target surveillance video; sending the download breakpoint time and the end time to a target monitoring device for storing the target surveillance video, so that the target monitoring device sends, to the client, video code streams of the target surveillance video from the download breakpoint time to the end time; and receiving and saving the video code streams. The present solution can perform breakpoint-resume transmission from the download breakpoint time, when the download of a target surveillance video is interrupted and is performed again, without the need to re-download the target surveillance video from the start time, saving much downloading time and traffic.

Description

监控录像的断点续传方法及装置Method and device for resuming transmission of surveillance video
本申请要求于2016年10月31日提交中国专利局、申请号为201610931170.0发明名称为“监控录像的断点续传方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201610931170.0, entitled "Restoring Method and Apparatus for Surveillance of Surveillance Video," filed on October 31, 2016, the entire contents of which are incorporated herein by reference. In the application.
技术领域Technical field
本申请涉及监控安防领域,特别是涉及一种监控录像的断点续传方法及装置。The present application relates to the field of monitoring security, and in particular to a method and device for a breakpoint transmission of a surveillance video.
背景技术Background technique
目前,监控设备广泛应用于各种公共场所,用于监控现场安全,例如各大商场、办公楼内等场所一般都安装有监控设备。早期的监控设备一般是闭路监控系统,该系统包括前端摄像设备、后端主机设备及显示器,具体的,前端摄像设备采集现场图像,并将其传输至后端主机设备,通过显示器同步显示监控视频图像,供工作人员实时观看现场情况,以监控现场安全。At present, monitoring equipment is widely used in various public places to monitor on-site safety. For example, monitoring equipment is generally installed in various shopping malls and office buildings. The early monitoring equipment is generally a closed-circuit monitoring system, which includes a front-end camera device, a back-end host device, and a display. Specifically, the front-end camera device collects the live image and transmits it to the back-end host device, and simultaneously displays the monitoring video through the display. Image for staff to view live conditions in real time to monitor site safety.
随着网络技术的飞速发展,监控设备逐渐改革升级,可以通过网络实现远程监控等功能。客户端可以通过网络与监控设备建立连接,实时观看监控视频,也可以下载监控设备存储的监控录像。在监控录像下载过程中,客户端接收用户的下载指令后,向对应的监控设备发送所要下载的监控录像的开始时刻及结束时刻,监控设备则将对应的监控录像从开始时刻到结束时刻的码流返回给客户端,客户端进行码流的保存,进而完成下载。例如:客户端所请求监控录像的开始时刻为2016年9月15日上午八点,结束时刻为2016年9月15日上午十点,那么监控设备便将2016年9月15日上午八点至上午十点这段时间内的监控录像码流发送给客户端。With the rapid development of network technology, monitoring equipment has been gradually reformed and upgraded, and remote monitoring and other functions can be realized through the network. The client can establish a connection with the monitoring device through the network, watch the monitoring video in real time, and download the monitoring video stored by the monitoring device. During the monitoring video downloading process, after receiving the download command of the user, the client sends the start time and the end time of the monitoring video to be downloaded to the corresponding monitoring device, and the monitoring device codes the corresponding monitoring video from the start time to the end time. The stream is returned to the client, and the client saves the code stream to complete the download. For example, the start time of the surveillance video requested by the client is 8:00 am on September 15, 2016, and the end time is 10:00 am on September 15, 2016. Then the monitoring equipment will be at 8:00 am on September 15, 2016. The surveillance video stream during the 10:00 am is sent to the client.
但是,一旦在下载过程中由于网络或者人为原因导致下载中断,客户端需从监控录像的开始时刻重新开始下载,无法从中断的位置继续下载,这样会造成时间和流量的大量浪费,特别是在一些带宽有限的环境中,会花费更多时间。However, once the download is interrupted due to network or human reasons during the download process, the client needs to restart the download from the beginning of the surveillance video, and cannot continue to download from the interrupted location, which will result in a lot of waste of time and traffic, especially in the In some environments with limited bandwidth, it takes more time.
发明内容Summary of the invention
本申请实施例公开了一种监控录像的断点续传方法及装置,用以解决现 有技术中下载监控录像时不能断点续传造成的时间和流量浪费的问题。技术方案如下:The embodiment of the present application discloses a method and a device for continuously transmitting a breakpoint of a surveillance video, which are used to solve the present problem. There is a problem in the technology that downloading surveillance video can not be interrupted by the time and traffic wasted. The technical solutions are as follows:
第一方面,本申请实施例提供了一种监控录像的断点续传方法,应用于客户端,所述方法包括:In a first aspect, the embodiment of the present application provides a method for a resume transmission of a surveillance video, which is applied to a client, and the method includes:
获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Determining a download breakpoint time of the target surveillance video according to the part of the monitored video recorded; sending the download breakpoint time and the ending time to a target monitoring device storing the target surveillance video to make the target The monitoring device sends the video code stream of the target surveillance video from the download breakpoint time to the end time to the client;
接收并保存所述录像码流。The video stream is received and saved.
可选的,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤,包括:Optionally, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time includes:
根据所述开始时刻和所述结束时刻,查找所述目标监控录像对应的当前已下载的部分监控录像。And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
可选的,当所述目标监控录像为标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,包括:Optionally, when the target monitoring video is a standard code stream, the determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint time of the target monitoring video, including:
确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
可选的,当所述目标监控录像为非标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,包括:Optionally, when the target monitoring video is a non-standard code stream, the determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint time of the target monitoring video, including:
确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频 时长进行加法计算;Determining the video duration of the part of the monitored video that is found, and the starting time and the video The duration is added;
将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
可选的,所述方法还包括:Optionally, the method further includes:
在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。After the end of the resume of the breakpoint, the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
可选的,当所述目标监控录像为标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,包括:Optionally, when the target monitoring video is a standard code stream, the step of splicing the searched partial monitoring video with the downloaded video file of the current breakpoint resuming includes:
确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
可选的,当所述目标监控录像为非标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,包括:Optionally, when the target monitoring video is a non-standard code stream, the step of splicing the searched partial monitoring video with the downloaded video file of the current breakpoint resuming includes:
将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
可选的,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤之前,所述方法还包括: Optionally, before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video, the method further includes:
根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times, wherein the breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
可选的,所述下载指令还携带设备信息,Optionally, the downloading instruction further carries device information.
相应的,所述发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备的步骤之前,所述方法还包括:Correspondingly, before the step of sending the downloading breakpoint time and the ending time to the target monitoring device storing the target monitoring video, the method further includes:
根据所述设备信息确定存储所述目标监控录像的目标监控设备。Determining, according to the device information, a target monitoring device that stores the target surveillance video.
第二方面,本申请实施例还提供了一种监控录像的断点续传装置,应用于客户端,所述装置包括:In a second aspect, the embodiment of the present application further provides a device for monitoring a video recording point, which is applied to a client, and the device includes:
下载指令获得模块,用于获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;a download instruction module, configured to obtain a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
断点标识判断模块,用于判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;a breakpoint identification determining module, configured to determine whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, The breakpoint identifier is: recorded when the monitoring video downloading process ends abnormally;
下载断点时刻确定模块,用于根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Downloading a breakpoint time determination module, configured to determine a download breakpoint moment of the target surveillance video according to the part of the monitored video recorded;
下载断点时刻发送模块,用于发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Downloading a breakpoint time sending module, configured to send the download breakpoint time, the end time to a target monitoring device that stores the target surveillance video, so that the target monitoring device records the target surveillance video from the Transmitting a video stream from the breakpoint moment to the end moment to the client;
录像码流接收模块,用于接收并保存所述录像码流。The video stream receiving module is configured to receive and save the video stream.
可选的,所述断点标识判断模块包括:Optionally, the breakpoint identifier determining module includes:
已下载查找单元,用于根据所述开始时刻和所述结束时刻,查找与所述目标监控录像对应的当前已下载的部分监控录像。 The search unit has been downloaded to search for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
可选的,所述下载断点时刻确定模块包括:Optionally, the download breakpoint time determination module includes:
图像确定单元,用于当所述目标监控录像为标准码流时,确定所查找到的部分监控录像中的最后一幅I帧图像;An image determining unit, configured to determine a last I frame image of the part of the monitored video records when the target monitoring video is a standard code stream;
第一下载断点时刻确定单元,用于将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。a first download breakpoint time determining unit, configured to determine a timestamp corresponding to the last I image as a download breakpoint time, or a first preset duration before a timestamp corresponding to the last I image The moment is determined as the download breakpoint moment.
可选的,所述下载断点时刻确定模块包括:Optionally, the download breakpoint time determination module includes:
时长确定单元,用于当所述目标监控录像为非标准码流时,确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;a duration determining unit, configured to determine a video duration of the part of the monitored video recording when the target monitoring video is a non-standard code stream, and add the starting time to the video duration;
第二下载断点时刻确定单元,用于将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The second download breakpoint time determining unit is configured to determine the time obtained by the addition calculation as the download breakpoint time, or determine the time of the second preset duration before the time calculated by the addition as the download breakpoint time.
可选的,所述装置还包括:Optionally, the device further includes:
文件拼接模块,用于在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。The file splicing module is configured to splicing the part of the monitored video records and the video files downloaded by the resume of the current breakpoint after the end of the resume of the breakpoint.
可选的,所述文件拼接模块包括:Optionally, the file splicing module includes:
第一图像确定单元,用于当所述目标监控录像为标准码流时,确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;a first image determining unit, configured to: when the target monitoring video is a standard code stream, determine image data of a last I frame image of the found partial monitoring video;
第二图像确定单元,用于从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的的最后一幅I帧图像的图像数据相同的I帧图像;a second image determining unit, configured to determine, from an image frame of a third preset duration from the beginning of the downloaded video file of the current breakpoint, the last frame of the monitored video with the found portion The same I frame image as the image data of the I frame image;
第一文件拼接单元,用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。And a first file splicing unit, configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same I frame image position.
可选的,所述文件拼接模块包括:Optionally, the file splicing module includes:
第一转化单元,用于当所述目标监控录像为非标准码流时,将所述所查 找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;a first converting unit, configured to: when the target monitoring video is a non-standard code stream, The image data of the last fourth preset duration of the found part of the surveillance video is converted into binary data;
第二转化单元,用于将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;a second conversion unit, configured to convert the image data of the fifth preset duration of the downloaded video file that is downloaded by the current breakpoint into binary data;
数据确定单元,用于从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;a data determining unit, configured to determine, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
第一文件拼接单元,用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And a first file splicing unit, configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
可选的,所述装置还包括:Optionally, the device further includes:
下载中断次数判断模块,用于在根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像之前,根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;The download interruption number judging module is configured to determine, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number before searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein The breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
可选的,所述下载指令还携带设备信息,Optionally, the downloading instruction further carries device information.
相应的,所述装置还包括:Correspondingly, the device further comprises:
目标监控设备确定模块,用于在发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备之前,根据所述设备信息确定存储所述目标监控录像的目标监控设备。a target monitoring device determining module, configured to determine, according to the device information, a target monitoring device that stores the target monitoring video, before sending the downloading breakpoint time and the ending time to a target monitoring device that stores the target monitoring video .
第三方面,本申请实施例还提供了一种电子设备,适用于监控录像的断点续传,所述电子设备包括:In a third aspect, the embodiment of the present application further provides an electronic device, which is applicable to a breakpoint transmission of a surveillance video, where the electronic device includes:
壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered; the memory is for storing executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始 时刻和结束时刻;Obtaining a download instruction, wherein the download instruction carries a start of a target surveillance video to be downloaded Time and end time;
判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述电子设备;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the electronic device;
接收并保存所述录像码流。The video stream is received and saved.
第四方面,本申请实施例还提供了一种应用程序,所述应用程序用于在运行时执行上述监控录像的断点续传方法。In a fourth aspect, an embodiment of the present application further provides an application, where the application is used to perform a breakpoint retransmission method of the above surveillance video at runtime.
第五方面,本申请实施例还提供了一种存储介质,其特征在于,用于存储应用程序,所述应用程序在运行时用于执行上述监控录像的断点续传方法。In a fifth aspect, the embodiment of the present application further provides a storage medium, which is used for storing an application, and the application is used to execute a breakpoint continuous transmission method of the above surveillance video during operation.
本方案中,客户端首先获得下载指令,判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,并根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻,然后发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至客户端,最后接收并保存所述录像码流。采用本方案可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。In this solution, the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the currently downloaded part corresponding to the target surveillance video according to the start time. Monitoring the video, and determining a download breakpoint time of the target surveillance video according to the part of the monitored video, and then sending the download breakpoint time and the end time to a target monitoring device storing the target surveillance video, And causing the target monitoring device to send the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receive and save the video code stream. By adopting this scheme, when the target surveillance video download is interrupted and downloaded again, the resume transmission is resumed from the download breakpoint time, and the downloading time and the traffic volume can be saved without re-downloading from the start time of the target surveillance video.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present application, and other drawings can be obtained according to the drawings without any creative work for those skilled in the art.
图1为本申请实施例所提供的一种监控录像的断点续传方法的流程图;FIG. 1 is a flowchart of a method for continuously transmitting a breakpoint of a surveillance video according to an embodiment of the present application;
图2为本申请实施例所提供的标准码流的录像文件对应的一种文件拼接方式的示意图;2 is a schematic diagram of a file splicing manner corresponding to a video file of a standard code stream according to an embodiment of the present disclosure;
图3为本申请实施例所提供的非标准码流的录像文件对应的一种文件拼接方式的示意图;FIG. 3 is a schematic diagram of a file splicing manner corresponding to a video file of a non-standard code stream according to an embodiment of the present disclosure;
图4为本申请实施例所提供的一种监控录像的断点续传装置的结构示意图。FIG. 4 is a schematic structural diagram of a device for maintaining a breakpoint of a surveillance video according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
为了使监控录像下载中断后再次下载时无需重新开始下载,以节省下载时间和流量,本申请实施例提供了一种监控录像的断点续传方法及装置。In order to save the download time and the traffic, the downloading time and the traffic are saved in order to save the downloading of the monitoring video after the downloading of the monitoring video is interrupted. The embodiment of the present application provides a method and a device for stopping the transmission of the monitoring video.
下面首先对本申请实施例所提供的一种监控录像的断点续传方法进行介绍。The following is a description of a method for resuming a breakpoint of a surveillance video provided by an embodiment of the present application.
如图1所示,一种监控录像的断点续传方法,应用于客户端,包括以下步骤:As shown in FIG. 1 , a method for continuously transmitting a breakpoint of a surveillance video is applied to a client, and includes the following steps:
S101,获得下载指令;S101, obtaining a download instruction;
本申请实施例所提供的方法应用于客户端,该客户端可以与监控设备建立有线或无线连接,进而进行数据的传输。其中,无线连接可以为WIFI连接或蜂窝移动网络(制式可以为3G、4G等)等连接方式。The method provided by the embodiment of the present application is applied to a client, and the client can establish a wired or wireless connection with the monitoring device to perform data transmission. The wireless connection may be a connection method such as a WIFI connection or a cellular mobile network (the system may be 3G, 4G, etc.).
客户端可以获得用户的下载指令,也可以在满足预先设定的下载规则时获得下载指令,当然,客户端也可以通过其他现有方式获取下载指令,在此不做具体限定,其中,该下载指令一般携带待下载的目标监控录像的开始时刻和结束时刻。The client can obtain the download instruction of the user, and can also obtain the download instruction when the preset download rule is met. Of course, the client can also obtain the download instruction through other existing methods, which is not specifically limited herein, wherein the download The command generally carries the start time and the end time of the target surveillance video to be downloaded.
举例而言,用户在客户端输入待下载的目标监控录像的开始时刻为2016 年9月15日10点10分,结束时刻为2016年9月15日14点30分,那么客户端便可以获得携带开始时刻为2016年9月15日10点10分,结束时刻为2016年9月15日14点30分的下载指令。客户端也可以在满足预先设定的下载规则时获得下载指令,例如,预先设定规则可以为:每天中午12点下载当天8点到10点的监控录像,那么客户端在每天中午12点便可以获得携带开始时刻为当天8点,结束时刻为当天10点的下载指令。For example, the user enters the target monitoring video to be downloaded at the client to start at 2016. At 10:10 on September 15th, the end time is 14:30 on September 15th, 2016, then the client can get the start time of the carrier as 10:10 on September 15, 2016, and the end time is 2016. Download instructions at 14:30 on September 15. The client can also obtain the download command when the preset download rule is met. For example, the preset rule can be: download the surveillance video from 8:00 to 10:00 every day at 12 noon, then the client is at 12 noon every day. It is possible to obtain a download instruction that the carrying start time is 8 o'clock on the day and the end time is 10 o'clock on the day.
S102,判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像;S102, determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time;
客户端获得了上述下载指令后,为了判断待下载的目标监控录像是否为下载中断录像,可以判断是否存在与该下载指令所携带的开始时刻和结束时刻对应的断点标识。After the client obtains the above download command, in order to determine whether the target monitoring video to be downloaded is a download interruption recording, it may be determined whether there is a breakpoint identifier corresponding to the start time and the end time carried by the download instruction.
需要说明的是,该断点标识为监控录像下载过程中发生异常结束时所记录的,也就是说,在监控录像下载过程中,如果发生了人为或者网络等原因引起的下载中断时,客户端便可以记录下该断点标识。进而,如果客户端判断出存在与该下载指令所携带的开始时刻和结束时刻对应的断点标识,便说明该待下载的目标监控录像曾经在下载过程中中断过,也就是该待下载的目标监控录像为下载中断录像。It should be noted that the breakpoint identifier is recorded when an abnormal end occurs during the download of the surveillance video, that is, in the process of downloading the surveillance video, if a download interruption occurs due to human or network reasons, the client You can record the breakpoint ID. Further, if the client determines that there is a breakpoint identifier corresponding to the start time and the end time carried by the download instruction, it indicates that the target surveillance video to be downloaded has been interrupted during the download process, that is, the target to be downloaded. The surveillance video is the download interruption video.
如果客户端判断出不存在与该下载指令所携带的开始时刻和结束时刻对应的断点标识,说明该待下载的目标监控录像不是下载中断录像。可以理解的是,如果该待下载的目标监控录像不是下载中断录像,那么客户端便可以从下载指令所携带的开始时刻开始下载该待下载的目标监控录像。If the client determines that there is no breakpoint identifier corresponding to the start time and the end time carried by the download command, the target monitoring video to be downloaded is not the download interruption video. It can be understood that if the target surveillance video to be downloaded is not the download interruption video, the client can download the target surveillance video to be downloaded from the start time carried by the download instruction.
当客户端判断出存在与该下载指令所携带的开始时刻和结束时刻对应的断点标识时,可以进一步根据该开始时刻,查找目标监控录像对应的当前已下载的部分监控录像。由于一个用户一般不会下载时间段相同的监控录像,也就是说目标监控录像的开始时刻一般是不同的,所以客户端在下载一段监控录像时,可以记录与该段监控录像的开始时刻对应的不重复的标识信息,例如默认文件名等,由于该标识信息是唯一的,且与已下载的监控录像一一对应,所以便可以通过查找与上述开始时刻对应的标识信息,来查找上述目 标监控录像对应的当前已下载的部分监控录像。When the client determines that there is a breakpoint identifier corresponding to the start time and the end time carried by the download command, the client may further search for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time. Since a user generally does not download the surveillance video with the same time period, that is, the start time of the target surveillance video is generally different, the client can record the corresponding start time of the surveillance video when downloading a surveillance video. The identification information that is not repeated, such as the default file name, etc., because the identification information is unique and corresponds to the downloaded surveillance video, so that the above information can be found by searching for the identification information corresponding to the start time. The part of the currently monitored part of the surveillance video corresponding to the surveillance video.
在本申请的一个实施例中,为了进一步保证可以查找到准确的上述目标监控录像对应的当前已下载的部分监控录像,查找该已下载的部分监控录像的方式可以为:In an embodiment of the present application, in order to further ensure that the currently downloaded partial surveillance video corresponding to the target surveillance video is found, the manner of searching for the downloaded partial surveillance video may be:
根据所述开始时刻和所述结束时刻,查找与所述目标监控录像对应的当前已下载的部分监控录像。And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
由于在一些情况下,客户端的用户可能为多个,多个用户可能下载过开始时刻相同的监控录像,如果这些开始时刻相同的监控录像在下载过程中中断过,那么客户端在根据该开始时刻,查找目标监控录像对应的当前已下载的部分监控录像时,可能会查找到多个当前已下载的部分监控录像,而这些查找的当前已下载的部分监控录像的断点时刻,可能并不在目标监控录像的开始时刻和结束时刻之间。In some cases, the number of users of the client may be multiple, and multiple users may download the same monitoring video at the beginning of the time. If the same monitoring video at the beginning of the moment is interrupted during the downloading process, the client is based on the starting moment. When searching for the currently downloaded part of the surveillance video corresponding to the target surveillance video, some of the currently downloaded partial surveillance recordings may be found, and the breakpoints of the currently downloaded partial surveillance video of these searches may not be at the target. Monitor the start and end of the recording.
鉴于此,客户端在下载一段监控录像时,可以记录与该段监控录像的开始时刻和结束时刻对应的标识信息,例如默认文件名等,这样便可以保证所查找的部分监控录像的断点时刻是在目标监控录像的开始时刻和结束时刻之间的,以保证查找的准确性,避免影响后续步骤的进行。当然,客户端也可以在记录上述断点标识时,将该断点标识与该当前已下载的部分监控录像进行关联,这样在确定了该断点标识后便可以查找到该当前已下载的部分监控录像,这都是合理的。In view of this, when downloading a surveillance video, the client can record the identification information corresponding to the start time and the end time of the surveillance video, such as the default file name, so as to ensure the breakpoint time of the part of the surveillance video that is found. It is between the start time and the end time of the target surveillance video to ensure the accuracy of the search and avoid affecting the subsequent steps. Of course, the client may also associate the breakpoint identifier with the currently downloaded partial surveillance video when the breakpoint identifier is recorded, so that the currently downloaded portion can be found after the breakpoint identifier is determined. It is reasonable to monitor the video.
需要说明的是,为了避免在某些情况下重复下载同一段监控录像,当该待下载的目标监控录像不是下载中断录像时,客户端可以进一步检测是否已经存在与该下载指令所携带的开始时刻和结束时刻对应的监控录像,如果存在,便不再进行重复下载。It should be noted that, in order to avoid repeatedly downloading the same piece of surveillance video in some cases, when the target surveillance video to be downloaded is not the download interruption video, the client may further detect whether there is already a start time carried by the download instruction. The surveillance video corresponding to the end time, if it exists, will not be repeated.
举例而言,客户端可以通过查找与该开始时刻和结束时刻对应的默认文件来确定是否已经存在与该下载指令所携带的开始时刻和结束时刻对应的监控录像。也可以通过记录完整下载标识的方式来确定是否已经存在与该下载指令所携带的开始时刻和结束时刻对应的监控录像,也就是说,在完整下载一个下载指令所对应的待下载的目标监控录像时,客户端可以记录一个与该 目标监控录像对应的完整下载标识,那么当客户端检测到该完整下载标识时,说明目标监控录像已经完整下载,便不需要再重新下载,进一步节省下载时间和流量。For example, the client may determine whether there is already a monitoring video corresponding to the start time and the end time carried by the download instruction by searching for a default file corresponding to the start time and the end time. It is also possible to determine whether there is already a monitoring video corresponding to the start time and the end time carried by the download instruction by recording the complete download identifier, that is, downloading the target surveillance video corresponding to the download instruction corresponding to the download instruction. When the client can record one with the The complete download identifier corresponding to the target surveillance video, when the client detects the complete download identifier, it indicates that the target surveillance video has been completely downloaded, and there is no need to re-download, further saving download time and traffic.
S103,根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;S103. Determine, according to the part of the monitored video records, the download breakpoint time of the target surveillance video;
查找到该部分监控录像后,客户端便可以根据所查找到的部分监控录像,确定上述目标监控录像的下载断点时刻。After finding the part of the surveillance video, the client can determine the download breakpoint time of the target surveillance video according to the part of the surveillance video that is found.
当上述目标监控录像为标准码流时,确定该目标监控录像的下载断点时刻的方式可以包括:When the target monitoring video is a standard code stream, the manner of determining the download breakpoint time of the target surveillance video may include:
确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
将所述最后一幅I图像帧对应的时间戳确定为下载断点时刻,或,将所述最后I帧对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I picture frame is determined as the download breakpoint time, or the time of the first preset time period before the timestamp corresponding to the last I frame is determined as the download breakpoint time.
上述标准码流的类型主要包括h.264、h.265、MPEG-4等,如果目标监控录像为标准码流,那么客户端便可以确定所查找到的部分监控录像中的最后一幅I帧图像,可以理解的是,该最后一幅I帧图像即为该部分监控录像中,最接近尾部的一幅I帧图像。需要说明的是,确定该部分监控录像中的最后一幅I帧图像的方式为本领域常用的图像处理方法,本领域技术人员可以根据该部分监控录像的码流类型等因素进行具体操作,在此不做详细说明。The types of the above standard code streams mainly include h.264, h.265, MPEG-4, etc. If the target surveillance video is a standard stream, the client can determine the last I frame in the part of the monitored video that is found. The image, it can be understood that the last I frame image is the one I frame image closest to the tail in the part of the surveillance video. It should be noted that the method for determining the last I frame image in the part of the surveillance video is an image processing method commonly used in the field, and those skilled in the art can perform specific operations according to factors such as the code stream type of the part of the surveillance video. This will not be explained in detail.
确定了上述最后一幅I帧图像后,客户端可以将该最后一幅I帧图像对应的时间戳确定为下载断点时刻。例如,该最后一幅I帧图像对应的时间戳所代表的时刻为2016年9月15日9点20分5秒10毫秒,那么客户端便可以将2016年9月15日9点20分5秒10毫秒确定为下载断点时刻。After determining the last I frame image, the client may determine the timestamp corresponding to the last I frame image as the download breakpoint time. For example, the timestamp corresponding to the timestamp of the last I-frame image is 9:20:5, 10, 10 milliseconds on September 15, 2016, so the client can place 9:20 on September 15, 2016. 10 milliseconds is determined as the download breakpoint moment.
为了避免数据丢失,确保最终所下载的目标监控录像的完整性,客户端还可以将上述最后一幅I帧图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻,其中,该第一预设时长可以由本领域技术人员根据上述目标监控录像的码流类型及部分监控录像的时长等因素进行确定,在此不作具体限定,例如可以为3秒、5秒等。 In order to avoid data loss and ensure the integrity of the target video recording that is finally downloaded, the client may also determine the time of the first preset duration before the time stamp corresponding to the last I frame image as the download breakpoint time, where The first preset duration may be determined by a person skilled in the art according to the type of the code stream of the target monitoring video and the duration of the partial monitoring video, and is not limited herein, for example, may be 3 seconds, 5 seconds, or the like.
当上述目标监控录像为非标准码流时,确定该目标监控录像的下载断点时刻的方式可以包括:When the target monitoring video is a non-standard code stream, the manner of determining the download breakpoint time of the target surveillance video may include:
确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;Determining a video duration of the part of the monitored video that is found, and adding the start time to the video duration;
将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
查找到上述部分监控录像后,客户端便可以采用现有任意方式确定该部分监控录像的视频时长,进而将上述开始时刻与该视频时长进行加法计算,将加法计算所得的时刻确定为下载断点时刻。例如,该部分监控录像的视频时长为50分钟,该开始时刻为2016年9月15日10点10分,那么下载断点时刻即为2016年9月15日11点。After finding the above part of the surveillance video, the client can determine the video duration of the part of the surveillance video by any existing method, and then add the start time and the duration of the video, and determine the time calculated by the addition as the download breakpoint. time. For example, the video duration of this part of the surveillance video is 50 minutes, the starting time is 10:10 on September 15, 2016, then the download breakpoint is 11:00 on September 15, 2016.
为了避免数据丢失,确保最终所下载的目标监控录像的完整性,还可以将将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻,其中,该第二预设时长可以由本领域技术人员根据部分监控录像的时长等因素进行确定,在此不作具体限定,例如可以为3秒、5秒等。In order to avoid the data loss, and ensure the integrity of the target video recording that is finally downloaded, the time of the second preset duration before the time calculated by the addition may be determined as the download breakpoint time, wherein the second preset duration may be It is determined by a person skilled in the art according to factors such as the length of the partial surveillance video, and is not specifically limited herein, and may be, for example, 3 seconds, 5 seconds, or the like.
S104,发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;S104. Send the download breakpoint time and the end time to a target monitoring device that stores the target surveillance video, so that the target monitoring device records the target surveillance video from the download breakpoint moment to the The video stream of the end time is sent to the client;
客户端确定了上述下载断点时刻后,便可以将该下载断点时刻及上述结束时刻发送至存储上述目标监控录像的目标监控设备,这样,该目标监控设备便可以接收该下载断点时刻及该结束时刻,进而将该目标监控录像的从该下载断点时刻到该结束时刻的录像码流发送至客户端,实现目标监控录像的断点续传,而不是重新将从上述开始时刻到该结束时刻的录像码流发送至客户端,节省了大量下载时间和流量。After the client determines the download breakpoint time, the download breakpoint time and the end time may be sent to the target monitoring device storing the target surveillance video, so that the target monitoring device can receive the download breakpoint time and At the end time, the recorded code stream of the target surveillance video from the download breakpoint time to the end time is sent to the client, and the breakpoint transmission of the target surveillance video is realized, instead of restarting from the start time to the The video stream at the end time is sent to the client, saving a lot of download time and traffic.
S105,接收并保存所述录像码流。S105. Receive and save the video stream.
客户端接收到上述目标监控设备发送的录像码流后,将该录像码流进行保存,进而完成对目标监控录像的下载。 After receiving the video stream sent by the target monitoring device, the client saves the video stream to complete the download of the target surveillance video.
可见,本申请实施例所提供的方案中,客户端首先获得下载指令,判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,并根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻,然后发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至客户端,最后接收并保存所述录像码流。采用本方案可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。It can be seen that, in the solution provided by the embodiment of the present application, the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the target monitor according to the start time. Recording a part of the currently downloaded partial surveillance video corresponding to the video, and determining a download breakpoint time of the target surveillance video according to the found partial surveillance video, and then transmitting the download breakpoint time and the ending time to storing the Target monitoring device of the target monitoring video, so that the target monitoring device sends the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receives and saves the video Code stream. By adopting this scheme, when the target surveillance video download is interrupted and downloaded again, the resume transmission is resumed from the download breakpoint time, and the downloading time and the traffic volume can be saved without re-downloading from the start time of the target surveillance video.
作为本申请实施例的一种实施方式,为了保证最终下载的目标监控录像的完整性及准确性,避免出现数据丢失和冗余,在本次断点续传结束后,客户端可以将所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。As an implementation manner of the embodiment of the present application, in order to ensure the integrity and accuracy of the target monitoring video of the final download, and avoid data loss and redundancy, after the end of the resume transmission, the client can find the data. Some of the surveillance videos that have arrived are spliced with the video files downloaded from this resume.
当上述目标监控录像为标准码流时,将所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的方式具体可以包括:When the target surveillance video is a standard code stream, the method for splicing the partial surveillance video that is found and the video file downloaded by the current resume may include:
确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
如图2所示,客户端可以确定所查找到的部分监控录像210的最后一幅I帧图像的图像数据230。然后客户端可以从本次断点续传所下载的录像文件220的开始第三预设时长的图像帧数据240中,确定与上述所查找到的部分监控录像210的最后一幅I帧图像的图像数据230相同的图像数据(图中以相同图像数据表示),进而确定本次断点续传所下载的录像文件220中与该相同的图像数 据对应的I帧图像。As shown in FIG. 2, the client can determine the image data 230 of the last I frame image of the portion of the monitored video 210 that is found. Then, the client may determine, from the image frame data 240 of the third preset duration starting from the download of the downloaded video file 220 at the current breakpoint, the last I frame image of the partial surveillance video 210 that is found above. The image data 230 has the same image data (indicated by the same image data in the figure), and further determines the same number of images in the video file 220 downloaded from this resume. According to the corresponding I frame image.
需要说明的是,该第三预设时长可以由本领域技术人员根据所查找到的部分监控录像210和本次断点续传所下载的录像文件220的时长、码流类型等因素确定,在此不做具体限定,例如可以为5秒或者6秒等。It should be noted that the third preset duration may be determined by a person skilled in the art according to the searched partial surveillance video 210 and the duration of the video file 220 downloaded by the current resume, the type of the code stream, and the like. It is not specifically limited, and may be, for example, 5 seconds or 6 seconds.
进一步需要说明的是,上述最后一幅I帧图像的图像数据230的确定方式,以及从本次断点续传所下载的录像文件220中确定与该最后一幅I帧图像的图像数据230相同的图像数据对应的I帧图像的方式均为本领域采用的图像处理方式,本领域技术人员可以根据所查找到的部分监控录像210和本次断点续传所下载的录像文件220的码流类型等因素进行操作,在此不做具体说明。It should be further noted that the manner of determining the image data 230 of the last I frame image and the video file 220 downloaded from the resume of the current breakpoint are determined to be the same as the image data 230 of the last I frame image. The manner of the I frame image corresponding to the image data is the image processing mode adopted in the art, and those skilled in the art can perform the code stream of the downloaded video file 210 and the downloaded video file 220 according to the found partial video recording 210. The type and other factors operate, and will not be specified here.
确定了上述最后一幅I帧图像的图像数据230以及本次断点续传所下载的录像文件220中与该最后一幅I帧图像的图像数据230相同的图像数据对应的I帧图像后,客户端便可以将本次断点续传所下载的录像文件220与所查找到的部分监控录像210在该相同的I帧图像的位置250进行拼接,得到拼接后的部分监控录像260。After determining the image data 230 of the last I frame image and the I frame image corresponding to the same image data of the last I frame image data 230 in the video file 220 downloaded by the current breakpoint, The client can splicing the downloaded video file 220 and the found partial surveillance video 210 at the position 250 of the same I-frame image to obtain the spliced partial surveillance video 260.
当上述目标监控录像为非标准码流时,将所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的方式具体可以包括:When the target monitoring video is a non-standard code stream, the method for splicing the part of the monitored video and the video file downloaded by the current resume may include:
将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
如图3所示,客户端可以将所查找到的部分监控录像310的最后第四预设时长的图像数据转化为二进制数据330。然后客户端可以将本次断点续传所下载的录像文件320的开始第五预设时长的图像数据转化为二进制数据340。 As shown in FIG. 3, the client can convert the image data of the last fourth preset duration of the found partial surveillance video 310 into binary data 330. Then, the client can convert the image data of the fifth preset duration from the start of the downloaded video file 320 to the binary data 340.
需要说明的是,该第四预设时长及第五预设时长可以由本领域技术人员根据所查找到的部分监控录像310和本次断点续传所下载的录像文件320的时长等因素确定,在此不做具体限定,例如,该第四预设时长可以为2秒等,该第五预设时长则可以为5秒或者6秒等。It should be noted that the fourth preset duration and the fifth preset duration may be determined by a person skilled in the art according to factors such as the partial surveillance video 310 found and the duration of the video file 320 downloaded by the current breakpoint. The fourth preset duration may be 2 seconds or the like, and the fifth preset duration may be 5 seconds or 6 seconds, and the like.
进一步需要说明的是,上述将图像数据转化为二进制数据的方式为本领域采用的数据处理方式,本领域技术人员可以根据所查找到的部分监控录像310和本次断点续传所下载的录像文件320的图像数据等因素进行操作,在此不做具体说明。It should be further noted that the foregoing method for converting image data into binary data is a data processing method adopted by the field, and those skilled in the art can perform the video downloaded according to the partial monitoring video 310 and the downloaded video of the current breakpoint. The image data of the file 320 is operated and the like, and will not be specifically described herein.
确定了上述第五预设时长的数据转化的二进制数据340及上述第四预设时长的数据转化的二进制数据330后,客户端便可以从该第五预设时长的数据340转化的二进制数据中,确定与该第四预设时长的数据转化的二进制数据330相同的二进制数据(图中以相同二进制数据表示),将本次断点续传所下载的录像文件320和所查找到的部分监控录像310在相同的二进制数据的位置350进行拼接,得到拼接后的部分监控录像360。After the binary data 340 of the data conversion of the fifth preset duration and the binary data 330 of the data of the fourth preset duration are determined, the client can convert the binary data converted from the data 340 of the fifth preset duration. Determining the same binary data (in the figure represented by the same binary data) as the data conversion binary data 330 of the fourth preset duration, and continuing to download the downloaded video file 320 and the found partial monitoring The video 310 is spliced at the same position 350 of the binary data to obtain a spliced partial surveillance video 360.
通过上述文件拼接方式可以将断点续传所下载的多个录像文件拼接为一个录像文件,避免数据丢失和冗余。同时,如果本次断点续传时再次发生异常结束,那么在下一次断点续传该监控录像时,可以根据拼接后的已下载的部分监控录像更加精确地确定断点时刻。Through the above file splicing method, multiple video files downloaded by the resume can be spliced into one video file to avoid data loss and redundancy. At the same time, if the abnormal end occurs again when the breakpoint is resumed, the next time the resume is transmitted to the surveillance video, the breakpoint time can be determined more accurately according to the spliced part of the downloaded surveillance video.
作为本申请实施例的一种实施方式,在根据上述开始时刻,查找目标监控录像对应的当前已下载的部分监控录像的步骤之前,所述方法还可以包括:As an implementation of the embodiment of the present application, before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the foregoing start time, the method may further include:
根据所述断点标识,判断下载中断次数是否超过预设次数;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
为了方便记录监控录像的下载中断次数,客户端在记录上述断点标识时,可以将该断点标识与下载中断次数对应,这样便可以通过该断点标识确定下载中断次数,进而判断下载中断次数是否超过预设次数。需要说明的是,该预设次数可以由本领域技术人员根据网络状况等因素确定,例如可以为10次等,在此不做具体限定。 In order to facilitate the recording of the number of download interruptions of the surveillance video, the client can record the breakpoint identifier corresponding to the number of download interruptions when the breakpoint identifier is recorded, so that the number of download interruptions can be determined by the breakpoint identifier, thereby determining the number of download interruptions. Whether it exceeds the preset number of times. It should be noted that the preset number of times may be determined by a person skilled in the art according to factors such as network conditions, for example, may be 10 times, etc., and is not specifically limited herein.
当判断出下载中断次数超过预设次数时,说明下载中断次数很多,下载中断比较频繁,那么很可能是由于网络状况不良引起的下载中断,所以此时客户端可以暂时停止断点续传,避免由于频繁尝试连接目标监控设备进行断点续传而造成的下载时间和流量浪费。When it is judged that the number of download interruptions exceeds the preset number, it indicates that the number of download interruptions is many, and the download interruption is frequent. It is likely that the download is interrupted due to poor network conditions, so the client can temporarily stop the resume transmission and avoid The download time and traffic are wasted due to frequent attempts to connect to the target monitoring device for resume transmission.
当判断出下载中断次数没有超过预设次数时,说明下载中断次数较少,由于网络状况不良引起的下载中断的可能性较小,那么客户端便可以继续执行根据上述开始时刻,查找目标监控录像对应的当前已下载的部分监控录像的步骤,进行断点续传。When it is determined that the number of download interruptions does not exceed the preset number of times, the number of download interruptions is small, and the possibility of download interruption due to poor network conditions is small, and the client can continue to perform the search for the target surveillance video according to the above start time. Corresponding to the currently downloaded part of the monitoring video recording step, resume the breakpoint.
作为本申请实施例的一种实施方式,由于监控设备可能为多台,为了方便确定目标监控设备,上述下载指令还可以携带设备信息。As an implementation manner of the embodiment of the present application, since the monitoring device may be multiple, the download instruction may further carry the device information, in order to conveniently determine the target monitoring device.
相应的,在客户端发送上述下载断点时刻、结束时刻至存储上述目标监控录像的目标监控设备的步骤之前,所述方法还可以包括:Correspondingly, before the step of sending the downloading breakpoint and ending time to the target monitoring device for storing the target monitoring video, the method may further include:
根据上述设备信息确定存储上述目标监控录像的目标监控设备。Determining, by the device information, the target monitoring device that stores the target surveillance video.
客户端根据该设备信息确定了目标监控设备后,便可以与该目标监控设备建立连接,并将上述下载断点时刻、结束时刻发送至该目标监控设备。该设备信息一般包括目标监控设备对应的IP地址、端口信息、用户名及密码信息等。After determining the target monitoring device according to the device information, the client may establish a connection with the target monitoring device, and send the downloading breakpoint time and ending time to the target monitoring device. The device information generally includes an IP address, port information, a user name, and password information corresponding to the target monitoring device.
相应于上述方法实施例,本申请实施例还提供了一种监控录像的断点续传装置,下面对本申请实施例所提供的一种监控录像的断点续传装置进行介绍。Corresponding to the above method embodiment, the embodiment of the present application further provides a device for maintaining a video recording breakpoint. The following is a description of a device for monitoring video recording.
如图4所示,一种监控录像的断点续传装置,应用于客户端,所述装置包括:As shown in FIG. 4, a breakpoint continuous transmission device for monitoring video is applied to a client, and the device includes:
下载指令获得模块410,用于获得下载指令;The download instruction obtaining module 410 is configured to obtain a download instruction;
其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻。The download instruction carries a start time and an end time of the target surveillance video to be downloaded.
断点标识判断模块420,用于判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的 当前已下载的部分监控录像;The breakpoint identifier determining module 420 is configured to determine whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, search for the target surveillance video according to the start time Some of the surveillance videos that have been downloaded;
其中,所述断点标识为:监控录像下载过程中异常结束时所记录的。The breakpoint identifier is recorded when the monitoring video is abnormally ended during the downloading process.
下载断点时刻确定模块430,用于根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;The download breakpoint determination module 430 is configured to determine a download breakpoint moment of the target surveillance video according to the found partial surveillance video;
下载断点时刻发送模块440,用于发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Downloading a breakpoint time sending module 440, configured to send the download breakpoint time and the end time to a target monitoring device that stores the target monitoring video, so that the target monitoring device selects the target monitoring video Transmitting a video code stream from the download breakpoint moment to the end moment to the client;
录像码流接收模块450,用于接收并保存所述录像码流。The video stream receiving module 450 is configured to receive and save the video stream.
可见,本申请实施例所提供的方案中,客户端首先获得下载指令,判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,并根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻,然后发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至客户端,最后接收并保存所述录像码流。采用本方案可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。It can be seen that, in the solution provided by the embodiment of the present application, the client first obtains a download instruction, and determines whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searches for the target monitor according to the start time. Recording a part of the currently downloaded partial surveillance video corresponding to the video, and determining a download breakpoint time of the target surveillance video according to the found partial surveillance video, and then transmitting the download breakpoint time and the ending time to storing the Target monitoring device of the target monitoring video, so that the target monitoring device sends the video code stream of the target surveillance video from the download breakpoint time to the end time to the client, and finally receives and saves the video Code stream. By adopting this scheme, when the target surveillance video download is interrupted and downloaded again, the resume transmission is resumed from the download breakpoint time, and the downloading time and the traffic volume can be saved without re-downloading from the start time of the target surveillance video.
作为本申请实施例的一种实施方式,所述断点标识判断模块420可以包括:As an implementation of the embodiment of the present application, the breakpoint identifier determining module 420 may include:
已下载查找单元(图中未示出),用于根据所述开始时刻和所述结束时刻,查找与所述目标监控录像对应的当前已下载的部分监控录像。The search unit (not shown) has been downloaded for searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
作为本申请实施例的一种实施方式,所述下载断点时刻确定模块430可以包括:As an implementation manner of the embodiment of the present application, the download breakpoint time determination module 430 may include:
图像确定单元(图中未示出),用于当所述目标监控录像为标准码流时,确定所查找到的部分监控录像中的最后一幅I帧图像; An image determining unit (not shown), configured to determine a last I frame image of the part of the monitored video records when the target monitoring video is a standard code stream;
第一下载断点时刻确定单元(图中未示出),用于将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。a first download breakpoint time determining unit (not shown) for determining a timestamp corresponding to the last I image as a download breakpoint time, or a time corresponding to the last I image The time at which the first preset duration is before the stamp is determined as the download breakpoint moment.
作为本申请实施例的一种实施方式,所述下载断点时刻确定模块430可以包括:As an implementation manner of the embodiment of the present application, the download breakpoint time determination module 430 may include:
时长确定单元(图中未示出),用于当所述目标监控录像为非标准码流时,确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;a duration determining unit (not shown), configured to determine a video duration of the part of the monitored video records when the target monitoring video is a non-standard stream, and add the starting time to the video duration Calculation
第二下载断点时刻确定单元(图中未示出),用于将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。a second download breakpoint time determining unit (not shown) for determining the time obtained by the addition calculation as the download breakpoint time, or determining the time of the second preset duration before the time calculated by the addition as the download Breakpoint moment.
作为本申请实施例的一种实施方式,所述装置还可以包括:As an implementation manner of the embodiment of the present application, the device may further include:
文件拼接模块(图中未示出),用于在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。The file splicing module (not shown) is configured to splicing the found partial monitoring video with the downloaded video file of the current breakpoint after the end of the resume.
作为本申请实施例的一种实施方式,所述文件拼接模块可以包括:As an implementation manner of the embodiment of the present application, the file splicing module may include:
第一图像确定单元(图中未示出),用于当所述目标监控录像为标准码流时,确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;a first image determining unit (not shown), configured to determine image data of a last I frame image of the found partial monitoring video when the target monitoring video is a standard code stream;
第二图像确定单元(图中未示出),用于从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的的最后一幅I帧图像的图像数据相同的I帧图像;a second image determining unit (not shown) for determining the portion to be found from the image frame of the third preset duration starting from the download of the downloaded video file by the current breakpoint The same I frame image of the image data of the last I frame image of the surveillance video;
第一文件拼接单元(图中未示出),用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。a first file splicing unit (not shown), configured to perform the current video file downloaded by the current resume and the partial video surveillance video at the same I frame image position splice.
作为本申请实施例的一种实施方式,所述文件拼接模块可以包括:As an implementation manner of the embodiment of the present application, the file splicing module may include:
第一转化单元(图中未示出),用于当所述目标监控录像为非标准码流时,将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据; a first conversion unit (not shown), configured to convert image data of the last fourth preset duration of the found partial surveillance video into binary when the target surveillance video is a non-standard code stream Data
第二转化单元(图中未示出),用于将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;a second conversion unit (not shown) for converting the image data of the fifth preset duration of the downloaded video file of the current breakpoint conversion into binary data;
数据确定单元(图中未示出),用于从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;a data determining unit (not shown), configured to determine, from the binary data converted by the data of the fifth preset duration, binary data that is the same as the binary data of the fourth preset duration data conversion;
第一文件拼接单元(图中未示出),用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。a first file splicing unit (not shown), configured to splicing the downloaded video file of the current breakpoint and the found partial monitoring video at the same binary data position .
作为本申请实施例的一种实施方式,所述装置还包括:As an implementation manner of the embodiment of the present application, the device further includes:
下载中断次数判断模块(图中未示出),可以用于根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像之前,根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;The download interruption number judging module (not shown) may be configured to determine the number of download interruptions according to the breakpoint identifier before searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time. Whether the preset number of times exceeds, wherein the breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
作为本申请实施例的一种实施方式,所述下载指令还可以携带设备信息,As an implementation manner of the embodiment of the present application, the downloading instruction may further carry device information.
相应的,所述装置还可以包括:Correspondingly, the device may further comprise:
目标监控设备确定模块(图中未示出),用于在发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备之前,根据所述设备信息确定存储所述目标监控录像的目标监控设备。a target monitoring device determining module (not shown), configured to determine, according to the device information, before storing the downloading breakpoint time and the ending time to storing the target monitoring device of the target monitoring video Target monitoring device for target surveillance video.
另外,根据本申请的实施例,还提供了一种电子设备,适用于监控录像的断点续传,所述电子设备包括:In addition, according to an embodiment of the present application, an electronic device is further provided, which is suitable for monitoring resume transmission of a video recording, and the electronic device includes:
壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序, 以用于执行以下步骤:a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered; the memory is for storing executable program code; the processor runs the program corresponding to the executable program code by reading executable program code stored in the memory, Used to perform the following steps:
获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述电子设备;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the electronic device;
接收并保存所述录像码流。The video stream is received and saved.
在本实施例中,该电子设备可以以多种形式存在,包括但不限于:In this embodiment, the electronic device may exist in various forms including, but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机以及低端手机等。(1) Mobile communication devices: These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器硬盘内存系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The server consists of a processor , a hard disk , a memory , a system bus, etc. The server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
(5)其他具有数据交互功能的电子装置。 (5) Other electronic devices with data interaction functions.
可以看出,本实施例中,电子设备可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。It can be seen that, in this embodiment, the electronic device can resume the transmission from the download breakpoint when the target monitoring video download is interrupted, and does not need to re-download from the start time of the target surveillance video, which can save a large amount. Download time and traffic.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,所执行的所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤,可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the performing the searching for the target according to the start time The steps of monitoring the video recording corresponding to the currently downloaded part of the surveillance video may include:
根据所述开始时刻和所述结束时刻,查找所述目标监控录像对应的当前已下载的部分监控录像。And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,当所述目标监控录像为标准码流时,所执行的所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a standard code stream, the executed The determining, according to the part of the monitoring video that is found, the step of determining a download breakpoint of the target surveillance video, may include:
确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,当所述目标监控录像为非标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, when the target monitoring video is a non-standard code stream, And determining, according to the part of the monitoring video that is found, the step of downloading the breakpoint of the target surveillance video, which may include:
确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;Determining a video duration of the part of the monitored video that is found, and adding the start time to the video duration;
将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,所执行的方法还可以包括: In an implementation of the present application, the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, and the executed method may further include:
在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。After the end of the resume of the breakpoint, the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,当所述目标监控录像为标准码流时,所执行的所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a standard code stream, the executed The step of splicing the part of the monitored video recording with the video file downloaded by the current breakpoint may include:
确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,当所述目标监控录像为非标准码流时,所执行的所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and when the target monitoring video is a non-standard code stream, is executed. The step of splicing the part of the monitored video recording with the downloaded video file of the current resume download may include:
将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
在本申请的一种实现方式中,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,所执行的所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤之 前,所述方法还可以包括:In an implementation manner of the present application, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the performing the searching for the target according to the start time The step of monitoring the video corresponding to the currently downloaded part of the surveillance video The method may further include:
根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times, wherein the breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
在本申请的一种实现方式中,所述下载指令还可以携带设备信息,In an implementation manner of the application, the downloading instruction may further carry device information.
相应的,上述处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,所执行的所述发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备的步骤之前,所述方法还可以包括:Correspondingly, the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, and the executing the downloading breakpoint time and the ending time to store the target Before the step of monitoring the target monitoring device of the video, the method may further include:
根据所述设备信息确定存储所述目标监控录像的目标监控设备。Determining, according to the device information, a target monitoring device that stores the target surveillance video.
对于电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the electronic device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
本申请还提供了一种应用程序,该应用程序用于在运行时执行本申请实施例提供的监控录像断点续传方法。其中,监控录像断点续传方法包括:The application further provides an application program for performing the monitoring video breakpoint retransmission method provided by the embodiment of the present application at runtime. Among them, the monitoring video breakpoint resume transmission method includes:
获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the client;
接收并保存所述录像码流。 The video stream is received and saved.
可以看出,通过本申请实施例提供的应用程序的运行,可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。It can be seen that, by using the application program provided by the embodiment of the present application, when the target monitoring video download is interrupted and then downloaded again, the breakpoint is resumed from the time of downloading the breakpoint, and it is not necessary to re-start from the start time of the target surveillance video. Downloads can save a lot of download time and traffic.
在本申请的一种实现方式中,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤,可以包括:In an implementation manner of the present application, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time may include:
根据所述开始时刻和所述结束时刻,查找所述目标监控录像对应的当前已下载的部分监控录像。And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
在本申请的一种实现方式中,当所述目标监控录像为标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a standard code stream, the step of determining a download breakpoint moment of the target surveillance video according to the part of the monitored video recording may include:
确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
在本申请的一种实现方式中,当所述目标监控录像为非标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a non-standard code stream, the step of determining a download breakpoint time of the target surveillance video according to the part of the monitored video records that is found may include :
确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;Determining a video duration of the part of the monitored video that is found, and adding the start time to the video duration;
将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
在本申请的一种实现方式中,所述方法还包括:In an implementation manner of the application, the method further includes:
在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。After the end of the resume of the breakpoint, the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
在本申请的一种实现方式中,当所述目标监控录像为标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件 拼接的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a standard code stream, the part of the monitored video recording and the video file downloaded by the current breakpoint are filed. The step of splicing may include:
确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
在本申请的一种实现方式中,当所述目标监控录像为非标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a non-standard code stream, the part of the monitored video recording is spliced with the video file downloaded by the current resume. The steps can include:
将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
在本申请的一种实现方式中,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤之前,所述方法还可以包括:In an implementation manner of the present application, before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video, the method may further include:
根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times, wherein the breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
在本申请的一种实现方式中,所述下载指令还可以携带设备信息,In an implementation manner of the application, the downloading instruction may further carry device information.
相应的,所述发送所述下载断点时刻、所述结束时刻至存储所述目标监 控录像的目标监控设备的步骤之前,所述方法还可以包括:Correspondingly, the sending the download breakpoint moment and the ending moment to storing the target monitor Before the step of controlling the target monitoring device of the video, the method may further include:
根据所述设备信息确定存储所述目标监控录像的目标监控设备。Determining, according to the device information, a target monitoring device that stores the target surveillance video.
对于应用程序实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the application embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
另外,根据本申请的实施例,还提供了一种存储介质,该存储介质用于存储应用程序,该应用程序用于在运行时执行本申请实施例提供的监控录像断点续传方法。其中,监控录像断点续传方法包括:In addition, according to an embodiment of the present application, a storage medium is further provided, where the storage medium is used to execute the monitoring video breakpoint retransmission method provided by the embodiment of the present application at runtime. Among them, the monitoring video breakpoint resume transmission method includes:
获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the client;
接收并保存所述录像码流。The video stream is received and saved.
可以看出,通过本申请实施例提供的应用程序的运行,可以在目标监控录像下载中断后再次下载时,从下载断点时刻进行断点续传,不需要重新从目标监控录像的开始时刻进行下载,可以节省大量的下载时间和流量。It can be seen that, by using the application program provided by the embodiment of the present application, when the target monitoring video download is interrupted and then downloaded again, the breakpoint is resumed from the time of downloading the breakpoint, and it is not necessary to re-start from the start time of the target surveillance video. Downloads can save a lot of download time and traffic.
在本申请的一种实现方式中,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤,可以包括:In an implementation manner of the present application, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time may include:
根据所述开始时刻和所述结束时刻,查找所述目标监控录像对应的当前已下载的部分监控录像。 And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
在本申请的一种实现方式中,当所述目标监控录像为标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a standard code stream, the step of determining a download breakpoint moment of the target surveillance video according to the part of the monitored video recording may include:
确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
在本申请的一种实现方式中,当所述目标监控录像为非标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a non-standard code stream, the step of determining a download breakpoint time of the target surveillance video according to the part of the monitored video records that is found may include :
确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;Determining a video duration of the part of the monitored video that is found, and adding the start time to the video duration;
将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
在本申请的一种实现方式中,所述方法还可以包括:In an implementation manner of the application, the method may further include:
在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。After the end of the resume of the breakpoint, the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
在本申请的一种实现方式中,当所述目标监控录像为标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a standard code stream, the part of the monitored video recording is spliced with the video file downloaded by the current resume. Steps can include:
确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
在本申请的一种实现方式中,当所述目标监控录像为非标准码流时,所 述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,可以包括:In an implementation manner of the present application, when the target monitoring video is a non-standard code stream, The step of splicing the part of the monitored video recorded and the video file downloaded by the resume of the current breakpoint may include:
将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
在本申请的一种实现方式中,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤之前,所述方法还可以包括:In an implementation manner of the present application, before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video, the method may further include:
根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times, wherein the breakpoint identifier corresponds to the number of download interruptions;
如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
在本申请的一种实现方式中,所述下载指令还可以携带设备信息,In an implementation manner of the application, the downloading instruction may further carry device information.
相应的,所述发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备的步骤之前,所述方法还可以包括:Correspondingly, before the step of sending the downloading breakpoint time and the ending time to the target monitoring device storing the target monitoring video, the method may further include:
根据所述设备信息确定存储所述目标监控录像的目标监控设备。Determining, according to the device information, a target monitoring device that stores the target surveillance video.
对于存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、 “包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Moreover, the term "includes", "Include" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also other elements not specifically listed, or Include elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。 The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (21)

  1. 一种监控录像的断点续传方法,其特征在于,应用于客户端,所述方法包括:A method for resuming transmission of a surveillance video, which is characterized in that it is applied to a client, and the method includes:
    获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
    判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
    根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
    发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the client;
    接收并保存所述录像码流。The video stream is received and saved.
  2. 如权利要求1所述的方法,其特征在于,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤,包括:The method according to claim 1, wherein the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time comprises:
    根据所述开始时刻和所述结束时刻,查找所述目标监控录像对应的当前已下载的部分监控录像。And searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
  3. 如权利要求1所述的方法,其特征在于,当所述目标监控录像为标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,包括:The method according to claim 1, wherein when the target surveillance video is a standard code stream, the step of determining a download breakpoint time of the target surveillance video according to the found partial surveillance video, include:
    确定所查找到的部分监控录像中的最后一幅I帧图像;Determining the last I frame image in the partial surveillance video found;
    将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。The timestamp corresponding to the last I image is determined as the download breakpoint time, or the time of the first preset duration before the timestamp corresponding to the last I image is determined as the download breakpoint time.
  4. 如权利要求1所述的方法,其特征在于,当所述目标监控录像为非标准码流时,所述根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻的步骤,包括: The method according to claim 1, wherein when the target surveillance video is a non-standard code stream, the step of determining a download breakpoint time of the target surveillance video according to the found partial surveillance video , including:
    确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;Determining a video duration of the part of the monitored video that is found, and adding the start time to the video duration;
    将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The time obtained by the addition calculation is determined as the download breakpoint time, or the time of the second preset time before the time calculated by the addition is determined as the download breakpoint time.
  5. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 wherein the method further comprises:
    在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。After the end of the resume of the breakpoint, the part of the monitored video recorded is merged with the video file downloaded by the resume of the breakpoint.
  6. 如权利要求5所述的方法,其特征在于,当所述目标监控录像为标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,包括:The method according to claim 5, wherein when the target surveillance video is a standard code stream, the performing part of the monitored video recording and the video file downloaded by the current breakpoint transmission are performed. The steps of file splicing include:
    确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据;Determining image data of the last I frame image of the found partial surveillance video;
    从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的最后一幅I帧图像的图像数据相同的I帧图像;Determining the same image data as the image data of the last I frame image of the found partial surveillance video from the image frame of the third preset duration starting from the download of the downloaded video file at the current breakpoint Frame image
    将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。The video file downloaded by the current breakpoint is spliced with the found partial surveillance video at the same I frame image position.
  7. 如权利要求5所述的方法,其特征在于,当所述目标监控录像为非标准码流时,所述将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接的步骤,包括:The method according to claim 5, wherein when the target surveillance video is a non-standard code stream, the partial surveillance video recorded and the video file downloaded by the current breakpoint are continuously transmitted. The steps of file splicing include:
    将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;Converting image data of the last fourth preset duration of the found partial monitoring video into binary data;
    将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;Converting the image data of the fifth preset duration of the video file downloaded by the current resume to the binary data;
    从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;Determining, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
    将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像 在所述相同的二进制数据的位置进行拼接。And downloading the video file downloaded by the current breakpoint and the part of the monitored video recorded. Splicing is performed at the same location of the binary data.
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤之前,所述方法还包括:The method according to any one of claims 1 to 7, wherein the method further comprises: before the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, the method further comprises :
    根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;Determining, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number of times, wherein the breakpoint identifier corresponds to the number of download interruptions;
    如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
  9. 如权利要求8所述的方法,其特征在于,所述下载指令还携带设备信息,The method of claim 8 wherein said download instruction further carries device information.
    相应的,所述发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备的步骤之前,所述方法还包括:Correspondingly, before the step of sending the downloading breakpoint time and the ending time to the target monitoring device storing the target monitoring video, the method further includes:
    根据所述设备信息确定存储所述目标监控录像的目标监控设备。Determining, according to the device information, a target monitoring device that stores the target surveillance video.
  10. 一种监控录像的断点续传装置,其特征在于,应用于客户端,所述装置包括:A breakpoint continuous transmission device for monitoring video, which is characterized in that it is applied to a client, and the device includes:
    下载指令获得模块,用于获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;a download instruction module, configured to obtain a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
    断点标识判断模块,用于判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;a breakpoint identification determining module, configured to determine whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, The breakpoint identifier is: recorded when the monitoring video downloading process ends abnormally;
    下载断点时刻确定模块,用于根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Downloading a breakpoint time determination module, configured to determine a download breakpoint moment of the target surveillance video according to the part of the monitored video recorded;
    下载断点时刻发送模块,用于发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述客户端; Downloading a breakpoint time sending module, configured to send the download breakpoint time, the end time to a target monitoring device that stores the target surveillance video, so that the target monitoring device records the target surveillance video from the Transmitting a video stream from the breakpoint moment to the end moment to the client;
    录像码流接收模块,用于接收并保存所述录像码流。The video stream receiving module is configured to receive and save the video stream.
  11. 如权利要求10所述的装置,其特征在于,所述断点标识判断模块包括:The device according to claim 10, wherein the breakpoint identification determining module comprises:
    已下载查找单元,用于根据所述开始时刻和所述结束时刻,查找与所述目标监控录像对应的当前已下载的部分监控录像。The search unit has been downloaded to search for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time and the end time.
  12. 如权利要求10所述的装置,其特征在于,所述下载断点时刻确定模块包括:The device according to claim 10, wherein the download breakpoint time determination module comprises:
    图像确定单元,用于当所述目标监控录像为标准码流时,确定所查找到的部分监控录像中的最后一幅I帧图像;An image determining unit, configured to determine a last I frame image of the part of the monitored video records when the target monitoring video is a standard code stream;
    第一下载断点时刻确定单元,用于将所述最后一幅I图像对应的时间戳确定为下载断点时刻,或,将所述最后一幅I图像对应的时间戳之前第一预设时长的时刻确定为下载断点时刻。a first download breakpoint time determining unit, configured to determine a timestamp corresponding to the last I image as a download breakpoint time, or a first preset duration before a timestamp corresponding to the last I image The moment is determined as the download breakpoint moment.
  13. 如权利要求10所述的装置,其特征在于,所述下载断点时刻确定模块包括:The device according to claim 10, wherein the download breakpoint time determination module comprises:
    时长确定单元,用于当所述目标监控录像为非标准码流时,确定所查找到的部分监控录像的视频时长,将所述开始时刻与所述视频时长进行加法计算;a duration determining unit, configured to determine a video duration of the part of the monitored video recording when the target monitoring video is a non-standard code stream, and add the starting time to the video duration;
    第二下载断点时刻确定单元,用于将加法计算所得的时刻确定为下载断点时刻,或,将加法计算所得的时刻之前第二预设时长的时刻确定为下载断点时刻。The second download breakpoint time determining unit is configured to determine the time obtained by the addition calculation as the download breakpoint time, or determine the time of the second preset duration before the time calculated by the addition as the download breakpoint time.
  14. 如权利要求10所述的装置,其特征在于,所述装置还包括:The device of claim 10, wherein the device further comprises:
    文件拼接模块,用于在本次断点续传结束后,将所述所查找到的部分监控录像与本次断点续传所下载的录像文件进行文件拼接。The file splicing module is configured to splicing the part of the monitored video records and the video files downloaded by the resume of the current breakpoint after the end of the resume of the breakpoint.
  15. 如权利要求14所述的装置,其特征在于,所述文件拼接模块包括:The device of claim 14, wherein the file splicing module comprises:
    第一图像确定单元,用于当所述目标监控录像为标准码流时,确定所述所查找到的部分监控录像的最后一幅I帧图像的图像数据; a first image determining unit, configured to: when the target monitoring video is a standard code stream, determine image data of a last I frame image of the found partial monitoring video;
    第二图像确定单元,用于从所述本次断点续传所下载的录像文件的开始第三预设时长的图像帧中,确定与所述所查找到的部分监控录像的的最后一幅I帧图像的图像数据相同的I帧图像;a second image determining unit, configured to determine, from an image frame of a third preset duration from the beginning of the downloaded video file of the current breakpoint, the last frame of the monitored video with the found portion The same I frame image as the image data of the I frame image;
    第一文件拼接单元,用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的I帧图像的位置进行拼接。And a first file splicing unit, configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same I frame image position.
  16. 如权利要求14所述的装置,其特征在于,所述文件拼接模块包括:The device of claim 14, wherein the file splicing module comprises:
    第一转化单元,用于当所述目标监控录像为非标准码流时,将所述所查找到的部分监控录像的最后第四预设时长的图像数据转化为二进制数据;a first converting unit, configured to convert image data of the last fourth preset duration of the found partial monitoring video into binary data when the target monitoring video is a non-standard code stream;
    第二转化单元,用于将所述本次断点续传所下载的录像文件的开始第五预设时长的图像数据转化为二进制数据;a second conversion unit, configured to convert the image data of the fifth preset duration of the downloaded video file that is downloaded by the current breakpoint into binary data;
    数据确定单元,用于从所述第五预设时长的数据转化的二进制数据中,确定与所述第四预设时长的数据转化的二进制数据相同的二进制数据;a data determining unit, configured to determine, from the binary data converted by the data of the fifth preset duration, the same binary data as the data converted by the fourth preset duration;
    第一文件拼接单元,用于将所述本次断点续传所下载的录像文件与所述所查找到的部分监控录像在所述相同的二进制数据的位置进行拼接。And a first file splicing unit, configured to splicing the video file downloaded by the current breakpoint and the part of the monitored video recorded at the same binary data position.
  17. 如权利要求10所述的装置,其特征在于,所述装置还包括:The device of claim 10, wherein the device further comprises:
    下载中断次数判断模块,用于在根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像之前,根据所述断点标识,判断下载中断次数是否超过预设次数,其中,所述断点标识与所述下载中断次数对应;The download interruption number judging module is configured to determine, according to the breakpoint identifier, whether the number of download interruptions exceeds a preset number before searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein The breakpoint identifier corresponds to the number of download interruptions;
    如果否,继续执行所述根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像的步骤。If no, the step of searching for the currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time is continued.
  18. 如权利要求10-17任一项所述的装置,其特征在于,所述下载指令还携带设备信息,The device according to any one of claims 10-17, wherein the download instruction further carries device information.
    相应的,所述装置还包括:Correspondingly, the device further comprises:
    目标监控设备确定模块,用于在发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备之前,根据所述设备信息确定存储所述目标监控录像的目标监控设备。 a target monitoring device determining module, configured to determine, according to the device information, a target monitoring device that stores the target monitoring video, before sending the downloading breakpoint time and the ending time to a target monitoring device that stores the target monitoring video .
  19. 一种电子设备,其特征在于,适用于监控录像的断点续传,所述电子设备包括:An electronic device, characterized in that it is suitable for resuming transmission of a video recording, the electronic device comprising:
    壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered; the memory is for storing executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
    获得下载指令,其中,所述下载指令携带待下载的目标监控录像的开始时刻和结束时刻;Obtaining a download instruction, where the download instruction carries a start time and an end time of the target surveillance video to be downloaded;
    判断是否存在与所述开始时刻和结束时刻对应的断点标识,如果是,根据所述开始时刻,查找所述目标监控录像对应的当前已下载的部分监控录像,其中,所述断点标识为:监控录像下载过程中异常结束时所记录的;Determining whether there is a breakpoint identifier corresponding to the start time and the end time, and if yes, searching for a currently downloaded partial surveillance video corresponding to the target surveillance video according to the start time, wherein the breakpoint identifier is : Recorded during the abnormal end of the monitoring video download process;
    根据所查找到的部分监控录像,确定所述目标监控录像的下载断点时刻;Determining a download breakpoint time of the target surveillance video according to the partial surveillance video found;
    发送所述下载断点时刻、所述结束时刻至存储所述目标监控录像的目标监控设备,以使所述目标监控设备将所述目标监控录像的从所述下载断点时刻到所述结束时刻的录像码流发送至所述电子设备;Sending the download breakpoint time and the ending time to the target monitoring device storing the target monitoring video, so that the target monitoring device records the target monitoring video from the download breakpoint time to the end time The video stream is sent to the electronic device;
    接收并保存所述录像码流。The video stream is received and saved.
  20. 一种应用程序,其特征在于,所述应用程序用于在运行时执行权利要求1-9任一项所述的监控录像的断点续传方法。An application program for performing a breakpoint retransmission method for monitoring video according to any one of claims 1-9 at runtime.
  21. 一种存储介质,其特征在于,用于存储应用程序,所述应用程序在运行时用于执行权利要求1-9任一项所述的监控录像的断点续传方法。 A storage medium for storing an application, the application being used at runtime to perform a breakpoint retransmission method for monitoring video according to any one of claims 1-9.
PCT/CN2017/108359 2016-10-31 2017-10-30 Breakpoint-resume transmission method and device for surveillance video WO2018077266A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610931170.0 2016-10-31
CN201610931170.0A CN108023906B (en) 2016-10-31 2016-10-31 Breakpoint continuous transmission method and device of monitoring video

Publications (1)

Publication Number Publication Date
WO2018077266A1 true WO2018077266A1 (en) 2018-05-03

Family

ID=62023118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/108359 WO2018077266A1 (en) 2016-10-31 2017-10-30 Breakpoint-resume transmission method and device for surveillance video

Country Status (2)

Country Link
CN (1) CN108023906B (en)
WO (1) WO2018077266A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740062A (en) * 2019-10-24 2020-01-31 泰康保险集团股份有限公司 Breakpoint resume method and device
CN111600945A (en) * 2020-05-13 2020-08-28 上海英方软件股份有限公司 FTP server breakpoint downloading method and device based on block transmission
CN112203050A (en) * 2020-09-30 2021-01-08 普联技术有限公司 Method and device for continuously transmitting video
CN116634209A (en) * 2023-07-24 2023-08-22 武汉能钠智能装备技术股份有限公司 Breakpoint video recovery system and method based on hot plug

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110620889B (en) * 2018-06-20 2022-04-05 杭州海康威视数字技术股份有限公司 Video monitoring system, network hard disk video recorder and data transmission method
CN109617971A (en) * 2018-12-14 2019-04-12 浩云科技股份有限公司 A kind of method and device for downloading breakpoint transmission
CN109756708B (en) * 2018-12-28 2021-05-14 深圳英飞拓智能技术有限公司 Continuous transmission method and device of audio and video data
CN109729319A (en) * 2019-01-21 2019-05-07 山东劳动职业技术学院(山东劳动技师学院) A kind of implementation method that the video file suspension of monitoring device resumes
CN109862398A (en) * 2019-03-29 2019-06-07 北京奇艺世纪科技有限公司 Multimedia data transmission method, apparatus and system
CN111478751B (en) * 2020-03-30 2023-03-24 百富计算机技术(深圳)有限公司 Data breakpoint continuous transmission method and device and terminal equipment
CN111698466B (en) * 2020-05-07 2022-03-01 浙江大华技术股份有限公司 Method, device, equipment and medium for monitoring breakpoint download of video

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007114054A (en) * 2005-10-20 2007-05-10 Funai Electric Co Ltd Image recording and regenerating device, and electrical equipment
CN102104623A (en) * 2010-12-20 2011-06-22 广州市动景计算机科技有限公司 Method and system for performing break-point continuous playing of media file through mobile terminal
CN103065662A (en) * 2013-01-22 2013-04-24 中兴通讯股份有限公司 Method and system for continuous broadcasting of media resources in device
CN105338297A (en) * 2014-08-11 2016-02-17 杭州海康威视系统技术有限公司 Video data storage and playback system, device and method
CN105530547A (en) * 2014-09-30 2016-04-27 中兴通讯股份有限公司 Bookmark display method and device for internet television on-demand content, and set top box

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179393A (en) * 2006-12-14 2008-05-14 腾讯科技(深圳)有限公司 Method and system for implementing document breakpoint transmission
CN101546321B (en) * 2008-03-28 2013-11-13 爱国者电子科技有限公司 Breakpoint continuous transmission method of mobile storage equipment
CN101459693A (en) * 2008-12-29 2009-06-17 中兴通讯股份有限公司 Stream media downloading method and system
CN102811344A (en) * 2011-12-08 2012-12-05 苏州科达科技有限公司 Control method and device for improving storage stability in video monitoring system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007114054A (en) * 2005-10-20 2007-05-10 Funai Electric Co Ltd Image recording and regenerating device, and electrical equipment
CN102104623A (en) * 2010-12-20 2011-06-22 广州市动景计算机科技有限公司 Method and system for performing break-point continuous playing of media file through mobile terminal
CN103065662A (en) * 2013-01-22 2013-04-24 中兴通讯股份有限公司 Method and system for continuous broadcasting of media resources in device
CN105338297A (en) * 2014-08-11 2016-02-17 杭州海康威视系统技术有限公司 Video data storage and playback system, device and method
CN105530547A (en) * 2014-09-30 2016-04-27 中兴通讯股份有限公司 Bookmark display method and device for internet television on-demand content, and set top box

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740062A (en) * 2019-10-24 2020-01-31 泰康保险集团股份有限公司 Breakpoint resume method and device
CN111600945A (en) * 2020-05-13 2020-08-28 上海英方软件股份有限公司 FTP server breakpoint downloading method and device based on block transmission
CN112203050A (en) * 2020-09-30 2021-01-08 普联技术有限公司 Method and device for continuously transmitting video
CN112203050B (en) * 2020-09-30 2022-09-06 普联技术有限公司 Method and device for continuously transmitting video
CN116634209A (en) * 2023-07-24 2023-08-22 武汉能钠智能装备技术股份有限公司 Breakpoint video recovery system and method based on hot plug
CN116634209B (en) * 2023-07-24 2023-11-17 武汉能钠智能装备技术股份有限公司 Breakpoint video recovery system and method based on hot plug

Also Published As

Publication number Publication date
CN108023906B (en) 2020-06-12
CN108023906A (en) 2018-05-11

Similar Documents

Publication Publication Date Title
WO2018077266A1 (en) Breakpoint-resume transmission method and device for surveillance video
US10484806B2 (en) Managing audio output through an intermediary
JP6490654B2 (en) Method and system for providing a time machine function in live broadcasting
US11093981B2 (en) Smart broadcasting device
CN106791958B (en) Position mark information generation method and device
US8588824B2 (en) Transferring media context information based on proximity to a mobile device
US9374403B2 (en) Media stream fragment request
WO2017201935A1 (en) Video playing method and apparatus
US20120224825A1 (en) Selectively using local non-volatile storage in conjunction with transmission of content
EP2748788A2 (en) Method for transferring media playback from a different device
WO2013117085A1 (en) Method, device and system for realizing video retrieval
TW201215109A (en) Monitoring user activity on a mobile device
WO2018205833A1 (en) Method and apparatus for transmitting music file information, storage medium, and electronic apparatus
WO2017202060A1 (en) Video playing method and apparatus
CN107146608B (en) Playing control method and device and intelligent equipment
WO2022127523A1 (en) Video playback method and apparatus, device, and medium
EP3800894A1 (en) Method and apparatus for detecting video playing quality
JP2010278860A (en) Video recording apparatus and external terminal
CN102622254B (en) Television outage disposal route and system
CN104050236A (en) Website content update prompting method, server and client
CN112118487B (en) Video playing control method, device, equipment and medium
WO2015089790A1 (en) Service processing method, apparatus, and system
WO2022218425A1 (en) Recording streaming method and apparatus, device, and medium
TW200920125A (en) Method of recovering missed parts of mobile TV broadcasts
CN112637668B (en) Video playing method, device, equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17866056

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17866056

Country of ref document: EP

Kind code of ref document: A1