Screen projection method, electronic equipment and computer readable storage medium

By recording device identification information in the storage file and rejecting repeated screen mirroring requests, combined with the screen mirroring link disconnection keep-alive control link, the screen mirroring interruption problem caused by automatic device reconnection is solved, improving the reliability and stability of screen mirroring switching, and enabling flexible configuration while being compatible with different component versions.

CN121531491APending Publication Date: 2026-02-13SHANGHAI PATEO ELECTRONIC EQUIPMENT MANUFACTURING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511974902.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

During the screen mirroring switching between devices, the automatic reconnection of disconnected devices forces the screen mirroring content to be interrupted, reducing the user experience.

Method used

By writing the identification information of the first device into the storage file, the screen mirroring request initiated by it is rejected again. Combined with the disconnection of the screen mirroring link and the keep-alive control link, the ability to exchange control commands between devices is maintained, and the screen mirroring link can be quickly rebuilt.

Benefits of technology

It improves the reliability and stability of screen casting switching, ensures that screen casting connection meets user expectations, reduces the coupling between components, is compatible with different baseline versions of screen casting components, and enables flexible configuration and iterative optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121531491A_ABST
    Figure CN121531491A_ABST
Patent Text Reader

Abstract

The invention provides a screen projection method, electronic equipment and a computer readable storage medium, and the method comprises the steps: in the case of establishing a wireless screen projection connection with first equipment, responding to a screen projection request of second equipment, writing the identification information of the first equipment into a storage file, and disconnecting the screen projection connection of the first equipment through a first component; and in response to the screen projection request initiated by the first device again, controlling the first component to reject the screen projection request of the first device based on the storage file. Therefore, the problem that the projection screen content of the second equipment is forced to be interrupted due to the abnormal reconnection of the first equipment is effectively solved, the reliability and the stability of projection screen switching are improved, and the projection screen connection is ensured to conform to the user expectation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to wireless communication technology, in particular to a screen projection method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Wireless screen projection technology, as a core technology for media content sharing between smart devices, has been widely used in home entertainment, car entertainment, business demonstration and education collaboration scenarios.

[0003] Currently, in the process of screen projection switching between devices, the phenomenon of automatic reconnection of the device that has disconnected the screen projection connection may occur, thereby causing the current screen projection content to be forced to be interrupted, and reducing the user experience. SUMMARY

[0004] An embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein in the case of establishing a wireless screen projection connection with a first device, if a screen projection request of a second device is received, the identification information of the first device is written into a storage file, and if the first device initiates a screen projection connection request again subsequently, the screen projection request can be rejected according to the stored device identification information, effectively solving the problem that the screen projection content of the second device is forced to be interrupted due to abnormal reconnection of the first device, improving the reliability and stability of screen projection switching, and ensuring that the screen projection connection meets the user's expectation.

[0005] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein when a screen projection connection disconnection operation is performed, the processing mode of disconnecting the screen projection link to control the link is adopted, which can not only realize screen projection switching, but also maintain the control instruction interaction capability between devices relying on the control link in the keep-alive state, support subsequent rapid reconstruction of the screen projection link, and realize seamless screen projection switching.

[0006] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein for the first reason of fragmentation of the operating system of the first device and / or the second reason of the mismatch between the hardware and the operating system of the first device, which causes the first device to initiate a screen projection request again after screen projection switching, the screen projection request can be rejected according to the stored device identification information, effectively solving the problem that the screen projection content of the second device is forced to be interrupted due to abnormal reconnection of the first device, improving the reliability and stability of screen projection switching.

[0007] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein the first component and the second component are designed to be functionally decoupled, so that the first component and the second component independently bear the screen projection connection service and the screen projection device management service respectively. When the first device initiates a screen projection request again, the first component sends the identification information of the second device to the second component to trigger the second component to perform a query on the storage file and return a screen projection rejection identifier. The first component rejects the screen projection request of the first device according to the received screen projection rejection identifier. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions are compatible, the influence of the update of the screen projection component baseline version on the screen projection connection service is avoided, and flexible configuration and iterative optimization of the screen projection device management service are realized.

[0008] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein the first component and the second component are designed to be functionally decoupled, so that the first component and the second component independently bear the screen projection connection service and the screen projection device management service respectively. When the first device initiates a screen projection request again, the first component sends the identification information of the second device to the second component to trigger the second component to perform a query on the storage file and return a screen projection rejection identifier. The first component rejects the screen projection request of the first device according to the received screen projection rejection identifier. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions are compatible, the influence of the update of the screen projection component baseline version on the screen projection connection service is avoided, and flexible configuration and iterative optimization of the screen projection device management service are realized.

[0009] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein the first component and the second component are designed to be functionally decoupled, so that the first component and the second component independently bear the screen projection connection service and the screen projection device management service respectively. When the first device initiates a screen projection request again, the first component sends the identification information of the second device to the second component to trigger the second component to perform a query on the storage file and return a screen projection rejection identifier. The first component rejects the screen projection request of the first device according to the received screen projection rejection identifier. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions are compatible, the influence of the update of the screen projection component baseline version on the screen projection connection service is avoided, and flexible configuration and iterative optimization of the screen projection device management service are realized.

