Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The fast application is a novel application form, and has the remarkable characteristics that the application can be used without installation after downloading, and the occupied memory is far smaller than that of the original application (the application which can be used only after being downloaded) and is generally about several hundred kb. The fast application is generally operated and developed based on a fast application engine, and normally, the native application can be developed into the fast application based on the fast application engine, for example, the native applications such as a video application, a social application, a picture application, a music application, a reading application, a learning and education application, a financial application, a life application, an office application, a trip application, a shopping application, a game application, and the like can be developed into the fast application based on the fast application engine.
Currently, the applications of the fast application in touch devices such as smart phones and tablet computers are more, and accordingly, the response of the fast application to touch operation is technically mature. However, with the popularization of large-screen electronic devices such as smart televisions, more and more users tend to use application programs specially adapted for large screens on the large-screen electronic devices, and the fast application does not need to be installed, occupies a low memory, and has lower development difficulty and cost compared with the native application, so that the deployment of the fast application on the large-screen electronic devices such as smart televisions has become a hot issue of research. However, large-screen electronic devices such as smart televisions are usually controlled by a remote controller, and therefore, how to adapt the application to the remote controller quickly so as to respond to key events of the remote controller becomes a problem to be solved urgently.
In view of the above, embodiments of the present application provide a remote control interaction based method, an apparatus, an electronic device, and a storage medium, which enable a fast application to adapt to a remote controller, where the remote control interaction based method may be applied in an application environment as shown in fig. 1. The application environment includes aremote control 102 and anelectronic device 104. Theelectronic device 104 may be a large-screen electronic device such as a smart television, a projection device, and the like, and theelectronic device 104 may be operated by theremote controller 102. Theelectronic device 104 has installed therein a fast application that can run based on a fast application engine in theelectronic device 104.
In one embodiment, as shown in fig. 2, a remote control interaction-based method is provided, which is exemplified by the method applied to the electronic device in fig. 1, and includes the following steps:
step 201, in the process of displaying the page of the target fast application, detecting whether a physical key triggering event aiming at the page occurs through an operating system.
When the electronic equipment displays the page of the target fast application, if the key of the remote controller is pressed by a user, the remote controller sends a remote control signal to the electronic equipment according to the pressed key. After receiving a remote control signal sent by a remote controller, an electronic device may detect a physical key trigger event triggered by a remote control operation through an operating system, where the operating system may be an android operating system, a Windows operating system, and the like, and the specific type of the operating system is not limited in the embodiments of the present application.
When the operating system is an android operating system, after a remote control signal sent by a remote controller is received, a physical key triggering event triggered by remote control operation can be monitored through a keyEvent function in the android system.
For example, the smart television displays a page of the fast application a, when a key a of the remote controller is pressed by a user, the remote controller generates a remote control signal according to a key position value corresponding to the preset key a, and sends the remote control signal to the smart television. The smart television receives a remote control signal sent by a remote controller, and an android system installed in the smart television can detect a physical key triggering event which is triggered by remote control operation and aims at a page of the fast application A based on a keyEvent function.
Step 202, if the physical key triggering event is detected by the operating system, obtaining key position information corresponding to the physical key triggering event by the fast application engine.
In this embodiment of the application, when an operating system in the electronic device detects a physical key trigger event, key location information corresponding to the physical key trigger event may be obtained, for example, when the operating system is an android operating system, the android operating system may obtain the key location information corresponding to the physical key trigger event when monitoring the physical key trigger event triggered by remote operation based on a keyEvent function.
The key position information comprises at least one of a remote controller key position value, remote controller key position action and remote controller key position action repetition times. The remote controller key position value is used for indicating the pressed key of the remote controller, the remote controller key position action is used for indicating the pressed key and bounces, and the remote controller key position action repetition times are used for indicating the pressed key and bounces. For example, the key position information may include: the key a is pressed and bounced, and the number of times the key a is pressed and bounced is 2 times.
The electronic equipment is pre-provided with a fast application engine, and the electronic equipment can acquire key position information corresponding to a physical key triggering event through the fast application engine. Optionally, the operating system of the electronic device may provide an interactive interface with the fast application engine, and instep 202, the fast application engine may obtain key position information corresponding to the physical key triggering event from the operating system based on the interactive interface.
Andstep 203, transmitting the key position information to the target fast application through the fast application engine so that the target fast application responds to the physical key triggering event based on the key position information.
After acquiring the key position information, the fast application engine may transmit the key position information to the target fast application, and optionally, in this embodiment of the application, the fast application engine may transmit the key position information to the target fast application based on a callback function registered in advance by the target fast application. The callback function is a function passed as a parameter, that is, an executable code is passed to other codes as a parameter, and the code is called to be executed at a certain time, and the passed code is called the callback function. A callback function is called a synchronous callback function if it is executed immediately, or an asynchronous callback function if it is executed later at some time. The callback function pre-registered by the target fast application can be used as a parameter to be transferred to the function included by the target fast application.
After receiving the key position information transmitted by the fast application engine, the target fast application may respond to the physical key trigger event based on the key position information, where the response of the target fast application to the physical key trigger event may include: the method includes switching a focus component in a target fast application page, switching a page of a target fast application, and the like, which is not specifically limited in this embodiment of the present application.
Among other things, the page of the target fast application may include a number of components, which may be options, such as a "movie" option, a "tv show" option, etc., where the focused component refers to the component where the cursor is currently located.
In the remote control interaction method, in the process of displaying the page of the target fast application, whether a physical key triggering event triggered by remote control aiming at the page occurs is detected through the operating system, if the physical key triggering event is detected through the operating system, key position information corresponding to the physical key triggering event is obtained through the fast application engine, and the key position information is transmitted to the target fast application through the fast application engine, so that the target fast application responds to the physical key triggering event triggered by the remote control according to the key position information.
In one embodiment, as shown in fig. 3, the above step of passing the key bit information to the target fast application by the fast application engine may include the following steps:
step 301, determining a focusing component corresponding to a physical key triggering event in each component included in a page of a target fast application through a fast application engine.
As described above, the page of the target fast application may include a plurality of components, where the focused component corresponding to the physical key trigger event refers to the component where the cursor is currently located. Referring to fig. 4, a page of the target fast application is provided with a plurality of components, where the plurality of components may be a movie option, a drama option, an art option, and an animation option, where if a cursor is currently located in the movie option, the movie option is a focusing component corresponding to a physical key trigger event.
In an alternative embodiment of the present application, the focusing component in the page of the target fast application may carry a focusing flag, and the fast application engine may determine the focusing component from the components included in the page of the target fast application by checking whether the component carries the focusing flag.
Step 302, detecting whether the focus component registers a callback function through the fast application engine.
In this embodiment of the present application, a callback function may be registered in the fast application engine in advance for at least one component in a page of a target fast application, for example, a technician may register a corresponding callback function in the fast application engine for one or some components in the page of the target fast application in the process of developing the target fast application, where the callback function is used to acquire key location information corresponding to a physical key triggering event.
After determining the focusing assembly corresponding to the physical key triggering event, detecting whether the focusing assembly is registered with a callback function through a fast application engine. For example, in the case where the movie option is determined to be the focus component, it may be detected by the fast application engine whether the movie option is registered with a callback function.
And 303, if the callback function is registered in the focusing assembly, transmitting the key position information to the target fast application through the fast application engine based on the callback function registered in the focusing assembly.
If the focusing assembly registers a callback function, the quick application engine transfers the callback function registered by the focusing assembly to a function corresponding to the focusing assembly in a parameter mode, calls the callback function in the process of executing the function corresponding to the focusing assembly, and acquires key position information corresponding to a physical key triggering event through the callback function. Thus, the target application can obtain the key position information, and respond to the physical key triggering event according to the key position information.
For example, the fast application engine may transfer a callback function registered in advance for a movie option to a function corresponding to the movie option in a parameter form, and in the process of executing the function corresponding to the movie option, the callback function may be called to acquire key position information through the callback function, so that the target fast application may respond to the physical key trigger event according to the key position information.
In the process of transmitting the key information to the target fast application through the fast application engine, the fast application engine determines a focusing assembly corresponding to a physical key trigger event in each assembly included in the page, detects whether the focusing assembly registers a callback function or not, and transmits the key information to the target fast application through the fast application engine based on the callback function registered by the focusing assembly if the focusing assembly registers the callback function. The embodiment of the application provides a mode of acquiring and transmitting key position information through a callback function, so that a target fast application can respond to a physical key triggering event according to the key position information, the fast application is adaptive to television equipment, the application range of the fast application is expanded, and the callback function registered by a focusing assembly can be set according to user requirements, so that the functions of electronic equipment are expanded.
In one embodiment, as shown in fig. 5, after the step of detecting whether the focus component is registered with the callback function by the fast application engine, the method may further include:
step 304, if the callback function is not registered in the focusing assembly, detecting whether the page of the target fast application is registered with the page onkey life cycle through the fast application engine.
The page onkey lifecycle is a special callback function, which is generally a callback function for page registration, and generally, the execution process of the page onkey lifecycle includes: and transferring the life cycle of the page onkey to a page function corresponding to the page in a parameter mode, and calling the life cycle of the page onkey in the process of executing the page function so as to realize the function of the life cycle of the page onkey.
In the embodiment of the application, a page onkey lifecycle can be registered in the fast application engine in advance for a page of a target fast application, for example, a technician can register the page onkey lifecycle for the page of the target fast application in the fast application engine in a development process of the target fast application, where the page onkey lifecycle is used to acquire key position information corresponding to a physical key triggering event.
If the fast application engine detects that the focusing component does not register the callback function, the focusing component does not have the function of responding to the physical key triggering event, and in this case, the electronic device can detect whether the page of the target fast application is registered with the page onkey lifecycle through the fast application engine.
Step 305, if the page of the target fast application is registered with the page onkey lifecycle, the key position information is transmitted to the target fast application through the fast application engine based on the page onkey lifecycle.
If the fast application engine detects that the page of the target fast application is registered with the page onkey life cycle, the fast application engine can transmit the page onkey life cycle to a function corresponding to the page of the target fast application in a parameter mode, the page onkey life cycle is called in the process of executing the function corresponding to the page of the target fast application, and key position information is obtained through the page onkey life cycle. Thus, the target application can obtain the key position information, and respond to the physical key triggering event according to the key position information.
And step 306, if the page onkey life cycle is not registered, acquiring a response event corresponding to the physical key trigger event through the operating system, and executing the response event.
If the fast application engine detects that the page of the target fast application does not register the page onkey life cycle, it indicates that the page of the target fast application does not have the function of responding to the physical key trigger event, and in this case, the operating system of the electronic device may respond to the physical key trigger event.
Optionally, when the fast application engine detects that the page of the target fast application does not register the page onkey lifecycle, a response event corresponding to the physical key trigger event may be obtained by the operating system, for example, the response event may be an event of reducing volume, an event of shutdown, and the like, which is not specifically limited in this embodiment of the present application. After determining the response event, the electronic device may execute the response event via the operating system.
Optionally, the electronic device may maintain a correspondence table between the key location information and the response event, and the electronic device may query the correspondence table through the operating system based on the key location information corresponding to the physical key trigger event, so as to obtain the response event corresponding to the physical key trigger event.
In the above embodiment, if the focus component does not register the callback function, the fast application engine is used to detect whether the page has a page onkey lifecycle registered therein, if the page has a page onkey lifecycle registered therein, the fast application engine is used to transmit the key position information to the target fast application based on the page onkey lifecycle, and if the page has no page onkey lifecycle registered therein, the operating system is used to obtain the response event corresponding to the physical key trigger event and execute the response event. The embodiment of the disclosure provides a mode for acquiring and transmitting key position information through a life cycle of a page onkey, so that a target fast application can respond to a physical key triggering event according to the key position information, the fast application is adaptive to television equipment, and the application range of the fast application is expanded; moreover, the life cycle of the page onkey of the page registration can be set according to the requirements of the user, so that the functions of the electronic equipment are expanded.
In one embodiment, as shown in fig. 6, a remote control interaction-based method is provided, which is exemplified by the method applied to the electronic device in fig. 1, and includes the following steps:
step 401, in the process of displaying the page of the target fast application, detecting whether a physical key trigger event for the page occurs through an operating system.
The operating system of the electronic equipment can be an android system, and various event monitoring functions can be set in the android system. For example, the event listening function includes at least one of a key event function, a progress bar event function, and a pull-down menu event function. The embodiments of the present disclosure do not limit this.
The electronic device detects whether a physical key triggering event for a page occurs by using a key event (English) function of an operating system.
Step 402, if a physical key trigger event is monitored based on a key event function in the operating system, obtaining key position information transmitted by the operating system through the fast application engine.
If the key event function of the operating system monitors a physical key trigger event, the operating system can acquire key position information corresponding to the monitored physical key trigger event. Thereafter, the fast application engine obtains key position information from the operating system and delivers the key position information to the target fast application in subsequent steps.
And step 403, determining a focusing component corresponding to the physical key triggering event in each component included in the page through the fast application engine.
Atstep 404, the fast application engine detects whether the focus component is registered with a callback function.
And 405, if the focus component registers a callback function, transmitting the key position information to the target fast application through the fast application engine based on the callback function registered by the focus component.
Instep 406, if the focus component does not register the callback function, the fast application engine detects whether the page is registered with the page onkey life cycle.
Step 407, if the page onkey lifecycle is registered in the page, the key position information is transmitted to the target fast application through the fast application engine based on the page onkey lifecycle.
And step 408, if the page onkey life cycle is not registered, acquiring a response event corresponding to the physical key trigger event through the operating system, and executing the response event.
In the remote control interaction method, after the physical key triggering event is detected by the operating system, the key position information corresponding to the physical key triggering event is acquired and transmitted by the fast application engine, so that the target fast application can respond to the physical key triggering event, the fast application can be adapted to television equipment, and the application range of the fast application is expanded; moreover, the functions of the television equipment are improved, and the interactive experience of the user is improved.
It should be understood that, although the steps in the flowcharts of fig. 2 to 6 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 to 6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 7, there is provided a remote control based interaction device, which can be applied to the electronic device described above, including:
anevent detection module 501, configured to detect, by an operating system, whether a physical key trigger event for a page occurs in a process of displaying a page of a target fast application, where the physical key trigger event is triggered by a remote control operation;
a keyposition obtaining module 502, configured to obtain, by the fast application engine, key position information corresponding to a physical key triggering event if the physical key triggering event is detected by the operating system;
the keyposition transferring module 503 is configured to transfer the key position information to the target fast application through the fast application engine, so that the target fast application responds to the physical key triggering event based on the key position information.
In one embodiment, as shown in fig. 8, the keybit delivery module 503 includes:
the focusing component determining sub-module 5031 is configured to determine, by using the fast application engine, a focusing component corresponding to the physical key trigger event in each component included in the page;
a callbackfunction detection sub-module 5032, configured to detect, by the fast application engine, whether the focus component registers a callback function;
the first key bit passing sub-module 5033 is configured to, if the focus component registers a callback function, pass the key bit information to the target fast application through the fast application engine based on the callback function registered by the focus component.
In one embodiment, the first keyposition delivery sub-module 5033 is specifically configured to deliver the callback function registered by the focusing component to the function corresponding to the focusing component through the fast application engine; calling a callback function in the process of executing the function corresponding to the focusing assembly; and acquiring key position information through a callback function.
In one embodiment, as shown in fig. 8, the apparatus further comprises:
the second keyposition transmission sub-module 5034 is configured to detect, by the fast application engine, whether the page onkey lifecycle is registered in the page if the focus component does not register the callback function; and if the page onkey life cycle is registered in the page, transmitting the key position information to the target fast application through the fast application engine based on the page onkey life cycle.
In one embodiment, the second keyposition delivery sub-module 5034 is specifically configured to deliver the life cycle of the page onkey to a function corresponding to the page through the fast application engine; calling a webpage onkey life cycle in the process of executing a function corresponding to the page; and acquiring key position information through the life cycle of the page onkey.
In one embodiment, as shown in fig. 9, the apparatus further comprises:
theresponse module 504 is configured to, if the page onkey life cycle is not registered in the page, obtain a response event corresponding to the physical key trigger event through the operating system, and execute the response event.
In one embodiment, the keylocation obtaining module 502 is specifically configured to obtain, by the fast application engine, key location information transmitted by the operating system if a physical key triggering event is monitored based on a key event function in the operating system.
In one embodiment, the key information includes at least one of a remote controller key position value, a remote controller key action, and a repetition number of the remote controller key action.
For specific limitations of the remote control based interaction device, reference may be made to the above limitations of the remote control based interaction method, which are not described herein again. The various modules in the remote control-based interaction device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent of a processor in the electronic device, or can be stored in a memory in the electronic device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, an electronic device is provided, the internal structure of which may be as shown in FIG. 10. The electronic device comprises a processor, a memory, a communication interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device is used for carrying out wired or wireless communication with external electronic devices, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a remote control based interaction method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a remote controller, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the present solution and does not constitute a limitation on the electronic devices to which the present solution applies, and that a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
in the process of displaying the page of the target fast application, detecting whether a physical key triggering event aiming at the page occurs through an operating system, wherein the physical key triggering event is triggered by remote control operation;
if the physical key triggering event is detected through the operating system, acquiring key position information corresponding to the physical key triggering event through the fast application engine;
and transmitting the key position information to the target fast application through the fast application engine so that the target fast application responds to the physical key triggering event based on the key position information.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining a focusing component corresponding to a physical key triggering event in each component included in a page through a fast application engine;
detecting whether a callback function is registered in a focusing assembly or not through a fast application engine;
and if the focus component registers a callback function, transmitting the key position information to the target fast application through the fast application engine based on the callback function registered by the focus component.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
transferring the callback function registered by the focusing assembly to a function corresponding to the focusing assembly through a fast application engine;
calling a callback function in the process of executing the function corresponding to the focusing assembly;
and acquiring key position information through a callback function.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the focus component does not register the callback function, detecting whether the page is registered with the page onkey life cycle or not through the fast application engine;
and if the page onkey life cycle is registered in the page, transmitting the key position information to the target fast application through the fast application engine based on the page onkey life cycle.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
transmitting the lifecycle of the page onkey to a function corresponding to the page through a fast application engine;
calling a webpage onkey life cycle in the process of executing a function corresponding to the page;
and acquiring key position information through the life cycle of the page onkey.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and if the page onkey life cycle is not registered, acquiring a response event corresponding to the physical key trigger event through the operating system, and executing the response event.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and if the physical key triggering event is monitored based on the key event function in the operating system, acquiring key position information transmitted by the operating system through the fast application engine.
In one embodiment, the key position information includes at least one of a remote controller key position value, a remote controller key position action, and a number of repetitions of the remote controller key position action.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
in the process of displaying the page of the target fast application, detecting whether a physical key triggering event aiming at the page occurs through an operating system, wherein the physical key triggering event is triggered by remote control operation;
if the physical key triggering event is detected through the operating system, acquiring key position information corresponding to the physical key triggering event through the fast application engine;
and transmitting the key position information to the target fast application through the fast application engine so that the target fast application responds to the physical key triggering event based on the key position information.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a focusing component corresponding to a physical key triggering event in each component included in a page through a fast application engine;
detecting whether a callback function is registered in a focusing assembly or not through a fast application engine;
and if the focus component registers a callback function, transmitting the key position information to the target fast application through the fast application engine based on the callback function registered by the focus component.
In one embodiment, the computer program when executed by the processor further performs the steps of:
transferring the callback function registered by the focusing assembly to a function corresponding to the focusing assembly through a fast application engine;
calling a callback function in the process of executing the function corresponding to the focusing assembly;
and acquiring key position information through a callback function.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the focus component does not register the callback function, detecting whether the page is registered with the page onkey life cycle or not through the fast application engine;
and if the page onkey life cycle is registered in the page, transmitting the key position information to the target fast application through the fast application engine based on the page onkey life cycle.
In one embodiment, the computer program when executed by the processor further performs the steps of:
transmitting the lifecycle of the page onkey to a function corresponding to the page through a fast application engine;
calling a webpage onkey life cycle in the process of executing a function corresponding to the page;
and acquiring key position information through the life cycle of the page onkey.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the page onkey life cycle is not registered, acquiring a response event corresponding to the physical key trigger event through the operating system, and executing the response event.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the physical key triggering event is monitored based on the key event function in the operating system, acquiring key position information transmitted by the operating system through the fast application engine.
In one embodiment, the key position information includes at least one of a remote controller key position value, a remote controller key position action, and a number of repetitions of the remote controller key position action.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.