Screen projection method, screen projection resolution adjusting method and device and electronic equipment

By creating a virtual screen with a lower resolution than the target, the method addresses hardware encoding and decoding limitations in screen mirroring, ensuring successful mirroring and maintaining application layout integrity.

CN120321448APending Publication Date: 2025-07-15VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510552560.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

During the screen projection process, due to the limited hardware encoding and decoding capabilities of the screen projection source and target ends, the screen projection fails when the screen projection resolution exceeds the device capability.

Method used

During the screen projection process, create a virtual screen with a resolution smaller than the target resolution, display the target interface in the virtual screen, and send it to the target device, so as to achieve screen projection operation by reducing the resolution of the screen projection content.

Benefits of technology

It avoids screen projection failure due to insufficient hardware encoding and decoding capabilities, supports the coexistence of normal screen projection and other functions of multiple application windows, is compatible with old and new platforms, and solves the problem of limited screen projection of mid- and low-end devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321448A_ABST
    Figure CN120321448A_ABST
Patent Text Reader

Abstract

The invention discloses a screen projection method, a screen projection resolution adjusting method and device and electronic equipment, and belongs to the technical field of communication. The screen projection method comprises the steps that under the condition that first electronic equipment is connected with second electronic equipment, the screen projection resolution of a target interface of the first electronic equipment is acquired; under the condition that the screen projection resolution is greater than a target resolution, creating a first virtual screen and displaying the target interface in the first virtual screen; the resolution of the first virtual screen is smaller than the target resolution; and sending the target interface displayed by the first virtual screen to the second electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technologies, and particularly relates to a screen mirroring method, a screen mirroring resolution adjustment method, a device, and an electronic device. Background Art

[0002] Currently, the screen mirroring function has become an essential basic function of intelligent devices. During the screen mirroring process of mobile terminal users, mirror screen mirroring creates a virtual screen mirror with the resolution of the source device, copies the content of its main screen, encodes the screen content, and then transmits it to the peer device for screen mirroring display. Application window screen mirroring creates a virtual screen with the resolution of the screen mirroring display device, displays the specified application on the background virtual screen, encodes and records the content of the screen, and then streams it to the peer device and creates a new window for display. The encoding and decoding resources required for multiple application screen mirroring windows are cumulative.

[0003] However, since the hardware encoding and decoding capabilities of the screen mirroring source device and the screen mirroring target device are limited, when the screen mirroring source device needs to mirror the main screen or certain applications to another screen mirroring target device, if one of the devices cannot encode or decode the screen mirroring information according to the currently set resolution, the screen mirroring will fail. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a screen mirroring method, a screen mirroring resolution adjustment method, a device, and an electronic device, which can solve the problem that the current screen mirroring function fails due to the hardware encoding and decoding capabilities of the screen mirroring or the screen mirroring target device.

[0005] In a first aspect, the embodiments of this application provide a screen mirroring method, which is executed by a first electronic device. The method includes:

[0006] When the first electronic device is connected to the second electronic device, obtain the screen mirroring resolution of the target interface of the first electronic device;

[0007] When the screen mirroring resolution is greater than the target resolution, create a first virtual screen and display the target interface in the first virtual screen; the resolution of the first virtual screen is less than the target resolution;

[0008] Send the target interface displayed on the first virtual screen to the second electronic device.

[0009] In a second aspect, the embodiments of this application provide a screen mirroring resolution adjustment method, which is executed by a third electronic device. The method includes:

[0010] During the process of the fourth electronic device displaying the screen mirroring content of the third electronic device, monitor the first encoding and decoding resources of the third electronic device and the second encoding and decoding resources of the fourth electronic device;

[0011] In the case where the first codec resource and / or the second codec resource changes, adjust the resolution of the screen projection content according to the changed codec resource.

[0012] In a third aspect, an embodiment of the present application provides a screen projection device, which is applied to a first electronic device. The device includes:

[0013] A first acquisition module, configured to acquire the screen projection resolution of a target interface of the first electronic device when the first electronic device is connected to a second electronic device;

[0014] A first processing module, configured to create a first virtual screen and display the target interface in the first virtual screen when the screen projection resolution is greater than the target resolution; the resolution of the first virtual screen is less than the target resolution;

[0015] A first sending module, configured to send the target interface displayed on the first virtual screen to the second electronic device.

[0016] In a fourth aspect, an embodiment of the present application provides a screen projection resolution adjustment device, which is applied to a first electronic device. The device includes:

[0017] A monitoring module, configured to monitor a first codec resource of a third electronic device and a second codec resource of a fourth electronic device during the process that the fourth electronic device displays the screen projection content of the third electronic device;

[0018] An adjustment module, configured to adjust the resolution of the screen projection content according to the changed codec resource in the case where the first codec resource and / or the second codec resource changes.

[0019] In a fifth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented.

[0020] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented.

[0021] In a seventh aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a program or instruction to implement the method described in the first aspect, or implement the method described in the second aspect.

[0022] In an eighth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect or to implement the method described in the second aspect.

[0023] In an embodiment of the present application, when the screen mirroring resolution of the target interface exceeds the target resolution corresponding to the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored, a first virtual screen with a resolution smaller than the target resolution is created, the target interface is displayed in the first virtual screen, and the target interface displayed on the first virtual screen is sent to a second electronic device. Thus, by reducing the resolution of the screen mirroring content to implement the screen mirroring operation of the target interface, the problem of screen mirroring failure caused by the screen mirroring resolution exceeding the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A flowchart showing the steps of the screen mirroring method provided by an embodiment of the present application;

