CN114584815A - Method, computer readable storage medium and device for controlling screen projection in backward mode - Google Patents
Method, computer readable storage medium and device for controlling screen projection in backward mode Download PDFInfo
- Publication number
- CN114584815A CN114584815A CN202011381181.9A CN202011381181A CN114584815A CN 114584815 A CN114584815 A CN 114584815A CN 202011381181 A CN202011381181 A CN 202011381181A CN 114584815 A CN114584815 A CN 114584815A
- Authority
- CN
- China
- Prior art keywords
- mobile terminal
- android mobile
- control event
- control
- target terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000003860 storage Methods 0.000 title claims abstract description 11
- 230000008569 process Effects 0.000 claims abstract description 34
- 230000004913 activation Effects 0.000 claims description 27
- 230000003213 activating effect Effects 0.000 claims description 23
- 230000006870 function Effects 0.000 claims description 19
- 238000012545 processing Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004891 communication Methods 0.000 claims description 7
- 230000007246 mechanism Effects 0.000 claims description 5
- 230000000903 blocking effect Effects 0.000 claims description 4
- 208000019116 sleep disease Diseases 0.000 claims description 3
- 238000004886 process control Methods 0.000 claims description 2
- 230000004044 response Effects 0.000 claims description 2
- 238000005266 casting Methods 0.000 abstract description 11
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/41—Structure of client; Structure of client peripherals
- H04N21/4104—Peripherals receiving signals from specially adapted client devices
- H04N21/4122—Peripherals receiving signals from specially adapted client devices additional display device, e.g. video projector
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/41—Structure of client; Structure of client peripherals
- H04N21/4104—Peripherals receiving signals from specially adapted client devices
- H04N21/4126—The peripheral being portable, e.g. PDAs or mobile phones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/436—Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
- H04N21/4363—Adapting the video stream to a specific local network, e.g. a Bluetooth® network
- H04N21/43637—Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Telephone Function (AREA)
Abstract
The invention provides a method for controlling screen projection in a returnable mode, which comprises the following steps: connecting the android mobile terminal with a target terminal through a USB (universal serial bus) line; opening a developer mode of the mobile terminal; a control event input service program is operated as background service at the android mobile terminal through an ADB tool and an app _ process tool carried by the android mobile terminal at the target terminal, and a back control function of the android mobile terminal is activated; and under the WIFI screen projection mode, disconnecting the wired connection between the android mobile terminal and the target terminal. Android mobile terminal users are no longer bound by wired connection in the screen throwing operation of the feedback control, the operation is more flexible and more convenient, the user experience is improved, and the screen throwing technology is further popularized and promoted. The invention also provides a screen device capable of being controlled back, which comprises an android mobile terminal and a target terminal; and a computer-readable storage medium having advantages corresponding to the realization of the method for controlled screen-casting according to the present invention.
Description
Technical Field
The invention belongs to the technical field of screen projection, and particularly relates to a screen projection method capable of being controlled back in the screen projection technology, a related computer readable storage medium and a screen projection device.
Background
With the increasing development of the internet and the popularization of mobile terminals such as mobile phones and intelligent tablets, the mobile terminals can more conveniently obtain rich internet information resources and a large amount of data information due to the portability and the diversity of internet connection modes; in addition, the mobile terminal is attractive in interface and convenient to operate based on the characteristics of an operating system of the mobile terminal, and for example, the interface impression and the user experience of operation of an android mobile phone are excellent at present. However, the display screen of a general mobile terminal is often small and not easy to be fixed at a certain place for use, and in many specific use scenes, people often need both the internet content obtained by the mobile terminal and the obtained content to be displayed or operated on a fixed larger screen or have a requirement of sharing the display content. For example, in vehicle applications, it is a very common and practical requirement to project the navigation and incoming call answering control of a mobile phone to a fixed vehicle screen. The vehicle-mounted machine is a vehicle-mounted infotainment product installed in an automobile, and the vehicle-mounted machine can realize information communication between people and the automobile and between the automobile and the outside (automobile and automobile) in terms of functions. In the aspect of screen projection of the vehicle, the functions which a mobile phone user wants to use on the vehicle are projected to the vehicle for use, so that the development cost of the vehicle-mounted computer system is reduced. Besides CarPlay of an iOS system, the android system-based car projector has better domestic universality, and more car projectors are hundred-degree CarLife.
In the screen-throwing application, people often want to be able to control the operation of the mobile terminal on the target terminal, i.e. to perform the back control, for example, when a mobile phone throws a screen on a car machine, the operation performed on a car machine interface is back controlled to the mobile phone, and the operation is actually the mobile phone itself. CarLife supports two modes of USB screen projection and WIFI screen projection, and in the USB screen projection mode, a mobile phone is required to be connected with a vehicle machine through a USB line all the time, and the mobile phone can be controlled on the vehicle machine. At present, the control back of CarLife in the WIFI screen projection mode is performed on a mobile terminal based on an iOS system, so that the control back is performed by using a protocol based on the iOS system. Therefore, for the android mobile terminal, CarLife does not support the return control operation in the WIFI screen projection mode, so that a user of the android mobile terminal has to be restrained by a USB line if the user needs to return to control the android mobile terminal on a target terminal when projecting a screen, the user experience is reduced, and the screen projection application is not convenient enough.
Disclosure of Invention
The present invention is made based on the above-mentioned problems in the prior art, and aims to provide a method, a computer-readable storage medium, and a device for controlling screen projection, which enable a user of an android mobile terminal to perform wired control (control back) of the android mobile terminal at a target terminal in a USB screen projection mode, and to perform wireless control back in a WIFI screen projection mode.
In the description of the present invention, the "screen projection" refers to transmitting screen data of one terminal to another terminal for display. For convenience of description, one terminal in the present application refers to an android mobile terminal. The other terminal mainly refers to an electronic device such as a television, a car center console (car machine) and the like which needs to receive screen projection, and is hereinafter referred to as a target terminal. The screen projection function can be provided by a computer system or an application, and is called as a screen projection main control provided in the application. The screen projection interface refers to an interface which is required by or actually displayed on the target terminal by the android mobile terminal.
As is well known, the presentation form of the program Interface is a Graphical User Interface (GUI), which refers to a User Interface related to computer operation and displayed in a graphical manner. The interface may be comprised of visual interface elements such as icons, buttons, button groups, option areas, dialog boxes, prompt boxes, progress bars, and the like. These visual interface elements are also referred to as controls of the application interface. An event is an operation that can be recognized by the control, such as pressing a decision button, selecting a radio button, or a check box. Each control has an event which can be recognized by the control, such as loading, clicking, double-clicking and other events of a form, a text change event of an edit box (text box) and the like. All explanations and definitions of the terms and related principles of the technology referred to in this application are intended to be illustrative and not restrictive.
The invention provides a controllable screen projection method in one aspect, which comprises the following steps: s1, connecting an android mobile terminal with a target terminal through a USB (universal serial bus) line; s2, opening a developer mode of the android mobile terminal; s3, operating a control event input service program on the android mobile terminal as a background service at the target terminal through an ADB tool and an app _ process tool carried by the android mobile terminal, and activating a back control function of the android mobile terminal, wherein the control event input service program is used for injecting a control event into the android mobile terminal after receiving the back control event from the target terminal; and S4, disconnecting the wired connection between the android mobile terminal and the target terminal in the WIFI screen projection mode.
In the invention, the background service program which is operated through the app _ process tool has high authority, so that the control event input service program which is used as the background service program can inject the control event into the android mobile terminal, and the operation can be performed on the target terminal to return to the android mobile terminal and perform the same operation on the android mobile terminal. After the control event input service program is successfully operated, the USB cable can be unplugged in a WIFI screen projection mode, so that a user can be free from the constraint of wired connection to realize wireless back control.
Specifically, between the step S2 and the step S3, the control event input service program is pushed to the android mobile terminal by the target terminal through the ADB tool.
In a preferred embodiment, the android mobile terminal is an android mobile phone or an android smart tablet.
In a specific implementation, the target terminal is a car machine.
In a possible embodiment, the process of injecting the control event into the android mobile terminal by the control event input service program in the step S3 includes: s31, setting the running state of the control event input service program to True; s32, initializing the control event input service program, then creating a Socket, and establishing TCP connection with a target terminal through a preset target terminal IP and a port number; s33, initializing a control event processing function module of the control event input service program; and S34, starting the first sub-thread, and when control stream data arrives, calling an 'injectInputEvent' interface to inject a control event into the android mobile terminal through a reflection mechanism, so as to control the operation of the android mobile terminal at the target terminal.
In a specific implementation, in step S34, the operation state of the control event input service program is determined, and if the operation state is True, the control flow data is blocked and waits to be received; and if the running state is not True, ending the first sub-thread.
In a preferred embodiment, between the step S32 and the step S33, it is determined whether the connection between the android mobile terminal and the target terminal is successful, and if the connection is successful, the step S33 is started; if the connection fails, the operation state of the control event input program is set to False, and the operation is started again from step S1 after the sleep preset time.
In a further preferred embodiment, between step S31 and step S32, a second sub-thread is opened, a DatagramSocket is created in the second sub-thread, and a "callback activated" message is broadcasted through the UDP port at preset intervals.
In another preferred embodiment, after step S4, when the user turns off the USB debug switch at the android mobile terminal, the control event input service program ends running. At this time, the android mobile terminal cannot be controlled again on the target terminal.
In another possible embodiment, the specific process of activating the callback function of the android mobile terminal in step S3 includes: starting a sub thread at a target terminal to receive a pairing connection request of an android mobile terminal and a request for activating a back control operation; when the target terminal receives a request of activating a back control operation of the android mobile terminal, starting an ADB tool to detect whether the android mobile terminal is connected to the target terminal through a USB line or not, and detecting whether the android mobile terminal turns on a USB debugging switch or not; and if the android mobile terminal is connected with the target terminal through a USB line and the USB debugging switch is turned on, pushing the control event input program to the android mobile terminal, running the control event input service program on a background of the android mobile terminal through an ADB tool, and activating the back control operation of the android mobile terminal.
In a preferred implementation of this method, the step S3 of activating the callback function of the android mobile terminal further includes: judging whether the activation is successful, and if the activation is successful, ending the sub thread; if the activation is not successful, try again; the process ends if it is still not active after a preset number of attempts.
In another aspect of the present invention, a program product is provided, which comprises instructions that, when run on a computer, cause the computer to perform the above-described method of controllable screen projection.
In a further aspect of the invention, a computer-readable storage medium is provided, which comprises a computer program enabling a computer to carry out the above-mentioned method of controlled screen casting when the computer program is run.
In addition, the invention also provides a controllable screen projection device, which comprises: an android mobile terminal, a target terminal and a computer program; the android mobile terminal is in communication connection with a target terminal; the android mobile terminal comprises a first processor and a first memory; the target terminal comprises a display screen, a control component, a second processor and a second memory; the computer program comprises an ADB tool, an app _ process tool, a control event input service program and a screen projection service program; the control component is used for receiving input operation; the display screen is used for displaying a screen projection interface; the first memory is used for storing the app _ process tool and the control event input service program; the second memory is used for storing the ADB tool and the screen projection service program; the control event input program comprises a network connection module and a control event processing module; the first processor is configured to: running the app _ process tool to input the control event into a service program to run in the background; operating the network connection module to establish communication connection between the android mobile terminal and the target terminal; the control event processing module is operated to analyze and process control flow data sent from a target terminal, and then a corresponding control event is injected into the android mobile terminal; the screen projection service program at least comprises a back control activation service module; the second processor is configured to: and operating the back control activation service module to send control flow data to the android mobile terminal to realize activation of back control operation.
In a specific embodiment, when the control event input service program runs in the background, the first processor performs the following operations: setting the running state of the control event input service program to True; initializing the control event input service program; operating the network connection module to create Socket sockets, and establishing TCP connection with a target terminal through a preset target terminal IP and a preset port number; initializing the control event processing module and starting a first sub thread; when control stream data comes, an injectInputEvent interface is called through a reflection mechanism to inject a control event into the android mobile terminal, and the operation of the android mobile terminal is controlled at a target terminal.
In an optional manner, after the first sub-thread is opened, the first processor further performs the operations of: judging the running state of the control event input service program, and if the running state is True, blocking and waiting for receiving control flow data; and if the running state is not True, ending the first sub-thread.
In a preferred embodiment, before initializing the control event processing module, the first processor further performs the operations of: judging whether the connection between the android mobile terminal and the target terminal is successful, and initializing the control event processing module if the connection is successful; and if the connection fails, setting the running state of the control event input program to False, and setting the running state of the control event input service program to True again after sleeping for preset time.
In a further preferred embodiment, after initializing the control event input service, the first processor further performs the operations of: and operating the network connection module to start a second sub-thread, creating a DatagrmSycket socket in the second sub-thread, and broadcasting a message of 'response control activated' outwards through a UDP port at preset intervals.
In one possible embodiment, running the callback activation service module, the second processor performs the following operations: starting a sub thread at a target terminal to receive a pairing connection request of an android mobile terminal and a request for activating a back control operation; when a request for activating the back control operation of the android mobile terminal is received, starting an ADB tool to detect whether the android mobile terminal is connected to a target terminal through a USB line or not, and detecting whether the android mobile terminal is turned on a USB debugging switch or not; and if the android mobile terminal is connected with the target terminal through a USB line and the USB debugging switch is turned on to meet the conditions, pushing the control event input program to the android mobile terminal, executing the control event input service program in the background of the android mobile terminal through an ADB tool, and activating the back control operation of the android mobile terminal.
In an optional implementation, the second processor further performs the operations of: judging whether the read activation is successful, and if the read activation is successful, ending the process; if the activation is not successful, try again; the process ends if it is still not active after a preset number of attempts.
Preferably, the android mobile terminal is an android mobile phone or an android smart tablet; the target terminal is a car machine. The screen projection function is applied to a common scene in an automobile, the content on the android mobile phone or the android intelligent tablet and the acquired internet resources such as a navigation map, a music player and the like are displayed on a display screen of the vehicle machine through a screen projection technology, and the screen projection method can be controlled by a user to operate a control component of the vehicle machine, such as a knob, a key or a touch screen, so that the android mobile phone or the android intelligent tablet is controlled, the operation is easier, and the driving safety is also facilitated.
The invention has the following beneficial effects: according to the retroactive screen projection method, the control event input program is operated at the background of the android mobile terminal through the ADB tool and the app _ process tool carried by the android mobile terminal, the retroactive operation is executed, the problem that screen projection of the android mobile terminal needs specific authority can be avoided, meanwhile, in the WIFI screen projection mode, only a developer mode needs to be opened, the USB wire can be pulled out after the retroactive function is activated, the android mobile terminal is controlled at the target terminal, and therefore the android mobile terminal user is not bound by wired connection in the retroactive screen projection operation, the operation is more flexible and convenient, the user experience is improved, and further popularization and promotion of the screen projection technology are facilitated. The controllable screen-casting device and the computer storage medium have corresponding advantages because the controllable screen-casting method can be realized.
Drawings
Fig. 1 is a schematic view of a controllable screen-projecting device according to an embodiment of the invention.
Fig. 2 is a schematic diagram illustrating a control event input procedure according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a configuration of a screen projection service program according to an embodiment of the present invention.
Fig. 4 is a flowchart of a controllable screen-projecting method according to an embodiment of the present invention.
Fig. 5 is a schematic diagram illustrating an implementation process of the control event input program according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of activating a callback function of an android mobile terminal in an embodiment of the present invention.
Fig. 7 is a schematic diagram of an implementation process of the control event input program according to the second embodiment of the present invention.
Detailed Description
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings. In the figures, parts of the same structure or function are denoted by the same reference numerals, and not all parts shown are denoted by the associated reference numerals in all figures for reasons of clarity of presentation.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
As shown in fig. 1, in a first embodiment of the present invention, a controllable screen-projection device includes an android mobile terminal and a target terminal, where the android mobile terminal in the specific embodiment is described by taking an android phone 10 as an example, which is not limited to this, and may also be other mobile terminals based on an android system, such as an android smart tablet; the target terminal is illustrated by taking the car machine 20 as an example, but is not limited to this, and the target terminal may also be a television or a computer. In the present embodiment, the vehicle 20 includes a display screen 201 and a control component 202, such as a knob-controlled central control device. Conventionally, the android phone 10 and the car machine 20 can be connected by a USB cable, and in an embodiment, the USB interface is an interface conforming to a USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. In the embodiment of the invention, the controllable screen throwing system can support a USB wired screen throwing mode and also supports a WIFI wireless screen throwing mode, and the controllable screen throwing device disclosed by the invention can realize the control returning operation in the USB wired screen throwing mode and also can realize the wireless control returning operation in the WIFI wireless screen throwing mode. The back control operation is realized under the condition that the USB wire is always connected in the USB screen projecting mode, only a developer mode switch of the android mobile phone 10 needs to be turned on, and the central control touch display screen 20 of the vehicle loader is connected through the USB wire.
In the embodiment, the main screen-casting control of the android phone 10 is an android phone-side screen-casting APP, which is named ACarPlay. The ACarPlay is used for intercepting data being displayed on the screen of the android mobile phone 10, then the data is coded into an H264 data stream 10D through MediaCodec, and the data is transmitted to the display screen 201 through a WIFI network (Socket) or a USB network (Localsocket), so that screen projection of the mobile phone is realized.
In this embodiment, as illustrated in fig. 1, the android phone 10 includes a first memory 101, a first processor 102; the car machine 20 further includes a second memory 203 and a second processor 204. Both the first memory 101 and the second memory 203 are computer-readable storage media that may be used to store computer-executable program code, the executable program code comprising instructions; the first processor 102 can execute and complete corresponding operations by executing the instructions stored in the first memory 101, and the second processor 203 can execute the instructions stored in the second memory 203. The screen-returning controllable screen projection device further comprises a computer program, which comprises an app _ process tool and the control event input service program stored in the first memory 101 in the embodiment; ADB tool and the screen projection service program stored on the second memory 203. ADB tools and android's own app _ process tools are common in the art and are not specifically set forth herein.
The control event input program is used for receiving a back control event from the car machine 20 through a communication WIFI network (Socket) or a USB network (localcocket) and then injecting a control event into the android mobile phone 10. The control event input program in this embodiment is named "acarplayputeventserver". The control event input program is hereinafter referred to as acarplayputeventserver. In the embodiment, the ACarPlayInputEventServer includes a network connection module 11 and a control event processing module 12, as shown in fig. 2.
As shown in fig. 3, the screen-casting service program named ACarPlayServer in this embodiment includes a callback activation service module 21, and further includes a mobile phone pairing connection service module, an H264 data receiving service module, an H264 data decoding service module, a frame data transmission service module, and a touch event distribution service module. In order to implement the controllable screen-casting ACarPlayServer, the ACarPlayServer at least includes a callback activation service module 21, which is used to send control flow data to the android mobile terminal to activate a callback operation, in this embodiment, other modules included in the ACarPlayServer are a better example of this embodiment, and are not limited, and there may be more or fewer modules or include other specific function modules according to a specific application scenario.
As shown in fig. 4, the method for realizing the controllable screen projection in the embodiment includes step s1, connecting an android mobile phone 10 to a car machine 20 through a USB cable; s2, opening a developer mode of the android mobile phone 10; step S3, the ACCARPlayInputEventServer is operated on the android mobile phone 10 as a background service program through the ADB tool and an app _ process tool of the android mobile phone 10 system in the car machine 20, the back control function of the android mobile phone 10 is activated, and the ACCARPlayInputEventServer injects a control event into the android mobile phone 10 after receiving the back control event from the car machine 20; and S4, in the WIFI screen projection mode, disconnecting the wired connection between the android mobile phone 10 and the car machine 20 by the user. Just so can realize that wireless controllable screen is thrown to the back, need not receive the constraint of data line all the time, in use can control android mobile phone 10 in the operation on controlling part 202, and the operation is more nimble, and is convenient, and the experience that the user thrown the screen and uses is better.
In still other embodiments, after step S4 above, if the user turns off the USB debug switch of the android phone 10 during use, the ACarPlayInputEventServer ends the run. The android phone 10 can no longer be controlled by the manipulation component 202.
In a first embodiment, the method for implementing the above-mentioned controllable screen-casting by the controllable screen-casting device of the present invention is performed by the first processor 102 and the second processor 204. The first processor 102 is configured to perform the following operations: running the app _ process tool will run in the acarplayputeventserver background; the network connection module 11 is operated to establish communication connection between the android mobile phone 10 and the car machine 20; the operation control event processing module 12 analyzes and processes control flow data 20D sent from the car machine 20, and then injects a corresponding control event into the android phone 10; the second processor 204 is configured to perform the following operations: and the operation feedback activation service module 21 sends control flow data 20D to the android phone 10 to activate the feedback operation.
Referring to fig. 1 in combination, as shown in fig. 5, when the acarplayputeventserver runs in the background, the first processor 102 performs the following operations: step S31, setting the running state of the ACarPlayInputEventServer to True; step S32, initializing the ACarPlayInputEventServer, then operating the network connection module 11 to create a Socket, and establishing TCP connection with the car machine 20 through the preset IP and port number of the car machine 20; s33, initializing a control event processing module 12; s34, starting the first sub-thread, blocking and waiting for receiving the control flow data 20D, judging whether data comes or not, and continuing waiting if not; when control stream data comes, an injectInputEvent interface is called by a reflection mechanism to inject a control event into the android phone 10, and then the control event is processed.
In some preferred implementations of this embodiment, in step S34, the first processor 102 further executes a determining process to determine an operating status of the acarplayputeventserver, and if the operating status is sure, continues to block and wait for receiving the control flow data 20D; if the operating condition is not Ture, but False, the first child thread is ended. This is a better practice example of the present embodiment, and does not limit other possible practices of the present embodiment.
In this embodiment, the first processor 102 executes an operation, and the network connection module 11 and the car machine 20 are operated to establish a TCP connection with a port number "8886", and the TCP connection may send a request to the car machine 20 and may also receive control flow data 20D sent by the car machine 20.
In some other embodiments of the present invention, the ACarPlayInputEventServer is not pre-stored in the first memory 101 of the android phone 10, and the user may first push the ACarPlayInputEventServer from the car machine 20 to the first memory 101 of the android phone 10 for storage through the ADB tool when performing the controllable screen-casting for the first time. The present invention is not limited thereto.
In this embodiment, referring to fig. 1, a specific process of the second processor 204 running the callback activation service module 21 to execute the callback function of the android phone 10 is shown in fig. 6, and includes: the car machine 20 starts a "mobile phone pairing connection request" sub-thread to receive the pairing connection request of the android mobile phone 10 and a request for activating a callback operation, in an embodiment, the sub-thread starts a TCP socket service with a port number "8886", and then waits for a mobile phone connection. This is done for a specific embodiment and is not intended to be limiting. After receiving a request for activating the callback operation of the android phone 10, processing the request for activating the callback operation, starting an ADB tool to detect whether the android phone 10 is connected to the car machine 20 through a USB line, and detecting whether the android phone 10 turns on a USB debugging switch; if the result is not yes, returning, and continuing to wait for the connection of the mobile phone; when the condition is satisfied, the acarplayputeventserver is pushed to the android phone 10. In some embodiments, the ACarPlayInputEventServer is previously stored in the first memory 101 of the android handset 10, and there is no push. The ACarPlayInputEventServer is operated in the background of the android phone 10 through an ADB tool, so that the callback operation of the android phone 10 is activated.
In some preferred implementations of the present embodiment, in the specific process of activating the callback function of the android phone 10, the second processor 204 further performs the following operations: judging whether the activation is successful, and if the activation is successful, ending the process; if the activation is not successful, try again; the process ends if it is still not active after a preset number of attempts. In the specific embodiment, the back-out is set to be attempted for 10 times, and a smaller or larger number of times can be set according to actual conditions to match with applicable scenes or specific requirements.
The main difference between the second embodiment and the first embodiment is that the first processor 102 executes the process of the acarplayputeventserver execution operation. Referring to fig. 1 in combination, as shown in fig. 7, after initializing ACarPlayInputEventServer in the present embodiment, the first processor 102 further performs the operations of: step S31', the network connection module 11 is operated to start the second sub-thread, create a DatagramSocket in the second sub-thread, and broadcast the message of "back control activated" to the outside through the UDP port at preset intervals. The UDP port number in this embodiment is "8885". The specific preset time is 1 second in the embodiment, and may also be 2 seconds, or a time preset according to the actual situation. The purpose is to let ACarPlay know the state of acarplayputeventserver background running.
In this embodiment, prior to initializing the control event processing module 12, the first processor also performs the operations of: step S32', determining whether the android phone 10 and the car machine 20 are successfully connected, and if the connection is successful, initializing the control event processing module 12; if the connection fails, setting the running state of the ACarPlayInputEventServer to be False, setting the running state of the ACarPlayInputEventServer to be True again after sleeping for 1 second, and trying to continue running, wherein in some embodiments, the running state is sleeping for 2 seconds or other preset time according to actual conditions.
The above embodiments are preferred examples of the present invention, and are not intended to limit the scope of the present invention. For purposes of clarity, numerous implementation details are set forth in the above description. It should be understood, however, that the details of these implementations should not be used to limit the invention. In addition, for simplicity of illustration, some structures and components are shown in the drawings in a simplified schematic manner, which is merely schematic and does not limit the design possibilities.
In addition, the descriptions related to the first, the second, etc. in the present invention are only used for description purposes, do not particularly refer to an order or sequence, and do not limit the present invention, but only distinguish components or operations described in the same technical terms, and are not understood to indicate or imply relative importance or implicitly indicate the number of indicated technical features.
Technical solutions between various embodiments may be combined with each other, but must be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Claims (20)
1. A method for controllable screen projection is characterized in that: the method comprises the following steps:
s1, connecting an android mobile terminal with a target terminal through a USB (universal serial bus) line;
s2, opening a developer mode of the android mobile terminal;
s3, operating a control event input service program on the android mobile terminal as a background service through an ADB tool and an app _ process tool of the android mobile terminal at the target terminal, and activating a back control function of the android mobile terminal, wherein the control event input service program is used for injecting a control event into the android mobile terminal after receiving the back control event from the target terminal;
and S4, disconnecting the wired connection between the android mobile terminal and the target terminal in the WIFI screen projection mode.
2. The method of claim 1, wherein: between the step S2 and the step S3, the control event input service program is pushed to the android mobile terminal by the target terminal through the ADB tool.
3. The method of claim 1, wherein: in step S3, the process of injecting the control event into the android mobile terminal by the control event input service program includes:
s31, setting the running state of the control event input service program to be True;
s32, initializing the control event input service program, then creating a Socket, and establishing TCP connection with a target terminal through a preset target terminal IP and a port number;
s33, initializing a control event processing function module of the control event input service program;
and S34, starting the first sub-thread, and when control stream data arrives, calling an 'injectInputEvent' interface to inject a control event into the android mobile terminal through a reflection mechanism, so as to control the operation of the android mobile terminal at the target terminal.
4. The method of claim 3, wherein: in step S34, determining the running state of the control event input service program, and if the running state is True, blocking waiting for receiving control flow data; ending the first child thread if the running state is not True.
5. The method of claim 3, wherein: between the step S32 and the step S33, determining whether the connection between the android mobile terminal and the target terminal is successful, and if the connection is successful, starting a step S33; if the connection fails, the operation state of the control event input program is set to False, and the operation is started again from step S1 after the sleep preset time.
6. The method of claim 3, wherein: between the step S31 and the step S32, a second sub-thread is opened, a DatagramSocket is created in the second sub-thread, and a message of "back control activated" is broadcast to the outside through a UDP port at preset intervals.
7. The method of any one of claims 1 to 6, wherein: after step S4, when the user turns off the USB debug switch at the android mobile terminal, the control event input service program ends running.
8. The method of any one of claims 1 to 6, wherein: the specific process of activating the callback function of the android mobile terminal in the step S3 includes:
starting a sub thread at a target terminal to receive a pairing connection request of the android mobile terminal and a request for activating a back control operation;
when the target terminal receives a request of activating a back control operation of the android mobile terminal, starting an ADB tool to detect whether the android mobile terminal is connected to the target terminal through a USB line or not, and detecting whether the android mobile terminal turns on a USB debugging switch or not;
and if the android mobile terminal is connected with the target terminal through a USB line and the USB debugging switch is turned on, pushing the control event input program to the android mobile terminal, running the control event input service program on a background of the android mobile terminal through an ADB tool, and activating the back control operation of the android mobile terminal.
9. The method of claim 8, wherein: the process of activating the callback function of the android mobile terminal in step S3 further includes: judging whether the activation is successful, and if the activation is successful, ending the sub-thread; if the activation is not successful, try again; the process ends if it is still not active after a preset number of attempts.
10. The method of any one of claims 1 to 6, wherein: the android mobile terminal is an android mobile phone or an android intelligent tablet.
11. The method of any one of claims 1 to 6, wherein: the target terminal is a vehicle machine.
12. A computer-readable storage medium characterized by: the computer-readable storage medium comprises a computer program which, when executed, enables a computer having the computer program to perform the method of any of claims 1-11.
13. A screen device is thrown in controllable backtracking which characterized in that: the method comprises the following steps:
an android mobile terminal, a target terminal and a computer program; the android mobile terminal is in communication connection with a target terminal;
the android mobile terminal comprises a first processor and a first memory; the target terminal comprises a display screen, a control component, a second processor and a second memory; the computer program comprises an ADB tool, an app _ process tool, a control event input service program and a screen projection service program;
the control component is used for receiving input operation; the display screen is used for displaying a screen projection interface;
the first memory is used for storing the app _ process tool and the control event input service program; the second memory is used for storing the ADB tool and the screen projection service program;
the control event input program comprises a network connection module and a control event processing module; the first processor is configured to perform the following operations:
running the app _ process tool to input the control event into a service program to run in the background;
operating the network connection module to establish communication connection between the android mobile terminal and the target terminal; the control event processing module is operated to analyze and process control flow data sent from a target terminal, and then a corresponding control event is injected into the android mobile terminal;
the screen projection service program at least comprises a back control activation service module; the second processor is configured to: and operating the back control activation service module to send control flow data to the android mobile terminal to realize activation of back control operation.
14. A controllable screen-projecting device according to claim 13, wherein: when the control event input service program runs in the background, the first processor performs the following operations:
setting the running state of the control event input service program to True; initializing the control event input service program;
operating the network connection module to create Socket sockets, and establishing TCP connection with a target terminal through a preset target terminal IP and a preset port number;
initializing the control event processing module and starting a first sub-thread;
when control stream data comes, an injectInputEvent interface is called through a reflection mechanism to inject a control event into the android mobile terminal, and the operation of the android mobile terminal is controlled at a target terminal.
15. A controllable screen-projecting device according to claim 14, wherein: after the first child thread is opened, the first processor further performs the operations of:
judging the running state of the control event input service program, and if the running state is True, blocking and waiting for receiving control flow data; and if the running state is not True, ending the first sub-thread.
16. A controllable screen-projecting device according to claim 14, wherein: prior to initializing the control event processing module, the first processor further performs the operations of:
judging whether the connection between the android mobile terminal and the target terminal is successful, and initializing the control event processing module if the connection is successful; and if the connection fails, setting the running state of the control event input program to False, and setting the running state of the control event input service program to True again after sleeping for preset time.
17. A controllable screen-projecting device according to claim 14, wherein: after initializing the control event input service, the first processor further performs the operations of: and operating the network connection module to start a second sub-thread, creating a DatagramSocket socket in the second sub-thread, and broadcasting a message of 'response control activated' outwards through a UDP port at preset intervals.
18. A controllable screen-projecting device according to claim 13 or 14, wherein: the second processor executes the back control activation service module and performs the following operations: starting a sub thread at a target terminal to receive a pairing connection request of an android mobile terminal and a request for activating a back control operation;
when a request for activating a callback operation of the android mobile terminal is received, starting an ADB tool to detect whether the android mobile terminal is connected to a target terminal through a USB line or not and detect whether the android mobile terminal is turned on a USB debugging switch or not;
and if the android mobile terminal is connected with the target terminal through a USB line and the USB debugging switch is turned on to meet the conditions, pushing the control event input program to the android mobile terminal, executing the control event input service program in the background of the android mobile terminal through an ADB tool, and activating the back control operation of the android mobile terminal.
19. A controllable screen-projecting device according to claim 18, wherein: the second processor further performs the operations of: judging whether the activation is successful, and if the activation is successful, ending the sub-thread; if the activation is not successful, try again; the process ends if it is still not active after a preset number of attempts.
20. A controllable screen-projecting device according to any of claims 13-17, wherein: the android mobile terminal is an android mobile phone or an android smart tablet; the target terminal is a car machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011381181.9A CN114584815A (en) | 2020-11-30 | 2020-11-30 | Method, computer readable storage medium and device for controlling screen projection in backward mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011381181.9A CN114584815A (en) | 2020-11-30 | 2020-11-30 | Method, computer readable storage medium and device for controlling screen projection in backward mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114584815A true CN114584815A (en) | 2022-06-03 |
Family
ID=81767729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011381181.9A Pending CN114584815A (en) | 2020-11-30 | 2020-11-30 | Method, computer readable storage medium and device for controlling screen projection in backward mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114584815A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6559883B1 (en) * | 2000-09-27 | 2003-05-06 | David H. Sitrick | Movie film security system utilizing infrared patterns |
CN103002155A (en) * | 2012-12-13 | 2013-03-27 | 江苏诚迈科技有限公司 | Method for deploying Android mobile phone by using vehicle-mounted terminal |
CN104333844A (en) * | 2014-11-12 | 2015-02-04 | 沈阳美行科技有限公司 | Interconnection method of vehicle-mounted terminal and smart phone |
CN104391695A (en) * | 2014-11-06 | 2015-03-04 | 北京凌阳益辉科技有限公司 | Method for performing synchronous control through external equipment and device thereof |
US20160085699A1 (en) * | 2013-05-20 | 2016-03-24 | Zte Corporation | Enabling method and enabling device for debugging port of terminal, and terminal |
CN106027808A (en) * | 2016-07-28 | 2016-10-12 | 上海博泰悦臻电子设备制造有限公司 | Car machine, intelligent mobile terminal, and corresponding connection control method and system |
WO2016206528A1 (en) * | 2015-06-26 | 2016-12-29 | 飞天诚信科技股份有限公司 | Method for implementing automatic bluetooth reconnection in android system |
WO2017101419A1 (en) * | 2015-12-15 | 2017-06-22 | 乐视控股(北京)有限公司 | Screen projection method |
CN108255677A (en) * | 2018-01-16 | 2018-07-06 | 中电福富信息科技有限公司 | The vehicle-mounted vehicle device of car networking and Android device communication means and its device |
CN108536491A (en) * | 2018-02-07 | 2018-09-14 | 武汉光庭信息技术股份有限公司 | A kind of processing method and system of mobile unit Reverse Turning Control Android mobile terminal |
-
2020
- 2020-11-30 CN CN202011381181.9A patent/CN114584815A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6559883B1 (en) * | 2000-09-27 | 2003-05-06 | David H. Sitrick | Movie film security system utilizing infrared patterns |
CN103002155A (en) * | 2012-12-13 | 2013-03-27 | 江苏诚迈科技有限公司 | Method for deploying Android mobile phone by using vehicle-mounted terminal |
US20160085699A1 (en) * | 2013-05-20 | 2016-03-24 | Zte Corporation | Enabling method and enabling device for debugging port of terminal, and terminal |
CN104391695A (en) * | 2014-11-06 | 2015-03-04 | 北京凌阳益辉科技有限公司 | Method for performing synchronous control through external equipment and device thereof |
CN104333844A (en) * | 2014-11-12 | 2015-02-04 | 沈阳美行科技有限公司 | Interconnection method of vehicle-mounted terminal and smart phone |
WO2016206528A1 (en) * | 2015-06-26 | 2016-12-29 | 飞天诚信科技股份有限公司 | Method for implementing automatic bluetooth reconnection in android system |
WO2017101419A1 (en) * | 2015-12-15 | 2017-06-22 | 乐视控股(北京)有限公司 | Screen projection method |
CN106027808A (en) * | 2016-07-28 | 2016-10-12 | 上海博泰悦臻电子设备制造有限公司 | Car machine, intelligent mobile terminal, and corresponding connection control method and system |
CN108255677A (en) * | 2018-01-16 | 2018-07-06 | 中电福富信息科技有限公司 | The vehicle-mounted vehicle device of car networking and Android device communication means and its device |
CN108536491A (en) * | 2018-02-07 | 2018-09-14 | 武汉光庭信息技术股份有限公司 | A kind of processing method and system of mobile unit Reverse Turning Control Android mobile terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107493375B (en) | Mobile terminal expansion screen projection method and screen projection system | |
US10104599B2 (en) | Device binding methods and apparatuses | |
CN108184164B (en) | Audio playing method, smart television and computer readable storage medium | |
EP2592535A1 (en) | Method and mobile terminal for locking screen | |
CN104967971A (en) | Method achieving bluetooth automatic return connection in Android system | |
CN113992958B (en) | Multi-window same-screen interaction method, terminal and storage medium | |
CN103235680B (en) | The processing method and processing device that bluetooth connects | |
CN107341407B (en) | Multi-android system implementation method based on terminal, storage medium and terminal | |
CN106027631B (en) | Data transmission method and device | |
EP4106377A1 (en) | Verification information processing method and apparatus, terminal device and storage medium | |
CN112565526A (en) | Monitoring method, monitoring device, vehicle and storage medium | |
KR100678023B1 (en) | Abbreviation method for booting time of mobile communication terminal device | |
CN107466022B (en) | SIM card switching method, mobile terminal and storage medium | |
CN114584815A (en) | Method, computer readable storage medium and device for controlling screen projection in backward mode | |
WO2024001257A1 (en) | Display device and processing method for display device | |
CN114579217A (en) | Content definable screen projection equipment and method and computer readable storage medium | |
KR101181758B1 (en) | Method for Factory Reset of Mobile Terminal | |
CN114968456B (en) | Method and device for controlling terminal | |
JP4621589B2 (en) | Character input method, character input device, and mobile communication terminal device | |
CN115550498A (en) | Screen projection method, device, equipment and storage medium | |
CN114584828B (en) | Android screen-throwing method, computer readable storage medium and equipment | |
CN114584816B (en) | An Zhuotou screen definition setting method, computer-readable storage medium, and apparatus | |
CN111381793A (en) | Data transmission method, transmission equipment and display equipment | |
EP3550864B1 (en) | Vehicle-mounted electronic device for performing double authentication | |
JP4195061B2 (en) | Cooperation operation method and mobile terminal apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |