CN112333540A - Method and device for determining video encryption length - Google Patents

Method and device for determining video encryption length Download PDF

Info

Publication number
CN112333540A
CN112333540A CN202011158976.3A CN202011158976A CN112333540A CN 112333540 A CN112333540 A CN 112333540A CN 202011158976 A CN202011158976 A CN 202011158976A CN 112333540 A CN112333540 A CN 112333540A
Authority
CN
China
Prior art keywords
encryption
length
maximum
determining
target video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011158976.3A
Other languages
Chinese (zh)
Other versions
CN112333540B (en
Inventor
何新江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011158976.3A priority Critical patent/CN112333540B/en
Publication of CN112333540A publication Critical patent/CN112333540A/en
Application granted granted Critical
Publication of CN112333540B publication Critical patent/CN112333540B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4408Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video stream encryption, e.g. re-encrypting a decrypted video stream for redistribution in a home network
    • 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/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a method and a device for determining video encryption length, which comprises the following steps: determining the maximum encryption time-consuming constraint when encrypting the target video according to the frame rate of the acquired target video; determining the maximum encryption length when the target video is encrypted according to the target regression function and the maximum time consumption constraint of encryption; and determining the encryption length of the target video according to the maximum encryption length. According to the invention, the problem that different environment requirements cannot be met by encrypting the video by adopting a fixed data length is solved, so that the effects of improving the video encryption efficiency and improving the security and reliability of the encrypted video are achieved.

Description

Method and device for determining video encryption length
Technical Field
The invention relates to the field of communication, in particular to a method and a device for determining video encryption length.
Background
In a video monitoring system, security of video data transmission is more and more emphasized. However, the video camera and decoder usually include AI functions, which occupy a lot of system resources and risk pre-empting resources with the encryption and decryption functions.
In the prior art, video data with fixed length is generally selected for encryption and then packaged for transmission. The selected fixed length needs to satisfy the encryption effect and the encryption performance. However, since the network environment and the operating environment are complex and changeable, a large amount of debugging cost exists, and subjective judgment on how to evaluate the encryption effect and the encryption performance exists, the implementation process has certain difficulty. The mark encrypted frame and the data encryption length are added to the tail of the frame data, which results in that the decryption decoding end must accept the complete frame data to judge how to process. In the network transmission process, because the video frame data is large and needs to be subjected to sub-packet processing, the method for adding the encryption information to the tail part of the frame data cannot receive the encryption data and decrypt the encryption data. Encryption and decryption are also subject to performance constraints at the decoding end. In a real scene, the back-end equipment needs to interface multiple cameras. Fixed length cannot cope with complex docking environments.
Aiming at the technical problem that in the related technology, the video is encrypted by adopting a fixed data length, and different environmental requirements cannot be met, an effective solution does not exist at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for determining video encryption length, which are used for at least solving the problem that different environmental requirements cannot be met by encrypting a video by adopting a fixed data length in the related technology.
According to an embodiment of the present invention, there is provided a method for determining a video encryption length, including: determining an encryption maximum time-consuming constraint when encrypting a target video according to the frame rate of the acquired target video; determining the maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, wherein the target regression function is generated when the target video is collected; and determining the encryption length of the target video according to the maximum encryption length.
Optionally, before the determining, according to the target regression function and the encryption maximum time consumption constraint, a maximum encryption length when the target video is encrypted, the method includes: determining the data length of each group of image data in N groups of image data, wherein the target video comprises the N groups of image data, and N is greater than or equal to 2; determining the encryption time consumption when each group of image data is encrypted; and generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
Optionally, the determining a maximum encryption length when the target video is encrypted according to the target regression function and the encryption maximum time consumption constraint includes: determining the maximum ciphering length
Figure BDA0002743704110000021
Where MC is the ciphering maximum time consuming constraint.
Optionally, determining an encryption length for the target video according to the maximum encryption length includes: acquiring the maximum decryption length of a decryption unit; determining a minimum encryption length constraint when encrypting the target video; and determining the encryption length of the target video according to the maximum decryption length, the minimum encryption length constraint and the maximum encryption length.
Optionally, the determining an encryption length for the target video according to the maximum decryption length, the minimum encryption length constraint, and the maximum encryption length includes: determining the minimum length of the maximum decryption length and the maximum encryption length as a negotiation encryption length; and determining the maximum length in the negotiated encryption length and the minimum encryption length constraint as the encryption length of the target video.
Optionally, after the determining the encryption length for the target video, the method includes: and encrypting the first M bytes of the target video, wherein the M bytes represent the encryption length of the target video, and M is a natural number.
According to another embodiment of the present invention, there is provided an apparatus for determining a video encryption length, including: the first determining module is used for determining the maximum encryption time consumption constraint when the target video is encrypted according to the frame rate of the acquired target video; a second determining module, configured to determine a maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, where the target regression function is generated when the target video is collected; and the third determining module is used for determining the encryption length of the target video according to the maximum encryption length.
Optionally, the apparatus further comprises: a fourth determining module, configured to determine a data length of each of N groups of image data before determining a maximum encryption length when encrypting the target video according to a target regression function and the encryption maximum time consumption constraint, where the target video includes the N groups of image data, and N is greater than or equal to 2; a fifth determining module, configured to determine time consumed for encrypting each set of image data; and the generating module is used for generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the maximum encryption time-consuming constraint during encryption of the target video is determined according to the frame rate of the acquired target video; determining the maximum encryption length when the target video is encrypted according to a target regression function and the maximum time consumption constraint of encryption, wherein the target regression function is generated when the target video is collected; and determining the encryption length of the target video according to the maximum encryption length. The purpose of encrypting the video by adopting the variable data length is achieved, therefore, the problem that the video cannot meet different environmental requirements by adopting the fixed data length to encrypt the video can be solved, the video encryption efficiency is improved, and the video encryption safety and reliability are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a method for determining a video encryption length according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for determining a video encryption length according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a network environment according to an embodiment of the present invention;
FIG. 4 is a coordinate diagram of length-time consumption information according to an embodiment of the present invention;
FIG. 5 is a diagram of an encrypted frame format according to an embodiment of the invention;
FIG. 6 is a diagram illustrating specific steps of an application program of a device according to an embodiment of the present invention;
fig. 7 is a block diagram of a structure of an apparatus for determining a video encryption length according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of the method running on the mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the method for determining the video encryption length according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the method for determining the video encryption length in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for determining a video encryption length running in the mobile terminal is provided, and fig. 2 is a flowchart of the method for determining a video encryption length according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, according to the frame rate of the collected target video, determining the maximum encryption time consumption constraint when encrypting the target video;
step S204, determining the maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, wherein the target regression function is generated when the target video is collected;
and step S206, determining the encryption length of the target video according to the maximum encryption length.
As an optional implementation, the target video may be obtained by shooting an image acquisition device, the image acquisition device may be a monitoring camera, and the image acquisition area may be a factory, a road, or the like. Taking a mobile terminal as an example for explanation, in an actual network environment, one or more front-end cameras, a video recording device, a management computer, and a platform server may exist in an equipment network, and fig. 3 is a schematic diagram of a network environment according to an embodiment of the present invention. The front-end camera is responsible for generating video code streams, and encrypting and transmitting the video code streams to the rear end. The back-end device is responsible for decryption, storage, preview, etc. of the video.
As an optional implementation, the Maximum time constraint (Maximum time constraint) may be determined according to the frame rate of the video, and specifically, includes the following steps:
step S31, determining the Frame Rate (Frame Rate) of the target video;
step S32, determining a frame interval time of the target video according to the frame rate of the target video, wherein the frame interval time t is obtained according to the following formula:
Figure BDA0002743704110000061
step S33, determining the encryption maximum time consumption constraint to be 1/4 of the frame interval time.
As an alternative embodiment, the target regression function may be a unitary linear regression equation, where the unitary regression equation is generated by the image acquisition device when the image acquisition device acquires an image of the image acquisition region, and the regression equations generated by the image acquisition device when the image acquisition device acquires images of different image acquisition regions are different. In this embodiment, because the shooting environment can influence the regression function generated by the image acquisition device, and the video encryption length in the present application is obtained based on the regression function, the influence of the shooting environment is considered by the video encryption length in this embodiment, the influence of different environments on video encryption is avoided, the video encryption length in this embodiment can be adapted to different environments, and the security and the reliability are higher.
Through the steps, the maximum encryption time-consuming constraint during encryption of the target video is determined according to the frame rate of the acquired target video; determining the maximum encryption length when the target video is encrypted according to a target regression function and the maximum time consumption constraint of encryption, wherein the target regression function is generated when the target video is collected; and determining the encryption length of the target video according to the maximum encryption length. The purpose of encrypting the video by adopting the variable data length is achieved, therefore, the problem that the video cannot meet different environmental requirements by adopting the fixed data length to encrypt the video can be solved, the video encryption efficiency is improved, and the video encryption safety and reliability are improved.
Alternatively, the execution subject of the above steps may be a terminal or the like, but is not limited thereto.
Optionally, before the determining, according to the target regression function and the encryption maximum time consumption constraint, a maximum encryption length when the target video is encrypted, the method includes: determining the data length of each group of image data in N groups of image data, wherein the target video comprises the N groups of image data, and N is greater than or equal to 2; determining the encryption time consumption when each group of image data is encrypted; and generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
As an optional implementation manner, the Maximum newly added memory (Maximum new added memory): the video transmission end can adopt a fragment processing strategy of edge encryption and edge transmission, the length of an encryption fragment unit can be set to be a preset length, and the preset length can be determined according to the actual situation, such as Encrypt Slice Len 32K. The maximum newly-increased memory size is the length of the encryption fragmentation unit, the constraint condition reduces the requirement of the encryption data length on the memory, and equipment with a short memory can still adopt the scheme to carry out negotiation encryption processing.
As an optional implementation manner, the front-end camera encoding module fragments the plaintext whole frame data according to the encryption fragmentation unit length and circularly pushes the plaintext whole frame data to the encryption module. The encryption module determines whether a target regression function (length-time consuming unary linear regression equation) exists. If not, generating the target regression function by the following method:
step S41, receiving N groups of image data sent by the encoding module, wherein each group of image data corresponds to a frame of image;
and step S42, slicing each frame of image according to the length of the encryption slicing unit, sequentially carrying out full-frame encryption on each group of image data in the N groups of image data according to the length of the encryption slicing unit, recording the length of each group of image data, and consuming time for encryption. Wherein, the encryption time consumption can be obtained according to the recorded encryption start time and encryption end time. Obtaining length-time consumption information P respectively corresponding to N groups of image data(0)(Len0,Len0),P(1)(Len1,Time1),P(2)(Len2,Time2),…,P(n)(Lenn,Timen). Wherein, P(n)(Lenn, Timen) corresponds to the length-elapsed time information of the Nth group of image data, LennIs the data length, Time, of the Nth group of image datanIt takes time to encrypt the nth set of image data. The length of the image data may be the number of bytes included in the image data. In this embodiment, fig. 4 is a schematic coordinate diagram of length-time consumption information according to an embodiment of the present invention, and fig. 4 is a unary linear regression equation of length-time consumption corresponding to three different platforms, which is described by taking one of the unary linear regression equations as an example, and an abscissa of each coordinate point on the unary linear regression equation of length-time consumption represents an encryption length of a set of image data. The ordinate indicates the time taken for encryption when the set of image data is encrypted.Since a straight line can be determined by at least two coordinate points, the length-time-consuming unary linear regression equation y ═ ax + b can be determined by the data length and the encryption time consumption of at least two sets of image data.
Optionally, the determining a maximum encryption length when the target video is encrypted according to the target regression function and the encryption maximum time consumption constraint includes: determining the maximum ciphering length
Figure BDA0002743704110000081
Where MC is the ciphering maximum time consuming constraint.
As an alternative, the Maximum encryption length (Maximum encryption length, corresponding to ML in the formula) that the front-end device is allowed to process may be obtained according to a Maximum time constraint (Maximum time constraint, corresponding to MC in the formula), that is, Maximum encryption length (Maximum time constraint-b)/a, where a and b are a and b in a length-time unary linear regression equation y ═ ax + b.
Optionally, determining an encryption length for the target video according to the maximum encryption length includes: acquiring the maximum decryption length of a decryption unit; determining a minimum encryption length constraint when encrypting the target video; and determining the encryption length of the target video according to the maximum decryption length, the minimum encryption length constraint and the maximum encryption length.
As an alternative, the Minimum encryption length constraint (Minimum encryption length) is that the video transmission end application should set the Minimum encryption length, which must satisfy the header data covering the key frame information, for example, the header data length may be 2 k. Due to the particularity of the video key frame format, the head of the video key frame is encrypted, and the video data is difficult to directly restore and play, so that the purpose of privacy protection in the transmission process is achieved. The constraint provides the lowest security.
As an optional embodiment, the backend device is configured to decrypt the received encrypted file, and may set a maximum decryption length at the backend device. And determining the encryption length for encrypting the target video according to the maximum encryption length of the front-end equipment, the maximum decryption length of the rear-end equipment and the minimum encryption length constraint.
Optionally, the determining an encryption length for the target video according to the maximum decryption length, the minimum encryption length constraint, and the maximum encryption length includes: determining the minimum length of the maximum decryption length and the maximum encryption length as a negotiation encryption length; and determining the maximum length in the negotiated encryption length and the minimum encryption length constraint as the encryption length of the target video.
As an optional implementation manner, when the back-end device accesses the front-end device, the maximum decryption length of the back-end device is sent to the front-end device, and the front-end device compares the maximum decryption length with the maximum encryption length of the front-end device itself, and selects a smaller value as the maximum negotiation encryption length. And comparing the maximum negotiation encryption length with the minimum encryption length, selecting a larger value as a final encryption data length M, feeding the final encryption data length M back to the rear-end equipment, and carrying out encryption transmission on the front M bytes of the code stream data. The format of the encrypted frame may adopt a format of first filling the encryption information and then filling the encryption data, and fig. 5 is a schematic diagram of the format of the encrypted frame according to the embodiment of the present invention.
Optionally, after the determining the encryption length for the target video, the method includes: and encrypting the first M bytes of the target video, wherein the M bytes represent the encryption length of the target video, and M is a natural number.
As an alternative embodiment, the length-time consumption information P can be recorded(i)(Leni,Timei) And i is an integer from 0 to n. And recalculating in another thread to obtain the maximum encryption length for updating the decision encryption length M in real time. When the back-end equipment needs to adjust the encryption length according to the running condition of the back-end equipment, the negotiation setting can be carried out on the front-end equipment in real time. As an optional implementation manner, fig. 6 is a schematic diagram of specific steps of an application program of a device according to an embodiment of the present invention, which may specifically include the following steps:
and step 61, the front-end camera coding module fragments the whole frame of plaintext data according to the encryption fragmentation unit length Encrypt Slice Len and circularly pushes the whole frame of plaintext data to the encryption module.
Step 62, the encryption module determines whether a unary linear regression equation for length-elapsed time exists. If the data length does not exist, acquiring N groups of data, carrying out full-frame encryption on each group of data, and recording the data length, the encryption starting time and the encryption ending time information of each group of data. Calculating the encryption time consumption of each frame of image according to the starting time and the ending time, and representing the length-time consumption information as P(0)(Len0,Len0),P(1)(Len1,Time1),P(2)(Len2,Time2),…,P(n)(Lenn,Timen)。
Step 63, grouping P according to N +1(i)(Leni,Timei) The information is calculated according to the formula y ═ ax + b by using a unary linear regression equation. Wherein y represents the time consumed by encryption, and x represents the data length.
Step 64, if there is a unary linear regression equation of length-time consumption, obtaining the Maximum encryption length (Maximum encryption length) allowed to be processed by the front-end device according to the Maximum time constraint (Maximum time constraint), that is, Maximum encryption length ═ a (Maximum time constraint-b)/a.
And step 65, when the back-end equipment is accessed to the front-end equipment, setting the maximum decryption length of the back end of the back-end equipment to the front-end equipment, comparing the front-end equipment with the maximum encryption length of the front-end equipment, and selecting a smaller value as the maximum negotiation encryption length.
And step 66, comparing the maximum negotiation encryption length with the minimum encryption length, selecting a larger value as the final encryption data length N, feeding the final encryption data length N back to the rear-end equipment, and carrying out encryption transmission on the front N bytes of the code stream data.
And step 67, recording the length-time consumption information P (Lenx, Timex) of the encryption key at the same time, and recalculating the maximum encryption length in another thread according to steps 63 and 64 to update the decision-making encryption length N in real time.
Step 68, when the back-end device needs to adjust the encryption length according to its own operating condition, the front-end device may also be negotiated and set in real time.
Through the method and the device, the encryption length is adaptively adjusted, a large amount of debugging cost is reduced, and the efficiency is improved. The front end and the back end negotiate the encryption length, and the performance difference of front and back encryption and decryption is considered, so that the safety capability is improved to the maximum extent. The encrypted data frame format is filled with the encrypted information and then the encrypted data, the complete data does not need to be cached, the encryption and decryption can be supported while the transmission is carried out, and the influence of the memory is reduced.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a device for determining a video encryption length is further provided, where the device is used to implement the foregoing embodiment and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 7 is a block diagram of a configuration of an apparatus for determining a video encryption length according to an embodiment of the present invention, as shown in fig. 7, the apparatus including: a first determining module 72, configured to determine, according to a frame rate of an acquired target video, a maximum time-consuming encryption constraint when encrypting the target video; a second determining module 74, configured to determine a maximum encryption length when encrypting the target video according to a target regression function and the encryption maximum time consumption constraint, where the target regression function is generated when acquiring the target video; a third determining module 76, configured to determine an encryption length of the target video according to the maximum encryption length.
Optionally, the apparatus further comprises: a fourth determining module, configured to determine a data length of each of N groups of image data before determining a maximum encryption length when encrypting the target video according to a target regression function and the encryption maximum time consumption constraint, where the target video includes the N groups of image data, and N is greater than or equal to 2; a fifth determining module, configured to determine time consumed for encrypting each set of image data; and the generating module is used for generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
As an optional implementation manner, the apparatus is further configured to determine a maximum encryption length when the target video is encrypted according to the target regression function and the encryption maximum time consumption constraint, by: determining the maximum ciphering length
Figure BDA0002743704110000111
Where MC is the ciphering maximum time consuming constraint.
As an optional implementation manner, the apparatus is further configured to determine the encryption length of the target video according to the maximum encryption length by: acquiring the maximum decryption length of a decryption unit; determining a minimum encryption length constraint when encrypting the target video; and determining the encryption length of the target video according to the maximum decryption length, the minimum encryption length constraint and the maximum encryption length.
Optionally, the above apparatus is further configured to determine the encryption length of the target video according to the maximum decryption length, the minimum encryption length constraint, and the maximum encryption length by: determining the minimum length of the maximum decryption length and the maximum encryption length as a negotiation encryption length; and determining the maximum length in the negotiated encryption length and the minimum encryption length constraint as the encryption length of the target video.
Optionally, the apparatus is further configured to encrypt the first M bytes of the target video after the determining the encryption length of the target video, where M bytes represent the encryption length of the target video, where M is a natural number.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, determining the maximum encryption time consumption constraint when encrypting the target video according to the frame rate of the collected target video;
s2, determining the maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, wherein the target regression function is generated when the target video is collected;
and S3, determining the encryption length of the target video according to the maximum encryption length.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, determining the maximum encryption time consumption constraint when encrypting the target video according to the frame rate of the collected target video;
s2, determining the maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, wherein the target regression function is generated when the target video is collected;
and S3, determining the encryption length of the target video according to the maximum encryption length.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for determining video encryption length, comprising:
determining an encryption maximum time-consuming constraint when encrypting a target video according to the frame rate of the acquired target video;
determining the maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, wherein the target regression function is generated when the target video is collected;
and determining the encryption length of the target video according to the maximum encryption length.
2. The method of claim 1, wherein before said determining a maximum encryption length for encrypting the target video according to the target regression function and the encryption maximum time-consuming constraint, the method comprises:
determining the data length of each group of image data in N groups of image data, wherein the target video comprises the N groups of image data, and N is greater than or equal to 2;
determining the encryption time consumption when each group of image data is encrypted;
and generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
3. The method of claim 2, wherein determining the maximum encryption length for encrypting the target video according to the target regression function and the encryption maximum time consumption constraint comprises:
determining the maximum ciphering length
Figure FDA0002743704100000011
Where MC is the ciphering maximum time consuming constraint.
4. The method of claim 1, wherein determining the encryption length for the target video based on the maximum encryption length comprises:
acquiring the maximum decryption length of a decryption unit;
determining a minimum encryption length constraint when encrypting the target video;
and determining the encryption length of the target video according to the maximum decryption length, the minimum encryption length constraint and the maximum encryption length.
5. The method of claim 4, wherein determining the encryption length for the target video based on the maximum decryption length, the minimum encryption length constraint, and the maximum encryption length comprises:
determining the minimum length of the maximum decryption length and the maximum encryption length as a negotiation encryption length;
and determining the maximum length in the negotiated encryption length and the minimum encryption length constraint as the encryption length of the target video.
6. The method of claim 1, wherein after said determining the encryption length for the target video, the method comprises:
and encrypting the first M bytes of the target video, wherein the M bytes represent the encryption length of the target video, and M is a natural number.
7. An apparatus for determining a video encryption length, comprising:
the first determining module is used for determining the maximum encryption time consumption constraint when the target video is encrypted according to the frame rate of the acquired target video;
a second determining module, configured to determine a maximum encryption length when the target video is encrypted according to a target regression function and the encryption maximum time consumption constraint, where the target regression function is generated when the target video is collected;
and the third determining module is used for determining the encryption length of the target video according to the maximum encryption length.
8. The apparatus of claim 7, further comprising:
a fourth determining module, configured to determine a data length of each of N groups of image data before determining a maximum encryption length when encrypting the target video according to a target regression function and the encryption maximum time consumption constraint, where the target video includes the N groups of image data, and N is greater than or equal to 2;
a fifth determining module, configured to determine time consumed for encrypting each set of image data;
and the generating module is used for generating the target regression function y ═ ax + b according to the data length and the encryption time consumption of the N groups of image data, wherein x represents the data length, and y represents the encryption time consumption.
9. A storage medium, in which a computer program is stored, wherein the program is executable by a terminal device or a computer to perform the method of any one of claims 1 to 6.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202011158976.3A 2020-10-26 2020-10-26 Method and device for determining video encryption length Active CN112333540B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011158976.3A CN112333540B (en) 2020-10-26 2020-10-26 Method and device for determining video encryption length

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011158976.3A CN112333540B (en) 2020-10-26 2020-10-26 Method and device for determining video encryption length

Publications (2)

Publication Number Publication Date
CN112333540A true CN112333540A (en) 2021-02-05
CN112333540B CN112333540B (en) 2022-06-24

Family

ID=74311996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011158976.3A Active CN112333540B (en) 2020-10-26 2020-10-26 Method and device for determining video encryption length

Country Status (1)

Country Link
CN (1) CN112333540B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1041576A2 (en) * 1999-03-03 2000-10-04 Sony Corporation Non-volatile record medium, recording medium, and recording apparatus
JP2004349958A (en) * 2003-05-21 2004-12-09 Mitsubishi Electric Information Systems Corp Encryption device and program
CN102395034A (en) * 2011-12-22 2012-03-28 东北大学 MPEG-4video chaotic encryption method based on intra prediction
CN105791853A (en) * 2016-03-04 2016-07-20 广东工业大学 Encrypted embedded video chaotic secret communication method after H.264 coding
CN110035319A (en) * 2019-04-02 2019-07-19 北京文香信息技术有限公司 A kind of encryption and decryption method of audio, video data, device and playback equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1041576A2 (en) * 1999-03-03 2000-10-04 Sony Corporation Non-volatile record medium, recording medium, and recording apparatus
JP2004349958A (en) * 2003-05-21 2004-12-09 Mitsubishi Electric Information Systems Corp Encryption device and program
CN102395034A (en) * 2011-12-22 2012-03-28 东北大学 MPEG-4video chaotic encryption method based on intra prediction
CN105791853A (en) * 2016-03-04 2016-07-20 广东工业大学 Encrypted embedded video chaotic secret communication method after H.264 coding
CN110035319A (en) * 2019-04-02 2019-07-19 北京文香信息技术有限公司 A kind of encryption and decryption method of audio, video data, device and playback equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
肖梁山等: "Zynq芯片的三维视频混沌保密通信系统设计", 《单片机与嵌入式系统应用》 *

Also Published As

Publication number Publication date
CN112333540B (en) 2022-06-24

Similar Documents

Publication Publication Date Title
US20120195425A1 (en) Security video transmission apparatus, video data reception apparatus, and key generation method thereof
CN109309650B (en) Data processing method, terminal equipment and network equipment
CN111917555B (en) Data processing method and device
Chen et al. ARM-embedded implementation of a video chaotic secure communication via WAN remote transmission with desirable security and frame rate
CN115208863B (en) Code stream encryption and decryption method and related device, equipment, system and medium
CN112883388A (en) File encryption method and device, storage medium and electronic device
CN113810778A (en) Monitoring video processing method and device, storage medium and electronic equipment
CN110719526B (en) Video playing method and device
CN110620950B (en) Method, device and equipment for storing audio and video files
CN115599744A (en) File transcoding method and device, storage medium and electronic device
CN104123244A (en) USB redirection system and method
CN110996137B (en) Video processing method and device
CN112333540B (en) Method and device for determining video encryption length
CN111552938B (en) File encryption method and device
CN110401689B (en) File management method, device and storage medium
CN114124891B (en) Processing method and device of network request, storage medium and electronic device
CN114390317B (en) Encryption method and system for streaming video
CN107302659B (en) A kind of data compression method for network transmission
CN112394882B (en) Data storage method and device, storage medium and electronic device
CN111506913B (en) Audio encryption method and device, storage medium and electronic device
CN111490880B (en) File receiving method and device
CN109618207B (en) Video frame processing method and device, storage medium and electronic device
CN114490451A (en) Data encryption and data decryption method and device, storage medium and electronic device
CN114143616A (en) Target video processing method and system, storage medium and electronic device
CN114039969A (en) Data transmission method and device

Legal Events

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