[0010] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein the first component and the second component are designed to be functionally decoupled, so that the first component and the second component independently bear the screen projection connection service and the screen projection device management service respectively. When the first device initiates a screen projection request again, the first component sends the identification information of the second device to the second component to trigger the second component to perform a query on the storage file and return a screen projection rejection identifier. The first component rejects the screen projection request of the first device according to the received screen projection rejection identifier. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions are compatible, the influence of the update of the screen projection component baseline version on the screen projection connection service is avoided, and flexible configuration and iterative optimization of the screen projection device management service are realized.

[0011] Another embodiment of the present application provides a screen projection method, an electronic device and a computer readable storage medium, wherein, in response to a screen projection connection instruction of a first device, the identification information of the first device is deleted in time by a second component, and the first component responds to a screen projection request of the first device based on an updated storage file in time, so that flexible control of the screen projection connection permission of the device is realized, and the flexibility and adaptability of the screen projection device management are improved.

[0012] To achieve one or more of the above objects, a first aspect of the embodiments of the present application provides a screen projection method, comprising: In a case where a wireless screen projection connection with a first device is established, in response to a screen projection request of a second device, the identification information of the first device is written into a storage file, and the screen projection connection of the first device is disconnected by a first component; In response to the screen projection request of the first device being initiated again, the first component is controlled to reject the screen projection request of the first device based on the storage file.

[0013] A second aspect of the embodiments of the present application provides an electronic device, comprising: a memory configured to store computer executable instructions or computer programs; a processor configured to execute the computer executable instructions or computer programs stored in the memory to implement the screen projection method provided by the embodiments of the present application.

[0014] The embodiments of the present application provide a computer readable storage medium storing computer programs or computer executable instructions, which are used to implement the screen projection method provided by the embodiments of the present application when executed by a processor. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a schematic diagram of a component framework of an optional screen projection system provided by the embodiments of the present application; Figure 2 is a first flowchart of a screen projection switching method provided by the embodiments of the present application; Figure 3 is a second flowchart of the screen projection switching method provided by the embodiments of the present application; Figure 4 is a third flowchart of the screen projection switching method provided by the embodiments of the present application; Figure 5 is a fourth flowchart of the screen projection switching method provided by the embodiments of the present application; Figure 6 is a fifth flowchart of the screen projection switching method provided by the embodiments of the present application; Figure 7 is a schematic diagram of a component structure of an electronic device provided by the embodiments of the present application.

[0016] It should be noted that the above-mentioned "first", "second" are only used to distinguish different schemes, and do not represent the degree of distinction between the schemes or the priority in the implementation process. DETAILED DESCRIPTION

[0017] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0018] Wireless screen projection technology, as the core technology of media content sharing between smart devices, has been widely used in home entertainment, car entertainment, business demonstration and education collaboration scenarios. At present, the mainstream wireless screen projection protocols for vehicles mainly include CarPlay, CarLife and Android Auto.

[0019] Taking the Android Auto protocol as an example, due to the serious fragmentation of Android versions in different countries and regions and the huge hardware differences of different Android phone models, the user will often encounter exceptions when switching between multiple Android phones, which will cause the Android Auto to fail to realize wireless screen projection.

[0020] Based on this, the embodiments of the present application provide a screen projection method, an electronic device and a computer readable storage medium, wherein in the case of establishing a wireless screen projection connection with a first device, if a screen projection request of a second device is received, the identification information of the first device is written into a storage file, and if the first device initiates a screen projection connection request again subsequently, the screen projection request can be rejected according to the stored device identification information, effectively solving the problem that the screen projection content of the second device is forced to be interrupted due to the abnormal reconnection of the first device, improving the reliability and stability of screen projection switching, and ensuring that the screen projection connection meets the user's expectations.

[0021] Figure 1 is an optional screen projection system composition framework schematic diagram provided by the embodiments of the present application, and the screen projection system 100 includes but is not limited to a first device 110, a second device 120 and a third device 130, wherein the third device 130 is a screen projection receiving end and supports establishing a screen projection connection with multiple different devices.

[0022] In a scenario where the first device 110 has established a screen projection connection with the third device 130, if it is necessary to switch the screen projection connection to the second device 120, the third device 130 needs to write the identification information of the first device into a storage file. Subsequently, when the first device 110 initiates a screen projection connection request again, the third device 130 can reject the screen projection request of the first device 110 according to the stored device identification information, thereby realizing stable screen projection switching from the first device 110 to the second device 120.

[0023] The first device and the second device can be screen projection sending end devices, such as User Equipment (UE), user unit, mobile device, user terminal, wireless communication device, and the like, and can be specifically implemented as a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computing device connected to a wireless modem, a vehicle-mounted terminal, a wearable device, a 5G network terminal device, or a terminal device in a future evolved Public Land Mobile Network (PLMN).

[0024] The third device can be a screen projection receiving end device, such as a display terminal, a smart television, a projector, a smart screen, a tablet computer, a notebook computer, a virtual reality (VR) device, an augmented reality (AR) device, a smart vehicle display, or a future evolved public display terminal with screen projection receiving capability.

[0025] The embodiment of the present application provides a screen projection method, applied to a third device. As shown in the method provided by the embodiment of the present application can include the following steps S201 to S202: Figure 2 Step S201: in the case of establishing a wireless screen projection connection with a first device, in response to a screen projection request of a second device, write identification information of the first device into a storage file, and disconnect the screen projection connection of the first device through a first component; In the embodiment, the first device refers to a screen projection sending end device that has successfully established a wireless screen projection connection with a screen projection receiving end device; the second device refers to another screen projection sending end device that a user currently expects to establish a new wireless screen projection connection with the screen projection receiving end device; the screen projection receiving end device refers to an electronic device with screen projection data receiving and analyzing capability, and can convert screen projection data into audio and video content for display, and specifically refers to the third device in the embodiment of the present application.