[0025] Figure 2 A flowchart showing the steps of the screen mirroring resolution adjustment method provided by an embodiment of the present application;

[0026] Figure 3 A schematic structural diagram of the screen mirroring device provided by an embodiment of the present application;

[0027] Figure 4 A schematic structural diagram of the screen mirroring resolution adjustment device provided by an embodiment of the present application;

[0028] Figure 5 One of the schematic structural diagrams of the electronic device provided by an embodiment of the present application;

[0029] Figure 6 Another schematic structural diagram of the electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0030] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application fall within the scope of protection of the present application.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The screen projection method and the screen projection resolution adjustment method provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0033] like Figure 1 As shown, an embodiment of the present application provides a screen projection method, which is performed by a first electronic device, and the screen projection method includes:

[0034] Step 101, when a first electronic device is connected to a second electronic device, obtaining a projection resolution of a target interface of the first electronic device;

[0035] In this step, the target interface includes: a main screen interface of the first electronic device; or a running interface of one or more target applications in the first electronic device.

[0036] In one implementation, when the target interface is the main screen interface, the screen projection scene can be called a mirror projection scene, and mirror projection can be understood as projecting the physical screen display content of the current device; in another implementation, when the target interface is the running interface of one or more target applications, the screen projection scene can be called an application window projection scene, and application window projection can be understood as projecting the target application of the current device.

[0037] Optionally, in a mirror projection scenario, the projection resolution of the target interface is the resolution of the main screen interface, or a pre-set resolution, or a user-specified resolution.

[0038] Optionally, in the application window projection scenario, the projection resolution of the target interface is the resolution of the second electronic device, or a pre-set resolution, or a user-specified resolution.

[0039] Step 102: when the projection screen resolution is greater than the target resolution, create a first virtual screen and display the target interface on the first virtual screen; the resolution of the first virtual screen is less than the target resolution;

[0040] In this step, the case where the screen mirroring resolution is greater than the target resolution can be understood as the current screen mirroring function being restricted, that is, if screen mirroring is performed according to the screen mirroring resolution of the interface to be screen mirrored, screen mirroring will fail. The target resolution is the resolution related to the hardware encoding and decoding capabilities of the screen mirroring or the device to be screen mirrored. The resolution of the first virtual screen created in the embodiment of the present application is less than the target resolution, and the encoder of the first electronic device encodes the display content of the first virtual screen for screen mirroring, thereby reducing the resolution of the screen mirrored content to achieve successful screen mirroring.

[0041] Optionally, assuming that the resolution of the first virtual screen is the first resolution, the first virtual screen mirror-displays the target interface according to the first resolution.

[0042] Step 103, send the target interface displayed on the first virtual screen to the second electronic device.

[0043] Optionally, the encoder of the first electronic device encodes the display content (i.e., the target interface) of the first virtual screen and then sends it to the second electronic device.

[0044] In the embodiment of the present application, the encoding resolution corresponding to screen mirroring is reduced through the mirror scaling characteristics between multiple screens (i.e., between the main screen and the first virtual screen), and it does not depend on the chip hardware and supports new and old devices across all platforms; at the same time, it can solve the problem that the screen mirroring resolution exceeds the target resolution, resulting in the inability of the first electronic device or the second electronic device to encode and decode.

[0045] In some embodiments of the present application, the target resolution is the smaller resolution between the maximum resolution supported by the first electronic device and the maximum resolution supported by the second electronic device.

[0046] In an optional embodiment of the present application, for the mirror screen mirroring scenario, the first virtual screen is a virtual screen that is reduced in proportion to the main screen resolution. The first virtual screen mirror-copies the display content of the main screen, thereby reducing the display content of the main screen and displaying it on the first virtual screen, and using the encoder to encode the first virtual screen to achieve the effect of reducing the screen mirroring resolution.

[0047] In one implementation, the method further includes:

[0048] Determine the aspect ratio of the resolution of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein, the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device;

[0049] Determine the resolution of the first virtual screen according to the aspect ratio of the resolution of the first virtual screen and the target resolution.

[0050] Optionally, the aspect ratio of the resolution of the first virtual screen is equal to the aspect ratio of the screen mirroring resolution.

[0051] For example, for the mirror screen mirroring scenario, a first virtual screen that is reduced in proportion to the main screen resolution is created to mirror and display the content of the main screen.

[0052] As an optional embodiment, determining the resolution of the first virtual screen according to the aspect ratio of the resolution of the first virtual screen and the target resolution includes:

[0053] Determine a first value range of the height of the resolution of the first virtual screen according to the first formula;

[0054] Determine a second value range of the height of the resolution of the first virtual screen according to the second formula;

[0055] Determine that the value of the height of the resolution of the first virtual screen is any value in the intersection of the first value range and the second value range;

[0056] According to the value of the height of the resolution of the first virtual screen and the aspect ratio of the resolution of the first virtual screen, determine the value of the width of the resolution of the first virtual screen; where

[0057] The first formula is: X <= h; the second formula is: X <= 1 / n * w;

[0058] Where X is the height of the resolution of the first virtual screen; h is the height of the target resolution; w is the width of the target resolution; n is the aspect ratio of the resolution of the first virtual screen.

