WO2021159644A1 - Screen capture management method and apparatus, and mobile terminal - Google Patents

Screen capture management method and apparatus, and mobile terminal Download PDF

Info

Publication number
WO2021159644A1
WO2021159644A1 PCT/CN2020/093596 CN2020093596W WO2021159644A1 WO 2021159644 A1 WO2021159644 A1 WO 2021159644A1 CN 2020093596 W CN2020093596 W CN 2020093596W WO 2021159644 A1 WO2021159644 A1 WO 2021159644A1
Authority
WO
WIPO (PCT)
Prior art keywords
video stream
screenshot
encryption
picture
control
Prior art date
Application number
PCT/CN2020/093596
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 WO2021159644A1 publication Critical patent/WO2021159644A1/en

Links

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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4408Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 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/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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • 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/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface

Definitions

  • This application belongs to the field of information security technology, and particularly relates to a screenshot management method and a mobile terminal.
  • the screen capture function is very convenient to use, and the user can conveniently use the screen capture function to capture and save some required information.
  • the information security in the mobile terminal is low.
  • the payment codes of some payment programs and the important mail records in some mail programs are extremely easy to be intercepted and disseminated illegally, which greatly reduces the security of the information in the mobile terminal.
  • the embodiments of the present application provide a screenshot management method and a mobile terminal, which can solve the problem of low information security of the mobile terminal caused by the screenshot function.
  • the first aspect of the embodiments of the present application provides a screenshot management method, including: detecting whether the currently called control has a first identifier; if the control has the first identifier, acquiring the control at a first frequency
  • the display page of each display page, and the display size of each display page ; create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding display page
  • the canvas generates a rendered control picture corresponding to each display screen; renders all the control pictures obtained into an encrypted video stream according to the corresponding display size, and plays the encrypted video stream; if A screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is acquired, and the background picture is stored as a screenshot corresponding to the screenshot instruction.
  • a second aspect of the embodiments of the present application provides a screenshot management device, including: an identification detection module, configured to detect whether the currently called control has a first identification; and a page acquisition module, configured if the control has the The first identifier acquires the display page of the control and the display size of each display page at a first frequency; the picture rendering module is used to create a picture context based on the display size of each display page, according to The picture context lays a canvas, and the display page is rendered to the corresponding canvas, and a rendered control picture corresponding to each display screen is generated; a video stream conversion module is used to convert all the obtained controls The picture is rendered into an encrypted video stream according to the corresponding display size, and the encrypted video stream is played; the screenshot processing module is configured to obtain the corresponding first identifier if a screenshot instruction for the encrypted video stream is detected And store the background image as a screenshot corresponding to the screenshot instruction.
  • a third aspect of the embodiments of the present application provides a mobile terminal.
  • the mobile terminal includes a memory and a processor.
  • the memory stores a computer program that can run on the processor, and the processor executes: Whether the currently called control has the first identifier; if the control has the first identifier, the display page of the control and the display size of each display page are acquired at the first frequency; based on each The display size of the display page creates a picture context, lays a canvas according to the picture context, and renders the display page to the corresponding canvas, and generates a rendered control picture corresponding to each display screen; All the control pictures obtained are rendered as encrypted video streams according to the corresponding display size, and the encrypted video stream is played; if a screenshot instruction for the encrypted video stream is detected, the corresponding first identifier is obtained And store the background image as a screenshot corresponding to the screenshot instruction.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, including: a computer program is stored, wherein the computer program is executed by a processor to implement the screenshot management as described in any one of the above-mentioned first aspects Method steps.
  • the fifth aspect of the embodiments of the present application provides a computer program product, which when the computer program product runs on a mobile terminal, causes the mobile terminal to execute the screenshot management method described in any one of the above-mentioned first aspects.
  • the embodiment of the present application prevents the user from taking screenshots of the controls identified in the application program, thereby improving the information security of the mobile terminal.
  • FIG. 1 is a schematic diagram of the implementation process of the screenshot management method provided by Embodiment 1 of the present application.
  • Fig. 2 is a schematic diagram of the implementation process of the screenshot management method provided in the second embodiment of the present application.
  • FIG. 3 is a schematic diagram of the implementation process of the screenshot management method provided in the third embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of a screenshot management device provided in the fourth embodiment of the present application.
  • FIG. 5 is a schematic diagram of a mobile terminal provided in Embodiment 5 of the present application.
  • an optional method is to directly install a configuration file in the mobile terminal to prohibit the screenshot function in the mobile terminal, so that the user cannot take screenshots of any display content of the mobile terminal, although it can improve the information of the mobile terminal.
  • Security but it will also directly cause users to be unable to use mobile terminal applications normally.
  • the digital rights management function supported by the iOS system is used in the embodiments of this application.
  • the video stream is converted and the video stream is encrypted and played.
  • the digital rights management is used to stop the capture of the video stream content, and at the same time, the preset background image is set as the corresponding screenshot, so that the user cannot Take screenshots of the controls identified in the application.
  • this embodiment of the present application can implement control-level functional management of the screenshot function, and can customize the screenshot management of the controls according to different security requirements, for example, it can only be targeted at the application Some controls containing sensitive information are identified, such as only the payment code display controls in the payment program, etc., so as to improve the information security of the mobile terminal while minimizing the need for users to use the application program normally. Interference to ensure the normal use of the application by users.
  • the embodiment of this application does not limit the specific controls for adding identification.
  • the technician can select and add identification according to the needs of actual applications. For example, it is possible to only control some controls containing sensitive information in each application as in the above example. Add the logo, or you can select the controls for each application according to the actual security level requirements of different applications. If the security level of the video playback program is low, you can only involve users in it. Add logos to the controls of private information, such as the controls corresponding to the playback record. If the security level of the payment program is higher, you can add logos to all the controls of the payment program, so as to achieve high-security screenshot management.
  • the execution subject of the screenshot management method in the embodiment of the present application is a mobile terminal using the iOS system.
  • the specific type of the mobile terminal is not limited here and needs to be determined by the specific actual application scenario requirements.
  • Mobile terminals that can be selected for scenario requirements include, but are not limited to, mobile phones, tablets, smart watches, and robots that use iOS systems in the field of artificial intelligence.
  • FIG. 1 shows a flowchart of the screenshot management method provided in the first embodiment of the present application.
  • the embodiment of the present application will pre-add the identification of the application control that needs to perform screenshot management. Therefore, the embodiment of the present application only needs to perform the first identification detection on the application control currently used by the user.
  • the embodiment of this application does not limit the specific type of the first identifier, which can be set by the technicians themselves. For example, a set of specific character strings can be set as the first identifier, such as the character string 0000. At this time, only the current control needs to be detected. Whether it has a 0000 logo or not.
  • the embodiment of the application When the control has the first identifier, it means that the control needs to perform screenshot management. At this time, the embodiment of the application will obtain the content of the display page output by the control and convert it into an encrypted video stream for playback. Specifically: the embodiment of the application will use the first frequency interval Obtain the display page of the control to obtain the raw materials required for the video stream frame picture. At the same time, in order to ensure that the output encrypted video stream can accurately restore the control display page, so as to reduce the impact on the normal use of the user's application, the embodiment of this application will also Obtain the display size of each display page while obtaining the display page. Among them, the specific value of the first frequency is not limited here, and can be set by a technician according to actual needs, for example, it can be set to 20 to 90 frames per second.
  • the embodiment of this application will finally replace the control display page in the form of playing an encrypted video stream to be displayed on the mobile terminal display screen, that is, for the user, what he sees is not the content of the real control display page. , But the content of the encrypted video stream played after the video stream conversion. Therefore, in the embodiment of this application, the display page of the control is not necessarily displayed on the display screen. That is, the display page of the control does not mean that the control is actually on the display screen.
  • the displayed page content refers to the page content that the control actually needs to be displayed on the display screen.
  • the lower the first frequency the smaller the workload of converting and encrypting the video stream, but the refresh frequency of the control display page content will be lower, making the video stream content and The real-time synchronization of the actual control display page content is poor, and the response speed to user operations is slow.
  • too low frequency will cause the video stream frame rate to be too low, making the user unable to view the video stream normally, and thus making the user unable to use it normally.
  • the higher the first frequency the higher the refresh frequency of the control display page, the real-time synchronization and the response speed to user operations, so that users can get better viewing results, but at the same time It also takes up a lot of processor resources, causing a greater impact on the use of the mobile terminal, and may even cause application freezes. Therefore, a reasonable frequency value range is extremely important to the embodiments of the present application.
  • the value range of the first frequency is set to 20-60 frames per second.
  • step S103 the embodiment of the present application will perform image rendering on the obtained display page to obtain the frame pictures required to convert the video stream.
  • the operation steps are all the same, so here only the operation of a single display page is used as an example to describe step S103, which is described in detail as follows:
  • the embodiment of the present application first The picture context is created according to the display size of the display page, and then the canvas is laid out based on the created picture context, and finally the entire display page is rendered into the canvas to obtain the rendered control picture.
  • CGContextRef can be used to create the picture context and lay out the canvas.
  • the process of rendering the control picture includes: importing the display page into the corresponding canvas, and obtaining the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
  • S104 Render all the obtained control pictures into an encrypted video stream according to the corresponding display size, and play the encrypted video stream.
  • the essence of rendering the video stream is to use the control picture as the frame picture, according to the time sequence when the control picture is generated, the corresponding display size is taken as the real-time size of the video stream frame picture, and the first frequency is taken as the video stream frame rate.
  • the video stream is generated, but because the digital rights management function only performs screenshot management on the encrypted video stream, the embodiment of this application also needs to encrypt the generated video stream in real time on the basis of the above operations to obtain the required Encrypt the video stream, and when playing, only need to decrypt the encrypted video stream for playback.
  • the embodiments of the present application do not limit the specific video stream encryption methods, which can be selected or set by the technicians according to actual needs, and may also refer to the related descriptions in the second to fifth embodiments of the present application.
  • EXT-X-KEY can be used to describe the encryption key of the video stream, which indicates that the current video stream has been encrypted by digital rights, and the proxy method of the AVFoundation framework is used to determine the current video stream content during playback. Whether to support playback, and when it supports playback, play the encrypted video stream.
  • this embodiment also obtains the specific location area of each display page in the display screen, and outputs the frame picture to the location area of the corresponding display page when the encrypted video stream is played. For example, assume that display page A is full screen Display, that is, the location area is full screen. At this time, the corresponding frame picture in the encrypted video stream will also be output in full screen on the display. It is also assumed that the display page B is displayed in a floating window in the middle of the display. At this time, the corresponding frame in the encrypted video stream is displayed. The frame picture will also be output in the floating window of the corresponding area in the middle of the display.
  • the conversion of the display page to the video stream in the embodiment of this application is a real-time and continuous operation, that is, when the video stream conversion is performed on the display page of the control, every time a single display page is obtained, image rendering will be performed. And video stream conversion operations.
  • the embodiment of the application will continue to acquire the display page at the first frequency, combined with S102, S103, and S104, the embodiment of the application can achieve the acquisition of the real-time display page of the control, and realize the The real-time video stream conversion of the display page realizes real-time playback of the content of the display page of the control in the format of an encrypted video stream, ensuring the normal use of the control by the user.
  • the mobile terminal On the basis of completing the real-time conversion and output of the above-mentioned encrypted video stream, if the user manually triggers the screenshot function, or illegal elements trigger the screenshot function through plug-ins, etc., the mobile terminal will generate or receive a screenshot instruction for the encrypted video stream being played. At this time, the digital rights management function will be triggered synchronously, that is, the video control will be directly displayed blank, so that the obtained screenshot is also a blank picture, thereby realizing the effective protection of the control display information.
  • a background picture is preset to replace the blank picture directly generated by digital rights management.
  • the specific content contained in the background picture is not limited here, and can be set by the technician according to actual needs. It can be a blank picture or a picture that contains some warnings. For example, you can add a warning message of "In order to protect your privacy, you can’t take a screenshot here" on the basis of the blank picture, so as to warn users to pay attention to the information Safety.
  • the above-mentioned preset background picture may be a plurality of background pictures pre-stored in a blockchain or a database, and when a background picture is needed, it may be directly obtained from the blockchain or the database.
  • the embodiment of the application makes full use of the digital rights management function supported by the iOS system itself.
  • the application controls that need to prevent screenshots are added in advance, and the control page with the logo is added. Perform video stream conversion and encrypt the video stream.
  • digital rights management is used to stop the capture of the video stream content, and the preset background image is set as the corresponding screenshot at the same time. This makes it impossible for the user to take screenshots of the controls identified in the application. Therefore, the embodiments of the present application can implement control-level functional management of the screenshot function.
  • control screenshots can be customized for the control, for example, only for Some controls in the application that contain sensitive information are identified, such as only the payment code display controls in the payment program, etc., which can improve the information security of the mobile terminal while minimizing the normal use of users.
  • the interference of the application program guarantees the normal use of the application program by the user.
  • the first embodiment of this application is the real-time video stream conversion of the control display page
  • the specific steps of performing the encrypted video stream conversion on the control picture are: Including the following steps.
  • S202 Obtain a first character string with a length of n and only containing numbers, and use the numbers at each position of the first character string as the number of encryption intervals in turn, and generate an encryption interval sequence containing n numbers of encryption intervals, where n is positive Integer.
  • this embodiment of the application chooses to encrypt only part of the frame pictures in the unencrypted video stream, because it is not necessary to operate on all the frame pictures. , which greatly reduces the workload of the encryption operation and reduces the time-consuming encryption. Specifically: the embodiment of the present application first obtains a first character string with a length of n and only containing numbers, where the first character string can be either It is pre-set by a technician, or it can be generated according to a certain generation rule, which is not limited here.
  • each number in the first character string is used as an encryption interval number.
  • the encryption interval number is used to determine the next selection after selecting the frame picture that needs to be encrypted. For frame pictures, for example, assuming that the number of encryption intervals corresponding to frame picture A to be selected is 1, after frame picture A is extracted, the embodiment of the present application will extract the frame picture after an interval of one picture after frame picture A. By taking each number as the number of encryption intervals and sorting them in order, the corresponding encryption interval sequence can be obtained. For example, assuming that the first character string is 135, the corresponding encryption interval sequence ⁇ 1, 3, 5 ⁇ can be obtained at this time.
  • this embodiment of the application will start to select the frame picture of the unencrypted video stream. Specifically, the first frame picture of the unencrypted video stream is taken as the first extracted frame picture, and then according to the encryption interval sequence The first encryption interval number in determines the next extracted frame picture and extracts it. After the extraction is completed, the next frame picture is extracted according to the next encryption interval number, and the frame picture extraction is repeated according to the number of encryption intervals
  • the operation can realize real-time extraction of the frame pictures that need to be encrypted in the embodiment of the present application. An example is as follows: Suppose the encryption interval sequence is ⁇ 1, 3, 5 ⁇ .
  • the embodiment of this application does not limit the conditions for terminating extraction of frame pictures, which can be set by technicians according to actual needs, including but not limited to, such as setting to stop extraction when all the encryption intervals in the sequence are exhausted. , Set to stop when the extracted frame pictures reach a certain threshold, or set to reuse the number of encryption intervals in the sequence until the output of the unencrypted video stream is completed.
  • the security of encryption will also decrease. Therefore, in order to reduce the workload of encryption (ie The number of encrypted frame pictures is less than the total number of frame pictures in the video stream) while ensuring the security of encryption.
  • a method of randomly generating the first character string is used, so that the specific encrypted frame pictures cannot be predicted.
  • random encryption methods include: randomly generating a length n, and randomly generating a first string of length n that contains only numbers.
  • the length and content of the first character string are completely randomly generated, so that the encrypted frame picture each time is unpredictable, which greatly increases the difficulty of finding the encrypted frame picture when cracking, making the encrypted frame picture Security can be improved.
  • S204 Encrypt the selected frame pictures to obtain an encrypted video stream.
  • the embodiment of the application After extracting the required encrypted frame pictures, the embodiment of the application encrypts these frame pictures to realize the encryption protection of the unencrypted video stream.
  • the specific encryption method is not limited here, and the technical personnel can follow
  • the actual requirements are selected or set, including, but not limited to, using some reversible algorithms to blur the frame picture, as well as segmenting and shuffling the frame picture content area.
  • the encrypted interval sequence is converted by using the first character string, and the unencrypted video stream is extracted according to the number of encryption intervals in the encrypted interval sequence, and finally the extracted frame pictures are encrypted, so that the video stream is encrypted.
  • the process only needs to process the frame pictures in the video stream, which reduces the workload of encryption, makes the encryption faster, and ensures the real-time efficiency of encrypted video stream conversion.
  • the embodiment of the application will cyclically use the encryption interval numbers in the encryption interval sequence, so that each encryption interval number can be used repeatedly, and the sequence numbers of the n encryption interval numbers in the encryption interval sequence are sequentially
  • the step of extracting frame pictures specifically includes: S301, selecting the number of encryption intervals in sequence from small to large according to the sequence number, and based on each Select the number of encryption intervals, and select the frame pictures to be encrypted in the unencrypted video stream at intervals.
  • S302 If the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to perform the operation of sequentially selecting the encryption interval numbers according to the sequence number from small to large.
  • the encryption interval sequence is re-used for subsequent frame picture selection operations, so as to realize the repeated use of each encryption interval number.
  • the embodiment of the present application can continuously perform frame image selection operations to meet actual encryption requirements.
  • both the second and third embodiments of the present application only perform encryption processing on part of the frame pictures of the unencrypted video stream, for the finally generated encrypted video stream, only part of it is
  • the frame pictures are encrypted. If the number of these encrypted frame pictures is very small, even if the encrypted video stream is played directly, the encrypted video stream can be viewed normally, which makes the effect of encryption extremely poor and cannot guarantee the reliability and information of encryption. Security.
  • this embodiment of the application sets the frame rate of the video stream and the encryption interval, so that if the encrypted video stream is played directly without decryption, it will result in encryption.
  • the video stream cannot be viewed normally.
  • the operation of obtaining the first frequency specifically includes: randomly generating a first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec.
  • the obtaining operation of the first character string in this embodiment of the present application includes: obtaining the first character string with a length of n and only containing the number 1.
  • the lower limit of the first frequency is set to 20 frames per second to ensure the decryption.
  • the video stream can be viewed normally.
  • the interval sampling limit is to collect every other frame, that is, at most 50% of the frame pictures of the unencrypted video stream can be encrypted. Therefore, the upper limit of the first frequency is set in the embodiment of this application.
  • the value is set to less than 40 frames per second, and at the same time, the numbers of the first string are all set to 1, so that in the encrypted video stream, the number of unencrypted frame pictures output per second will not exceed 20, which is In the case of decryption, even if the encrypted video stream is played directly, the user cannot watch the video stream content normally, that is, the encrypted video stream must be decrypted before it can be watched normally, which greatly improves the reliability of encryption and guarantees the security of mobile terminal information sex.
  • FIG. 4 shows a structural block diagram of a screenshot management device provided in an embodiment of the present application.
  • the screenshot management apparatus illustrated in FIG. 4 may be the execution subject of the screenshot management method provided in the first embodiment.
  • the screenshot management device includes: an identification detection module 41, configured to detect whether the currently called control carries a first identification.
  • the page obtaining module 42 is configured to obtain the display page of the control and the display size of each display page at a first frequency if the control has the first identifier.
  • the picture rendering module 43 is configured to create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding canvas to generate each Display the rendered control picture corresponding to the screen.
  • the video stream conversion module 44 is configured to render all the obtained control pictures into an encrypted video stream according to the corresponding display size, and play the encrypted video stream.
  • the screenshot processing module 45 is configured to, if a screenshot instruction for the encrypted video stream is detected, obtain a background picture corresponding to the first identifier, and store the background picture as a screenshot corresponding to the screenshot instruction.
  • the picture rendering module 43 includes: importing the display page into the corresponding canvas, and obtaining the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
  • the video stream conversion module 44 includes: a video rendering module, configured to render the obtained control picture into an unencrypted video stream according to the corresponding display size.
  • Interval acquisition module for acquiring a first character string of length n and containing only numbers, and taking the numbers at each position of the first character string as the number of encryption intervals in turn, to generate an encryption including n of the number of encryption intervals Interval sequence, where n is a positive integer.
  • the picture selection module is configured to sequentially select the frame pictures to be encrypted in the unencrypted video stream at intervals according to the number of n encryption intervals in the sequence of encryption intervals.
  • the encryption module is used to encrypt the selected frame pictures to obtain the encrypted video stream.
  • the interval obtaining module includes: randomly generating a length n, and randomly generating a first character string with a length n and containing only numbers.
  • the screenshot management device further includes: a frequency acquisition module, configured to randomly generate the first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec.
  • the interval obtaining module includes: obtaining a first character string with a length of n and only containing the number 1.
  • sequence numbers of the n encryption interval numbers in the encryption interval sequence are 1, 2, ..., n
  • the picture selection module includes: sequentially selecting the encryption interval numbers according to the sequence number from small to large , And based on the number of encryption intervals selected each time, the frame pictures to be encrypted in the unencrypted video stream are selected at intervals.
  • the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to execute the sequence of selecting the encryption interval number in order from small to large. Operation.
  • the term “if” can be construed as “when” or “once” or “in response to determination” or “in response to detecting “.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • first”, second, third, etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. It should also be understood that although the terms “first”, “second”, etc. are used in the text in some embodiments of the present application to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another.
  • the first table may be named the second table, and similarly, the second table may be named the first table without departing from the scope of the various described embodiments.
  • the first form and the second form are both forms, but they are not the same form.
  • the wearable device when the terminal device is a wearable device, the wearable device may also be a general term for using wearable technology to intelligently design daily wear and develop wearable devices.
  • a wearable device is a portable device that is directly worn on the body or integrated into the user's clothes or accessories. Wearable devices are not only a kind of hardware device, but also realize powerful functions through software support, data interaction, and cloud interaction. In a broad sense, wearable smart devices include full-featured, large-sized, complete or partial functions that can be implemented without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, and need to be used in conjunction with other devices such as smart phones. , Such as various smart bracelets for physical sign monitoring.
  • FIG. 5 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application.
  • the mobile terminal 5 of this embodiment includes: at least one processor 50 (only one is shown in FIG. Computer program 52.
  • the processor 50 executes the computer program 52, the steps in the above embodiments of the screenshot management method are implemented, for example, steps 101 to 105 shown in FIG. 1.
  • the processor 50 executes the computer program 52, the functions of the modules/units in the foregoing device embodiments, such as the functions of the modules 41 to 65 shown in FIG. 4, are realized.
  • the mobile terminal 5 may be a mobile computing device such as a tablet computer and a mobile phone.
  • the mobile terminal may include, but is not limited to, a processor 50 and a memory 51.
  • FIG. 5 is only an example of the mobile terminal 5, and does not constitute a limitation on the mobile terminal 5. It may include more or less components than those shown in the figure, or a combination of certain components, or different components.
  • the mobile terminal may also include an input sending device, a network access device, a bus, and the like.
  • the so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors) Signal Processor, DSP), Application Specific Integrated Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the mobile terminal 5 in some embodiments, such as a hard disk or a memory of the mobile terminal 5.
  • the memory 51 may also be an external storage device of the mobile terminal 5, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) equipped on the mobile terminal 5. Card, Flash Card, etc.
  • the memory 51 may also include both an internal storage unit of the mobile terminal 5 and an external storage device.
  • the memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program.
  • the memory 51 can also be used to temporarily store data that has been sent or will be sent.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the embodiments of the present application provide a computer program product.
  • the steps in the foregoing method embodiments can be realized when the mobile terminal is executed.
  • the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the present application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM) , Random Access Memory (Random Access Memory, RAM), electrical carrier signal, telecommunications signal, and software distribution media, etc.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