[0026] ​The screen projection request is a request initiated by the first device or the second device to the third device for establishing a wireless screen projection connection. The screen projection request can be generated by a user manually clicking a screen projection function button, or can be automatically generated according to a preset condition.

[0027] The identification information is information for uniquely identifying the first device. For example, the identification information can be a hardware serial number (Device Serial), an identity (Device ID), a media access control address (Media Access Control Address, MAC), an international mobile equipment identity (International Mobile Equipment Identity, IMEI), or the like, which has a unique identity.

[0028] The storage file is used to store one or more device identification information that rejects the screen projection connection. The specific form of the storage file can be a rejected device list, a rejected device list, a rejected device set, or the like, which can provide core data for screen projection device management services.

[0029] The first component is a function module specially responsible for executing a screen projection connection service. The main function of the first component is to complete the establishment operation of the wireless screen projection connection or execute the disconnection operation of the wireless screen projection connection according to a preset service logic. For example, the function of the first component can be implemented based on an Android Auto protocol library, which defines the communication interaction specification between a mobile terminal and a vehicle terminal, covers core protocol standards such as data transmission, instruction interaction, and screen projection adaptation, and can provide underlying protocol support for the screen projection connection establishment and link management of an Android device and a vehicle terminal in a wireless screen projection scenario.

[0030] In some embodiments, disconnecting the screen projection connection of the first device by the first component can include disconnecting the screen projection link of the first device by the first component and keeping alive the control link of the first device.

[0031] When performing the screen projection connection disconnection operation, the processing mode of disconnecting the screen projection link and keeping alive the control link can achieve screen projection switching, maintain the control instruction interaction capability between devices relying on the control link in the alive state, support subsequent rapid reconstruction of the screen projection link, and realize seamless screen projection switching.

[0032] The wireless screen projection connection can include two independent communication links, a screen projection link and a control link, which work together to realize the screen projection function. The control link is a communication link for transmitting control instructions and interaction signaling. In the wireless screen projection connection state, the control link is in a connected state to ensure real-time interaction of control information between the screen projection sending end and the receiving end and maintain stable operation of the screen projection connection. In the wireless screen projection connection state, the control link continues to be in the connected state to maintain the control instruction interaction capability between devices, support subsequent rapid reconstruction of the screen projection link, and realize seamless screen projection switching. In the wireless screen projection connection state, the control link can also be disconnected.

[0033] The screen projection link is a core communication link for transmitting media data such as audio and video and is a key channel for realizing projection of image content and sound content from the sending end to the receiving end. In the wireless screen projection connection state, the screen projection link is in a connected state, and the screen projection receiving end can normally play media content from the sending end. In the wireless screen projection disconnection state, the screen projection link is in a disconnected state, and content projection to the receiving end is terminated.

[0034] For example, when the user attempts to use the second device (such as mobile phone B) for screen projection, the vehicle-mounted terminal first disconnects the screen projection link of the currently connected first device (such as mobile phone A) but retains the control link of mobile phone A. The vehicle-mounted terminal then establishes a wireless screen projection connection with mobile phone B, thereby realizing smooth switching of the screen projection device.

[0035] Step S202: In response to the first device again initiating a screen projection request, the first component is controlled to reject the screen projection request of the first device based on the storage file.

[0036] In this embodiment, the first device again initiating a screen projection request means that the first device initiates a request to reestablish a wireless screen projection connection after being disconnected from the control link and the screen projection link. This situation can occur after the control link of the first device is accidentally disconnected. According to a relevant stability strategy, the first device automatically triggers a reconnection mechanism to attempt to reestablish a connection with the screen projection receiving end device to ensure continuity of the screen projection service. At this time, when the screen projection request initiated again by the first device is received, the storage file is immediately called to perform device identification information matching query. If the identification information of the first device already exists in the storage file, it is determined that the first device is currently in a temporary state of rejecting screen projection, and the first component is controlled to reject the screen projection request of the first device.

[0037] In some embodiments, the first device again initiating a screen projection request includes that the control link of the first device is actively disconnected based on a first reason and / or a second reason, and the first device initiates a screen projection request again within a preset time, where the first reason indicates fragmentation of the operating system of the first device, and the second reason indicates a mismatch degree between the hardware and the operating system of the first device.

[0038] In view of the problem that the first device initiates a screen projection request again after screen projection switching due to the fragmentation of the operating system of the first device, the mismatch between the hardware and the operating system of the first device, and the like, the screen projection request can be rejected according to the stored device identifier information, the problem that the screen projection content of the second device is forced to be interrupted due to the abnormal reconnection of the first device is effectively solved, and the reliability and stability of screen projection switching are improved.

[0039] The fragmentation of the operating system refers to the fact that the operating system versions used by different manufacturers, different models, and different countries / regions are different, and the operating system update strategy is not unified, so that the communication interaction mechanism between devices cannot be compatible, and the problem of abnormal disconnection of the control link is caused.

[0040] The mismatch between the hardware and the operating system refers to the fact that the hardware configurations (such as processors, communication modules, sensors, etc.) of different devices are different, so that the adaptability of some devices to the operating system carried is insufficient, and the stability of the control link is destroyed, and even the control link is abnormally interrupted.