[0059] In one implementation, if the width of the main screen resolution is W and the height is H, then the aspect ratio of the first virtual screen is W / H, so n = W / H. The first formula is used to limit the height X of the resolution of the first virtual screen to be less than the height h of the target resolution, that is: X <= h; the second formula is used to limit the width Y of the resolution of the first virtual screen to be less than the width w of the target resolution, that is Y <= w. Since the aspect ratio of the resolution of the first virtual screen is n, then Y / X = n, so Y = n * X, that is n * X <= w, so X <= 1 / n * w. Further, taking the intersection of the first value range and the second value range, the value of X can be the maximum value of this intersection, and the value of Y is X * n. Using the above method, the screen mirroring resolution of the mirror screen mirroring can be reduced from H * W to X * Y, thus achieving the effect of reducing the screen mirroring resolution.

[0060] In another alternative embodiment of the present application, for the scenario of casting an application window to a screen, when casting an application, a second virtual screen is created according to the resolution of the second electronic device, and the target application is displayed on the second virtual screen. Then, a first virtual screen is created, and its resolution is proportionally reduced compared to the resolution of the second virtual screen. When casting the screen, the encoder encodes the display content of the first virtual screen, thereby achieving the effect of proportionally scaling the screen and reducing the resolution.

[0061] In one implementation manner, when the interface to be cast is the running interface of one or more target applications in the first electronic device,

[0062] Before creating the first virtual screen and displaying the interface to be cast on the first virtual screen, the method further includes:

[0063] Creating a second virtual screen and displaying the running interface of the target application on the second virtual screen; wherein, the resolution of the second virtual screen is the same as the casting resolution;

[0064] Displaying the target interface on the first virtual screen includes:

[0065] Mirroring and displaying the target application displayed on the second virtual screen on the first virtual screen.

[0066] In the embodiment of the present application, the screen is scaled by using mirror mapping of the screen, separating the screen recorded by the encoder of the first electronic device from the screen on which the application is displayed and run, and binding the encoder to the first virtual screen with the reduced resolution, thereby achieving the purpose of reducing the casting resolution while ensuring the normal display of the application layout.

[0067] Among them, casting an application window means moving the specified application from the main screen to a newly created virtual screen for display, thereby achieving the effect of casting with different displays, and multiple virtual screens can be opened for casting multiple applications. This function is independent of mirror casting. Each time an application casting is enabled, new encoding and decoding resources are occupied, and are released when closed. The resolution of the virtual screen for application casting is generally the same as or a specified resolution of the display device.

[0068] Correspondingly, when the target interface is the running interface of multiple target applications in the first electronic device,

[0069] The first virtual full screen includes: first virtual screens corresponding to each target application respectively; the second virtual screen includes: second virtual screens corresponding to each target application respectively.

[0070] As an alternative embodiment, the method further includes:

[0071] Determine the aspect ratio of the resolution of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein, the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device;

[0072] Determine the resolution of the first virtual screen according to the aspect ratio of the resolution of the first virtual screen and the target resolution.

[0073] Optionally, the aspect ratio of the resolution of the first virtual screen is equal to the aspect ratio of the screen mirroring resolution.

[0074] For example, for the application window screen mirroring scenario, create a second virtual screen with the same resolution as the second electronic device, and display the target application on the second virtual screen; then create a first virtual screen with a proportionally reduced resolution to mirror the content of the second virtual screen.

[0075] As an optional embodiment, the determining the resolution of the first virtual screen according to the aspect ratio of the resolution of the first virtual screen and the target resolution includes:

[0076] Determine the first value range of the height of the resolution of the first virtual screen according to the first formula;

[0077] Determine the second value range of the height of the resolution of the first virtual screen according to the second formula;

[0078] Determine that the value of the height of the resolution of the first virtual screen is any value in the intersection of the first value range and the second value range;

[0079] Determine the value of the width of the resolution of the first virtual screen according to the value of the height of the resolution of the first virtual screen and the aspect ratio of the resolution of the first virtual screen; wherein,

[0080] The first formula is: X <= h; the second formula is: X <= 1 / n * w;

[0081] Wherein, X is the height of the resolution of the first virtual screen; h is the height of the target resolution; w is the width of the target resolution; n is the aspect ratio of the resolution of the first virtual screen.

[0082] In one implementation, if the width of the resolution of the second electronic device is A and the height is B, then the aspect ratio of the width to the height of the first virtual screen is A / B, and n = A / B. First, create a second virtual screen with the same resolution and pixel density as the second electronic device, and move the target application to be displayed on this second virtual screen; then create a first virtual screen (with a resolution of height X and width Y), where the aspect ratio of the width to the height of the first virtual screen is the same as that of the second virtual screen. Among them, the first formula is used to limit the height X of the resolution of the first virtual screen to be less than the height h of the target resolution, that is: X <= h; the second formula is used to limit the width Y of the resolution of the first virtual screen to be less than the width w of the target resolution, that is Y <= w. Since the aspect ratio of the width to the height of the resolution of the first virtual screen is n, then A / B = n, so Y = n * X, that is n * X <= w, so X <= 1 / n * w. Further, take the intersection of the first value range and the second value range, then the value of X can be the maximum value of this intersection, and the value of Y is X * n. Using the above method, the screen mirroring resolution can be reduced from H * W to X * Y. After the first virtual screen is successfully created, the display content in the second virtual screen is mirror-displayed, and the first electronic device starts the encoder to encode the content of the first virtual screen at the resolution of X * Y for screen mirroring, so that the screen mirroring resolution is scaled from the original H * W to X * Y. This method can use the mirror mapping and scaling of the screen and bind the encoder to a screen with a small resolution to achieve the effect of reducing the resolution.

