Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar modules or modules having the same or similar functionality throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. On the contrary, the embodiments of the application include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
For a better understanding of the present application, the remote control signal generated by the infrared remote control will be described first.
The commonly used transmission protocols of infrared remote controller signals include NEC, SHARP, PHILIPS RC-5, SONY, TOSIBA and the like, and the most used transmission protocol of domestic infrared remote controller signals is NEC codes. The infrared remote control signal may comprise one or more of the following signal codes: a guide code, a user system code, a user data inverse code and an end code. The main differences in the infrared remote control signal transmission protocols are the difference in the boot code and the difference in the signal code. Because of the wide variety of remote control signal transmission protocols, only two commonly used NEC/RC-5 protocols are described here, and other protocols are basically similar to the two remote control protocols and will not be described in detail.
The NEC code is shown in FIG. 1, where 9ms +4.5ms is the pilot code, Address low/high is the user system code, Command is the user data code,the user data is decoded. Fig. 2 shows that 2.25ms intervals between 2 high levels represent a logic 1, and 1.12ms intervals between 2 high levels represent a logic 0.
RC-5 code as shown in FIG. 3, 2 consecutive logic 1 are start codes (denoted by S1/S2); in the figure, a mark T is a control bit, 1 represents that the key is a new key value at this time, and 0 represents a repeated key; address (5 bits in total) is a user system code, and Command (6 bits in total) is a user data code. Fig. 4 shows that 889us is high before 889us is low after it, representing a logic 0, and the reverse order of high and low represents a logic 1.
The identification of the remote control signal transmission protocol is to judge through the time interval of the high and low level pulse signals of the remote control signal and identify a specific protocol. Taking the NEC/RC-5 protocol as an example, the MCU needs to obtain the start code/bootstrap code of the remote control signal, determine the general protocol type of the signal according to the start code/bootstrap code, and then identify the specific remote control protocol according to the signal characteristics of the logic level.
Fig. 5 is a flowchart illustrating a method for adapting a non-standard remote control by an intelligent electronic device according to an embodiment of the present application, where the method is specifically applicable to a situation where a matched remote control mapping file cannot be directly obtained from a server. The method comprises the following steps:
s51: starting an application program on the intelligent electronic equipment, and displaying an interface of the application program, wherein the interface comprises a key to be adapted.
The application program may be an application program that is configured in the intelligent electronic device in advance and is used for generating a remote controller mapping file.
When the remote controller mapping file needs to be generated, the application program may be started, and after the application program is started, an interface of the application program shown in fig. 6 may be displayed, where the interface includes a plurality of keys to be adapted, such as a power key 61.
S52: and selecting a key to be adapted in the interface, and acquiring a remote control code corresponding to the selected key, wherein the remote control code is acquired by analyzing a remote control signal, and the remote control signal is generated by pressing the key on the remote control by a user.
Wherein, the application program can automatically select a key for adaptation.
For example, the power key 61 may be initially adapted as a selected key, and after the power key 61 is adapted, the next key, such as a Menu (Menu) key, may be automatically skipped to perform the adaptation.
Of course, it is understood that the user may also manually select a key on the interface of the application program for adaptation.
When the application program adapts the keys, the remote control codes corresponding to the currently adapted keys can be obtained, so that the remote controller mapping file is generated according to the functions of the currently adapted keys and the corresponding remote control codes.
For example, an application program receives a notification message sent by a driver, wherein the notification message is sent after the driver analyzes the remote control code; and after receiving the notification message, the application program acquires the remote control code from the driver program.
Alternatively, the remote control may be a non-standard remote control of the intelligent electronic device.
Alternatively, the remote control signal may be generated by the user pressing a key on the non-standard remote control that has the same function as the selected key.
For example, the interface of the remote controller is shown in fig. 7. Taking the adaptive power key 61 as an example, when the power key 61 is adapted, a user can press the power key 71 on the remote controller to generate a remote controller signal, the driver can receive the remote controller signal and analyze the remote controller signal to obtain a remote control code, the driver can send a notification message to the application program after receiving the remote control code, and the application program can obtain a corresponding remote control code from the driver after receiving the notification message.
The remote controller can be specifically an infrared remote controller, and according to the difference of the transmission protocol adopted by the infrared remote controller, the remote control code can comprise: one or more of a user system code, a user data code, a boot code, etc.
After the application program acquires the remote control code corresponding to one key (e.g., the power key 61), the application program may automatically jump to the next key for adaptation, and repeat the above-mentioned process, for example, the user presses a key on the non-standard remote controller having the same function as the selected key, the driver analyzes the remote control signal to obtain the remote control code, and the application program acquires the remote control code from the driver until the adaptation is completed, for example, the adaptation of all the keys to be adapted in the interface shown in fig. 6 is completed, or an instruction generated by the user through the completion of the adaptation key or the cancellation of the adaptation key in the interface shown in fig. 6 is received.
In addition, the application program can process according to the standard remote control flow after receiving the remote control signal generated by the standard remote control.
S53: and generating a remote controller mapping file according to the function of the selected key and the remote control code.
The generation of the remote controller mapping file according to the selected key function and the remote control code can be specifically executed after the adaptation is completed.
The adaptation completion includes, for example:
completing the adaptation of all keys to be adapted in the interface; or,
receiving an instruction generated by pressing an adaptive key in the interface by a user; or,
and receiving an instruction generated by pressing the adaptation canceling key in the interface by the user.
The application program can pre-configure the corresponding relation between the keys and the functions in the interface, so that after one key is selected, the function corresponding to the selected key can be determined according to the pre-configured information.
The mapping relation between the remote control codes and the functions is recorded in the remote controller mapping file, so that after the intelligent electronic equipment receives the remote control signals and detects the remote control codes from the remote control signals, the corresponding functions can be determined according to the remote controller mapping file, and the corresponding functions are executed. The functions include, for example: turning on and off the machine, turning up or turning down the volume and the like.
The mapping relationship between the remote control code and the function is shown in table 1, for example.
TABLE 1
In table 1, the function is represented by a kernel key (key), and the user data code represents a remote control code corresponding to the function. () For example, the key value of key is 116 corresponding to the user data code "0 af 5", and the corresponding function is a switching power supply.
In addition, the remote controller mapping file may also include other remote control codes, such as user system codes.
On the other hand, when the remote controller mapping file matched with the remote controller exists at the server, the remote controller mapping file is downloaded from the server according to the manufacturer and the model of the remote controller. For example, a mobile phone assistant is used to select and download the matched remote controller mapping file from the server according to the manufacturer of the remote controller and the specific remote controller model.
In some embodiments, referring to fig. 8, after obtaining the remote controller mapping file, for example, generating the remote controller mapping file by using the above procedure, or downloading the remote controller mapping file from the server according to the manufacturer and model of the remote controller when the remote controller mapping file matching the remote controller exists at the server (S54), the method further includes:
s55: and writing the remote controller mapping file into a file node of a preset file system of the kernel so that the kernel can control according to the remote controller mapping file and the received remote controller signal generated by the remote controller.
The default file system is, for example, a sysfs file system of a Linux kernel system, and the sysfs file system is a device management system in the Linux system. The user space can read or write to a file node of the sysfs file system.
After the remote controller mapping file is written into the file node of the sysfs file system, the driver in the Linux kernel can perform corresponding control according to the remote controller mapping file, for example, when the driver receives a remote controller signal and resolves that the remote control code is 0af5, the driver can execute the function that the key value of kernel is 116, thereby realizing the control of the intelligent electronic device.
In addition, the intelligent electronic equipment can also store a remote controller mapping file corresponding to the standard remote controller, and after receiving the remote controller signal, a driver in the kernel of the intelligent electronic equipment can determine whether the remote controller signal comes from the standard remote controller or the non-standard remote controller by analyzing the remote control code, and then control the remote controller according to the corresponding remote controller mapping file.
In addition, when the intelligent electronic equipment needs to be adapted to another non-standard remote controller, the process can be executed again to realize the adaptation with a new remote controller, so that the intelligent electronic equipment can be adapted to various remote controllers.
In this embodiment, the application program is started on the intelligent electronic device, and the remote controller mapping file for recording the mapping relationship between the remote control codes and the functions is generated through the application program and the remote controller signals generated by the remote controller, so that the intelligent electronic device executes the corresponding functions according to the remote controller mapping file after receiving the remote controller signals generated by the non-standard remote controller, and the intelligent electronic device can be controlled by the non-standard remote controller. Furthermore, the embodiment generates the remote controller mapping file through the application program, so that the hardware cost does not need to be increased, and the cost is reduced. In this embodiment, through the non-standard remote controller of intelligent electronic equipment adaptation, can be when the standard configuration remote controller of intelligent electronic equipment is not good to use or loses, damage etc. can't use, can let intelligent electronic equipment normal use through the remote controller of the current other equipment standards of adaptation again, perhaps, select the remote controller that the user used commonly and used to carry out the adaptation, can realize resource reuse, reduce use cost, improve the user and experience the use of intelligent equipment, and can reach energy saving and emission reduction's purpose.
Fig. 9 is a schematic structural diagram of an apparatus for adapting a non-standard remote control to an intelligent electronic device according to another embodiment of the present application, where the apparatus may be specifically located in the intelligent electronic device. The apparatus 90 comprises: a starting module 91, an obtaining module 92 and a generating module 93.
The starting module 91 is configured to start an application program on the intelligent electronic device and display an interface of the application program, where the interface includes a key to be adapted.
The application program may be an application program that is configured in the intelligent electronic device in advance and is used for generating a remote controller mapping file.
When the remote controller mapping file needs to be generated, the application program may be started, and after the application program is started, an interface of the application program shown in fig. 6 may be displayed, where the interface includes a plurality of keys to be adapted, such as a power key 61.
The obtaining module 92 is configured to select a key to be adapted in the interface, and obtain a remote control code corresponding to the selected key, where the remote control code is obtained by analyzing a remote control signal, and the remote control signal is generated by a user pressing the key on the remote control.
Optionally, the obtaining module 92 is configured to select a key to be adapted in the interface, and includes:
an application program automatically selects a key; or,
and receiving a key selected by a user.
Wherein, the application program can automatically select a key for adaptation.
For example, the power key 61 may be initially adapted as a selected key, and after the power key 61 is adapted, the next key, such as a Menu (Menu) key, may be automatically skipped to perform the adaptation.
Of course, it is understood that the user may also manually select a key on the interface of the application program for adaptation.
Optionally, the obtaining module 92 is configured to obtain a remote control code corresponding to the selected key, and includes:
receiving a notification message sent by a driver, wherein the notification message is sent after the driver analyzes the remote control code;
and acquiring the remote control code from the driver after receiving the notification message.
Alternatively, the remote control may be a non-standard remote control of the intelligent electronic device.
Alternatively, the remote control signal may be generated by the user pressing a key on the non-standard remote control that has the same function as the selected key.
For example, the interface of the remote controller is shown in fig. 7. Taking the adaptive power key 61 as an example, when the power key 61 is adapted, a user can press the power key 71 on the remote controller to generate a remote controller signal, the driver can receive the remote controller signal and analyze the remote controller signal to obtain a remote control code, the driver can send a notification message to the application program after receiving the remote control code, and the application program can obtain a corresponding remote control code from the driver after receiving the notification message.
The remote controller can be specifically an infrared remote controller, and according to the difference of the transmission protocol adopted by the infrared remote controller, the remote control code can comprise: one or more of a user system code, a user data code, a boot code, etc.
And a generating module 93, configured to generate a remote controller mapping file according to the function of the selected key and the remote control code, where a mapping relationship between the remote control code and the function is recorded in the remote controller mapping file.
The generation module is used for generating the remote controller mapping file according to the function of the selected key and the remote controller, and the generation can be specifically executed after the adaptation is completed.
The generation module is further configured to determine an adaptation completion, the determining the adaptation completion comprising:
completing the adaptation of all keys to be adapted in the interface; or,
receiving an instruction generated by pressing an adaptive key in the interface by a user; or,
and receiving an instruction generated by pressing the adaptation canceling key in the interface by the user.
The mapping relation between the remote control codes and the functions is recorded in the remote controller mapping file, so that after the intelligent electronic equipment receives the remote control signals and detects the remote control codes from the remote control signals, the corresponding functions can be determined according to the remote controller mapping file, and the corresponding functions are executed. The functions include, for example: turning on and off the machine, turning up or turning down the volume and the like.
The mapping relationship between the remote control code and the function is shown in table 1, for example.
In some embodiments, referring to fig. 10, the apparatus 90 further comprises:
and a downloading module 94, configured to, when a remote controller mapping file matching the remote controller exists at the server, download the remote controller mapping file from the server according to the manufacturer and the model of the remote controller.
For example, a mobile phone assistant is used to select and download the matched remote controller mapping file from the server according to the manufacturer of the remote controller and the specific remote controller model.
In some embodiments, referring to fig. 10, the apparatus 90 further comprises:
the writing module 95 is configured to write the remote controller mapping file into a file node of a preset file system of the kernel, so that the kernel performs control according to the remote controller mapping file and a received remote controller signal generated by the remote controller.
The default file system is, for example, a sysfs file system of a Linux kernel system, and the sysfs file system is a device management system in the Linux system. The user space can read or write to a file node of the sysfs file system.
After the remote controller mapping file is written into the file node of the sysfs file system, the driver in the Linux kernel can perform corresponding control according to the remote controller mapping file, for example, when the driver receives a remote controller signal and resolves that the remote control code is 0af5, the driver can execute the function (switching power supply) that the key value of kernel is 116, thereby realizing the control of the intelligent electronic device.
In addition, the intelligent electronic equipment can also store a remote controller mapping file corresponding to the standard remote controller, and after receiving the remote controller signal, a driver in the kernel of the intelligent electronic equipment can determine whether the remote controller signal comes from the standard remote controller or the non-standard remote controller by analyzing the remote control code, and then control the remote controller according to the corresponding remote controller mapping file.
In this embodiment, the application program is started on the intelligent electronic device, and the remote controller mapping file for recording the mapping relationship between the remote control codes and the functions is generated through the application program and the remote controller signals generated by the remote controller, so that the intelligent electronic device executes the corresponding functions according to the remote controller mapping file after receiving the remote controller signals generated by the non-standard remote controller, and the intelligent electronic device can be controlled by the non-standard remote controller. Furthermore, the embodiment generates the remote controller mapping file through the application program, so that the hardware cost does not need to be increased, and the cost is reduced. In this embodiment, through the non-standard remote controller of intelligent electronic equipment adaptation, can be when the standard configuration remote controller of intelligent electronic equipment is not good to use or loses, damage etc. can't use, can let intelligent electronic equipment normal use through the remote controller of the current other equipment standards of adaptation again, perhaps, select the remote controller that the user used commonly and used to carry out the adaptation, can realize resource reuse, reduce use cost, improve the user and experience the use of intelligent equipment, and can reach energy saving and emission reduction's purpose.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.