[0041] Exemplarily, the operating system in the embodiment of the application includes, but is not limited to, an Android system, an iOS system, a Linux system, a HarmonyOS system, and the like.

[0042] The preset time is a configurable time threshold, which is used to determine whether the first device initiates a screen projection request again within a reasonable range after the screen projection connection of the first device is disconnected. The purpose of configuring the preset time window is to prevent frequent invalid reconnection behaviors and ensure that the device can be quickly switched under normal operation.

[0043] Exemplarily, the preset time can be 50 ms, 100 ms, 1 second, 5 seconds, 30 seconds, 1 minute, and the like.

[0044] In some embodiments, the method further includes: in response to a screen projection connection instruction for the first device, deleting the identifier information of the first device in the storage file, so as to control the first component to establish the control link and the screen projection link with the first device based on the storage file.

[0045] The screen projection connection instruction can be an instruction triggered when a user actively selects the first device to perform a screen projection operation on the third device side or the first device side. Exemplarily, the user clicks a screen projection key of the first device interface, or clicks a selection item corresponding to the first device in the third device interface, which can trigger the generation of the screen projection connection instruction for the first device; after the third device detects the screen projection connection instruction, the third device will perform corresponding logical processing according to the current screen projection connection state, including processes such as disconnecting the connection with the original screen projection device and establishing the screen projection connection with the first device.

[0046] The method for screen projection provided in the embodiments of the present application can effectively solve the problem that the screen projection content of the second device is forced to be interrupted due to the abnormal reconnection of the first device, improve the reliability and stability of screen projection switching, and ensure that the screen projection connection meets the user's expectation.

[0047] In some embodiments, step S202: the first component rejects the screen projection request of the first device based on the storage file, as shown in Figure 3 As shown in steps S301-S302, wherein: Step S301: the first component sends the identification information of the first device to the second component to trigger the second component to query the storage file according to the identification information of the first device and generate a screen projection rejection identifier. The first component refers to a functional module specially responsible for performing screen projection connection services, including performing operations such as establishing and disconnecting a wireless screen projection connection.

[0048] The second component refers to a functional module for performing screen projection device management services, including storage file maintenance and screen projection rejection judgment based on the storage file to obtain a screen projection permission identifier or a screen projection rejection identifier.

[0049] Exemplarily, the first device and the second device are Android devices, and the third device is a vehicle terminal. The function of the first component can be realized based on an Android Auto protocol library, which defines the communication interaction specification between the Android device and the vehicle terminal, covers core protocol standards such as data transmission, instruction interaction, and screen projection adaptation, and can provide underlying protocol support for the screen projection connection establishment and link management of the Android device and the vehicle terminal in the wireless screen projection scenario. The second component is an Android Auto application, or the second component is a functional module realized based on the Android Auto application.

[0050] The first interface refers to an interface for data interaction between the first component and the second component. The screen projection device management services are moved to the second component for execution through the first interface. The first component does not need to bear the screen projection device management services. The first component triggers the second component to execute the screen projection device management services through the first interface and receives the screen projection permission / rejection identifier returned by the second component. This not only reduces the coupling degree between components, but also is compatible with different screen projection component baseline versions, avoids the impact of the newly added screen projection device management services / screen projection component baseline version update on the screen projection connection services, and enables flexible configuration and iterative optimization of the screen projection device management services.

[0051] The screen projection rejection identifier is used to indicate that the first component rejects the screen projection request of the first device. For example, the return value function is a Boolean (BOOL) function, and accordingly, the screen projection rejection identifier can be a state identifier of the Boolean (BOOL) type. Optionally, the screen projection rejection identifier can be set to 1 or true, indicating that the screen projection request of the first device is rejected. Optionally, the screen projection rejection identifier can be set to 0 or false, indicating that the screen projection request of the first device is rejected.

[0052] In some embodiments, the second component configures a return value function; the return value function obtains the identifier information of the first device transmitted by the first component through the first interface of the first component; the return value function is used to parse the storage file and query the storage file according to the identifier information of the first device; when the identifier information of the first device is stored in the storage file, a screen projection rejection identifier is generated; and the return value function is also used to call back the first interface of the first component and return the screen projection rejection identifier to the first component.

[0053] By configuring the return value function on the second component, the parsing and querying of the storage file and the return of the screen projection rejection identifier are implemented. When the screen projection device management business / screen projection component baseline version is changed, the customization operation of the business can be implemented by modifying the internal implementation logic of the return value function, which is conducive to the flexible configuration and iterative optimization of the screen projection device management business and the compatibility of different screen projection component baseline versions. In addition, the data interaction between the first component and the second component can be implemented through the first interface of the first component, which effectively reduces the coupling degree between components and ensures the stable operation of the screen projection connection business.

[0054] The callback mechanism is used for the second component to feedback the execution result to the first component. The first component provides a first interface for returning the query result to the first component by calling back the return value function, and the interface is used to receive the result of the rejection identifier. This callback mechanism realizes the decoupling between the underlying protocol library and the upper layer application, makes the function expansion more flexible, and improves the maintainability and development efficiency of the system.

[0055] Step S302: When the first component receives the screen projection rejection identifier returned by the second component, the first component rejects the screen projection request of the first device.