[0083] In at least one embodiment of the present application, the method further includes:

[0084] Obtain the hardware encoding and decoding capabilities of the first electronic device and the hardware encoding and decoding capabilities of the second electronic device;

[0085] Determine the maximum resolution supported by the first electronic device according to the hardware encoding and decoding capabilities of the first electronic device;

[0086] Determine the maximum resolution supported by the second electronic device according to the hardware encoding and decoding capabilities of the second electronic device;

[0087] Among them, the hardware encoding and decoding capabilities include at least one of the following: the maximum resolution currently supported by the device.

[0088] In the embodiment of the present application, the maximum resolution supported by the first electronic device can be understood as the maximum resolution supported by the first electronic device at the target frame rate when it is idle, or the maximum resolution currently supported by the first electronic device, which is not specifically limited here. The maximum resolution supported by the second electronic device is the maximum resolution supported by the second electronic device at the target frame rate when it is idle, or the maximum resolution currently supported by the second electronic device, which is not specifically limited here.

[0089] In summary, in the embodiment of the present application, when the screen mirroring resolution of the target interface exceeds the target resolution corresponding to the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored, a first virtual screen with a resolution smaller than the target resolution is created, the target interface is displayed in the first virtual screen, and the target interface displayed on the first virtual screen is sent to the second electronic device. Therefore, by reducing the resolution of the screen mirroring content to implement the screen mirroring operation of the target interface, the problem of screen mirroring failure caused by the screen mirroring resolution exceeding the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored can be avoided.

[0090] The screen mirroring method provided by the embodiment of the present application can still perform normal screen mirroring when the hardware encoding and decoding capabilities are limited, ensuring the coexistence of screen mirroring and other functions, such as screen mirroring while playing a video and the coexistence of mirroring and application window screen mirroring; and in the embodiment of the present application, by scaling the encoding resolution proportionally during screen mirroring, it supports the normal display effect of the application interface after the resolution is reduced, can be compatible with all new and old platforms, effectively solves the problem of limited and unavailable screen mirroring functions on mid - to - low - end platforms, and supports all new and old devices across the platform without relying on chip hardware; and the embodiment of the present application can solve the problem that the screen mirroring resolution exceeds the maximum encoding and decoding length supported unilaterally by the screen mirroring or the device being screen mirrored, thus making it impossible to encode and decode, and supports screen mirroring in more scenarios and devices, such as when the device screen resolution exceeds its encoding and decoding support range.

[0091] To describe the screen mirroring method provided by the embodiment of the present application more clearly, the following will be described with two examples.

[0092] Example 1, Mirror Screen Mirroring

[0093] Step 1, after the first electronic device and the second electronic device are connected, the first electronic device obtains the hardware encoding and decoding capabilities of the two devices at both ends of the screen mirroring, including the maximum encoding and decoding resolution size supported at a specified frame rate when the device is idle and the encoding and decoding resolution that the device can currently handle.

[0094] Step 2, determine whether the mirror screen mirroring resolution exceeds the smaller value of the maximum resolutions supported by the two devices at both ends; if it exceeds, execute Step 4; if it does not exceed, execute Step 3.

[0095] Step 3, create a virtual screen with the mirror screen mirroring resolution for mirror screen mirroring;

[0096] Create a virtual screen according to the above - mentioned mirror screen mirroring resolution, and mirror - copy the display content of the main screen. The resolution of this virtual screen is the same as that of the main screen; start the encoder to encode this virtual screen and then push the stream to the second electronic device; correspondingly, the second electronic device decodes and displays the screen - mirrored content.

[0097] Step 4, create a first virtual screen with a resolution of X * Y, and mirror - display the content of the main screen on this first virtual screen;

[0098] The ratio of the width W to the height H of the main screen resolution is a fixed value. The height of the smaller resolution among the maximum resolutions supported by the two devices at both ends of the screen mirroring is h, and the width is w. The aspect ratio of the first virtual screen is the same as that of the main screen resolution. Then, the height X of the resolution of the first virtual screen <= Min(H, h), and the width Y of the resolution of the first virtual screen = X * W / H <= Min(W, w), that is, X <= H / W * Min(W, w). Taking the intersection of the above two X ranges, the value can be taken as the maximum value of the intersection. The width of the virtual screen resolution is X * W / H, and the resolution of the mirror screen mirroring is finally scaled from H * W to X * Y.

[0099] Start the encoder to encode the display content of the first virtual screen for screen mirroring; finally, successfully encode the screen mirroring source data and push the stream to the second electronic device, and the second electronic device successfully decodes and performs screen mirroring display.

[0100] Example 2, Application window screen mirroring

[0101] Step 5, after the first electronic device and the second electronic device are connected, the first electronic device obtains the hardware encoding and decoding capabilities of the two devices at both ends of the screen mirroring, including the maximum encoding and decoding resolution sizes supported at a specified frame rate when the device is idle and the encoding and decoding resolutions that the device can currently handle.

[0102] Step 6, determine whether the application window screen mirroring resolution (such as the resolution of the screen mirroring target device) exceeds the smaller value among the maximum resolutions supported by the two devices at both ends; if it exceeds, execute Step 8; if it does not exceed, execute Step 7.

[0103] Step 7, if it does not exceed, perform screen mirroring according to the resolution of the second electronic device (no need to reduce the resolution for screen mirroring); specifically, create a virtual screen according to the resolution of the second electronic device, move the target application to this virtual screen for display, and then start the encoder to encode the display content of this virtual screen and then perform screen mirroring. Finally, successfully encode the screen mirroring source data and push the stream to the second electronic device, and the second electronic device successfully decodes and performs screen mirroring display.