Abstract

The present application provides a screen capture management method and apparatus, and a mobile terminal, applicable to the technical field of data processing. The method comprises: detecting whether a currently invoked control has a first identifier; if the control has the first identifier, obtaining display pages of the control and the display size of each display page at a first frequency; creating a picture context on the basis of the display size of each display page, providing a canvas according to the picture context, and rendering each display page to the corresponding canvas to generate a rendered control picture corresponding to each display page; rendering all the control pictures obtained into an encrypted video stream according to the corresponding display sizes, and playing back the encrypted video stream; and if a screen capture instruction for the encrypted video stream is detected, obtaining the background image corresponding to the first identifier, and storing the background image as a screenshot corresponding to the screen capture instruction. Embodiments of the present application make it impossible for users to take screenshots of controls identified in applications, thereby improving information security of a mobile terminal.

Description

一种截屏管理方法、装置及移动终端Screen capture management method, device and mobile terminal
本申请要求于2020年2月11日提交中国专利局,申请号为2020100871417、发明名称为“一种截屏管理方法、装置及移动终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on February 11, 2020, the application number is 2020100871417, and the invention title is "a method, device and mobile terminal for screenshot management", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请属于信息安全技术领域,尤其涉及截屏管理方法及移动终端。This application belongs to the field of information security technology, and particularly relates to a screenshot management method and a mobile terminal.
背景技术Background technique
在iOS系统的移动终端中,截屏功能使用十分便利,用户可以很方便地使用截屏功能截取并保存一些所需的信息。但发明人意识到,在便利的同时也使得移动终端中信息安全性大大降低,例如一些支付程序的付款码和一些邮件程序中的重要邮件记录等,极容易被非法截取和传播,从而导致移动终端中信息的安全性大大降低。In the mobile terminal of the iOS system, the screen capture function is very convenient to use, and the user can conveniently use the screen capture function to capture and save some required information. However, the inventor realized that the convenience of the mobile terminal also greatly reduces the security of information in the mobile terminal. For example, the payment code of some payment programs and the important mail records in some mail programs are extremely easy to be intercepted and spread illegally, resulting in mobile The security of information in the terminal is greatly reduced.
技术问题technical problem
移动终端中信息安全性低,例如一些支付程序的付款码和一些邮件程序中的重要邮件记录等,极容易被非法截取和传播,从而导致移动终端中信息的安全性大大降低。The information security in the mobile terminal is low. For example, the payment codes of some payment programs and the important mail records in some mail programs are extremely easy to be intercepted and disseminated illegally, which greatly reduces the security of the information in the mobile terminal.
技术解决方案Technical solutions
有鉴于此,本申请实施例提供了一种截屏管理方法及移动终端,可以解决截屏功能导致的移动终端信息安全性较低的问题。In view of this, the embodiments of the present application provide a screenshot management method and a mobile terminal, which can solve the problem of low information security of the mobile terminal caused by the screenshot function.
本申请实施例的第一方面提供了一种截屏管理方法,包括:检测当前调用的控件是否带有第一标识;若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。The first aspect of the embodiments of the present application provides a screenshot management method, including: detecting whether the currently called control has a first identifier; if the control has the first identifier, acquiring the control at a first frequency The display page of each display page, and the display size of each display page; create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding display page The canvas generates a rendered control picture corresponding to each display screen; renders all the control pictures obtained into an encrypted video stream according to the corresponding display size, and plays the encrypted video stream; if A screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is acquired, and the background picture is stored as a screenshot corresponding to the screenshot instruction.
本申请实施例的第二方面提供了一种截屏管理装置,包括:标识检测模块,用于检测当前调用的控件是否带有第一标识;页面获取模块,用于若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;图片渲染模块,用于基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;视频流转换模块,用于将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;截屏处理模块,用于若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。A second aspect of the embodiments of the present application provides a screenshot management device, including: an identification detection module, configured to detect whether the currently called control has a first identification; and a page acquisition module, configured if the control has the The first identifier acquires the display page of the control and the display size of each display page at a first frequency; the picture rendering module is used to create a picture context based on the display size of each display page, according to The picture context lays a canvas, and the display page is rendered to the corresponding canvas, and a rendered control picture corresponding to each display screen is generated; a video stream conversion module is used to convert all the obtained controls The picture is rendered into an encrypted video stream according to the corresponding display size, and the encrypted video stream is played; the screenshot processing module is configured to obtain the corresponding first identifier if a screenshot instruction for the encrypted video stream is detected And store the background image as a screenshot corresponding to the screenshot instruction.
本申请实施例的第三方面提供了一种移动终端,所述移动终端包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机程序,所述处理器执行:检测当前调用的控件是否带有第一标识;若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。A third aspect of the embodiments of the present application provides a mobile terminal. The mobile terminal includes a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes: Whether the currently called control has the first identifier; if the control has the first identifier, the display page of the control and the display size of each display page are acquired at the first frequency; based on each The display size of the display page creates a picture context, lays a canvas according to the picture context, and renders the display page to the corresponding canvas, and generates a rendered control picture corresponding to each display screen; All the control pictures obtained are rendered as encrypted video streams according to the corresponding display size, and the encrypted video stream is played; if a screenshot instruction for the encrypted video stream is detected, the corresponding first identifier is obtained And store the background image as a screenshot corresponding to the screenshot instruction.
本申请实施例的第四方面提供了一种计算机可读存储介质,包括:存储有计算机程序,其中,所述计算机程序被处理器执行时实现如上述第一方面中任一项所述截屏管理方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, including: a computer program is stored, wherein the computer program is executed by a processor to implement the screenshot management as described in any one of the above-mentioned first aspects Method steps.
本申请实施例的第五方面提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行上述第一方面中任一项所述截屏管理方法。The fifth aspect of the embodiments of the present application provides a computer program product, which when the computer program product runs on a mobile terminal, causes the mobile terminal to execute the screenshot management method described in any one of the above-mentioned first aspects.
有益效果Beneficial effect
本申请实施例可使用户无法对应用程序中标识的控件进行截屏,进而提高了移动终端的信息安全度。The embodiment of the present application prevents the user from taking screenshots of the controls identified in the application program, thereby improving the information security of the mobile terminal.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only of the present application. For some embodiments, for those of ordinary skill in the art, other drawings may be obtained based on these drawings without creative labor.
图1是本申请实施例一提供的截屏管理方法的实现流程示意图。FIG. 1 is a schematic diagram of the implementation process of the screenshot management method provided by Embodiment 1 of the present application.
图2是本申请实施例二提供的截屏管理方法的实现流程示意图。Fig. 2 is a schematic diagram of the implementation process of the screenshot management method provided in the second embodiment of the present application.
图3是本申请实施例三提供的截屏管理方法的实现流程示意图。FIG. 3 is a schematic diagram of the implementation process of the screenshot management method provided in the third embodiment of the present application.
图4是本申请实施例四提供的截屏管理装置的结构示意图。Fig. 4 is a schematic structural diagram of a screenshot management device provided in the fourth embodiment of the present application.
图5是本申请实施例五提供的移动终端的示意图。FIG. 5 is a schematic diagram of a mobile terminal provided in Embodiment 5 of the present application.
本发明的实施方式Embodiments of the present invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions described in the present application, specific embodiments are used for description below.
为了便于理解本申请,此处先对本申请实施例进行简要说明,考虑到iOS系统的移动终端截屏功能使用十分便利,使得移动终端的信息极容易被非法截取和传播,信息安全性大大降低。In order to facilitate the understanding of the application, the embodiments of the application are briefly described here, considering that the screenshot function of the mobile terminal of the iOS system is very convenient to use, making the information of the mobile terminal extremely easy to be illegally intercepted and disseminated, and the information security is greatly reduced.
为了提高信息安全性,一种可选做法是直接在移动终端中安装配置文件以禁止移动终端内的截屏功能,从而使得用户无法对该移动终端任何显示内容进行截屏,这样虽然能提高移动终端信息的安全性,但也会直接导致用户无法正常使用移动终端的应用程序。In order to improve information security, an optional method is to directly install a configuration file in the mobile terminal to prohibit the screenshot function in the mobile terminal, so that the user cannot take screenshots of any display content of the mobile terminal, although it can improve the information of the mobile terminal. Security, but it will also directly cause users to be unable to use mobile terminal applications normally.
为了有效提高移动终端的信息安全性,本申请实施例之中利用了iOS系统自身支持的数字版权管理功能,首先预先对需要防止截屏的应用程序控件进行标识添加,对带有标识的控件页面进行视频流转换,并对视频流进行加密播放,在检测到截屏指令时,利用数字版权管理制止对视频流内容的截取,并同时将预先设定的背景图片设置为对应的截图,从而使得用户无法对应用程序中标识的控件进行截屏,因此本申请实施例可以实现对截屏功能作控件级别的功能管理,针对不同的安全性需求可以针对性地进行控件截屏管理定制,例如可以仅针对应用程序中一些包含敏感信息的控件进行标识,如仅对支付程序中的付款码显示控件等进行标识,进而在提高移动终端的信息安全度的同时,还可以最大程度地减小对用户正常使用应用程序的干扰,保障用户对应用程序的正常使用。In order to effectively improve the information security of the mobile terminal, the digital rights management function supported by the iOS system is used in the embodiments of this application. The video stream is converted and the video stream is encrypted and played. When the screen capture instruction is detected, the digital rights management is used to stop the capture of the video stream content, and at the same time, the preset background image is set as the corresponding screenshot, so that the user cannot Take screenshots of the controls identified in the application. Therefore, this embodiment of the present application can implement control-level functional management of the screenshot function, and can customize the screenshot management of the controls according to different security requirements, for example, it can only be targeted at the application Some controls containing sensitive information are identified, such as only the payment code display controls in the payment program, etc., so as to improve the information security of the mobile terminal while minimizing the need for users to use the application program normally. Interference to ensure the normal use of the application by users.
其中,本申请实施例不对具体添加标识的控件进行限定,可由技术人员根据实际应用的需求来进行选取和添加标识,例如既可以如上述举例中的仅对各个应用程序中一些包含敏感信息的控件进行标识添加,或者也可以根据实际对不同应用程序安全等级要求的不同,来针对性地对各个应用程序进行控件选取,如若对于视频播放程序的安全等级要求较低,可以仅对其中涉及到用户隐私信息的控件添加标识,如播放记录对应的控件等,而若对于支付程序的安全等级要求较高,此时可以将支付程序的所有控件均添加标识,从而达到高安全级别的截屏管理。Among them, the embodiment of this application does not limit the specific controls for adding identification. The technician can select and add identification according to the needs of actual applications. For example, it is possible to only control some controls containing sensitive information in each application as in the above example. Add the logo, or you can select the controls for each application according to the actual security level requirements of different applications. If the security level of the video playback program is low, you can only involve users in it. Add logos to the controls of private information, such as the controls corresponding to the playback record. If the security level of the payment program is higher, you can add logos to all the controls of the payment program, so as to achieve high-security screenshot management.
同时,由上述说明可知,本申请实施例中截屏管理方法的执行主体即为使用iOS系统的移动终端,其中移动终端的具体类型此处不予限定需由具体实际应用的场景需求决定,根据不同的场景需求可选用的移动终端包括但不限于如:手机、平板电脑、智能手表,如人工智能领域中使用iOS系统的机器人等。At the same time, it can be seen from the above description that the execution subject of the screenshot management method in the embodiment of the present application is a mobile terminal using the iOS system. The specific type of the mobile terminal is not limited here and needs to be determined by the specific actual application scenario requirements. Mobile terminals that can be selected for scenario requirements include, but are not limited to, mobile phones, tablets, smart watches, and robots that use iOS systems in the field of artificial intelligence.
本申请实施例详述如下:图1示出了本申请实施例一提供的截屏管理方法的实现流程图。The embodiments of the present application are described in detail as follows: FIG. 1 shows a flowchart of the screenshot management method provided in the first embodiment of the present application.
S101,检测当前调用的控件是否带有第一标识。S101: Detect whether the currently called control has a first identifier.
由上述说明可知,本申请实施例会预先对需要进行截屏管理的应用程序控件进行标识添加,因此本申请实施例只需要对用户当前使用的应用程序控件进行第一标识检测即可。其中,本申请实施例不对具体的第一标识种类进行限定,可由技术人员根据自行设定,例如可以设置一组特定的字符串作为第一标识,如字符串0000,此时只需要检测当前控件是否带有0000的标识即可。It can be seen from the above description that the embodiment of the present application will pre-add the identification of the application control that needs to perform screenshot management. Therefore, the embodiment of the present application only needs to perform the first identification detection on the application control currently used by the user. Among them, the embodiment of this application does not limit the specific type of the first identifier, which can be set by the technicians themselves. For example, a set of specific character strings can be set as the first identifier, such as the character string 0000. At this time, only the current control needs to be detected. Whether it has a 0000 logo or not.
S102,若控件带有第一标识,以第一频率获取控件的显示页面,以及每个显示页面的显示尺寸。S102: If the control has a first identifier, obtain the display page of the control and the display size of each display page at the first frequency.
当控件带有第一标识时,说明控件需要进行截屏管理,此时本申请实施例会获取控件输出的显示页面内容并转换为加密视频流播放,具体而言:本申请实施例会以第一频率间隔获取控件的显示页面,从而得到视频流帧图片所需的原材料,同时为了保证输出的加密视频流能准确还原控件显示页面,以降低对用户正常应用程序使用的影响,本申请实施例还会在获取显示页面的同时获取各个显示页面的显示尺寸。其中,第一频率的具体值此处不予限定,可由技术人员根据实际需求设定,如可以设置为20~90张/秒。When the control has the first identifier, it means that the control needs to perform screenshot management. At this time, the embodiment of the application will obtain the content of the display page output by the control and convert it into an encrypted video stream for playback. Specifically: the embodiment of the application will use the first frequency interval Obtain the display page of the control to obtain the raw materials required for the video stream frame picture. At the same time, in order to ensure that the output encrypted video stream can accurately restore the control display page, so as to reduce the impact on the normal use of the user's application, the embodiment of this application will also Obtain the display size of each display page while obtaining the display page. Among them, the specific value of the first frequency is not limited here, and can be set by a technician according to actual needs, for example, it can be set to 20 to 90 frames per second.
应当特别说明的,由于本申请实施例最后会以播放加密视频流的形式代替控件显示页面在移动终端显示屏进行显示,即对于用户而言,其看到的并不是真正的控件显示页面的内容,而是进过视频流转换后播放的加密视频流的内容,因此在本申请实施例中控件的显示页面最终不一定在显示屏显示,即控件的显示页面并不是指控件实际在显示屏中显示的页面内容,而是指控件实际需要在显示屏中显示的页面内容。It should be particularly noted that, since the embodiment of this application will finally replace the control display page in the form of playing an encrypted video stream to be displayed on the mobile terminal display screen, that is, for the user, what he sees is not the content of the real control display page. , But the content of the encrypted video stream played after the video stream conversion. Therefore, in the embodiment of this application, the display page of the control is not necessarily displayed on the display screen. That is, the display page of the control does not mean that the control is actually on the display screen. The displayed page content refers to the page content that the control actually needs to be displayed on the display screen.
作为本申请的一个实施例,考虑到实际应用中一方面,第一频率越低对视频流转换加密的工作量越小,但对控件显示页面内容的刷新频率会较低,使得视频流内容和实际控件显示页面内容的同步实时性较差,对用户操作的响应速度较慢,同时过低的频率还会导致视频流帧率过低,使得用户无法正常查看视频流,进而使得用户无法正常使用应用程序,另一方面,第一频率越高虽然实现对控件显示页面较高的刷新频率,保证同步时的实时性以及对用户操作的响应速度,使得用户可以得到较佳的查看效果,但同时也会占用大量的处理器资源,使得移动终端的使用造成较大的影响,甚至可能会导致应用程序卡顿,因此一个合理的频率取值范围,对本申请实施例极为重要。在本实施例中,为了平衡视频流转换的工作量、对用户操作的响应速度以及视频流的显示效果,会将第一频率的取值范围设置为20~60张/秒。As an embodiment of this application, considering one aspect of practical applications, the lower the first frequency, the smaller the workload of converting and encrypting the video stream, but the refresh frequency of the control display page content will be lower, making the video stream content and The real-time synchronization of the actual control display page content is poor, and the response speed to user operations is slow. At the same time, too low frequency will cause the video stream frame rate to be too low, making the user unable to view the video stream normally, and thus making the user unable to use it normally. For applications, on the other hand, the higher the first frequency, the higher the refresh frequency of the control display page, the real-time synchronization and the response speed to user operations, so that users can get better viewing results, but at the same time It also takes up a lot of processor resources, causing a greater impact on the use of the mobile terminal, and may even cause application freezes. Therefore, a reasonable frequency value range is extremely important to the embodiments of the present application. In this embodiment, in order to balance the workload of video stream conversion, the response speed to user operations, and the display effect of the video stream, the value range of the first frequency is set to 20-60 frames per second.
S103,基于每个显示页面的显示尺寸创建图片上下文,根据图片上下文铺设画布,并将显示页面渲染至对应的画布,生成每个显示画面对应的渲染后的控件图片。S103, creating a picture context based on the display size of each display page, laying a canvas according to the picture context, rendering the display page to the corresponding canvas, and generating a rendered control picture corresponding to each display screen.
在获取到所需的显示页面和显示尺寸之后,本申请实施例会对获取到的显示页面进行图片渲染,以得到转换视频流所需的帧图片,其中,本申请实施例对每个显示页面的操作步骤都是相同的,因此此处仅以对单个显示页面的操作为例来进行步骤S103的说明,详述如下:为了保障生成的控件图片与对应显示页面的尺寸相同,本申请实施例首先会根据显示页面的显示尺寸来进行图片上下文的创建,再基于创建的图片上下文铺设画布,最后将整个显示页面渲染至画布之中,从而得到渲染后的控件图片。其中,可以选用CGContextRef来进行图片上下文的创建和画布的铺设。After obtaining the required display page and display size, the embodiment of the present application will perform image rendering on the obtained display page to obtain the frame pictures required to convert the video stream. The operation steps are all the same, so here only the operation of a single display page is used as an example to describe step S103, which is described in detail as follows: In order to ensure that the generated control image has the same size as the corresponding display page, the embodiment of the present application first The picture context is created according to the display size of the display page, and then the canvas is laid out based on the created picture context, and finally the entire display page is rendered into the canvas to obtain the rendered control picture. Among them, CGContextRef can be used to create the picture context and lay out the canvas.
作为实施例中渲染控件图片的一种具体实现方式,渲染控件图片的过程,包括:将显示页面导入对应的画布,并通过UIGraphicsGetImageFromCurrentImageContext 函数从画布中得到渲染后的控件图片。As a specific implementation of rendering the control picture in the embodiment, the process of rendering the control picture includes: importing the display page into the corresponding canvas, and obtaining the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
S104,将得到的所有控件图片按照对应的显示尺寸渲染为加密视频流,并对加密视频流进播放。S104: Render all the obtained control pictures into an encrypted video stream according to the corresponding display size, and play the encrypted video stream.
在本申请实施例中,渲染视频流实质即为将控件图片作为帧图片,按照控件图片生成的时间先后,以对应的显示尺寸作为视频流帧图片的实时尺寸,第一频率作为视频流帧率进行视频流的生成,但由于数字版权管理功能仅会对加密的视频流进行截屏管理,因此本申请实施例在上述操作的基础上,还需要对生成的视频流进行实时加密以得到所需的加密视频流,而在进行播放时,只需对加密视频流进行解密播放即可。其中,本申请实施例不对具体的视频流加密方法进行限定,可由技术人员根据实际需求选取或设定,亦可参考本申请实施例二至五的相关说明。In the embodiment of this application, the essence of rendering the video stream is to use the control picture as the frame picture, according to the time sequence when the control picture is generated, the corresponding display size is taken as the real-time size of the video stream frame picture, and the first frequency is taken as the video stream frame rate. The video stream is generated, but because the digital rights management function only performs screenshot management on the encrypted video stream, the embodiment of this application also needs to encrypt the generated video stream in real time on the basis of the above operations to obtain the required Encrypt the video stream, and when playing, only need to decrypt the encrypted video stream for playback. Among them, the embodiments of the present application do not limit the specific video stream encryption methods, which can be selected or set by the technicians according to actual needs, and may also refer to the related descriptions in the second to fifth embodiments of the present application.
作为本申请的一个实施例,可以通过EXT-X-KEY来描述视频流的加密密钥,标识当前视频流已经经过数字版权加密,在播放时通过走 AVFoundation 框架的代理方法去判断当前视频流内容是否支持播放,并在支持播放时,对加密视频流进行播放。As an embodiment of this application, EXT-X-KEY can be used to describe the encryption key of the video stream, which indicates that the current video stream has been encrypted by digital rights, and the proxy method of the AVFoundation framework is used to determine the current video stream content during playback. Whether to support playback, and when it supports playback, play the encrypted video stream.
作为本申请的一个可选实施例,为了加密视频流能准确还原控件显示页面,实施例中还会准确还原显示页面在显示屏中的播放位置,具体而言,在本申请实施例一的基础上,本实施例还会获取每个显示页面在显示屏中的具体位置区域,并在进行加密视频流播放时,将帧图片输出至对应显示页面的位置区域,例如,假设显示页面A是全屏显示,即位置区域是全屏,此时加密视频流中对应的帧图片也会在显示屏中全屏输出,又假设显示页面B是在显示屏中间一块区域浮窗显示,此时加密视频流中对应的帧图片也会在显示屏中间对应区域浮窗输出。As an optional embodiment of the present application, in order to accurately restore the control display page of the encrypted video stream, the playback position of the display page on the display screen is also accurately restored in this embodiment. Specifically, in the basis of the first embodiment of the present application As mentioned above, this embodiment also obtains the specific location area of each display page in the display screen, and outputs the frame picture to the location area of the corresponding display page when the encrypted video stream is played. For example, assume that display page A is full screen Display, that is, the location area is full screen. At this time, the corresponding frame picture in the encrypted video stream will also be output in full screen on the display. It is also assumed that the display page B is displayed in a floating window in the middle of the display. At this time, the corresponding frame in the encrypted video stream is displayed. The frame picture will also be output in the floating window of the corresponding area in the middle of the display.
应当理解地,本申请实施例显示页面到视频流的转换是一个实时且持续的操作,即在对控件的显示页面进行视频流转换时,在每次获取到单个显示页面之后,都会进行图片渲染和视频流转换的操作,同时由于本申请实施例会以第一频率持续进行显示页面的获取,因此,结合S102、S103和S104,本申请实施例可以实现对控件实时显示页面的获取,并实现对显示页面的实时视频流转换,进而实现对控件显示页面内容以加密视频流的格式实时播放,保障用户对控件的正常使用。It should be understood that the conversion of the display page to the video stream in the embodiment of this application is a real-time and continuous operation, that is, when the video stream conversion is performed on the display page of the control, every time a single display page is obtained, image rendering will be performed. And video stream conversion operations. At the same time, because the embodiment of the application will continue to acquire the display page at the first frequency, combined with S102, S103, and S104, the embodiment of the application can achieve the acquisition of the real-time display page of the control, and realize the The real-time video stream conversion of the display page realizes real-time playback of the content of the display page of the control in the format of an encrypted video stream, ensuring the normal use of the control by the user.
S105,若检测到针对加密视频流的截屏指令,获取第一标识对应的背景图片,并将背景图片储存为截屏指令对应的截图。S105: If a screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is obtained, and the background picture is stored as a screenshot corresponding to the screenshot instruction.
在完成上述加密视频流实时转换输出的基础上,若用户手动触发了截屏功能,或者非法份子通过插件等途径触发了截屏功能,使得移动终端生成或接收到对正在播放的加密视频流的截屏指令,此时数字版权管理功能将会被同步触发,即会将视频控件直接显示空白,使得得到的截图也为空白图片,进而实现对控件显示信息的有效保护。On the basis of completing the real-time conversion and output of the above-mentioned encrypted video stream, if the user manually triggers the screenshot function, or illegal elements trigger the screenshot function through plug-ins, etc., the mobile terminal will generate or receive a screenshot instruction for the encrypted video stream being played. At this time, the digital rights management function will be triggered synchronously, that is, the video control will be directly displayed blank, so that the obtained screenshot is also a blank picture, thereby realizing the effective protection of the control display information.
其中,考虑到若直接将空白图片保存为截图,一方面对部分用户来说可能无法接受这种无法达到预期的结果,使得用户体验较差,另一方面,也无法起到警示用户注意信息安全的作用,因此,本申请实施例会预先设置一个背景图片用以替代数字版权管理直接生成的空白图片,其中背景图片内具体包含的内容此处不予限定,可由技术人员根据实际需求进行设定,既可以仍是空白图片,也可以是包含一些警示语的图片,例如可以在空白图片的基础上,增添“为了保护您的隐私,此处无法截屏哦”的警示语内容,从而警示用户注意信息安全。Among them, considering that if you save a blank picture directly as a screenshot, on the one hand, some users may not accept this unreachable result, making the user experience poor, and on the other hand, it cannot serve as a warning to users to pay attention to information security. Therefore, in this embodiment of the application, a background picture is preset to replace the blank picture directly generated by digital rights management. The specific content contained in the background picture is not limited here, and can be set by the technician according to actual needs. It can be a blank picture or a picture that contains some warnings. For example, you can add a warning message of "In order to protect your privacy, you can’t take a screenshot here" on the basis of the blank picture, so as to warn users to pay attention to the information Safety.
其中,上述预先设置的背景图片可以预先存储于区块链或者数据库中的多个背景图片,当需要背景图片时可直接从区块链或者数据库中进行获取。Among them, the above-mentioned preset background picture may be a plurality of background pictures pre-stored in a blockchain or a database, and when a background picture is needed, it may be directly obtained from the blockchain or the database.
为了有效提高移动终端的信息安全性,本申请实施例之中充分利用了iOS系统自身支持的数字版权管理功能,首先预先对需要防止截屏的应用程序控件进行标识添加,对带有标识的控件页面进行视频流转换,并对视频流进行加密播放,在检测到用户的截屏指令时,利用数字版权管理制止对视频流内容的截取,并同时将预先设定的背景图片设置为对应的截图,从而使得用户无法对应用程序中标识的控件进行截屏,因此本申请实施例可以实现对截屏功能作控件级别的功能管理,针对不同的安全性需求可以针对性地进行控件截屏管控定制,例如可以仅针对应用程序中一些包含敏感信息的控件进行标识,如仅对支付程序中的付款码显示控件等进行标识,进而在提高移动终端的信息安全度的同时,还可以最大程度地减小对用户正常使用应用程序的干扰,保障用户对应用程序的正常使用。In order to effectively improve the information security of the mobile terminal, the embodiment of the application makes full use of the digital rights management function supported by the iOS system itself. First, the application controls that need to prevent screenshots are added in advance, and the control page with the logo is added. Perform video stream conversion and encrypt the video stream. When the user's screen capture instruction is detected, digital rights management is used to stop the capture of the video stream content, and the preset background image is set as the corresponding screenshot at the same time. This makes it impossible for the user to take screenshots of the controls identified in the application. Therefore, the embodiments of the present application can implement control-level functional management of the screenshot function. For different security requirements, the control screenshots can be customized for the control, for example, only for Some controls in the application that contain sensitive information are identified, such as only the payment code display controls in the payment program, etc., which can improve the information security of the mobile terminal while minimizing the normal use of users. The interference of the application program guarantees the normal use of the application program by the user.
作为本申请实施例一中对控件图片进行加密视频流转换的一种具体实现方式,考虑到本申请实施例一是对控件显示页面的实时视频流转换,既需要将实时的显示页面内容展示给用户看,又要保障控件可以实时响应用户的操作,因此对整体加密视频流转换的耗时要求极高,同时,由于加密视频流在进行播放时还需要进行解密,因此在加密视频流转换过程中,若视频流加密占用时间较长,势必会导致整个加密视频流转换和播放的耗时较长,对控件显示页面的展示和用户操作的响应具有较大时延影响,进而影响用户对应用程序的正常使用。As a specific implementation of the encrypted video stream conversion of the control picture in the first embodiment of this application, considering that the first embodiment of this application is the real-time video stream conversion of the control display page, it is necessary to display the real-time display page content to For the user, it is necessary to ensure that the control can respond to the user's operation in real time. Therefore, the time-consuming requirement for the entire encrypted video stream conversion is extremely high. At the same time, since the encrypted video stream needs to be decrypted during playback, the Among them, if the video stream encryption takes a long time, it will inevitably lead to longer time-consuming conversion and playback of the entire encrypted video stream, which will have a large time delay impact on the display of the control display page and the response of user operations, thereby affecting the user’s application The normal use of the program.
因此,为了缩短加密视频流转换的耗时,以减小对用户正常使用应用程序的影响,如图2所示,在本申请实施例二中,对控件图片进行加密视频流转换的具体步骤,包括如下步骤。Therefore, in order to shorten the time-consuming conversion of the encrypted video stream and reduce the impact on the user's normal use of the application, as shown in FIG. 2, in the second embodiment of the present application, the specific steps of performing the encrypted video stream conversion on the control picture are: Including the following steps.
S201,将得到的控件图片按照对应的显示尺寸渲染为未加密视频流。S201: Render the obtained control picture as an unencrypted video stream according to the corresponding display size.
可参考S104中渲染视频流的操作说明,此处不予赘述。Refer to the operation description of rendering the video stream in S104, which is not repeated here.
S202,获取长度为n且仅包含数字的第一字符串,并将第一字符串各个位置处的数字依次作为加密间隔数,生成包含n个加密间隔数的加密间隔序列,其中,n为正整数。S202: Obtain a first character string with a length of n and only containing numbers, and use the numbers at each position of the first character string as the number of encryption intervals in turn, and generate an encryption interval sequence containing n numbers of encryption intervals, where n is positive Integer.
在得到未加密视频流之后开始对实时的未加密视频流进行加密。考虑到实际应用中对视频流加密的耗时要求极高,为了减少加密时长,本申请实施例选择了仅对未加密视频流中部分帧图片进行加密操作,由于无需对全部的帧图片进行操作,使得加密操作的工作量大大减小加密耗时得以降低,具体而言:本申请实施例首先会获取一个长度为n且仅包含数字的第一字符串,其中,第一字符串既可以是由技术人员预先设定的,也可以是根据一定生成规则生成的,此处不予限定。在获取到第一字符串之后,将第一字符串中各个数字均作为一个加密间隔数,该加密间隔数用于在每次挑选出所需加密的帧图片之后,确定下一次所需挑选的帧图片,例如假设所需选取的帧图片A对应的加密间隔数为1,在提取出帧图片A之后,本申请实施例会在帧图片A后间隔一张图片再提取帧图片。通过将各个数字作为加密间隔数并进行依次进行排序,即可得到对应的加密间隔序列,例如假设第一字符串为135,此时即可得到对应的加密间隔序列{1,3,5}。After obtaining the unencrypted video stream, start to encrypt the real-time unencrypted video stream. Considering that the time-consuming requirements for video stream encryption in practical applications are extremely high, in order to reduce the encryption time, this embodiment of the application chooses to encrypt only part of the frame pictures in the unencrypted video stream, because it is not necessary to operate on all the frame pictures. , Which greatly reduces the workload of the encryption operation and reduces the time-consuming encryption. Specifically: the embodiment of the present application first obtains a first character string with a length of n and only containing numbers, where the first character string can be either It is pre-set by a technician, or it can be generated according to a certain generation rule, which is not limited here. After the first character string is obtained, each number in the first character string is used as an encryption interval number. The encryption interval number is used to determine the next selection after selecting the frame picture that needs to be encrypted. For frame pictures, for example, assuming that the number of encryption intervals corresponding to frame picture A to be selected is 1, after frame picture A is extracted, the embodiment of the present application will extract the frame picture after an interval of one picture after frame picture A. By taking each number as the number of encryption intervals and sorting them in order, the corresponding encryption interval sequence can be obtained. For example, assuming that the first character string is 135, the corresponding encryption interval sequence {1, 3, 5} can be obtained at this time.
S203,按照加密间隔序列中的n个加密间隔数,依次间隔挑选未加密视频流中待加密的帧图片。S203: According to the number of n encryption intervals in the encryption interval sequence, sequentially select the frame pictures to be encrypted in the unencrypted video stream at intervals.
在得到加密间隔序列之后,本申请实施例会开始对未加密视频流进行帧图片选取,具体而言,将未加密视频流的第一张帧图片作为首张提取的帧图片,再根据加密间隔序列中的第一个加密间隔数确定下一张提取的帧图片并进行提取,在提取完成后再根据下一个加密间隔数进行下一张帧图片的提取,重复根据加密间隔数进行帧图片提取的操作,即可实现本申请实施例中所需加密的帧图片的实时提取。举例说明如下:假设加密间隔序列为{1,3,5},此时在对未加密视频流的第一张帧图片提取完成后,间隔1张帧图片进行帧图片提取,即提取未加密视频流的第3张帧图片,提取完成之后,再间隔3张进行帧图片提取,即提取未加密视频流的第7张帧图片,提取完成之后,再间隔5张进行帧图片提取,即提取未加密视频流的第13张帧图片,从而实现对待加密帧图片的提取。After the encryption interval sequence is obtained, this embodiment of the application will start to select the frame picture of the unencrypted video stream. Specifically, the first frame picture of the unencrypted video stream is taken as the first extracted frame picture, and then according to the encryption interval sequence The first encryption interval number in determines the next extracted frame picture and extracts it. After the extraction is completed, the next frame picture is extracted according to the next encryption interval number, and the frame picture extraction is repeated according to the number of encryption intervals The operation can realize real-time extraction of the frame pictures that need to be encrypted in the embodiment of the present application. An example is as follows: Suppose the encryption interval sequence is {1, 3, 5}. At this time, after the first frame picture of the unencrypted video stream is extracted, frame picture extraction is performed at intervals of 1 frame picture, that is, unencrypted video is extracted After the extraction is completed, the third frame picture of the stream is extracted, and then the frame picture is extracted at 3 intervals, that is, the 7th frame picture of the unencrypted video stream is extracted. Encrypt the 13th frame picture of the video stream, so as to realize the extraction of the frame picture to be encrypted.
其中应当说明地,本申请实施例中不对帧图片终止提取的条件进行限定,可由技术人员根据实际需求进行设定,包括但不限于如设置为当序列中的加密间隔数全部用完时停止提取、设置为当提取的帧图片达到一定的数量阈值时停止,或者设置为重复使用序列中的加密间隔数,直至未加密视频流输出完成。It should be noted that the embodiment of this application does not limit the conditions for terminating extraction of frame pictures, which can be set by technicians according to actual needs, including but not limited to, such as setting to stop extraction when all the encryption intervals in the sequence are exhausted. , Set to stop when the extracted frame pictures reach a certain threshold, or set to reuse the number of encryption intervals in the sequence until the output of the unencrypted video stream is completed.
作为本申请实施例二中获取第一字符串的一种具体实现方式,考虑到随着加密帧图片数量的减少,加密的安全性也会随之降低,因此,为了在减少加密工作量(即加密帧图片数量相对视频流总帧图片数量较少)的同时保证加密的安全性,在本申请实施例中,采用了随机生成第一字符串的方法,使得具体被加密的帧图片无法预知,进而提升加密的安全性,随机加密的方式包括:随机生成长度n,并随机生成长度为n且仅包含数字的第一字符串。As a specific implementation of obtaining the first character string in the second embodiment of the present application, considering that as the number of encrypted frame pictures decreases, the security of encryption will also decrease. Therefore, in order to reduce the workload of encryption (ie The number of encrypted frame pictures is less than the total number of frame pictures in the video stream) while ensuring the security of encryption. In this embodiment of the application, a method of randomly generating the first character string is used, so that the specific encrypted frame pictures cannot be predicted. To further improve the security of encryption, random encryption methods include: randomly generating a length n, and randomly generating a first string of length n that contains only numbers.
在本申请实施例中,第一字符串的长度和内容都是完全随机生成的,从而使得每次被加密的帧图片无法预知,进而使得破解时查找加密帧图片的难度大大增加,使得加密的安全性得以提升。In the embodiment of the present application, the length and content of the first character string are completely randomly generated, so that the encrypted frame picture each time is unpredictable, which greatly increases the difficulty of finding the encrypted frame picture when cracking, making the encrypted frame picture Security can be improved.
S204,对挑选出的帧图片进行加密,得到加密视频流。S204: Encrypt the selected frame pictures to obtain an encrypted video stream.
在提取出所需加密的帧图片之后,本申请实施例会对这些帧图片进行进行加密,以实现对未加密视频流的加密保护,其中,具体的加密方法此处不予限定,可由技术人员根据实际的需求进行选取或设定,包括但不限于如利用一些可逆的算法对帧图片进行模糊化,以及对帧图片内容区域分割并打乱重组。After extracting the required encrypted frame pictures, the embodiment of the application encrypts these frame pictures to realize the encryption protection of the unencrypted video stream. The specific encryption method is not limited here, and the technical personnel can follow The actual requirements are selected or set, including, but not limited to, using some reversible algorithms to blur the frame picture, as well as segmenting and shuffling the frame picture content area.
本申请实施例通过使用第一字符串转换加密间隔序列,并根据加密间隔序列中的加密间隔数对未加密视频流进行间隔提取,最后对提取出的帧图片进行加密,使得对视频流的加密过程仅需对视频流部分的帧图片进行处理,减少了加密的工作量,使得加密的速度更快,保障了加密视频流转换的实时高效。In the embodiment of the application, the encrypted interval sequence is converted by using the first character string, and the unencrypted video stream is extracted according to the number of encryption intervals in the encrypted interval sequence, and finally the extracted frame pictures are encrypted, so that the video stream is encrypted The process only needs to process the frame pictures in the video stream, which reduces the workload of encryption, makes the encryption faster, and ensures the real-time efficiency of encrypted video stream conversion.
作为本申请实施例二中帧图片提取的一种具体实现方式,考虑到实际应用中无法预知用户对控件的操作时长,即无法预知未加密视频流的时长,从而单次生成的加密间隔数的数量不一定满足加密的需求。As a specific implementation of frame picture extraction in the second embodiment of this application, considering that the user’s operation duration on the control cannot be predicted in actual applications, that is, the duration of the unencrypted video stream cannot be predicted, so the number of encryption intervals generated in a single time The number does not necessarily meet the needs of encryption.
为了满足未加密视频流不同时长的加密需求,本申请实施例会循环使用加密间隔序列中的加密间隔数,使得各个加密间隔数得以重复循环使用,加密间隔序列中n个加密间隔数的序列号依次为1、2、…、n,如图3所示,在本申请实施例中,提取帧图片的步骤具体包括:S301,按照序列号从小到大的顺序依次选取加密间隔数,并基于每次选取出的加密间隔数,间隔挑选未加密视频流中待加密的帧图片。In order to meet the encryption requirements of different durations of unencrypted video streams, the embodiment of the application will cyclically use the encryption interval numbers in the encryption interval sequence, so that each encryption interval number can be used repeatedly, and the sequence numbers of the n encryption interval numbers in the encryption interval sequence are sequentially As shown in Fig. 3, in the embodiment of the present application, the step of extracting frame pictures specifically includes: S301, selecting the number of encryption intervals in sequence from small to large according to the sequence number, and based on each Select the number of encryption intervals, and select the frame pictures to be encrypted in the unencrypted video stream at intervals.
这里的帧图片挑选操作可参考本申请实施例二中的说明,此处不予赘述。For the frame picture selection operation here, reference may be made to the description in the second embodiment of the present application, which will not be repeated here.
S302,若选取出的加密间隔数序列号为n,将下一次选取加密间隔数的序列号设置为1,并返回执行按照序列号从小到大的顺序依次选取加密间隔数的操作。S302: If the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to perform the operation of sequentially selecting the encryption interval numbers according to the sequence number from small to large.
在本申请实施例中,每次对加密间隔序列中的加密间隔数全部使用完之后,又会重新循环使用加密间隔序列进行后续的帧图片挑选操作,以实现对各个加密间隔数的重复循环使用,此时无论未加密视频流时长如何,本申请实施例都可以持续不断地进行帧图片的挑选操作,满足实际加密的需求。In the embodiment of the present application, each time the encryption interval number in the encryption interval sequence is used up, the encryption interval sequence is re-used for subsequent frame picture selection operations, so as to realize the repeated use of each encryption interval number. At this time, regardless of the duration of the unencrypted video stream, the embodiment of the present application can continuously perform frame image selection operations to meet actual encryption requirements.
作为本申请的一个实施例,考虑到上述本申请实施例二和三中都仅仅是对未加密视频流的部分帧图片进行加密处理,对于最终生成的加密视频流而言,其中仅仅是部分的帧图片被加密了,若这些加密帧图片数量非常少时,即使对加密视频流直接进行播放,加密视频流也可以正常的被观看,从而使得加密的效果极差,无法保障加密的可靠性以及信息的安全性。As an embodiment of the present application, considering that both the second and third embodiments of the present application only perform encryption processing on part of the frame pictures of the unencrypted video stream, for the finally generated encrypted video stream, only part of it is The frame pictures are encrypted. If the number of these encrypted frame pictures is very small, even if the encrypted video stream is played directly, the encrypted video stream can be viewed normally, which makes the effect of encryption extremely poor and cannot guarantee the reliability and information of encryption. Security.
为了保障加密的可靠性以及信息的安全性,本申请实施例会对视频流的帧率以及加密的间隔进行设置,使得在未经解密的情况下若直接对加密视频流进行播放,将会导致加密视频流无法正常被查看,在本申请实施例中,首先,对第一频率的获取操作具体包括:随机生成大于或等于20张/秒且小于40张/秒的第一频率。In order to ensure the reliability of encryption and the security of information, this embodiment of the application sets the frame rate of the video stream and the encryption interval, so that if the encrypted video stream is played directly without decryption, it will result in encryption. The video stream cannot be viewed normally. In the embodiment of the present application, first, the operation of obtaining the first frequency specifically includes: randomly generating a first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec.
在第一频率大于或等于20张/秒且小于40张/秒的基础上,本申请实施例对第一字符串的获取操作包括:获取长度为n且仅包含数字1的第一字符串。On the basis that the first frequency is greater than or equal to 20 frames/sec and less than 40 frames/sec, the obtaining operation of the first character string in this embodiment of the present application includes: obtaining the first character string with a length of n and only containing the number 1.
由于当视频帧率低于20张/秒时,人体将无法正常观看视频内容,因此在本申请实施例中,将第一频率的下限值设定为20张/秒,以保障解密后的视频流可正常被观看,同时由于间隔采样的极限是每隔一张采集一次,即最多能对未加密视频流50%的帧图片进行加密,因此本申请实施例中将第一频率的上限值设定为小于40张/秒,并同时将第一字符串的数字全设置为1,使得加密视频流中,每秒输出未加密帧图片的数量不会超过20张,实现了在未经解密的情况下即使直接播放加密视频流,用户也无法正常观看视频流内容,即必须对加密视频流进行解密后才能正常观看,进而极大地提高了加密的可靠性,保障了移动终端信息的安全性。When the video frame rate is lower than 20 frames per second, the human body will not be able to watch the video content normally. Therefore, in the embodiment of the present application, the lower limit of the first frequency is set to 20 frames per second to ensure the decryption. The video stream can be viewed normally. At the same time, since the interval sampling limit is to collect every other frame, that is, at most 50% of the frame pictures of the unencrypted video stream can be encrypted. Therefore, the upper limit of the first frequency is set in the embodiment of this application. The value is set to less than 40 frames per second, and at the same time, the numbers of the first string are all set to 1, so that in the encrypted video stream, the number of unencrypted frame pictures output per second will not exceed 20, which is In the case of decryption, even if the encrypted video stream is played directly, the user cannot watch the video stream content normally, that is, the encrypted video stream must be decrypted before it can be watched normally, which greatly improves the reliability of encryption and guarantees the security of mobile terminal information sex.
对应于上文实施例的方法,图4示出了本申请实施例提供的截屏管理装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。图4示例的截屏管理装置可以是前述实施例一提供的截屏管理方法的执行主体。Corresponding to the method of the above embodiment, FIG. 4 shows a structural block diagram of a screenshot management device provided in an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown. The screenshot management apparatus illustrated in FIG. 4 may be the execution subject of the screenshot management method provided in the first embodiment.
参照图4,该截屏管理装置包括:标识检测模块41,用于检测当前调用的控件是否带有第一标识。4, the screenshot management device includes: an identification detection module 41, configured to detect whether the currently called control carries a first identification.
页面获取模块42,用于若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸。The page obtaining module 42 is configured to obtain the display page of the control and the display size of each display page at a first frequency if the control has the first identifier.
图片渲染模块43,用于基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片。The picture rendering module 43 is configured to create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding canvas to generate each Display the rendered control picture corresponding to the screen.
视频流转换模块44,用于将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放。The video stream conversion module 44 is configured to render all the obtained control pictures into an encrypted video stream according to the corresponding display size, and play the encrypted video stream.
截屏处理模块45,用于若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。The screenshot processing module 45 is configured to, if a screenshot instruction for the encrypted video stream is detected, obtain a background picture corresponding to the first identifier, and store the background picture as a screenshot corresponding to the screenshot instruction.
进一步地,图片渲染模块43,包括:将所述显示页面导入对应的所述画布,并通过UIGraphicsGetImageFromCurrentImageContext 函数从所述画布中得到渲染后的控件图片。Further, the picture rendering module 43 includes: importing the display page into the corresponding canvas, and obtaining the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
进一步地,视频流转换模块44,包括:视频渲染模块,用于将得到的所述控件图片按照对应的所述显示尺寸渲染为未加密视频流。Further, the video stream conversion module 44 includes: a video rendering module, configured to render the obtained control picture into an unencrypted video stream according to the corresponding display size.
间隔获取模块,用于获取长度为n且仅包含数字的第一字符串,并将所述第一字符串各个位置处的数字依次作为加密间隔数,生成包含n个所述加密间隔数的加密间隔序列,其中,n为正整数。Interval acquisition module, for acquiring a first character string of length n and containing only numbers, and taking the numbers at each position of the first character string as the number of encryption intervals in turn, to generate an encryption including n of the number of encryption intervals Interval sequence, where n is a positive integer.
图片挑选模块,用于按照所述加密间隔序列中的n个所述加密间隔数,依次间隔挑选所述未加密视频流中待加密的帧图片。The picture selection module is configured to sequentially select the frame pictures to be encrypted in the unencrypted video stream at intervals according to the number of n encryption intervals in the sequence of encryption intervals.
加密模块,用于对挑选出的所述帧图片进行加密,得到所述加密视频流。The encryption module is used to encrypt the selected frame pictures to obtain the encrypted video stream.
进一步地,间隔获取模块,包括:随机生成长度n,并随机生成长度为n且仅包含数字的第一字符串。Further, the interval obtaining module includes: randomly generating a length n, and randomly generating a first character string with a length n and containing only numbers.
进一步地,该截屏管理装置,还包括:频率获取模块,用于随机生成大于或等于20张/秒且小于40张/秒的所述第一频率。Further, the screenshot management device further includes: a frequency acquisition module, configured to randomly generate the first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec.
所述间隔获取模块,包括:获取长度为n且仅包含数字1的第一字符串。The interval obtaining module includes: obtaining a first character string with a length of n and only containing the number 1.
进一步地,所述加密间隔序列中n个所述加密间隔数的序列号依次为1、2、…、n,图片挑选模块,包括:按照序列号从小到大的顺序依次选取所述加密间隔数,并基于每次选取出的所述加密间隔数,间隔挑选所述未加密视频流中待加密的帧图片。Further, the sequence numbers of the n encryption interval numbers in the encryption interval sequence are 1, 2, ..., n, and the picture selection module includes: sequentially selecting the encryption interval numbers according to the sequence number from small to large , And based on the number of encryption intervals selected each time, the frame pictures to be encrypted in the unencrypted video stream are selected at intervals.
若选取出的所述加密间隔数序列号为n,将下一次选取所述加密间隔数的序列号设置为1,并返回执行所述按照序列号从小到大的顺序依次选取所述加密间隔数的操作。If the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to execute the sequence of selecting the encryption interval number in order from small to large. Operation.
本申请实施例提供的截屏管理装置中各模块实现各自功能的过程,具体可参考前述图1所示实施例一的描述,此处不再赘述。For the process by which each module in the screenshot management device provided in the embodiment of the present application realizes their respective functions, please refer to the description of the first embodiment shown in FIG. 1 for details, which will not be repeated here.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the existence of the described features, wholes, steps, operations, elements and/or components, but does not exclude one or more other The existence or addition of features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the description of this application and the appended claims, the term "if" can be construed as "when" or "once" or "in response to determination" or "in response to detecting ". Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。还应理解的是,虽然术语“第一”、“第二”等在文本中在一些本申请实施例中用来描述各种元素,但是这些元素不应该受到这些术语的限制。这些术语只是用来将一个元素与另一元素区分开。例如,第一表格可以被命名为第二表格,并且类似地,第二表格可以被命名为第一表格,而不背离各种所描述的实施例的范围。第一表格和第二表格都是表格,但是它们不是同一表格。In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance. It should also be understood that although the terms “first”, “second”, etc. are used in the text in some embodiments of the present application to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, the first table may be named the second table, and similarly, the second table may be named the first table without departing from the scope of the various described embodiments. The first form and the second form are both forms, but they are not the same form.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。The reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of this application include a specific feature, structure, or characteristic described in combination with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless it is specifically emphasized otherwise. The terms "including", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
作为示例而非限定,当所述终端设备为可穿戴设备时,该可穿戴设备还可以是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,如智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环等。As an example and not a limitation, when the terminal device is a wearable device, the wearable device may also be a general term for using wearable technology to intelligently design daily wear and develop wearable devices. A wearable device is a portable device that is directly worn on the body or integrated into the user's clothes or accessories. Wearable devices are not only a kind of hardware device, but also realize powerful functions through software support, data interaction, and cloud interaction. In a broad sense, wearable smart devices include full-featured, large-sized, complete or partial functions that can be implemented without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, and need to be used in conjunction with other devices such as smart phones. , Such as various smart bracelets for physical sign monitoring.
图5是本申请一实施例提供的移动终端的结构示意图。如图5所示,该实施例的移动终端5包括:至少一个处理器50(图5中仅示出一个)、存储器51,所述存储器51中存储有可在所述处理器50上运行的计算机程序52。所述处理器50执行所述计算机程序52时实现上述各个截屏管理方法实施例中的步骤,例如图1所示的步骤101至105。或者,所述处理器50执行所述计算机程序52时实现上述各装置实施例中各模块/单元的功能,例如图4所示模块41至65的功能。FIG. 5 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application. As shown in FIG. 5, the mobile terminal 5 of this embodiment includes: at least one processor 50 (only one is shown in FIG. Computer program 52. When the processor 50 executes the computer program 52, the steps in the above embodiments of the screenshot management method are implemented, for example, steps 101 to 105 shown in FIG. 1. Alternatively, when the processor 50 executes the computer program 52, the functions of the modules/units in the foregoing device embodiments, such as the functions of the modules 41 to 65 shown in FIG. 4, are realized.
所述移动终端5可以是平板电脑、手机等移动计算设备。所述移动终端可包括,但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是移动终端5的示例,并不构成对移动终端5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述移动终端还可以包括输入发送设备、网络接入设备、总线等。The mobile terminal 5 may be a mobile computing device such as a tablet computer and a mobile phone. The mobile terminal may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art can understand that FIG. 5 is only an example of the mobile terminal 5, and does not constitute a limitation on the mobile terminal 5. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. For example, the mobile terminal may also include an input sending device, a network access device, a bus, and the like.
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors) Signal Processor, DSP), Application Specific Integrated Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器51在一些实施例中可以是所述移动终端5的内部存储单元,例如移动终端5的硬盘或内存。所述存储器51也可以是所述移动终端5的外部存储设备,例如所述移动终端5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述移动终端5的内部存储单元也包括外部存储设备。所述存储器51用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器51还可以用于暂时地存储已经发送或者将要发送的数据。The memory 51 may be an internal storage unit of the mobile terminal 5 in some embodiments, such as a hard disk or a memory of the mobile terminal 5. The memory 51 may also be an external storage device of the mobile terminal 5, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) equipped on the mobile terminal 5. Card, Flash Card, etc. Further, the memory 51 may also include both an internal storage unit of the mobile terminal 5 and an external storage device. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been sent or will be sent.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。其中,该计算机可读存储介质可以是非易失性,也可以是易失性。The embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized. Wherein, the computer-readable storage medium may be non-volatile or volatile.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a mobile terminal, the steps in the foregoing method embodiments can be realized when the mobile terminal is executed.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质等。If the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, it can implement the steps of the foregoing method embodiments. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM) , Random Access Memory (Random Access Memory, RAM), electrical carrier signal, telecommunications signal, and software distribution media, etc.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail or recorded in an embodiment, reference may be made to related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使对应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种截屏管理方法,其中,包括: A screenshot management method, which includes:
    检测当前调用的控件是否带有第一标识;Detect whether the currently called control has the first identifier;
    若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;If the control has the first identifier, acquiring the display page of the control and the display size of each display page at a first frequency;
    基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;Create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding canvas, and generate a rendered image corresponding to each display screen Control picture;
    将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;Rendering all the obtained control pictures into an encrypted video stream according to the corresponding display size, and playing the encrypted video stream;
    若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。If a screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is obtained, and the background picture is stored as a screenshot corresponding to the screenshot instruction.
  2. 如权利要求1所述的截屏管理方法,其中,所述将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片,包括: 8. The screenshot management method of claim 1, wherein the rendering the display page to the corresponding canvas and generating the rendered control picture corresponding to each display screen comprises:
    将所述显示页面导入对应的所述画布,并通过UIGraphicsGetImageFromCurrentImageContext 函数从所述画布中得到渲染后的控件图片。Import the display page into the corresponding canvas, and obtain the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
  3. 如权利要求1所述的截屏管理方法,其中,所述将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,包括: The screenshot management method according to claim 1, wherein said rendering all the obtained control pictures into an encrypted video stream according to the corresponding display size comprises:
    将得到的所述控件图片按照对应的所述显示尺寸渲染为未加密视频流;Rendering the obtained control picture into an unencrypted video stream according to the corresponding display size;
    获取长度为n且仅包含数字的第一字符串,并将所述第一字符串各个位置处的数字依次作为加密间隔数,生成包含n个所述加密间隔数的加密间隔序列,其中,n为正整数;Obtain a first character string with a length of n and only containing numbers, and use the numbers at each position of the first character string as the number of encryption intervals in sequence to generate an encryption interval sequence containing n of the number of encryption intervals, where n Is a positive integer;
    按照所述加密间隔序列中的n个所述加密间隔数,依次间隔挑选所述未加密视频流中待加密的帧图片;According to the number of n encryption intervals in the sequence of encryption intervals, sequentially select the frame pictures to be encrypted in the unencrypted video stream at intervals;
    对挑选出的所述帧图片进行加密,得到所述加密视频流。Encrypting the selected frame pictures to obtain the encrypted video stream.
  4. 如权利要求3所述的截屏管理方法,其中,所述获取仅包含数字的第一字符串,包括: 8. The screenshot management method according to claim 3, wherein said obtaining the first character string containing only numbers comprises:
    随机生成长度n,并随机生成长度为n且仅包含数字的第一字符串。Randomly generate a length of n, and randomly generate a first string of length n that contains only numbers.
  5. 如权利要求3所述的截屏管理方法,其中,在所述以第一频率获取所述控件的显示页面之前,还包括: 8. The screenshot management method of claim 3, wherein before said obtaining the display page of the control at the first frequency, the method further comprises:
    随机生成大于或等于20张/秒且小于40张/秒的所述第一频率;Randomly generating the first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec;
    所述获取长度为n且仅包含数字的第一字符串,包括:The obtaining the first string of length n and containing only numbers includes:
    获取长度为n且仅包含数字1的第一字符串。Get the first string with length n and only containing the number 1.
  6. 如权利要求3至5任意一项所述的截屏管理方法,其中,所述加密间隔序列中n个所述加密间隔数的序列号依次为1、2、…、n,所述按照所述加密间隔序列中的n个所述加密间隔数,依次间隔挑选所述未加密视频流中待加密的帧图片,包括: The screenshot management method according to any one of claims 3 to 5, wherein the sequence numbers of the n encryption intervals in the encryption interval sequence are 1, 2, ..., n, and the encryption interval sequence is The number of n encryption intervals in the interval sequence, and the selection of the frame pictures to be encrypted in the unencrypted video stream sequentially at intervals includes:
    按照序列号从小到大的顺序依次选取所述加密间隔数,并基于每次选取出的所述加密间隔数,间隔挑选所述未加密视频流中待加密的帧图片;Selecting the number of encryption intervals in order of sequence numbers from small to large, and selecting the frame pictures to be encrypted in the unencrypted video stream at intervals based on the number of encryption intervals selected each time;
    若选取出的所述加密间隔数序列号为n,将下一次选取所述加密间隔数的序列号设置为1,并返回执行所述按照序列号从小到大的顺序依次选取所述加密间隔数的操作。If the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to execute the sequence of selecting the encryption interval number in order from small to large. Operation.
  7. 如权利要求1所述的截屏管理方法,其中,所述对所述加密视频流进播放,包括: The screenshot management method according to claim 1, wherein said playing the encrypted video stream comprises:
    基于AVFoundation 框架判断所述加密视频流的视频流内容是否支持播放,并在支持播放时对所述加密视频流进行播放。Based on AVFoundation The framework determines whether the video stream content of the encrypted video stream supports playback, and plays the encrypted video stream when the playback is supported.
  8. 如权利要求1所述的截屏管理方法,其中,所述对所述加密视频流进播放包括:8. The screenshot management method according to claim 1, wherein said playing the encrypted video stream comprises:
    获取每个所述显示页面在显示屏中的位置;Acquiring the position of each display page in the display screen;
    将所述加密视频流的帧图片输出至所述显示屏中对应每个所述显示页面的位置。Outputting the frame pictures of the encrypted video stream to a position on the display screen corresponding to each of the display pages.
  9. 如权利要求1所述的截屏管理方法,其中,所述若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图,包括:The screenshot management method of claim 1, wherein if a screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is obtained, and the background picture is stored as the screenshot Screenshots corresponding to the instructions, including:
    若检测到针对所述加密视频流的截屏指令,则播放空白页面以使所述截屏指令对应的截图为空白图片。If a screenshot instruction for the encrypted video stream is detected, a blank page is played to make the screenshot corresponding to the screenshot instruction a blank picture.
  10. 一种截屏管理装置,其中,包括: A screenshot management device, which includes:
    标识检测模块,用于检测当前调用的控件是否带有第一标识;The identification detection module is used to detect whether the currently called control has the first identification;
    页面获取模块,用于若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;A page obtaining module, configured to obtain the display page of the control and the display size of each display page at a first frequency if the control has the first identifier;
    图片渲染模块,用于基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;The picture rendering module is configured to create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding canvas to generate each display The rendered control picture corresponding to the screen;
    视频流转换模块,用于将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;The video stream conversion module is configured to render all the obtained control pictures into an encrypted video stream according to the corresponding display size, and play the encrypted video stream;
    截屏处理模块,用于若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。The screenshot processing module is configured to, if a screenshot instruction for the encrypted video stream is detected, obtain a background picture corresponding to the first identifier, and store the background picture as a screenshot corresponding to the screenshot instruction.
  11. 一种移动终端,其中,所述移动终端包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现: A mobile terminal, wherein the mobile terminal includes a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program:
    检测当前调用的控件是否带有第一标识;Detect whether the currently called control has the first identifier;
    若所述控件带有所述第一标识,以第一频率获取所述控件的显示页面,以及每个所述显示页面的显示尺寸;If the control has the first identifier, acquiring the display page of the control and the display size of each display page at a first frequency;
    基于每个所述显示页面的所述显示尺寸创建图片上下文,根据所述图片上下文铺设画布,并将所述显示页面渲染至对应的所述画布,生成每个所述显示画面对应的渲染后的控件图片;Create a picture context based on the display size of each display page, lay a canvas according to the picture context, and render the display page to the corresponding canvas, and generate a rendered image corresponding to each display screen Control picture;
    将得到的所有所述控件图片按照对应的所述显示尺寸渲染为加密视频流,并对所述加密视频流进播放;Rendering all the obtained control pictures into an encrypted video stream according to the corresponding display size, and playing the encrypted video stream;
    若检测到针对所述加密视频流的截屏指令,获取所述第一标识对应的背景图片,并将所述背景图片储存为所述截屏指令对应的截图。If a screenshot instruction for the encrypted video stream is detected, a background picture corresponding to the first identifier is obtained, and the background picture is stored as a screenshot corresponding to the screenshot instruction.
  12. 如权利要求11所述的移动终端,其中,所述处理器执行所述计算机程序时实现: The mobile terminal according to claim 11, wherein, when the processor executes the computer program:
    将所述显示页面导入对应的所述画布,并通过UIGraphicsGetImageFromCurrentImageContext 函数从所述画布中得到渲染后的控件图片。Import the display page into the corresponding canvas, and obtain the rendered control picture from the canvas through the UIGraphicsGetImageFromCurrentImageContext function.
  13. 如权利要求11所述的移动终端,其中,所述处理器执行所述计算机程序时实现: The mobile terminal according to claim 11, wherein, when the processor executes the computer program:
    将得到的所述控件图片按照对应的所述显示尺寸渲染为未加密视频流;Rendering the obtained control picture into an unencrypted video stream according to the corresponding display size;
    获取长度为n且仅包含数字的第一字符串,并将所述第一字符串各个位置处的数字依次作为加密间隔数,生成包含n个所述加密间隔数的加密间隔序列,其中,n为正整数;Obtain a first character string with a length of n and only containing numbers, and use the numbers at each position of the first character string as the number of encryption intervals in sequence to generate an encryption interval sequence containing n of the number of encryption intervals, where n Is a positive integer;
    按照所述加密间隔序列中的n个所述加密间隔数,依次间隔挑选所述未加密视频流中待加密的帧图片;According to the number of n encryption intervals in the sequence of encryption intervals, sequentially select the frame pictures to be encrypted in the unencrypted video stream at intervals;
    对挑选出的所述帧图片进行加密,得到所述加密视频流。Encrypting the selected frame pictures to obtain the encrypted video stream.
  14. 如权利要求13所述的移动终端,其中,所述处理器执行所述计算机程序时实现: The mobile terminal according to claim 13, wherein, when the processor executes the computer program:
    随机生成长度n,并随机生成长度为n且仅包含数字的第一字符串。Randomly generate a length of n, and randomly generate a first string of length n that contains only numbers.
  15. 如权利要求13所述的移动终端,其中,所述处理器执行所述计算机程序时实现: The mobile terminal according to claim 13, wherein, when the processor executes the computer program:
    随机生成大于或等于20张/秒且小于40张/秒的所述第一频率;Randomly generating the first frequency greater than or equal to 20 frames/sec and less than 40 frames/sec;
    所述获取长度为n且仅包含数字的第一字符串,包括:The obtaining the first string of length n and containing only numbers includes:
    获取长度为n且仅包含数字1的第一字符串。Get the first string with length n and only containing the number 1.
  16. 如权利要求13至15任意一项所述的移动终端,其中,所述加密间隔序列中n个所述加密间隔数的序列号依次为1、2、…、n,所述处理器执行所述计算机程序时实现: The mobile terminal according to any one of claims 13 to 15, wherein the sequence numbers of the n encryption interval numbers in the encryption interval sequence are 1, 2, ..., n, and the processor executes the Realize in computer program:
    按照序列号从小到大的顺序依次选取所述加密间隔数,并基于每次选取出的所述加密间隔数,间隔挑选所述未加密视频流中待加密的帧图片;Selecting the number of encryption intervals in order of sequence numbers from small to large, and selecting the frame pictures to be encrypted in the unencrypted video stream at intervals based on the number of encryption intervals selected each time;
    若选取出的所述加密间隔数序列号为n,将下一次选取所述加密间隔数的序列号设置为1,并返回执行所述按照序列号从小到大的顺序依次选取所述加密间隔数的操作。If the selected sequence number of the encryption interval number is n, set the sequence number of the next selected encryption interval number to 1, and return to execute the sequence of selecting the encryption interval number in order from small to large. Operation.
  17. 如权利要求11所述的移动终端,其中,所述处理器执行所述计算机程序时实现: The mobile terminal according to claim 11, wherein, when the processor executes the computer program:
    基于AVFoundation 框架判断所述加密视频流的视频流内容是否支持播放,并在支持播放时对所述加密视频流进行播放。Based on AVFoundation The framework determines whether the video stream content of the encrypted video stream supports playback, and plays the encrypted video stream when the playback is supported.
  18. 如权利要求11所述的移动终端,其中,所述处理器执行所述计算机程序时实现:The mobile terminal according to claim 11, wherein, when the processor executes the computer program:
    获取每个所述显示页面在显示屏中的位置;Acquiring the position of each display page in the display screen;
    将所述加密视频流的帧图片输出至所述显示屏中对应每个所述显示页面的位置。Outputting the frame pictures of the encrypted video stream to a position on the display screen corresponding to each of the display pages.
  19. 如权利要求11所述的移动终端,其中,所述处理器执行所述计算机程序时实现:The mobile terminal according to claim 11, wherein, when the processor executes the computer program:
    若检测到针对所述加密视频流的截屏指令,则播放空白页面以使所述截屏指令对应的截图为空白图片。If a screenshot instruction for the encrypted video stream is detected, a blank page is played to make the screenshot corresponding to the screenshot instruction a blank picture.
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至9任一项所述方法的步骤。 A computer-readable storage medium storing a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 9 when the computer program is executed by a processor.
PCT/CN2020/093596 2020-02-11 2020-05-30 Screen capture management method and apparatus, and mobile terminal WO2021159644A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010087141.7 2020-02-11
CN202010087141.7A CN111327947B (en) 2020-02-11 2020-02-11 Screen capture management method and device and mobile terminal

Publications (1)

Publication Number Publication Date
WO2021159644A1 true WO2021159644A1 (en) 2021-08-19

Family

ID=71170938

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093596 WO2021159644A1 (en) 2020-02-11 2020-05-30 Screen capture management method and apparatus, and mobile terminal

Country Status (2)

Country Link
CN (1) CN111327947B (en)
WO (1) WO2021159644A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114302230A (en) * 2021-12-30 2022-04-08 苏州万店掌网络科技有限公司 Front-end playing component optimization method, system and storage medium
CN116540984A (en) * 2023-07-06 2023-08-04 易方信息科技股份有限公司 IOS (input/output) system-based screen recording prevention method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051592A (en) * 2021-03-31 2021-06-29 深圳市声扬科技有限公司 File encryption method and device, electronic equipment and storage medium
CN113535293B (en) * 2021-06-01 2023-10-03 浪潮金融信息技术有限公司 Android device screen capturing method, system and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408686A (en) * 2014-10-31 2015-03-11 宇龙计算机通信科技(深圳)有限公司 Method, system and terminal for screen capturing
CN108038396A (en) * 2017-12-05 2018-05-15 广东欧珀移动通信有限公司 Record screen method, apparatus and terminal
CN108563382A (en) * 2018-02-26 2018-09-21 挖财网络技术有限公司 Screenshotss method and device based on android system
US20190182549A1 (en) * 2017-12-08 2019-06-13 Confide, Inc. System and method for displaying screenshot-proof content
CN110377202A (en) * 2019-06-05 2019-10-25 平安科技(深圳)有限公司 Image processing method, device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685735B (en) * 2013-11-22 2015-06-10 毛秀允 Method for preventing mobile terminal from illegal screen capture
US10028021B2 (en) * 2014-12-22 2018-07-17 Hisense Electric Co., Ltd. Method and device for encoding a captured screenshot and controlling program content switching based on the captured screenshot
US20160301641A1 (en) * 2015-04-13 2016-10-13 Smoke Messaging, LLC Secure messaging system utilizing a limited viewing window
CN110308860B (en) * 2019-07-11 2022-01-25 Oppo广东移动通信有限公司 Screen capturing method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408686A (en) * 2014-10-31 2015-03-11 宇龙计算机通信科技(深圳)有限公司 Method, system and terminal for screen capturing
CN108038396A (en) * 2017-12-05 2018-05-15 广东欧珀移动通信有限公司 Record screen method, apparatus and terminal
US20190182549A1 (en) * 2017-12-08 2019-06-13 Confide, Inc. System and method for displaying screenshot-proof content
CN108563382A (en) * 2018-02-26 2018-09-21 挖财网络技术有限公司 Screenshotss method and device based on android system
CN110377202A (en) * 2019-06-05 2019-10-25 平安科技(深圳)有限公司 Image processing method, device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YU ZIJIANG: "iOS Anti-Capture Solution (Based on DRM)", 1 January 2019 (2019-01-01), XP055835342, Retrieved from the Internet <URL:https://www.jianshu.com/p/86d0cfed5f4e> *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114302230A (en) * 2021-12-30 2022-04-08 苏州万店掌网络科技有限公司 Front-end playing component optimization method, system and storage medium
CN116540984A (en) * 2023-07-06 2023-08-04 易方信息科技股份有限公司 IOS (input/output) system-based screen recording prevention method and device
CN116540984B (en) * 2023-07-06 2023-09-29 易方信息科技股份有限公司 IOS (input/output) system-based screen recording prevention method and device