[0056] By decoupling the functions of the first component and the second component, the first component and the second component independently bear the screen projection connection service and the screen projection device management service respectively. When the first device initiates the screen projection request again, the first component sends the identification information of the second device to the second component to trigger the second component to perform the query of the storage file and return the screen projection rejection identification. The first component rejects the screen projection request of the first device according to the received screen projection rejection identification. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions can be compatible, the influence of the update of the screen projection component baseline version on the screen projection connection service is avoided, and flexible configuration and iterative optimization of the screen projection device management service are realized.

[0057] In some embodiments, the step S302 of rejecting, by the first component, the screen projection request of the first device can include: generating, by the first component, a screen projection rejection response based on the screen projection rejection identification; and sending, by the first component, the screen projection rejection response to the first device to inform the first device that the current screen projection request is rejected and / or to inform the first device to stop sending the screen projection request again within a preset time.

[0058] In some embodiments, as shown in FIG. 4, the method of the embodiments of the present application further includes steps S401-S402, wherein: Figure 4 The step S401 includes: in response to the screen projection request of the second device, sending, by the first component, the identification information of the second device to the second component to trigger the second component to query the storage file according to the identification information of the second device and generate a screen projection permission identification. The step S401 includes: in response to the screen projection request of the second device, sending, by the first component, the identification information of the second device to the second component to trigger the second component to query the storage file according to the identification information of the second device and generate a screen projection permission identification. The screen projection permission identification is used to indicate that the first component allows the screen projection request of the first device. For example, the return value function is a Boolean (BOOL) function, and accordingly, the screen projection permission identification can be a state identification of the Boolean (BOOL) type. Alternatively, the screen projection permission identification can be set to 0 or false, indicating that the screen projection request of the first device is allowed. Alternatively, the screen projection permission identification can be set to 1 or true, indicating that the screen projection request of the first device is allowed.

[0059] In some embodiments, the second component configures a return value function. The return value function obtains the identification information of the second device transmitted by the first component through a first interface of the first component. The return value function is used to analyze the storage file and query the storage file according to the identification information of the second device. When the identification information of the second device is not stored in the storage file, the return value function generates a permission rejection identification. The return value function is also used to call back the first interface of the first component and return the screen projection permission identification to the first component.

[0060] By configuring the return value function on the second component, the parsing, query, return of the screen projection rejection / allowance identifier of the storage file are implemented, when the screen projection device management business changes, modifying the internal implementation logic of the return value function can realize the customized operation of the business, which is beneficial to the flexible configuration and iterative optimization of the screen projection device management business, and compatible with different screen projection component baseline versions. In addition, through the first interface of the first component, data interaction between the first component and the second component can be realized, effectively reducing the coupling degree between components and ensuring the stable operation of the screen projection connection business.

[0061] Step S402: When the first component receives the screen projection allowance identifier returned by the second component, the first component establishes a control link and a screen projection link with the second device.

[0062] By decoupling the functions of the first component and the second component, the screen projection connection business and the screen projection device management business are independently carried by the first component and the second component respectively. When the first device initiates a screen projection request again, the first component sends the identifier information of the second device to the second component to trigger the second component to query the storage file and return the screen projection allowance identifier. The first component establishes a control link and a screen projection link with the second device according to the received screen projection allowance identifier. In this way, the coupling degree between components is reduced, different screen projection component baseline versions can be compatible, the influence of the update of the screen projection component baseline version on the screen projection connection business is avoided, and the flexible configuration and iterative optimization of the screen projection device management business are realized.

[0063] In some embodiments, step S402: establishing a control link and a screen projection link with the second device through the first component, can include: establishing a control link with the second device through the first component; establishing a screen projection link with the second device through the first component when the second device meets the screen projection start condition; the first component obtains screen projection data of the second device through the screen projection link; the first component sends the screen projection data to the second component to make the second component display the screen projection content based on the screen projection data.

[0064] In some embodiments, step S201: in response to the screen projection request of the second device, writing the identifier information of the first device into the storage file, includes: when the second component determines that there is a screen projection request of the second device, the second component obtains the identifier information of the first device and writes the identifier information of the first device into the storage file.

[0065] In some embodiments, the method further includes: in response to a screen projection connection instruction for the first device, the second component deletes the identifier information of the first device in the storage file.

[0066] By recording and maintaining the identifier information of the screen projection rejection device through the second component, core data is provided for the screen projection device management business, and the influence on the screen projection connection business of the first component is avoided.

[0067] In some embodiments, as shown in Figure 5 The method of the embodiments of the present application can specifically include the following steps S501 to S503: Step S501: In the case of establishing a wireless screen projection connection with the first device, the second component determines that there is a screen projection request of the second device, the second component obtains the identification information of the first device, and writes the identification information of the first device into a storage file; Step S502: In response to the first device initiating a screen projection request again, the first component is controlled to reject the screen projection request of the first device based on the storage file; Step S503: In response to a screen projection connection instruction for the first device, the identification information of the first device in the storage file is deleted by the second component to control the first component to establish a control link and a screen projection link with the first device based on the storage file.

[0068] By decoupling the functions of the first component and the second component, the two components independently bear the screen projection connection business and the screen projection device management business respectively. The device identification information in the storage file is dynamically maintained by the second component, and the flexible control of the device screen projection connection permission is realized. In this way, the coupling degree between the components is reduced, different screen projection component baseline versions can be compatible, the influence of the screen projection component baseline version update on the screen projection connection business is avoided, and the flexible configuration and iterative optimization of the screen projection device management business are realized.

