Screen capturing method and electronic equipment
By displaying permission application pop-up windows during each screen capture operation and performing screenshots or screen recordings after obtaining user authorization, combined with virtual screen display technology, the problem of privacy and security risks in the existing technology is solved, and effective protection of user privacy is achieved and improve operational efficiency.
Patent Information
- Application Number
- CN202410083420.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-19
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-19
AI Technical Summary
Existing screen capture technology is prone to cause user privacy and security risks when it is not the first time it is operated. Screenshots or screen recordings are performed without authorization, which may reveal user privacy.
When each screen capture operation is triggered, the permission application pop-up window is always displayed. Only screenshot or screen recording operations are performed after the user is authorized. The interface content is saved by creating a virtual display screen to ensure user privacy, and block screenshots before authorization Or screen recording operation.
Effectively protect user privacy, prevent unauthorized screen capture, improve the efficiency and security of screenshot or screen recording operations, and avoid the situation where screenshot or screen recording content is empty.
Smart Images

Figure CN119249519A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a screen capture method and electronic equipment. Background Art
[0002] Screen capture includes screenshots and screen recordings, which refers to the process of capturing all or part of the screen of an electronic device through software or tools and converting it into an image or video. Screen capture can not only be used to record fixed content on the screen, such as game screens, video clips or presentations, but also to record screen dynamics to save a video of a specific process or interaction.
[0003] In the related art, when an application performs screen capture for the first time, it usually needs user authorization, and subsequent screenshot or screen recording operations for the application do not need to be authorized again. However, this method is likely to cause privacy and security risks to users. Summary of the invention
[0004] The present application provides a screen capture method and an electronic device, which can ensure the privacy of the user when taking screenshots or recording screens.
[0005] In a first aspect, an embodiment of the present application provides a screen capture method, the method comprising: running a first application on an electronic device, and displaying a first interface of the first application; in response to a first operation of a user on a screen capture control, displaying a permission application pop-up window, wherein the permission application pop-up window includes an authorization confirmation control, and the authorization confirmation control is used to determine the content of the first interface to be captured; in response to a user clicking operation on the authorization confirmation control, obtaining a historical authorization record, and taking a screenshot or recording the first interface according to the historical authorization record, wherein the historical authorization record is used to indicate whether the first application allows screen capture.
[0006] In the technical solution of the present application, a permission request pop-up window will be displayed each time the user triggers a screen capture operation, whether it is the first screen capture operation or not. The application can only perform the corresponding screenshot or recording operation according to the historical authorization record after obtaining the user's authorization, thereby ensuring the user's privacy.
[0007] Optionally, in a possible implementation of the first aspect, the above-mentioned screenshot or screen recording of the first interface based on the historical authorization record includes: when the historical authorization record indicates that the first application is not allowed to capture the screen, creating a screen recording proxy project, and using the created screen recording proxy project to screenshot or screen record the first interface, wherein the screen recording proxy project is used to create a virtual display screen on the first interface, and the virtual display screen is used to save the screen content of the first interface; or, when the historical authorization record indicates that the first application has been allowed to capture the screen, using the created screen recording proxy project to screenshot or screen record the first interface.
[0008] When the first application is allowed to capture the screen for the first time, it can apply to obtain the screen recording proxy project, and then the electronic device applies to create a virtual display screen, and uses the virtual display screen to save the screen content of the first interface. When the first application is allowed to capture the screen again, it does not need to create a screen recording proxy project, and can directly use the existing screen recording proxy project to create a virtual display screen, thereby simplifying the operation of screen capture that is not performed for the first time and improving the efficiency of screenshots or screen recordings.
[0009] Optionally, in another possible implementation of the first aspect, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when detecting that the virtual display screen has been created, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, it can be ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface, but only after obtaining the user's authorization, can the screen capture operation be performed normally, avoiding the situation where the screenshot or screen recording content is empty.
[0010] Optionally, in another possible implementation of the first aspect, the method further includes: when the first operation is received, putting the main thread of the first application to sleep; when the click operation is received, resuming the main thread of the first application. Since the user wants to capture the content of a specific interface, the method of putting the main thread of the first application to sleep can be used to ensure that no interface changes occur during the permission application process.
[0011] Optionally, in another possible implementation of the first aspect, in response to the user's click operation on the authorization confirmation control, historical authorization records are obtained, and screenshots or recordings are taken of the first interface based on the historical authorization records, including: starting from displaying the permission application pop-up window, when a click operation is detected within a preset time period, executing the operation of obtaining historical authorization records; when no click operation is detected until the end of the preset time period, stopping the current round of screen capture.
[0012] Among them, if the user does not choose to authorize after the permission request pop-up window is displayed for a certain period of time, the current round of screenshot or screen recording operations can be stopped by default instead of waiting for the user's authorization operation. This not only ensures the user's privacy and security, but also improves the responsiveness of the application.
[0013] Optionally, in another possible implementation of the first aspect, a countdown number is displayed on the permission application pop-up window, and the countdown number is used to prompt the user the remaining time for operating the control in the permission application pop-up window. Among them, by displaying the countdown, users can clearly know how much time they have left to make an authorization choice, thereby helping users to better manage time and avoid affecting user experience due to long waiting time.
[0014] Optionally, in another possible implementation of the first aspect, the permission application pop-up window further includes a permission cancellation control, and the authorization cancellation control is used to cancel the capture of the content of the first interface, and the method further includes: in response to a user clicking the authorization cancellation control, stopping the current round of screen capture. When a click operation is detected, it indicates that the user does not trust the first application, and at this time, screenshot or screen recording operations on the first interface are not allowed to protect the user's privacy security.
[0015] In a second aspect, an embodiment of the present application provides a screen capture device, which includes a unit composed of software and / or hardware for executing any one of the methods of the first aspect.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to implement any one of the methods of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device and includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device can implement any one of the methods of the first aspect.
[0018] Optionally, the chip system also includes a memory, and the memory is electrically connected to the processor.
[0019] Optionally, the chip system may also include a communication interface.
[0020] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device can implement any one of the methods of the first aspect.
[0021] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by an electronic device, the electronic device can implement any one of the methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 is a schematic diagram of the screen capture process;
[0024] Figure 2 It is a flowchart of a screen capture method provided in an embodiment of the present application;
[0025] Figure 3 This is a schematic diagram of the execution process of the first application performing the screen capture operation for the first time provided in an embodiment of the present application;
[0026] Figure 4 is a schematic diagram of an execution process of a screen capture operation performed by a first application not for the first time provided in an embodiment of the present application;
[0027] Figure 5 This is a schematic diagram of the execution process of user authorization provided by an embodiment of the present application;
[0028] Figure 6 is a structural schematic diagram of a screen capture device provided in an embodiment of the present application;
[0029] Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The scheme of the embodiment of the present application is introduced below with reference to the accompanying drawings.
[0031] Figure 1 is a schematic diagram of the screen capture process. Figure 1 As shown in the figure, when a user calls the screen capture operation of an application for the first time, a permission request pop-up window will be displayed. This permission request pop-up window is used to obtain user authorization. After the authorization is passed, the screenshot or screen recording operation of the application interface can be performed normally. After that, when the user calls the screen capture operation of the application again, that is, when it is not the first time to call the screen capture operation of the application, the screenshot or screen recording operation of the application interface can be performed directly without authorization again. However, this method is prone to cause privacy and security risks to users.
[0032] In view of this, an embodiment of the present application discloses a screen capture method, which mainly displays a permission request pop-up window each time the user triggers a screen capture operation, whether it is the first screen capture operation or not. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization, thereby ensuring the user's privacy.
[0033] Reference Figure 2 , shows a schematic diagram of the process of the screen capture method provided by the embodiment of the present application. Figure 2 The steps shown are introduced.
[0034] Step 201: Run a first application on an electronic device and display a first interface of the first application.
[0035] Among them, the electronic device can be terminal devices such as mobile phones, tablet computers, and laptops.
[0036] In the embodiment of the present application, the first application is an application that supports capturing or recording the current electronic device screen content. That is, the first application can capture and save the image on the current screen and store it in the form of a picture or video so that the user can record the information on the screen, share the content, or perform other purposes. The first interface is any display interface of the first application, such as the main interface, the settings interface, the content browsing interface, etc.
[0037] Step 202: In response to a first operation of the user on the screen capture control, a permission request pop-up window is displayed.
[0038] It should be noted that since screen capture involves the privacy and security of the user, the user's explicit authorization is required before executing the screenshot or screen recording operation. That is, when the user triggers the screen capture control (i.e., the first operation), a permission application pop-up window will be displayed on the screen of the electronic device to obtain the permission for the screenshot or screen recording operation.
[0039] In an embodiment of the present application, the screen capture control may be a screenshot control or a screen recording control, and the user may select a corresponding control according to actual needs to trigger the screenshot or screen recording function.
[0040] As an example, when a user wants to perform a screenshot operation, the first operation may be pressing a mechanical shortcut key combination on the electronic device. Specifically, a specific mechanical key combination may be defined for the electronic device, such as a power key and a volume down key, and when the user presses the power key and the volume down key at the same time, the screenshot operation is triggered.
[0041] As another example, when a user wants to perform a screenshot operation, the first operation may be clicking on a screenshot control in a function interface that is pulled down from the top of the screen. For example, the user may slide down on the top of the screen of the electronic device to display a second interface. The second interface may include a screenshot control. When the user clicks on the screenshot control, the screenshot operation of the electronic device is triggered.
[0042] As another example, when the user wants to perform a screen recording operation, the first operation may be clicking on a screen recording control in a function interface that is pulled down from the top of the screen. For example, the second interface may also include a screen recording control. When the user clicks on the screen recording control, the screen recording operation of the electronic device is triggered.
[0043] In an embodiment of the present application, the permission application pop-up window includes an authorization confirmation control, which is used to determine whether to intercept the content of the first interface. Correspondingly, the permission application pop-up window may also include an authorization cancellation control, which is used to cancel the interception of the content of the first interface. The user can choose to click the authorization confirmation control or the authorization cancellation control according to his or her needs and trust in the first application to decide whether to grant the screen capture permission for the first interface.
[0044] In one example, the permission request pop-up window can also display an obvious title, such as "Permission Request" or "Access to Screen Capture Permission", so that the user can quickly understand the purpose of the permission request pop-up window. The permission request pop-up window can also include some additional information, such as the name of the first application, developer information, and the purpose of permission use, to help users make decisions.
[0045] Step 203, in response to the user clicking the authorization confirmation control, obtaining historical authorization records, and taking a screenshot or recording the first interface according to the historical authorization records.
[0046] The historical authorization record is used to indicate whether the first application is allowed to perform screen capture.
[0047] It should be noted that the click operation is an operation of the user triggering the authorization confirmation control, which is used to indicate that the user confirms the authorization of the first application to perform screen capture. Correspondingly, the click operation below is an operation of the user triggering the authorization cancellation control, which is used to indicate that the user refuses authorization.
[0048] In one possible implementation, the above step 203 may include: when the historical authorization record indicates that the first application is not allowed to capture the screen, creating a screen recording proxy project, and using the created screen recording proxy project to capture or record the first interface, wherein the screen recording proxy project is used to create a virtual display screen on the first interface, and the virtual display screen is used to save the screen content of the first interface; or, when the historical authorization record indicates that the first application has been allowed to capture the screen, using the created screen recording proxy project to capture or record the first interface.
[0049] In this implementation, when the historical authorization record indicates that the first application is not allowed to perform screen capture, that is to say, the historical authorization record may be empty or there may be no historical authorization record. At this time, it means that in step 203, the first application is allowed to perform screen capture for the first time. At this time, you can apply to obtain the screen recording agent project, and then the electronic device applies to create a virtual display screen, and use the virtual display screen to save the screen content of the first interface. When the historical authorization record indicates that the first application is allowed to perform screen capture, that is to say, there may be a record that the first application has been authorized before this round of operations. At this time, it means that in step 203, the first application is not allowed to perform screen capture for the first time. At this time, there is no need to create a screen recording agent project, and the existing screen recording agent project can be used directly to create a virtual display screen, thereby simplifying the operation of non-first-time screen capture and improving the efficiency of screenshots or screen recording.
[0050] It should be noted that the screen recording proxy project is a tool or service that can capture the screen by simulating a display and a graphics environment. The screen recording proxy project can use a virtual graphics device driver to create a virtual display screen and render the content of the virtual display screen into memory, wherein the area, size, resolution, pixel format, refresh rate and other parameters of the virtual display screen are all configurable. After creating the virtual display screen, the virtual display screen can be used to capture the screen content of the first interface and perform screenshot or screen recording operations.
[0051] The following takes the Android system as an example to illustrate the above-mentioned process of executing screenshots or screen recording. When the first application performs a screen capture operation for the first time, the first application needs to first register the screen capture system service, obtain the screen capture agent, and obtain the screen recording agent project (for example, the VirtualDisplay project provided by the Android system). Then obtain the MediaProjection object through the system screen recording management module (for example, the MediaProjectionManager module) in the electronic device, and then use the MediaProjection object and call the MediaProjection.createVirtualDisplay interface to specify the parameters of the virtual display screen. Finally, the display module on the electronic device creates a virtual display screen (VirtualDisplay) for capturing the screen content of the first interface, and returns it to the first application after capturing the screen content. When the screen capture operation is not performed for the first application for the first time, there is no need to create a screen recording agent project, and the MediaProjection.createVirtualDisplay interface can be used directly to capture the screen content of the first interface.
[0052] It should be noted that the screen capture system service is a system service registered within an electronic device application. The screen capture system service can provide screen capture functions and interfaces. By obtaining the screen capture system service, the application can request screen capture permissions, use the screen capture interface to obtain screen content, and perform operations such as screen area selection, frame rate and quality control.
[0053] The system screen recording management module is a management module in an electronic device that is used to manage the screen capture function of an application. The system screen recording management module can provide an interface so that the application can request screen capture permissions. Taking the MediaProjectionManager module as an example, the MediaProjectionManager module is a management module in the Android system. The MediaProjectionManager module can perform screen capture operations by creating a MediaProjection object. The MediaProjectionManager module specifically includes functions such as screen capture permission request, screen capture permission result processing, and screen capture parameter configuration. Through the MediaProjectionManager module, the application can interact with the system screen capture function, obtain screen capture permissions, and create a MediaProjection object for screen capture. In this way, the application can use the screen capture function to perform operations such as screenshots and screen recordings.
[0054] The display module is a hardware or software component responsible for displaying images and content. The display module generally includes a display screen, a display controller, and related drivers. In an embodiment of the present application, the display module can be used to create a virtual display screen for capturing the screen content of the first interface. In this process, the first application can first determine the parameters of the virtual display screen, such as area, size, resolution, pixel format, refresh rate and other parameters, which determine the characteristics and display effect of the virtual display screen; then the application uses the interface provided by the display module to create a virtual display screen through the set parameters. The virtual display screen is equivalent to a blank canvas that can be used to draw and display the screen content; then the virtual display screen is used to capture the screen content of the first interface and render it to the virtual display screen, for example, drawing elements such as images, text, graphics, etc. on the canvas of the virtual display screen, thereby realizing the rendering of the screen content; finally, the display module returns the screen content to the first application, and the first application can obtain the rendering result (i.e., the captured screen content of the first interface) from the virtual display screen, such as an image or a video frame.
[0055] In a possible implementation, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when detecting the click operation, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, it can be ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface, but only after obtaining the user's authorization, can the screen capture operation be performed normally, avoiding the situation where the screenshot or screen recording content is empty. In addition, this embodiment facilitates the electronic device to control the time node of the screenshot or screen recording. However, when the first application performs the screen capture operation for the first time, if the screen recording proxy project is not created when the screen content is captured, that is, if the time node of the screen content is captured between the click operation and the time node of the screen recording proxy project being created, the screenshot or screen recording content will also be empty. This embodiment is applicable to the scenario where the first application performs the screen capture operation for the first time and not for the first time.
[0056] In another possible implementation, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when detecting that the virtual display screen has been created, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, the blocking of the screenshot or screen recording of the first interface is stopped only when the virtual display screen is created, which can effectively avoid the situation where the screenshot or screen recording content is empty. However, at this moment, the screen content needs to be captured through the virtual display screen in time. At this time, if the blocking is stopped first and then the screenshot or screen recording operation is performed, the timeliness is poor. This embodiment is applicable to the scenario where the first application performs the screen capture operation for the first time or not for the first time.
[0057] In another possible implementation, the method further includes: upon receiving the first operation, starting to block the screenshot or screen recording of the first interface; after detecting that the virtual display screen has been created, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, the situation where the screenshot or screen recording content is empty can be avoided to the greatest extent, but it is difficult to control the time node of the blocking in this method. This embodiment is applicable to the scenario where the first application performs the screen capture operation for the first time or not for the first time.
[0058] In another possible implementation, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when the screen recording proxy project is created, stopping blocking the screenshot or screen recording of the first interface. As long as the screen recording proxy project is created, the process of capturing the screen content and storing the screen content can be completed quickly. Through this embodiment, it is possible to avoid the situation where the screenshot or screen recording content is empty, and it is also convenient to control the time node. This embodiment is applicable to the scenario where the first application performs a screen capture operation for the first time. It should be understood that this embodiment is also applicable to the scenario where a screen recording proxy project needs to be created to complete the screenshot or screen recording regardless of whether it is the first time or not.
[0059] As an example, the above process of blocking the screenshot or screen recording of the first interface can be implemented by blocking the call of the MediaProjection.createVirtualDisplay interface.
[0060] In one implementation, the method further includes: when receiving the first operation, causing the main thread of the first application to sleep; when receiving the click operation, resuming the main thread of the first application. Since the user wants to capture the content of a specific interface, this embodiment can ensure that the interface will not change during the permission application process.
[0061] In one implementation, the above step 203 may include: starting from displaying the permission application pop-up window, when a click operation is detected within a preset time period, executing an operation of obtaining historical authorization records; when no click operation is detected until the end of the preset time period, stopping the current round of screen capture. In this embodiment, if the user does not choose to authorize after the permission application pop-up window is displayed for a certain period of time, the current round of screenshot or screen recording operations can be stopped by default instead of waiting for the user's authorization operation, which not only ensures the user's privacy and security issues, but also improves the responsiveness of the application. It should be understood that the preset time period can be set according to user needs, such as a few seconds or tens of seconds.
[0062] In one implementation, a countdown number is displayed on the permission application pop-up window, and the countdown number is used to prompt the user the remaining time to operate the controls in the permission application pop-up window. In this embodiment, by displaying the countdown, users can clearly know how much time they have to make an authorization choice, thereby helping users to better manage time and avoid affecting the user experience due to long waiting times. When the countdown ends, if the user has not made an authorization choice, canceling the screenshot or screen recording operation can provide a clear operation result. The user knows clearly that the screenshot or screen recording operation was canceled due to a timeout, and can re-operate or take other actions as needed.
[0063] In one implementation, the method further includes: in response to a user clicking on the authorization cancellation control, canceling step 203 and stopping the current round of screen capture operations. It should be noted that when a click operation is detected, it indicates that the user does not trust the first application, and screenshot or screen recording operations are not allowed on the first interface at this time to protect the user's privacy. Among them, a message canceling the screen capture operation can be displayed on the screen of the electronic device, so that the user can clearly know that the screenshot or screen recording operation has been canceled, and can re-operate or take other operations as needed.
[0064] The screen capture method provided in the above embodiment of the present application mainly ensures the privacy of the user by displaying a permission request pop-up window each time the user triggers the screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization. In addition, the blocking of the screenshot or screen recording of the first interface is blocked before the user authorizes, thereby ensuring that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining the user's authorization, thereby avoiding the situation where the screenshot or screen recording content is empty.
[0065] Figure 3 This is a schematic diagram of the execution process of the first application performing a screen capture operation for the first time provided in an embodiment of the present application.
[0066] Step 301: The user triggers a screen capture operation.
[0067] Among them, the user can trigger the screenshot operation by pressing a mechanical key on the electronic device. For another example, the user can also trigger the screenshot or screen recording operation by clicking the screenshot control or screen recording control in the function interface pulled down from the top of the screen.
[0068] Step 302: The first application obtains a screen capture system service.
[0069] Among them, in response to the first operation of the user triggering the screen capture operation, the first application first obtains the screen capture system service and the screen capture agent, and then after the user authorizes, the first application can perform the screenshot or screen recording operation through the screen capture system service.
[0070] Step 303: The first application creates and displays a permission request pop-up window.
[0071] The permission application pop-up window may include an authorization confirmation control and an authorization cancellation control, wherein the authorization confirmation control is used to confirm the content of the first interface to be captured, and the authorization cancellation control is used to cancel the content of the first interface to be captured. The user may choose to click the authorization confirmation control or the authorization cancellation control according to their needs and trust in the first application, so as to decide whether to grant the screen capture permission for the first interface.
[0072] Step 304: The user confirms whether to authorize. If yes, execute step 305; if no, execute step 306.
[0073] In one example, when the user clicks the authorization confirmation control, it means that the user allows the first application to perform the screen capture operation, then step 305 and subsequent steps 307-311 are executed; when the user clicks the authorization cancellation control, it means that the user does not allow the first application to perform the screen capture operation, then step 306 is executed, that is, the screen capture operation is canceled.
[0074] Step 305: The first application obtains the user authorization result and determines the first call of the application based on the historical authorization results, and applies for the screen recording agent project.
[0075] When the historical authorization record indicates that the first application is not allowed to perform screen capture, for example, the historical authorization record is empty or does not exist, it is determined that the first application has called the screen capture operation for the first time.
[0076] Step 306, cancel screen capture.
[0077] Among them, a message to cancel screen capture can be displayed on the screen of the electronic device, so that the user can clearly know that the screenshot or screen recording operation has been canceled, and can redo the operation or take other actions as needed.
[0078] Step 307: The system screen recording management module creates a new screen recording agent project.
[0079] It should be noted that since the first application is performing the screen capture operation for the first time, the system screen recording management module needs to create a new screen recording proxy project for subsequent screen capture or screen recording operations. If it is not the first time to perform the screen capture operation, there is no need to create a new screen recording proxy project, and the existing screen recording proxy project can be directly used to create a virtual display screen.
[0080] Step 308: The first application obtains a screen recording agent project.
[0081] Step 309: the system screen recording management module applies to create a virtual display screen.
[0082] Step 310: The display module creates a virtual display screen to store the screen content of the first interface.
[0083] Step 311: The first application obtains screen content for processing.
[0084] Figure 4 This is a schematic diagram of the execution process of a screen capture operation performed by a first application not for the first time provided in an embodiment of the present application.
[0085] Step 401: The user triggers a screen capture operation.
[0086] Among them, the user can trigger the screenshot operation by pressing a mechanical key on the electronic device. For another example, the user can also trigger the screenshot or screen recording operation by clicking the screenshot control or screen recording control in the function interface pulled down from the top of the screen.
[0087] Step 402: The system screen recording management module determines that the application is not called for the first time based on historical authorization results.
[0088] When the historical authorization record indicates that the first application is allowed to perform screen capture, for example, the first application has been authorized before the current round of operation, it is determined that the first application is not calling the screen capture operation for the first time.
[0089] Step 403: the system screen recording management module displays a pop-up window for requesting permission.
[0090] The permission application pop-up window may include an authorization confirmation control and an authorization cancellation control, wherein the authorization confirmation control is used to confirm the content of the first interface to be captured, and the authorization cancellation control is used to cancel the content of the first interface to be captured. The user may choose to click the authorization confirmation control or the authorization cancellation control according to their needs and trust in the first application, so as to decide whether to grant the screen capture permission for the first interface.
[0091] Step 404: The first application blocks the execution of screenshot or screen recording.
[0092] It should be noted that in order to ensure that unauthorized screen capture will not be performed before the user decides whether to grant the screen capture permission for the first interface, and that the screen capture operation can only be performed normally after obtaining the user's authorization, and to avoid the situation where the screenshot or screen recording content is empty, the screenshot or screen recording of the first interface can be temporarily blocked before the user authorizes. In particular, for non-first-time screen capture operations, the steps of displaying a permission application pop-up window to obtain user authorization and executing the screenshot or screen recording operation are usually asynchronous calls, which can easily result in the final screen content being empty, affecting the user experience.
[0093] In step 405, the user confirms whether to authorize. If yes, execute step 406; if not, execute steps 407 and 408.
[0094] In one example, when the user clicks the authorization confirmation control, it means that the user allows the first application to perform the screen capture operation, then step 306 and subsequent steps 408-410 are executed; when the user clicks the authorization cancellation control, it means that the user does not allow the first application to perform the screen capture operation, then steps 407 and 408 are executed, that is, the screen capture operation is canceled.
[0095] Step 406: The system screen recording management module uses the created screen recording agent project to apply for creating a virtual display screen.
[0096] Among them, since the screen capture operation is not performed for the first time, there is no need to create a new screen recording proxy project. The existing screen recording proxy project can be directly used to create a virtual display screen, thereby simplifying the operation of non-first execution of screen capture and improving the efficiency of screenshots or screen recording.
[0097] Step 407, cancel screen capture.
[0098] Step 408: The first application stops blocking the screenshot or screen recording.
[0099] It should be noted that the time point when the first application stops blocking screenshot or screen recording can be found in the relevant description below the aforementioned step 203, which will not be repeated here.
[0100] Step 409: the display module creates a virtual display screen to store the screen content of the first interface.
[0101] Step 410: The first application obtains screen content for processing.
[0102] This application Figure 3 and Figure 4The execution process of the screen capture operation provided in the illustrated embodiment is mainly to display a permission request pop-up window each time the user triggers the screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization, thereby ensuring the user's privacy. In addition, by blocking the blocking of the screenshot or screen recording of the first interface before the user authorizes, it is ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining the user's authorization, avoiding the situation where the screenshot or screen recording content is empty.
[0103] Figure 5 FIG. 1 is a schematic diagram of the execution process of user authorization in an embodiment of the present application. Figure 5 As shown, interface 501 is an interface of the first application (an example of the first interface) when the user triggers the screenshot capture operation. When the screenshot capture operation is triggered, a permission application pop-up window will be displayed, and the permission application pop-up window will display an authorization confirmation control and an authorization cancellation control, as shown in interface 502. Assuming that the user clicks the authorization confirmation control on interface 502, it means that the user confirms that the first application can perform screen capture, as shown in interface 503; assuming that the user clicks the authorization cancellation control on interface 502, it means that the user refuses authorization, and the screen capture is canceled, as shown in interface 504.
[0104] The above mainly introduces the method of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence, these steps are not necessarily performed in sequence in the order shown in the figure. Unless clearly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the steps or stages in other steps. The device of the embodiment of the present application is introduced below in conjunction with the accompanying drawings.
[0105] Figure 6 FIG. 1 is a schematic diagram of the structure of a screen capture device according to an embodiment of the present application. For the sake of convenience, only the parts related to the embodiment of the present application are shown. Figure 6As shown, the screen capture device 600 includes a processing unit 601 and a display unit 602. The screen capture device 600 can be integrated in an electronic device such as a mobile phone, a tablet computer, a laptop computer, etc. For another example, the screen capture device 600 can also be used to perform Figure 3 and Figure 4 The first application, the system screen recording management module and the display module perform the steps, and receive the user's operation and respond. The device screen capture device 600 can also be used to perform Figure 5 The process shown.
[0106] In one implementation, the screen capture device 600 may further include a storage unit for storing relevant data. The storage unit may be integrated in any one of the above units, or may be a unit independent of all the above units.
[0107] The screen capture device provided in the above-mentioned embodiment of the present application mainly displays a permission request pop-up window each time the user triggers the screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization, thereby ensuring the user's privacy. In addition, it also blocks the blocking of the screenshot or screen recording of the first interface before the user authorizes, thereby ensuring that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining the user's authorization, thereby avoiding the situation where the screenshot or screen recording content is empty.
[0108] Figure 7 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Figure 7As shown, the electronic device 700 may include a processor 710, an external memory interface 720, an internal memory 721, a universal serial bus (USB) interface 730, a charging management module 740, a power management module 741, a battery 742, an antenna 1, an antenna 2, a mobile communication module 750, a wireless communication module 760, an audio module 770, a speaker 770A, a receiver 770B, a microphone 770C, an earphone interface 770D, a sensor module 780, a button 790, a motor 791, an indicator 792, a camera 793, a display screen 794, and a subscriber identification module (SIM) card interface 795, etc. Among them, the sensor module 780 may include a pressure sensor 780A, a gyroscope sensor 780B, an air pressure sensor 780C, a magnetic sensor 780D, an acceleration sensor 780E, a distance sensor 780F, a proximity light sensor 780G, a fingerprint sensor 780H, a temperature sensor 780J, a touch sensor 780K, an ambient light sensor 780L, a bone conduction sensor 780M, etc.
[0109] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0110] For example, Figure 7 The processor 710 shown may include one or more processing units, for example, the processor 710 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0111] The controller may be the nerve center and command center of the electronic device 700. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0112] The processor 710 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 710 is a cache memory. The memory may store instructions or data that the processor 710 has just used or cyclically used. If the processor 710 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 710, and thus improves the efficiency of the system.
[0113] In some embodiments, the MIPI interface can be used to connect the processor 710 with peripheral devices such as the display screen 794 and the camera 793. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. The processor 710 and the display screen 794 communicate through the DSI interface to realize the display function of the electronic device 700.
[0114] In some embodiments, the GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. The GPIO interface can be used to connect the processor 710 with the camera 793, the display screen 794, the wireless communication module 760, the audio module 770, the sensor module 780, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0115] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0116] The electronic device 700 implements the display function through a GPU, a display screen 794, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 794 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 710 may include one or more GPUs, which execute program instructions to generate or change display information.
[0117] The display screen 794 is used to display images, videos, etc. The display screen 794 includes a display panel. In some embodiments, the electronic device 700 may include 1 or N display screens 794, where N is a positive integer greater than 1.
[0118] The internal memory 721 can be used to store computer executable program codes, which include instructions. The processor 710 executes various functional applications and data processing of the electronic device 700 by running the instructions stored in the internal memory 721. The internal memory 721 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 700 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 721 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0119] The pressure sensor 780A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 780A can be set on the display screen 794. There are many types of pressure sensors 780A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 780A, the capacitance between the electrodes changes. The electronic device 700 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 794, the electronic device 700 detects the touch operation intensity according to the pressure sensor 780A. The electronic device 700 can also calculate the touch position according to the detection signal of the pressure sensor 780A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0120] The touch sensor 780K is also called a "touch panel". The touch sensor 780K can be set on the display screen 794, and the touch sensor 780K and the display screen 794 form a touch screen, also called a "touch screen". The touch sensor 780K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 794. In other embodiments, the touch sensor 780K can also be set on the surface of the electronic device 700, which is different from the position of the display screen 794.
[0121] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0122] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0123] The embodiment of the present application also provides an electronic device, which includes: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, wherein the one or more processors execute the computer program so that the electronic device can implement the steps in any of the above methods. The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by the electronic device, the steps in each of the above method embodiments can be implemented.
[0124] The computer-readable medium may include at least: any entity or device capable of carrying computer program codes to a camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable medium cannot be an electric carrier signal or a telecommunication signal.
[0125] The present application embodiment provides a computer program product, which includes a computer program, and when the computer program is executed by an electronic device, the steps in the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.
[0126] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0127] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0130] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0131] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0132] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0133] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0134] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A screen capture method, characterized in that: include: Running a first application on the electronic device and displaying a first interface of the first application; In response to a first operation of the user on the screen capture control, displaying a permission application pop-up window, wherein the permission application pop-up window includes an authorization confirmation control, and the authorization confirmation control is used to determine the content of the first interface to be captured; In response to a user clicking operation on the authorization confirmation control, a historical authorization record is obtained, and a screenshot or screen recording is performed on the first interface according to the historical authorization record, wherein the historical authorization record is used to indicate whether the first application allows screen capture.
2. The screen capture method according to claim 1, characterized in that: The taking a screenshot or recording a screen of the first interface according to the historical authorization record includes: When the historical authorization record indicates that the first application is not allowed to perform screen capture, create a screen recording proxy project, and use the created screen recording proxy project to take a screenshot or record the first interface, wherein the screen recording proxy project is used to create a virtual display screen on the first interface, and the virtual display screen is used to save the screen content of the first interface; or When the historical authorization record indicates that the first application has been allowed to perform screen capture, the first interface is captured or recorded using the created screen recording agent project.
3. The screen capture method according to claim 2, characterized in that: The method further comprises: When receiving the first operation, starting to block screenshot or screen recording of the first interface; When it is detected that the virtual display screen is created, blocking of the screenshot or screen recording of the first interface is stopped.
4. The screen capture method according to claim 1, characterized in that: The method further comprises: When receiving the first operation, causing the main thread of the first application to sleep; When the click operation is received, the main thread of the first application is resumed.
5. The screen capture method according to claim 1, characterized in that: The step of obtaining a historical authorization record in response to a user clicking on the authorization confirmation control, and taking a screenshot or recording a screen of the first interface according to the historical authorization record includes: Starting from displaying the permission application pop-up window, when the click operation is detected within a preset time period, an operation of obtaining historical authorization records is performed; When the click operation is not detected until the preset time period ends, the current round of screen capture is stopped.
6. The screen capture method according to claim 1, characterized in that: A countdown number is displayed on the permission application pop-up window, and the countdown number is used to prompt the user of the remaining time for operating the controls in the permission application pop-up window.
7. The screen capture method according to any one of claims 1 to 6, characterized in that: The permission application pop-up window also includes a permission cancellation control, and the authorization cancellation control is used to cancel the interception of the content of the first interface. The method also includes: In response to the user clicking the authorization cancellation control, the current round of screen capture is stopped.
8. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 7.
9. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, cause the electronic device to perform the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Screen capturing method and screen capturing device as well as electronic device
CN104407804A
Authority granting method and device, electronic equipment and readable storage medium
CN112733097A
Page screenshot method and device, computer equipment and storage medium
CN117093386A
Webpage screen recording method, webpage screen recording device, equipment and storage medium
CN117119246A
Content delivery methods, servers, and terminal programs
JP5311525B1