[0104] Step 8, if it exceeds, assume that the ratio of the width A to the height B of the resolution of the second electronic device is a fixed value. The height of the smaller resolution among the maximum resolutions supported by the two devices at both ends of the screen mirroring is h, and the width is w. First, create a virtual screen 1 with the same resolution and pixel density as the second electronic device and move the application to this virtual screen 1 for display; then create a virtual screen 2 (with a resolution of height X and width Y). The aspect ratio of the resolution of virtual screen 2 is the same as that of the resolution of virtual screen 1. The height X of the virtual screen resolution <= Min(H, h), and the width of the virtual screen resolution is X * A / B <= Min(W, w), that is, X <= B / A * Min(W, w). Taking the intersection of the above two X ranges, the value can be taken as the maximum value of the intersection. The width of the virtual screen resolution is X * A / B.

[0105] After the virtual screen 2 is successfully created, display the content in the virtual screen 1. Start the encoder to encode the screen content of the virtual screen 2 at the resolution X, Y for screen mirroring, so that the screen mirroring resolution is scaled from the original H*W to X*Y; use the mirror mapping scaling of the screen and bind the encoder to the screen with a small resolution to achieve the effect of reducing the resolution.

[0106] Start the encoder to encode the display content of the virtual screen 2 for screen mirroring; finally, successfully encode the screen mirroring source data and push the stream to the second electronic device, and the second electronic device successfully decodes and displays the screen mirroring.

[0107] In the embodiment of the present application, when the screen mirroring resolution of the target interface exceeds the target resolution corresponding to the hardware encoding and decoding capabilities of the screen mirroring or the target device, a first virtual screen with a resolution smaller than the target resolution is created, and the target interface is displayed in the first virtual screen, and the target interface displayed in the first virtual screen is sent to the second electronic device, so as to realize the screen mirroring operation of the target interface by reducing the resolution of the screen mirroring content, and be able to avoid the problem of screen mirroring failure caused by the screen mirroring resolution exceeding the hardware encoding and decoding capabilities of the screen mirroring or the target device.

[0108] As Figure 2 shown, the embodiment of the present application further provides a method for adjusting the screen mirroring resolution, which is executed by a third electronic device, and the method includes:

[0109] Step 201, during the process of the fourth electronic device displaying the screen mirroring content of the third electronic device, monitor the first encoding and decoding resources of the third electronic device and the second encoding and decoding resources of the fourth electronic device;

[0110] In this step, the third electronic device monitors the remaining encoding and decoding resources of the two devices at both ends of the screen mirroring (i.e., the third electronic device and the fourth electronic device) in real time; among them, the remaining encoding and decoding resources change as functions that require the platform encoding and decoding capabilities are turned on or off at both ends of the device. For example, when the device turns on or off video playback, the encoding and decoding resources are occupied or released.

[0111] Step 202, when the first encoding and decoding resources and / or the second encoding and decoding resources change, adjust the resolution of the screen mirroring content according to the changed encoding and decoding resources.

[0112] Optionally, after the screen mirroring resolution is successfully adjusted, re-push the stream to display the screen mirroring effect.

[0113] In the embodiments of the present application, the third electronic device monitors the changes in the encoding and decoding resources of the two end devices in real time, and dynamically adjusts the resolution of mirror screen projection or multi-application window screen projection, so as to achieve the effect of resolution adjustment. Based on the dynamic resolution adjustment ability, it can support running more application window screen projections simultaneously and the coexistence ability with other services (such as video playback, etc.) during screen projection.

[0114] In at least one embodiment of the present application, step 202 includes:

[0115] In the case where the first encoding and decoding resource decreases and / or the second encoding and decoding resource decreases, adjust the resolution of the screen projection content to a resolution matching the decreased encoding and decoding resource according to the decreased encoding and decoding resource;

[0116] Or,

[0117] In the case where the first encoding and decoding resource increases and / or the second encoding and decoding resource increases, adjust the resolution of the screen projection content to a resolution matching the increased encoding and decoding resource according to the increased encoding and decoding resource.

[0118] In one implementation, when the screen projection content is the screen projection content including multiple screen projection windows, step 201 includes:

[0119] By monitoring the change situation of the number of the screen projection windows, monitor the first encoding and decoding resource of the third electronic device and the second encoding and decoding resource of the fourth electronic device;

[0120] Wherein, in the case where the number of the screen projection windows increases, determine that the first encoding and decoding resource and the second encoding and decoding resource decrease;

[0121] In the case where the number of the screen projection windows decreases, determine that the first encoding and decoding resource and the second encoding and decoding resource increase.

[0122] Optionally, after the screen projection connection is successful, the first electronic device monitors the change situation of the encoding and decoding resources of each end device in real time. After mirror screen projection or application screen projection is enabled, if the remaining encoding and decoding resources are no longer sufficient to perform application screen projection according to the screen resolution of the previous application screen projection when a new application is to be screen projected, the screen projection resolution of the new application can be set to the lowest screen projection resolution (which can be dynamically set). On this basis, the resolution of the already screen projected applications can also be adaptively adjusted as a whole.

