Infrared device control method, device, equipment and storage medium
By detecting the access of USB devices and parsing preset strings to start the infrared receiver, the problem that the infrared remote control cannot accurately control individual or partial infrared devices is solved, and precise control and selective control of infrared devices are achieved.
Patent Information
- Application Number
- CN202311841952.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2043-12-28
AI Technical Summary
When existing infrared remote controls only need to control one or some infrared devices, they cannot accurately control the corresponding infrared devices according to user needs, resulting in inaccurate control.
By detecting that the specified data is read after the USB device is connected, the preset string is parsed to turn on the infrared receiver, and the status of the infrared receiver is activated or maintained according to the content is detected to ensure that the infrared code value of the infrared remote control is correctly received and processed. .
It realizes precise control of infrared devices, avoids the infrared remote control's mistriggering of multiple devices, and improves the user's selective control ability of infrared devices.
Smart Images

Figure CN117831260B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of infrared control technology, and in particular to an infrared device control method, device, equipment and storage medium. Background Art
[0002] Since infrared remote controllers have the advantages of good stability, strong anti-interference, low power consumption, and low cost, most remote control devices are currently controlled by infrared rays to facilitate users to control the devices.
[0003] In order to facilitate users to control multiple display terminal devices at exhibitions, infrared remote controllers that can control multiple terminal devices are often used. In order to optimize the display effect of the product, reserved standby terminal devices are used when building the terminal devices for easy adjustment. However, when the user only needs the infrared remote controller to control one or some of the infrared devices, the infrared remote controller will trigger all the terminal devices, resulting in the infrared remote controller that controls multiple infrared devices being unable to accurately control the corresponding infrared devices according to the user's needs. Summary of the invention
[0004] The main purpose of the present application is to provide an infrared device control method, apparatus, device and storage medium, aiming to solve the technical problem in the prior art that when the user only needs an infrared remote control to control one or part of the infrared devices, the corresponding infrared devices cannot be accurately controlled according to the user's needs.
[0005] To achieve the above object, the present application provides an infrared device control method, the infrared device control method comprising:
[0006] After detecting that a USB device is connected, reading the specified data of the USB device;
[0007] Parsing a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device;
[0008] Performing content detection on the preset character string;
[0009] If the preset character string passes the content detection, the infrared receiver corresponding to the USB device is started to receive the infrared code value of the infrared remote controller.
[0010] Optionally, the step of performing content detection on the preset character string includes:
[0011] Comparing the preset string with a preset verification string;
[0012] If the preset character string is consistent with the preset verification character string, determining that the preset character string passes the content detection;
[0013] generating an opening instruction of the infrared receiver;
[0014] The step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller includes:
[0015] The infrared receiver corresponding to the USB device is started based on the start instruction to receive the infrared code value of the infrared remote controller.
[0016] Optionally, after the step of comparing the preset character string with a preset verification character string, the method further includes:
[0017] If the preset character string is inconsistent with the preset verification character string, determining that the preset character string fails the content detection;
[0018] A keep-closed instruction for the infrared receiver is generated, wherein the keep-closed instruction is used to control the infrared receiver to remain in a closed state, and an initial state of the infrared receiver is a closed state.
[0019] Optionally, after detecting that a USB device is connected, before the step of reading specified data of the USB device, the method further includes:
[0020] The preset verification string is written in the process of writing the self-running program, and the preset verification string is user-defined.
[0021] Optionally, the step of reading the specified data of the USB device includes:
[0022] Detecting specified data in the USB device;
[0023] If the designated data is detected, the designated data is read.
[0024] Optionally, after the step of detecting the specified data in the USB device, the method further includes:
[0025] If the designated data is not detected, the reading is abandoned and a keep-off instruction of the infrared receiver is generated.
[0026] Optionally, after the step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller, the step further includes:
[0027] Determining a control instruction based on the infrared code value;
[0028] Execute corresponding actions based on the control instruction.
[0029] In addition, to achieve the above purpose, the present application also provides an infrared device control device, the infrared device control device comprising:
[0030] A reading module, used to read the specified data of the USB device after detecting that the USB device is connected;
[0031] A parsing module, used for parsing a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device;
[0032] A detection module, used for performing content detection on the preset character string;
[0033] The infrared receiver control module is used to start the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller if the preset character string passes the content detection.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes an infrared device control device, which includes: a memory, a processor, and an infrared device control program stored in the memory and executable on the processor, and the infrared device control program is configured to implement the steps of the infrared device control method described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which an infrared device control program is stored, and when the infrared device control program is executed by a processor, the steps of the infrared device control method described above are implemented.
[0036] The present application provides an infrared device control method, apparatus, device and storage medium. Compared with the prior art in which the corresponding infrared devices cannot be accurately controlled according to the user's needs when the user only needs an infrared remote control to control one or part of the infrared devices, in the present application, after detecting that a USB device is connected, the specified data of the USB device is read; a preset character string in the specified data is parsed, and the preset character string represents the password for turning on the infrared receiver of the USB device; the content of the preset character string is detected; if the preset character string passes the content detection, the infrared receiver corresponding to the USB device is started to receive the infrared code value of the infrared remote control. That is, in the present application, after detecting that the USB device is connected, the specified data is read from the USB device, and then the specified data is parsed to obtain the preset character string in the specified data, and the content of the preset character string is detected. If the content detection is passed, it means that the USB device matches the infrared device, and the infrared device will start the infrared receiver to receive the infrared code value of the infrared remote control. That is, by detecting whether the USB device is connected and detecting whether the USB device matches the infrared device, if both the USB device is connected and the infrared device matches, the infrared code value of the infrared remote control will be received. The user can connect the USB device to the required infrared device, and when the infrared device detects that the USB device is connected and determines that it matches the USB device, the infrared receiver is turned on to receive the infrared code value of the infrared remote control, thereby avoiding the infrared remote control from being unable to selectively control the infrared device, thereby achieving precise control of the corresponding infrared device according to the user's needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 This is a schematic diagram of the structure of an infrared device control device in the hardware operating environment involved in the embodiment of the present application;
[0040] Figure 2 This is a flow chart of the first embodiment of the infrared device control method of the present application;
[0041] Figure 3 This is a schematic diagram of an example of an infrared code value transmitted by an infrared remote controller in the infrared device control method of the present application;
[0042] Figure 4 A schematic diagram of a specific implementation flow of the infrared device control method of the present application;
[0043] Figure 5 A schematic diagram of the network topology of the infrared device control method of this application;
[0044] Figure 6 This is a flow chart of the second embodiment of the infrared device control method of the present application;
[0045] Figure 7 This is a flow chart of the third embodiment of the infrared device control method of the present application;
[0046] Figure 8 This is a schematic diagram of the structural configuration of the infrared device control device of this application.
[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an infrared device control device in the hardware operating environment involved in the embodiment of the present application.
[0050] like Figure 1 As shown, the infrared device control device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0051] Those skilled in the art will understand that Figure 1The structure shown in the figure does not constitute a limitation on the infrared device control device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0052] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and an infrared device control program.
[0053] exist Figure 1 In the infrared device control device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the infrared device control device of the present application can be set in the infrared device control device, and the infrared device control device calls the infrared device control program stored in the memory 1005 through the processor 1001, and executes the infrared device control method provided in the embodiment of the present application.
[0054] The present application embodiment provides an infrared device control method, referring to Figure 2 , Figure 2 This is a flow chart of a first embodiment of an infrared device control method of the present application.
[0055] It should be noted that the executor of this embodiment can be the infrared device control device, and the infrared device control device can be an electronic device such as a personal computer, a smart phone, a tablet computer, or other other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the infrared device control method of this application is explained by taking the infrared device control device as an example.
[0056] In this embodiment, the infrared device control method includes:
[0057] Step S10, after detecting that a USB device is connected, reading the specified data of the USB device.
[0058] It should be noted that the access of USB devices is user-controlled, that is, the user will connect the USB device to the corresponding infrared device according to needs. After the infrared device detects the access of the USB device, it can be confirmed that the infrared device is the infrared device required by the user; if no USB device is detected to be connected, it means that the user does not need to use the infrared device.
[0059] The designated data at least includes a preset character string for a user to turn on the infrared receiver.
[0060] It should be noted that after detecting the USB device, in order to avoid mismatch between the USB device and the infrared device, it is necessary to read the specified data of the USB device and use the specified data for content detection so that the infrared device can accurately turn on the infrared receiver according to user needs and be controlled by the infrared remote control.
[0061] In the specific implementation, it is detected whether the USB device is connected. After detecting that the USB device is connected, it means that the user needs the infrared device, and then the specified data of the USB device is read to use the specified data to detect whether the connected USB device is correct, so as to achieve precise control of the infrared device required by the user.
[0062] Step S20, parsing a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device.
[0063] The preset character string may be a user-defined character string or a randomly generated character string, etc., and there is no specific limitation.
[0064] The preset character string may be composed of numbers, such as 112233, etc.; it may also be composed of letters, such as aabbCCDD, AABBCC, aabbcc, etc.; it may also be composed of numbers and letters, such as PID233, pID233, etc.
[0065] In a specific implementation, parsing the preset character string in the specified data can be understood as identifying the preset character string from the specified data, and using the preset character string to detect whether the USB device matches the infrared device.
[0066] Step S30: performing content detection on the preset character string.
[0067] It should be noted that the content detection of the preset string can be to detect the consistency between the preset characters and the preset verification string, that is, the preset verification character can be understood as a pre-set password, and the preset character can be understood as the password that needs to be entered when the USB device is connected to the infrared device, so as to determine whether the USB device is planned to be connected by detecting the content of the preset string.
[0068] Step S40: If the preset character string passes the content detection, the infrared receiver corresponding to the USB device is activated to receive the infrared code value of the infrared remote controller.
[0069] It should be noted that when the preset string passes the content detection, it means that the USB device matches the infrared device, avoiding the user from connecting the wrong USB device. After confirming that the connected USB is correct, the infrared receiver is started to use the infrared receiver to receive the infrared code value of the infrared controller, and then receive the control of the infrared controller.
[0070] It should be noted that there can be multiple or one infrared receiver. When the infrared device is controlled by multiple infrared remote controls at the same time, since each infrared remote control corresponds to a USB device, in order to distinguish the remote control that transmits the control command, multiple infrared receivers can be provided, that is, each infrared receiver corresponds to one infrared remote control; when the infrared device only receives the control command of one infrared remote control, one infrared receiver can be provided.
[0071] In a specific implementation, if there is only one infrared receiver in the infrared device, the infrared receiver is started after the preset string passes the content detection, so that the infrared receiver can receive the infrared code value of the infrared remote control, determine the corresponding control instruction according to the infrared code value, and then execute the corresponding action according to the control instruction; if there are multiple infrared receivers in the infrared device, the infrared receiver corresponding to the USB device needs to be started after the preset string passes the content detection, so as to ensure that when the USB device and the infrared device match, the infrared device can receive the infrared code value sent by the infrared remote control.
[0072] In the specific implementation, refer to Figure 3 When the infrared remote control (infrared remote control) sends an infrared code value, you need to press the corresponding button and convert the infrared code value into an infrared signal to send, where each button can correspond to an infrared code value.
[0073] In a specific implementation, since the infrared receiver receives a signal modulated by infrared rays, the infrared code value of the infrared remote controller received by the infrared receiver can be determined by modulating the signal after receiving the signal.
[0074] Furthermore, after the step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller, the step further includes:
[0075] Step S50, determining a control instruction based on the infrared code value;
[0076] Step S60: executing a corresponding action based on the control instruction.
[0077] It should be noted that, since each infrared code value has one or more corresponding control instructions, the control instruction can be determined from the infrared protocol according to the infrared code value, so as to control the execution action according to the control instruction.
[0078] In a specific implementation, an infrared protocol is provided in the infrared device to determine the relationship between the infrared code value and the control instruction through the infrared protocol. Therefore, after obtaining the infrared code value, the corresponding control instruction can be determined from the infrared protocol according to the infrared code value, and the corresponding action can be executed according to the control instruction.
[0079] In the specific implementation, refer to Figure 4 , pre-set the preset character segment PID233 in the USB device, detect whether the USB device is connected, if the USB device is connected, try to read the specified data (password.txt file) in the USB device, if the file can be read, detect whether the preset character segment in the file is PID233, if so, turn on the infrared receiver, and use the infrared receiver to receive the infrared signal of the infrared remote control device; if the USB device cannot be detected, the specified data cannot be read, or the content of the detected preset character segment is not PID233, a keep-closed instruction can be generated to keep the infrared receiver in a closed state.
[0080] It should be noted that the infrared device control method in this embodiment is as follows: Figure 5 The module structure is implemented, wherein the terminal device is used to preset the specified data for USB parsing, control the infrared receiver switch, read the USB, and parse the file data specified by the USB (file: password.txt, content: PID233); the USB device is used to store the preset string (user-defined); and the infrared remote control is used to send the infrared code value.
[0081] The present embodiment provides an infrared device control method. Compared with the prior art in which the corresponding infrared devices cannot be accurately controlled according to the user's needs when the user only needs an infrared remote control to control one or part of the infrared devices, in the present application, after detecting that a USB device is connected, the specified data of the USB device is read; a preset character string in the specified data is parsed, and the preset character string represents the password for turning on the infrared receiver of the USB device; a content detection is performed on the preset character string; if the preset character string passes the content detection, the infrared receiver corresponding to the USB device is started to receive the infrared code value of the infrared remote control. That is, in the present application, after detecting that the USB device is connected, the specified data is read from the USB device, and then the specified data is parsed to obtain the preset character string in the specified data, and the content of the preset character string is detected. If the content detection passes, it means that the USB device matches the infrared device, and the infrared device will start the infrared receiver to receive the infrared code value of the infrared remote control. That is, by detecting whether the USB device is connected and detecting whether the USB device matches the infrared device, if both the USB device is connected and the infrared device matches, the infrared code value of the infrared remote control will be received. The user can connect the USB device to the required infrared device, and when the infrared device detects that the USB device is connected and determines that it matches the USB device, the infrared receiver is turned on to receive the infrared code value of the infrared remote control, thereby avoiding the infrared remote control from being unable to selectively control the infrared device, thereby achieving precise control of the corresponding infrared device according to the user's needs.
[0082] refer to Figure 6 , Figure 6 This is a flow chart of the second embodiment of the infrared device control method of the present application.
[0083] Based on the above embodiment, in this embodiment, in order to prevent the user from connecting the USB device to the wrong device, step S30 includes:
[0084] Step S31, comparing the preset character string with a preset verification character string;
[0085] Step S32, if the preset character string is consistent with the preset verification character string, determining that the preset character string passes the content detection;
[0086] Step S33, generating an opening instruction of the infrared receiver.
[0087] Optionally, after detecting that a USB device is connected, before the step of reading specified data of the USB device, the method further includes:
[0088] Step Sa1, writing the preset verification string in the process of writing the self-running program, wherein the preset verification string is user-defined.
[0089] In a specific implementation, a preset verification string can be pre-written in the running program of the infrared device. When the preset string needs to be verified, the corresponding preset verification string is retrieved from the running program, and the preset verification string is compared with the preset string. When the preset string is consistent with the preset verification string, it is determined that the preset character passes the content detection, that is, the USB device matches the infrared device and the USB device is not connected incorrectly. Then, an infrared receiver start instruction is generated to turn on the infrared receiver according to the start instruction, so that the infrared receiver can receive the signal of the infrared remote control and parse the signal into an infrared code value.
[0090] It should be noted that by comparing the preset character with the preset check character to see if they are consistent, it is determined whether it matches the USB device, so as to avoid the situation where the USB device should not be connected to the infrared device after detecting that the USB device is connected.
[0091] For example, USB device 1 needs to be connected to infrared device a, but when the user connects the USB device and the infrared device, he connects USB device 2 to infrared device a. At this time, infrared device a can detect the connected USB device, but cannot determine whether the connected USB device is correct. Therefore, by comparing the preset string with the preset verification string, it can be detected whether the USB device is connected incorrectly.
[0092] It should be noted that when it is determined that the preset character is consistent with the preset check character, the infrared receiver's start instruction is generated, which can prevent the infrared receiver from receiving other error signals, thereby improving the accuracy of the infrared remote control in controlling the infrared device.
[0093] Furthermore, the step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller includes:
[0094] Step S41, based on the start instruction, starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller.
[0095] In a specific implementation, the start instruction includes the identity information of the infrared receiver that needs to be started, and the corresponding infrared receiver is started according to the identity information, so that the infrared receiver receives the infrared signal of the infrared remote controller and demodulates the infrared signal into an infrared code value.
[0096] Optionally, after the step of comparing the preset character string with a preset verification character string, the method further includes:
[0097] Step S011, if the preset character string is inconsistent with the preset verification character string, determining that the preset character string fails the content detection;
[0098] Step S012, generating a keep-off instruction for the infrared receiver, wherein the keep-off instruction is used to control the infrared receiver to remain in a closed state, and the initial state of the infrared receiver is a closed state.
[0099] It should be noted that if the preset string is inconsistent with the preset verification string, it can be determined that the USB device is connected to the wrong infrared device, and a keep-off instruction for the infrared receiver can be generated, or no action can be taken to keep the infrared receiver turned off and not receive infrared signals, thereby affecting the accuracy of the infrared remote control's control of the infrared device.
[0100] It should be noted that the initial state of the infrared receiver is the off state to avoid the situation where the infrared receiver can still receive the infrared signal of the infrared remote controller and respond to the infrared signal when the infrared device does not need to be controlled, thereby affecting the user's use.
[0101] In a specific implementation, if it is detected that the order of the preset string and the preset verification string are inconsistent, characters are missing, characters are added or characters are replaced, etc., it can be determined that the preset string and the preset verification string are inconsistent. In order to prevent the infrared device from responding to the received infrared signal, a keep-closed instruction can be generated and the keep-closed instruction can be applied to the infrared receiver to keep the infrared receiver in a closed state; or no action can be taken. At this time, the infrared receiver cannot receive the open instruction and will not open.
[0102] In a specific implementation, in order to avoid the situation where the infrared receiver defaults to being turned on when it detects that a USB device is connected but does not receive an on command, a keep-off command can be generated to keep the infrared receiver turned off.
[0103] refer to Figure 7 , Figure 7 This is a flow chart of the third embodiment of the infrared device control method of the present application.
[0104] Based on the above embodiment, in this embodiment, the step of reading the specified data of the USB device includes:
[0105] Step S1, detecting designated data in the USB device;
[0106] Step S2: if the designated data is detected, read the designated data.
[0107] The detection specified data may include a standard device request, a preset character segment, a device type (such as a keyboard, a mouse or a storage device) and a specific data packet capture method.
[0108] It should be noted that after the USB device is connected, the specified data is detected from the USB device. If the specified data can be detected, it means that the connected USB device is the USB corresponding to the infrared remote control. That is, through the double detection of detecting the specified data and detecting the preset character string, it is determined whether the USB device is connected to the wrong infrared device to improve credibility.
[0109] It should be noted that by detecting whether the USB device contains designated data, it is determined whether the USB device is a USB associated with the infrared remote controller to avoid being controlled by other infrared controllers.
[0110] In a specific implementation, the designated data is generally located at a specific position or identification character of the data, so the designated data in the USB device can be detected according to the specific position or identification character, and after the designated data is detected, the designated data is read from the USB device.
[0111] Optionally, after the step of detecting the specified data in the USB device, the method further includes:
[0112] Step S3: If the designated data is not detected, the reading is abandoned and a keep-off instruction of the infrared receiver is generated.
[0113] In a specific implementation, if the specified data cannot be detected, it means that the connected USB device is not the USB associated with the infrared remote control used to control the infrared device. In order to avoid control confusion, the reading is abandoned and a keep-off instruction for the infrared receiver is generated to keep the infrared receiver in a closed state.
[0114] The present application also provides an infrared device control device, referring to Figure 8 , the infrared equipment control device includes:
[0115] The reading module 801 is used to read the specified data of the USB device after detecting that the USB device is connected;
[0116] A parsing module 802 is used to parse a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device;
[0117] A detection module 803, configured to perform content detection on the preset character string;
[0118] The infrared receiver control module 804 is used to start the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller if the preset character string passes the content detection.
[0119] Optionally, the detection module 803 is further used to compare the preset string with a preset verification string; if the preset string is consistent with the preset verification string, it is determined that the preset string passes the content detection; and an opening instruction of the infrared receiver is generated;
[0120] The infrared receiver control module 804 is further configured to start the infrared receiver corresponding to the USB device based on the start instruction, and receive the infrared code value of the infrared remote controller.
[0121] Optionally, the detection module 803 is also used to determine that the preset string has not passed the content detection if the preset string is inconsistent with the preset verification string; generate a keep-closed instruction for the infrared receiver, and the keep-closed instruction is used to control the infrared receiver to remain in a closed state, and the initial state of the infrared receiver is a closed state.
[0122] Optionally, the reading module 801 is further used to write the preset verification string in the process of writing its own running program, and the preset verification string is user-defined.
[0123] Optionally, the reading module 801 is further configured to detect specified data in the USB device; if the specified data is detected, read the specified data.
[0124] Optionally, the reading module 801 is further configured to abandon reading if the designated data is not detected, and generate a keep-off instruction for the infrared receiver.
[0125] Optionally, the execution module 805 is used to determine a control instruction based on the infrared code value; and execute a corresponding action based on the control instruction.
[0126] The specific implementation of the infrared device control apparatus of the present application is substantially the same as the above-mentioned embodiments of the infrared device control method, and will not be described in detail here.
[0127] An embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned infrared device control methods.
[0128] The specific implementation of the storage medium of the present application is basically the same as the above-mentioned embodiments of the infrared device control method, and will not be repeated here.
[0129] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes an etc." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0130] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0132] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent mechanism or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for controlling an infrared device, characterized in that: The infrared device control method comprises: After detecting that a USB device is connected, reading the specified data of the USB device; Parsing a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device; Performing content detection on the preset character string; If the preset character string passes the content detection, the infrared receiver corresponding to the USB device is activated to receive the infrared code value of the infrared remote controller; The step of reading the specified data of the USB device comprises: Detecting specified data in the USB device; If the specified data is detected, reading the specified data; If the designated data is not detected, the reading is abandoned and a keep-off instruction of the infrared receiver is generated.
2. The infrared device control method according to claim 1, characterized in that: The step of performing content detection on the preset character string includes: Comparing the preset string with a preset verification string; If the preset character string is consistent with the preset verification character string, determining that the preset character string passes the content detection; generating an opening instruction of the infrared receiver; The step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller includes: The infrared receiver corresponding to the USB device is started based on the start instruction to receive the infrared code value of the infrared remote controller.
3. The infrared device control method according to claim 2, characterized in that: After the step of comparing the preset character string with the preset verification character string, the method further includes: If the preset character string is inconsistent with the preset verification character string, determining that the preset character string fails the content detection; A keep-closed instruction for the infrared receiver is generated, wherein the keep-closed instruction is used to control the infrared receiver to remain in a closed state, and an initial state of the infrared receiver is a closed state.
4. The infrared device control method according to claim 2 or 3, characterized in that: After the USB device is detected to be connected, before the step of reading the specified data of the USB device, the method further includes: The preset verification string is written in the process of writing the self-running program, and the preset verification string is user-defined.
5. The infrared device control method according to claim 1, characterized in that: After the step of starting the infrared receiver corresponding to the USB device to receive the infrared code value of the infrared remote controller, the method further includes: Determining a control instruction based on the infrared code value; Execute corresponding actions based on the control instruction.
6. An infrared device control device, characterized in that: The infrared equipment control device comprises: A reading module, used to read the specified data of the USB device after detecting that the USB device is connected; A parsing module, used for parsing a preset character string in the specified data, wherein the preset character string represents a password for activating an infrared receiver of the USB device; A detection module, used for performing content detection on the preset character string; An infrared receiver control module, configured to activate an infrared receiver corresponding to the USB device to receive an infrared code value of an infrared remote controller if the preset character string passes the content detection; The reading module is further used to detect specified data in the USB device; if the specified data is detected, read the specified data; The reading module is further used to abandon reading if the designated data is not detected, and generate a keep-off instruction for the infrared receiver.
7. An infrared device control device, characterized in that: The infrared device control device comprises: a memory, a processor and an infrared device control program stored in the memory and executable on the processor, wherein the infrared device control program is configured to implement the steps of the infrared device control method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a program for implementing the infrared device control method, and the program for implementing the infrared device control method is executed by a processor to implement the steps of the infrared device control method as claimed in any one of claims 1 to 5.