Also Published As

Publication number Publication date
CN111327947B (en) 2022-10-28
CN111327947A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
WO2021159644A1 (en) Screen capture management method and apparatus, and mobile terminal
US10154014B2 (en) Method and system for efficient encryption, transmission, and decryption of video data
Winkler et al. Trustcam: Security and privacy-protection for an embedded smart camera based on trusted computing
US10659226B2 (en) Data encryption method, decryption method, apparatus, and system
US11716197B2 (en) System and method for generating a cryptographic key
CN110446105B (en) Video encryption and decryption method and device
BR112018013867B1 (en) INFORMATION PROCESSING METHOD AND SYSTEM, FIRST TERMINAL, SECOND TERMINAL, SERVER AND STORAGE MEDIA IN COMPUTER
JP2003256282A (en) Memory card
WO2020244068A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN110582010A (en) Video/picture encryption transmission method and device, electronic equipment and storage medium
US20190303966A1 (en) Dynamic machine-readable codes
US10003462B2 (en) Key generating method and apparatus
CN108307244B (en) Bullet screen speaking time control method, storage medium, electronic device and system
TWI420315B (en) Recording contents of display screens
WO2017201999A1 (en) File encryption method, device, terminal and storage medium
WO2021017277A1 (en) Image capture method and apparatus, and computer storage medium
CN116756750A (en) Medical sensitive data acquisition desensitization method
WO2019184741A1 (en) Application program information storing method and apparatus, and application program information processing method and apparatus
US20220345292A1 (en) Method and device for encryption of video stream, communication equipment, and storage medium
CN113672954A (en) Feature extraction method and device and electronic equipment
CN115701017A (en) Image processing method and device
CN113836538A (en) Data model processing method, device, server and storage medium
US9449179B2 (en) Information processor
CN112434327A (en) Information protection method and device and electronic equipment
JP2017158080A (en) Information processing unit, information processing method, program and information processing system

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: 20918950

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: 20918950

Country of ref document: EP

Kind code of ref document: A1