[0123] For example, in the scenario of mirroring the application window for screen projection, determine whether the number of screen projection windows has changed; if a new application window is mirrored for screen projection and the configuration parameters such as the resolution of each application for screen projection are the same, and if the current encoding and decoding resources cannot add a new application screen projection window, adjust the resolution of all screen projection windows, and perform unified scaling adjustment according to the lowest resolution to ensure that more application screen projection windows can be supported; if the application window for screen projection is reduced and the current remaining encoding and decoding resources increase to meet the requirements for a higher resolution screen projection, adjust the resolution of all screen projection windows upward to ensure the best effect.

[0124] In summary, the screen projection resolution adjustment method provided in the embodiments of the present application can dynamically adjust the resolution of mirror screen projection or multi-application window screen projection according to the real-time changes of the encoding and decoding resources of the two devices, so as to achieve the effect of resolution adaptive adjustment. Based on the dynamic resolution adjustment ability, it can support the coexistence of more application windows for screen projection and other services (such as video playback, etc.) during screen projection, and at the same time ensure the balance between the screen projection effect and smoothness.

[0125] It should be noted that the third electronic device and the first electronic device in the embodiments of the present application can be the same electronic device, that is, after the electronic device executes the screen projection method on the first electronic device side, it continues to execute the screen projection resolution adjustment method on the third electronic device side; or, the third electronic device and the first electronic device are different electronic devices, that is, the third electronic device can perform screen projection according to the existing screen projection scheme and then continue to execute the screen projection resolution adjustment method on the third electronic device side, which is not specifically limited herein.

[0126] The screen projection method or the screen projection resolution adjustment method provided in the embodiments of the present application may be executed by a screen projection device or a screen projection resolution adjustment device. In the embodiments of the present application, taking the screen projection device or the screen projection resolution adjustment device executing the screen projection method or the screen projection resolution adjustment method as an example, the screen projection device or the screen projection resolution adjustment device provided in the embodiments of the present application is described.

[0127] As Figure 3 shown, the embodiments of the present application further provide a screen projection device 300, which is applied to the first electronic device. The device includes:

[0128] A first acquisition module 301, configured to acquire the screen projection resolution of the target interface of the first electronic device when the first electronic device is connected to the second electronic device;

[0129] A first processing module 302, configured to create a first virtual screen and display the target interface in the first virtual screen when the screen projection resolution is greater than the target resolution; the resolution of the first virtual screen is less than the target resolution;

[0130] A second sending module 303, configured to send the target interface displayed on the first virtual screen to the second electronic device.

[0131] In some embodiments of the present application, the target resolution is the smaller resolution of the maximum resolution supported by the first electronic device and the maximum resolution supported by the second electronic device.

[0132] In some embodiments of the present application, the apparatus further includes:

[0133] A first determination module, configured to determine the aspect ratio of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein, the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device;

[0134] A second determination module, configured to determine the resolution of the first virtual screen according to the aspect ratio of the first virtual screen and the target resolution.

[0135] In some embodiments of the present application, when the target interface is the running interface of one or more target applications in the first electronic device, the apparatus further includes:

[0136] A second processing module, configured to create a second virtual screen and display the running interface of the target application on the second virtual screen; wherein, the resolution of the second virtual screen is the same as the screen mirroring resolution;

[0137] The first processing module is further configured to:

[0138] Mirror and display the target application displayed on the second virtual screen in the first virtual screen.

[0139] In some embodiments of the present application, the apparatus further includes:

[0140] A second acquisition module, configured to acquire the hardware encoding and decoding capabilities of the first electronic device and the hardware encoding and decoding capabilities of the second electronic device;

[0141] A third determination module, configured to determine the maximum resolution supported by the first electronic device according to the hardware encoding and decoding capabilities of the first electronic device;

[0142] A fourth determination module, configured to determine the maximum resolution supported by the second electronic device according to the hardware encoding and decoding capabilities of the second electronic device;

[0143] Wherein, the hardware encoding and decoding capabilities include at least one of the following: the maximum resolution currently supported by the device.

[0144] In the embodiment of the present application, when the screen mirroring resolution of the target interface exceeds the target resolution corresponding to the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored, a first virtual screen with a resolution smaller than the target resolution is created, the target interface is displayed in the first virtual screen, and the target interface displayed on the first virtual screen is sent to a second electronic device, so as to implement the screen mirroring operation of the target interface by reducing the resolution of the screen mirroring content, and the problem of screen mirroring failure caused by the screen mirroring resolution exceeding the hardware encoding and decoding capabilities of the screen mirroring or the device being screen mirrored can be avoided.

[0145] It should be noted that the screen mirroring device provided in the embodiment of the present application is a device capable of executing the above screen mirroring method, so all embodiments of the above screen mirroring method are applicable to this device, and all can achieve the same or similar beneficial effects, which will not be repeated here.

[0146] As Figure 4 shown, the embodiment of the present application further provides a screen mirroring resolution adjustment device 400, which is applied to a third electronic device, and the device includes:

[0147] A monitoring module 401, configured to monitor the first encoding and decoding resources of the third electronic device and the second encoding and decoding resources of the fourth electronic device during the process of the fourth electronic device displaying the screen mirroring content of the third electronic device;

[0148] An adjustment module 402, configured to adjust the resolution of the screen mirroring content according to the changed encoding and decoding resources when the first encoding and decoding resources and / or the second encoding and decoding resources change.

[0149] In some embodiments of the present application, the adjustment module includes:

[0150] A first adjustment sub-module, configured to adjust the resolution of the screen mirroring content to a resolution matching the reduced encoding and decoding resources according to the reduced encoding and decoding resources when the first encoding and decoding resources decrease and / or the second encoding and decoding resources decrease;