[0069] On the basis of the above embodiments, the vehicle-mounted system screen projection switching scenario is now exemplarily described. The first device is a mobile phone A, the second device is a mobile phone B, and the third device is a vehicle-mounted terminal. The wireless screen projection connection in this scenario is established based on the Android Auto protocol, and the wireless screen projection connection specifically includes two links: a Wpp Socket control link and a Gal Socket screen projection link. The Wpp Socket control link (referred to as Wpp control link or control link) is used to transmit control instructions and state information; the Gal Socket screen projection link (referred to as Gal screen projection link or screen projection link) is used to transmit audio, video and other media content.

[0070] As shown in Figure 6 The screen projection switching method specifically includes: Step S1. The mobile phone A establishes a wireless screen projection connection with the vehicle-mounted terminal; Exemplarily, the wireless screen projection connection can specifically include a Wpp control link and a Gal screen projection link.

[0071] Step S2. The mobile phone B sends a screen projection request; Step S3. The Android Auto application of the vehicle-mounted terminal records the device_serial of the mobile phone A and writes it into the temporary rejection list. Step S4. The Android Auto application of the vehicle-mounted terminal initiates a disconnection instruction of the Gal screen projection link of the mobile phone A to the Android Auto protocol library. In the embodiments of the present disclosure, the Android Auto protocol library of the vehicle-mounted terminal belongs to a bottom software library, and its core role is to encapsulate the bottom interaction logic of the Android Auto communication protocol; the Android Auto application of the vehicle-mounted terminal is an upper business application developed based on the protocol library.

[0072] Step S5. The Android Auto protocol library of the vehicle-mounted terminal disconnects the Gal screen projection link with the mobile phone A and keeps the Wpp control link normally connected. In the embodiments of the present application, under the condition that the mobile phone A has established a wireless screen projection connection with the vehicle-mounted terminal, when the vehicle-mounted terminal Andorid Auto application determines that the mobile phone B wants to establish a screen projection connection, the device_serial (unique identification code of the mobile phone) of the mobile phone A is recorded and included in the temporary rejection list. At the same time, before the vehicle-mounted terminal establishes a screen projection connection with the mobile phone B, the vehicle-mounted terminal needs to disconnect the GalSocket screen projection link with the mobile phone A, but the Wpp Socket control link will not be actively disconnected under normal circumstances.

[0073] Step S6. Under abnormal circumstances, the mobile phone A will directly disconnect the Wpp control link and automatically initiate a screen projection request again within 1s. Step S7. The Android Auto application of the vehicle-mounted terminal and the protocol library negotiate screen projection and establish a Wpp control link with the mobile phone A. Step S8. Protocol library bool IsKnownDevice(std::string mobile_device_id) callback; The input parameter of the bool IsKnownDevice(std::string mobile_device_id) interface is the device identification (device_id) of the mobile phone A, which is used to check whether the device mobile phone A is a known device. If the mobile phone A is a known device, true is returned, and if the mobile phone A is an unknown device, false is returned.

[0074] Step S9. The Android Auto application returns true to indicate that the mobile phone A is a known device, and returns false to indicate that the mobile phone A is an unknown device. Step S10. The protocol library void OnReadyForProjection(wifi_projection_protocol::ClientInfo client_info) callback; The input parameter of the void OnReadyForProjection(wifi_projection_protocol::ClientInfo client_info) interface is the client information (client_info) of the mobile phone A, which is used to determine whether the mobile phone A is ready to establish a projection connection. If the mobile phone A is ready, true is returned, and if the mobile phone A is not ready, false is returned.

[0075] Step S11. The Android Auto application returns true to indicate that it is ready, and returns false to indicate that it is not ready. Step S12. The protocol library adds a bool IsRejectedTemporarily(std::string device_serial) callback. The input parameter of the bool IsRejectedTemporarily(std::string device_serial) interface is the hardware serial number (device_serial) of the mobile phone A, which is used to determine whether to reject the projection request of the mobile phone A. If the projection request is rejected, true is returned, and if the projection request is allowed, false is returned.

[0076] In the embodiments of the present application, a bool IsRejectedTemporarily(std::string device_serial) interface of the Boolean type is added to the protocol library, where the input parameter device_serial is the hardware serial number of the device to be verified. The specific implementation logic of the interface is migrated to the Android Auto application through a Java Native Interface (JNI). The protocol library does not need to process the core logic of the projection rejection judgment, and the bool IsRejectedTemporarily(std::string device_serial) interface is called to perform the projection rejection judgment by the Android Auto application, and finally a Boolean type result (false or true) is returned to the protocol library.

[0077] The screen projection method provided in the embodiments of the present application adds a Boolean type interface boolIsRejectedTemporarily(std::string device_serial) in a protocol library, and with the interface callback mechanism of the protocol library, the screen projection rejection judgment logic is moved to the application layer, and the application executes the screen projection rejection judgment logic in the interface callback, so that the logic implementation is more convenient and does not affect the original business logic of the protocol library.

[0078] Step S13. The Android Auto application queries the temporary rejection list, and returns true for the mobile phone A, indicating rejection. Step S14. The Android Auto application returns true, indicating rejection of the current screen projection request. Step S15. The protocol library informs the mobile phone A that the current wireless screen projection request is rejected. In the embodiments of the present application, the call of the boolIsRejectedTemporarily() interface will not be triggered in the case that the Wpp control link of the mobile phone A is not disconnected. However, according to the stability strategy related to the Android Auto protocol, the mobile phone A will initiate a screen projection request again to try to rebuild the connection and maintain the stability of the wireless screen projection link after the Wpp control link of the mobile phone A is disconnected in an abnormal case. For the screen projection request in the abnormal scenario, the protocol library (i.e., the first component) in the embodiments of the present application will trigger the call of the boolIsRejectedTemporarily() interface, and at this time, the Android Auto application (i.e., the second component) executes the screen projection device management business and returns true to the protocol library, so that the protocol library will reject the connection request of the mobile phone A, thereby effectively ensuring the stability of the screen projection process of the mobile phone B.

[0079] Step S16. The Android Auto application performs screen projection negotiation with the protocol library and establishes a Wpp control link with the mobile phone B. Step S17. The Android Auto application queries the temporary rejection list, and returns false for the mobile phone B, indicating permission. Step S18. The Android Auto application returns false for the mobile phone B, indicating permission of the current screen projection request. Step S19. Protocol library CanStartProjection(wifi_projection_protocol::ClientInfo client_info) callback. The input parameter of the CanStartProjection(wifi_projection_protocol::ClientInfo client_info) interface is the client information (client_info) of the mobile phone B, which is used to check whether the mobile phone B meets the projection starting condition. If the mobile phone B meets the projection starting condition, true is returned. If the mobile phone B does not meet the projection starting condition, false is returned.

[0080] Step S20. The Android Auto application returns true to indicate that the mobile phone B meets the projection starting condition, and returns false to indicate that the mobile phone B does not meet the projection starting condition. Step S21. The Android Auto protocol library informs the mobile phone B that projection is available. Step S22. The mobile phone B continues to transmit video stream data to the protocol library in the connected state. Step S23. The Android Auto protocol library returns the data to the application through callback. Step S24. The Android Auto application displays the projection content. Step S25. The Android Auto application returns an acknowledgement (Ack) frame to the protocol library. Step S26. The Android Auto protocol library returns the acknowledgement (Ack) frame to the mobile phone B.

[0081] Exemplarily, the method further includes that a user actively clicks to connect the mobile phone A on the vehicle terminal, the vehicle terminal Android Auto application deletes the device_serial of the mobile phone A from the temporary rejection list, and the mobile phone A can establish a new wireless projection connection with the vehicle terminal.

[0082] The method provided in the embodiments of the present application can stably switch when the user selects the mobile phone B to project, and prevent the mobile phone A from being connected again. Meanwhile, the method does not affect the reconnection request triggered by the user.

[0083] The projection method provided in the embodiments of the present application has the following beneficial effects when the projection switching between the vehicle terminal and the plurality of Android mobile phones is implemented. 1. When the user selects the second device (such as mobile phone B) for screen projection, the stability of the screen projection switching of the second device can be ensured, and the automatic reconnection behavior of the first device (such as mobile phone A) in abnormal conditions can be effectively prevented; at the same time, the normal response of the reconnection request of the first device triggered by the user is not affected, and the execution of the predetermined stability strategy of the Android Auto protocol is not affected, including the automatic reconnection strategy of the first device of the Android Auto protocol under the condition that the Wpp control link of the first device is disconnected due to signal interference, poor wireless communication quality and other factors.

[0084] 2. A Boolean type interface bool IsRejectedTemporarily(std::string device_serial) is added in the protocol library, and the screen projection rejection judgment logic is moved to the application layer by means of the interface callback mechanism of the protocol library. The application executes the screen projection rejection judgment logic in the interface callback, the logic implementation is more convenient, and no influence is brought to the original business logic of the protocol library.

[0085] 3. The coupling degree of the Android Auto application and the protocol library is reduced, a return value function is realized, and a corresponding Boolean value is returned. For the devices with this requirement, the customization operation can be performed based on the bool IsRejectedTemporarily() interface, and good reusability is achieved.

[0086] To implement the method of the embodiments of the present application, based on the same inventive concept, the embodiments of the present application further provide an electronic device, as shown in Figure 7 The electronic device 700 includes: The memory 701 is configured to store computer executable instructions or computer programs. The processor 702 is configured to execute the computer executable instructions or computer programs stored in the memory, and implement the screen projection method of any one of the embodiments of the present application. Of course, in actual application, as shown in Figure 7 The various components in the electronic device 700 are coupled together through the bus system 703. It can be understood that the bus system 703 is used to realize the connection and communication between the components. The bus system 703 includes a data bus, a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all the buses are marked as the bus system 703 in the figure.

[0087] In practical applications, the processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It can be understood that, for different devices, the electronic device used to implement the functions of the processor can also be other devices, and the embodiments of the present application do not make specific limitations.

[0088] The memory can be a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state disk (SSD), or a combination of the above types of memories, and provides instructions and data to the processor.

[0089] The memory can be a separate device independent of the processor, or can be integrated in the processor.

[0090] Optionally, the electronic device can be a third device, or a chip applied to the third device.

[0091] In the example embodiments, the embodiments of the present application also provide a computer readable storage medium, such as a memory including a computer program, which can be executed by the processor of the electronic device to complete the steps of the foregoing method.

[0092] The embodiments of the present application also provide a computer program product including a computer program, which, when executed by a processor, implements the steps of the method described in any of the embodiments of the present application.

[0093] Optionally, the computer program product can be applied to the electronic device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes realized by the electronic device in the various methods of the embodiments of the present application. For brevity, details are not repeated here.

[0094] The embodiments of the present application also provide a computer program.