[0151] And / or,

[0152] A second adjustment sub-module, configured to adjust the resolution of the screen mirroring content to a resolution matching the increased encoding and decoding resources according to the increased encoding and decoding resources when the first encoding and decoding resources increase and / or the second encoding and decoding resources increase.

[0153] In some embodiments of the present application, when the screen mirroring content is screen mirroring content including multiple screen mirroring windows, the monitoring module includes:

[0154] The monitoring sub-module is used to monitor the first codec resource of the third electronic device and the second codec resource of the fourth electronic device by monitoring the change in the number of the screen mirroring windows.

[0155] Wherein, when the number of the screen mirroring windows increases, it is determined that the first codec resource and the second codec resource decrease.

[0156] When the number of the screen mirroring windows decreases, it is determined that the first codec resource and the second codec resource increase.

[0157] The screen mirroring resolution adjustment device provided by the embodiments of the present application can dynamically adjust the resolution of the mirror screen mirroring or multi-application window screen mirroring according to the real-time changes of the codec resources of the two devices at both ends, so as to achieve the effect of resolution adaptive adjustment. Based on the resolution dynamic adjustment ability, it can support running more application window screen mirrorings simultaneously and the coexistence ability with other services (such as video playback, etc.) during screen mirroring, and at the same time ensure the balance between the screen mirroring effect and the smoothness.

[0158] It should be noted that the screen mirroring resolution adjustment device provided by the embodiments of the present application is a device capable of executing the above screen mirroring resolution adjustment method. Then, all the embodiments of the above screen mirroring resolution adjustment method are applicable to this device, and all can achieve the same or similar beneficial effects, which will not be repeated here.

[0159] The screen mirroring device or the screen mirroring resolution adjustment device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc. The embodiments of the present application do not make specific limitations.

[0160] The screen mirroring device or screen mirroring resolution adjustment device in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

[0161] The screen mirroring device or screen mirroring resolution adjustment device provided in the embodiments of the present application can implement Figures 1 to 2 each process implemented by the method embodiments. To avoid repetition, it will not be elaborated here.

[0162] Optionally, as Figure 5 shown, the embodiments of the present application further provide an electronic device 500. The electronic device 500 is the first electronic device or the third electronic device. The electronic device 500 includes a processor 501 and a memory 502. A program or instruction that can run on the processor 501 is stored on the memory 502. When the program or instruction is executed by the processor 501, it implements each step of the above screen mirroring method or screen mirroring resolution adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0163] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0164] Figure 6 It is a schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.

[0165] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610, etc.

[0166] Those skilled in the art can understand that the electronic device 600 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 610 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 6 The structure of the electronic device shown in [[ ]] does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0167] Among them, the processor 610 is used to obtain the screen mirroring resolution of the target interface of the first electronic device when the first electronic device is connected to the second electronic device;

[0168] A processor 610, configured to create a first virtual screen and display the target interface in the first virtual screen when the screen mirroring resolution is greater than the target resolution; the resolution of the first virtual screen is less than the target resolution;

[0169] The radio frequency unit 601 is further configured to send the target interface displayed on the first virtual screen to the second electronic device.

[0170] Optionally, the processor 610 is further configured to determine the aspect ratio of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device; and determine the resolution of the first virtual screen according to the aspect ratio of the first virtual screen and the target resolution.

[0171] Optionally, the processor 610 is further configured to monitor the first codec resource of the third electronic device and the second codec resource of the fourth electronic device during the process of the fourth electronic device displaying the screen mirroring content of the third electronic device; and adjust the resolution of the screen mirroring content according to the changed codec resources when the first codec resource and / or the second codec resource changes.

[0172] It should be understood that in the embodiments of the present application, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also referred to as a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. The other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0173] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 609 can include volatile memory or non-volatile memory, or the memory 609 can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 609 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0174] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 610 either.

[0175] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned screen mirroring method or the screen mirroring resolution adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0176] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0177] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above-mentioned screen mirroring method or the embodiment of the screen mirroring resolution adjustment method, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0178] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0179] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above-mentioned screen mirroring method or the embodiment of the screen mirroring resolution adjustment method, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0180] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described method may be executed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.

[0181] Through the description of the above embodiments, those skilled in the art can clearly understand that the above method of the embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0182] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. A screen mirroring method, characterized in that, Executed by a first electronic device, the method includes: When the first electronic device is connected to a second electronic device, obtain the screen mirroring resolution of a target interface of the first electronic device; When the screen mirroring resolution is greater than a target resolution, create a first virtual screen and display the target interface in the first virtual screen; the resolution of the first virtual screen is less than the target resolution; Send the target interface displayed on the first virtual screen to the second electronic device.

2. The method according to claim 1, wherein The target resolution is the smaller resolution between the maximum resolution supported by the first electronic device and the maximum resolution supported by the second electronic device.

3. The method according to claim 1, wherein The method further includes: Determine the aspect ratio of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein, the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device; Determine the resolution of the first virtual screen according to the aspect ratio of the first virtual screen and the target resolution.

4. The method according to claim 3, characterized in that When the target interface is the running interface of one or more target applications in the first electronic device, Before creating the first virtual screen and displaying the target interface in the first virtual screen, the method further includes: Create a second virtual screen and display the running interface of the target application on the second virtual screen; wherein, the resolution of the second virtual screen is the same as the screen mirroring resolution; The displaying the target interface in the first virtual screen includes: Mirror-display the target application displayed in the second virtual screen in the first virtual screen.

5. The method according to claim 1, wherein The method further includes: Obtain the hardware encoding and decoding capabilities of the first electronic device and the hardware encoding and decoding capabilities of the second electronic device; Determine the maximum resolution supported by the first electronic device according to the hardware encoding and decoding capabilities of the first electronic device; Determine the maximum resolution supported by the second electronic device according to the hardware encoding and decoding capabilities of the second electronic device; Wherein, the hardware encoding and decoding capabilities include: the maximum resolution currently supported by the device.

6. A method for adjusting the screen mirroring resolution, characterized in that, Executed by a third electronic device, the method includes: During the process of the fourth electronic device displaying the screen mirroring content of the third electronic device, monitor the first encoding and decoding resources of the third electronic device and the second encoding and decoding resources of the fourth electronic device; When the first encoding and decoding resources and / or the second encoding and decoding resources change, adjust the resolution of the screen mirroring content according to the changed encoding and decoding resources.

7. The method according to claim 6, characterized in that, When the first encoding and decoding resources and / or the second encoding and decoding resources change, adjusting the resolution of the screen mirroring content according to the changed encoding and decoding resources includes: When the first encoding and decoding resources decrease and / or the second encoding and decoding resources decrease, adjust the resolution of the screen mirroring content to a resolution matching the decreased encoding and decoding resources according to the decreased encoding and decoding resources; Or, In the case of an increase in the first codec resource and / or the second codec resource, adjust the resolution of the screen mirroring content to a resolution matching the increased codec resource according to the increased codec resource.

8. The method according to claim 6 or 7, characterized in that When the screen mirroring content is the screen mirroring content including a plurality of screen mirroring windows, the monitoring of the first codec resource of the third electronic device and the second codec resource of the fourth electronic device includes: Monitoring the first codec resource of the third electronic device and the second codec resource of the fourth electronic device by monitoring the change in the number of the screen mirroring windows; Wherein, when the number of the screen mirroring windows increases, it is determined that the first codec resource and the second codec resource decrease; when the number of the screen mirroring windows decreases, it is determined that the first codec resource and the second codec resource increase.

9. A screen mirroring device, characterized in that, Applied to a first electronic device, the apparatus includes: A first acquisition module, configured to acquire the screen mirroring resolution of a target interface of the first electronic device when the first electronic device is connected to a second electronic device; A first processing module, configured to create a first virtual screen and display the target interface in the first virtual screen when the screen mirroring resolution is greater than the target resolution; the resolution of the first virtual screen is less than the target resolution; A first sending module, configured to send the target interface displayed on the first virtual screen to the second electronic device.

10. The device according to claim 9, characterized in that The apparatus further includes: A first determination module, configured to determine the aspect ratio of the first virtual screen according to the aspect ratio of the screen mirroring resolution; wherein the screen mirroring resolution is the resolution of the first electronic device, or a preset resolution, or the resolution of the second electronic device; A second determination module, configured to determine the resolution of the first virtual screen according to the aspect ratio of the first virtual screen and the target resolution.

11. The device according to claim 10, characterized in that, The apparatus further includes: A second processing module, configured to create a second virtual screen and display the running interface of the target application on the second virtual screen; wherein the resolution of the second virtual screen is the same as the screen mirroring resolution; The first processing module is further configured to: mirror-display the target application displayed in the second virtual screen in the first virtual screen.

12. The device according to claim 9, characterized in that, The apparatus further includes: A second acquisition module, configured to acquire the hardware codec capabilities of the first electronic device and the hardware codec capabilities of the second electronic device; A third determination module, configured to determine the maximum resolution supported by the first electronic device according to the hardware codec capabilities of the first electronic device; A fourth determination module, configured to determine the maximum resolution supported by the second electronic device according to the hardware codec capabilities of the second electronic device; Wherein, the hardware codec capabilities include: the maximum resolution currently supported by the device.

13. A screen mirroring resolution adjustment device, characterized in that Applied to a third electronic device, the apparatus includes: A monitoring module, configured to monitor the first codec resource of the third electronic device and the second codec resource of the fourth electronic device during the process that the fourth electronic device displays the screen mirroring content of the third electronic device; An adjustment module, configured to adjust the resolution of the screen mirroring content according to the changed codec resources when the first codec resource and / or the second codec resource changes.

14. The device according to claim 13, characterized in that The adjustment module includes: A first adjustment sub-module, configured to adjust the resolution of the screen mirroring content to a resolution matching the reduced codec resources according to the reduced codec resources when the first codec resource decreases and / or the second codec resource decreases; Or, A second adjustment sub-module, configured to adjust the resolution of the screen mirroring content to a resolution matching the increased codec resources according to the increased codec resources when the first codec resource increases and / or the second codec resource increases.

15. The device according to claim 13 or 14, characterized in that, When the screen mirroring content includes screen mirroring content with multiple screen mirroring windows, the monitoring module includes: A monitoring sub-module, configured to monitor the first codec resource of the third electronic device and the second codec resource of the fourth electronic device by monitoring the change in the number of the screen mirroring windows; Wherein, when the number of the screen mirroring windows increases, it is determined that the first codec resource and the second codec resource decrease; when the number of the screen mirroring windows decreases, it is determined that the first codec resource and the second codec resource increase.

16. An electronic device, characterized in that, It includes a processor and a memory, the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, the steps of the screen mirroring method described in any one of claims 1-5 are implemented, or the screen mirroring resolution adjustment method described in any one of claims 6-8 is implemented.