[0095] Optionally, the computer program can be applied to the electronic device in the embodiments of the present application, and when the computer program runs on the computer, the computer is caused to execute the corresponding processes realized by the electronic device in the various methods of the embodiments of the present application. For brevity, details are not repeated here.

[0096] It should be understood that if the present disclosure refers to any user data and personal information (including but not limited to device information, behavior data, location information, etc.) and before applying the technical solutions described in the embodiments of the present disclosure, the relevant products or services should comply with the laws and regulations on user data and personal information protection, strictly handle the personal information and data of the user in accordance with the provisions of the applicable laws and regulations in the whole life cycle of data processing, comply with the principles of legality, legitimacy, necessity, honesty, openness and transparency, take reasonable privacy design scheme and technical measures to ensure the safety of user data and personal information, protect the legitimate rights and interests of users, and prevent the risk of leakage or theft, tampering, etc. of user data and personal information. Specifically, the privacy policy is published and displayed in a prominent position of the user interface in the name of the entity, and the user is explicitly informed of the matters that should be informed according to laws and regulations, such as the type of personal information, processing purpose, use, and manner; the user's prior informed consent or explicit authorization is obtained through active interaction of the user (such as prompt information confirmation pop-up window) for data processing behavior; user data is processed or stored in a secure manner within the legal required period; a series of security technologies and management measures including but not limited to data encryption and access control are taken; user data is shared and transferred in a legal manner within the scope allowed by law; the rights of the user are handled within the legal required time limit, including the rights to query, access, correct, delete, withdraw authorization consent, cancel, obtain a copy of personal information, etc.

[0097] It should be understood that the terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "an" and "the" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein means and includes any or all possible combinations of one or more associated listed items. In the present application, the expressions "have", "may have", "include" and "contain", or "may include" and "may contain" can be used herein to indicate the presence of the corresponding features (for example, elements such as numerical values, functions, operations or components), but do not exclude the presence of additional features.

[0098] It should be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another type of information. For example, without departing from the scope of the present application, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.

[0099] The technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0100] In several embodiments provided in the present application, it should be understood that the disclosed methods, devices and equipment can be implemented by other ways. The above described embodiments are only illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division way, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each component part shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0101] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed on multiple network units; part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0102] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be realized in the form of hardware or in the form of hardware plus software functional unit.

[0103] The above is only an embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement and improvement made within the spirit and scope of the present application shall be included in the protection scope of the present application.

Claims

1. A screen projection method, characterized in that, The method includes: When a wireless screen mirroring connection is established with the first device, in response to the screen mirroring request of the second device, the identification information of the first device is written into a storage file, and the screen mirroring connection of the first device is disconnected through the first component. In response to the first device initiating a screen mirroring request again, the first component is controlled to reject the screen mirroring request from the first device based on the stored file.

2. The method according to claim 1, characterized in that, Disconnecting the screen mirroring connection of the first device via the first component includes: The first component disconnects the screen projection link of the first device and keeps the control link of the first device active.

3. The method according to claim 2, characterized in that, The first device initiates a screen mirroring request again, including: After the control link of the first device is actively disconnected based on a first cause and / or a second cause, the first device initiates a screen mirroring request again within a preset time. The first cause indicates that the operating system of the first device is fragmented, and the second cause indicates that the hardware of the first device is incompatible with the operating system.

4. The method according to claim 1, characterized in that, The control of the first component to reject the screen mirroring request of the first device based on the stored file includes: The first component sends the identification information of the first device to the second component, thereby triggering the second component to query the storage file based on the identification information of the first device and generate a screen projection rejection flag; When the first component receives the screen mirroring rejection flag returned by the second component, it rejects the screen mirroring request from the first device.

5. The method according to claim 4, characterized in that, The second component is configured with a return value function; The return value function obtains the identification information of the first device passed in by the first component through the first interface of the first component; The return value function is used to parse the storage file and query the storage file according to the identification information of the first device; when storing the identification information of the first device in the storage file, the screen projection rejection flag is generated. The return value function is also used to call back the first interface of the first component and return the screen projection rejection flag to the first component.

6. The method according to claim 1, characterized in that, The method further includes: In response to the screen mirroring request from the second device, the first component sends the identification information of the second device to the second component, thereby triggering the second component to query the stored file based on the identification information of the second device and generate a screen mirroring permission identifier; When the first component receives the screen mirroring permission flag returned by the second component, it establishes a control link and a screen mirroring link with the second device through the first component.

7. The method according to claim 6, characterized in that, The second component is configured with a return value function; The return value function obtains the identification information of the second device passed in by the first component through the first interface of the first component; The return value function is used to parse the storage file and query the storage file according to the identification information of the second device; when the identification information of the second device is not stored in the storage file, the allow / deny flag is generated. The return value function is also used to call back the first interface of the first component and return the screen casting permission identifier to the first component.

8. The method according to claim 1, characterized in that, In response to the screen mirroring request from the second device, writing the identification information of the first device into a storage file includes: If the second component determines that there is a screen mirroring request from the second device, the second component obtains the identification information of the first device and writes the identification information of the first device into the storage file.

9. The method according to claim 7, characterized in that, The method further includes: In response to a screen mirroring connection command for the first device, the second component deletes the identification information of the first device from the storage file, thereby controlling the first component to establish a control link and screen mirroring link with the first device based on the storage file.

10. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 9.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements any one of claims 1 to 9. one The steps of the method described in the item.