Equipment control method and device, medium and equipment
By integrating multiple communication modules and analog communication bus functions on home devices, the problem of taking into account both cost and user experience is solved, and the needs of different user groups are met and cost reduction is achieved.
Patent Information
- Application Number
- CN202411382651.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-10
AI Technical Summary
Home equipment manufacturers face the problem of cost control and taking into account the needs of different user groups when designing home equipment. Especially due to the inconsistent preferences of user groups for Bluetooth and ZigBee modules, it is difficult for the equipment to take into account both cost and user experience.
Equipped with electronic devices with a variety of different types of communication modules (such as Bluetooth, ZigBee, RFID, WLAN modules), and the transmission function of the preset communication bus is simulated instead of the hardware communication bus structure, the device control method is realized to ensure that the device is compatible with different types of communications The user's terminal device.
By integrating multiple communication modules and analog communication bus functions on home devices, we can meet the needs of different user groups, while reducing overall costs and improving device compatibility and response efficiency.
Smart Images

Figure CN119105374A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to the field of device control technology, and in particular to a device control method, apparatus, medium and device. Background Art
[0002] Currently, most home appliances on the market have the function of wireless communication with mobile terminals, allowing users to remotely control home appliances on mobile terminals. For example, users can remotely control a washing machine to turn on or off the washing function through a mobile phone, and can also control the washing machine to turn on or off at a specified time.
[0003] In order to realize wireless communication between mobile terminals and home appliances, the mainstream implementation method is to create a communication connection between the mobile terminal and the home appliances based on communication technologies such as Bluetooth or ZigBee, so that wireless communication can be carried out between different devices.
[0004] In order to save costs, most home appliance manufacturers usually only equip one type of home appliance with one communication module. Considering that most smartphones currently have Bluetooth communication functions, Bluetooth modules have become the first choice for home appliance manufacturers when selecting communication modules. However, not all users are accustomed to using smartphones. For example, most elderly people are still accustomed to using remote controls designed based on ZigBee modules to control home appliances. This makes home appliance manufacturers face a choice between cost control and user experience. Summary of the invention
[0005] The embodiments of the present application provide a device control method, apparatus, medium and device. The device control method provided in the embodiments of the present application is used to solve the problem that most current home appliances cannot meet the needs of different user groups while reducing costs.
[0006] In one aspect, an embodiment of the present application provides a device control method, which is applied to an electronic device, wherein the electronic device includes at least two different types of first communication modules and second communication modules, and the method includes:
[0007] Receiving a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0008] According to the device control request, obtaining a target operation instruction in the device control request;
[0009] Call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0010] In the device control method described in the embodiment of the present application, before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes:
[0011] Respectively obtain the working status of the first communication module and the second communication module;
[0012] If the current working states of the first communication module and the second communication module are both in the process of performing data transceiving operations, then according to the priority levels of the first communication module and the second communication module, the working state of the first communication module or the second communication module with a lower priority level is modified to suspend the data transceiving operation;
[0013] After the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0014] In the device control method described in the embodiment of the present application, before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes:
[0015] Respectively obtain the working status of the first communication module and the second communication module;
[0016] If the current working states of the first communication module and the second communication module are both in the process of executing a data sending and receiving operation, respectively obtaining a first target operation instruction corresponding to the first communication module and a second target operation instruction corresponding to the second communication module;
[0017] The sending of the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module is suspended, and after the target operation instruction with a higher priority is executed, the sending of the target operation instruction with a lower priority to the data forwarding module is resumed.
[0018] In the device control method described in the embodiment of the present application, after the target operation instruction is sent to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction, the method further includes:
[0019] Acquire operation data generated during the execution of the target operation instruction;
[0020] The preset transmission function is called to send the operating data to the data forwarding module, and the operating data is displayed on a display screen connected to the data forwarding module through the data forwarding module.
[0021] In the device control method described in the embodiment of the present application, after obtaining the target operation instruction in the device control request, the method further includes:
[0022] Calling a preset transmission function simulating a preset communication bus, and writing the target operation instruction into an external memory;
[0023] The calling of the preset transmission function simulating the preset communication bus, and sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, comprises:
[0024] The preset transmission function simulating the preset communication bus is called to read the target operation instruction from the external memory, and the target operation instruction is sent to the data forwarding module connected to the preset transmission interface and the preset execution module respectively.
[0025] In the device control method described in the embodiment of the present application, the first communication module or the second communication module includes any one of a Bluetooth module, a ZigBee module, an RFID module and a WLAN module.
[0026] In the device control method described in the embodiment of the present application, the preset communication bus includes any one of an I2C bus, an SPI bus, a UART bus, a CAN bus and a USB bus.
[0027] Accordingly, another aspect of the embodiment of the present application further provides a device control device, which is applied to an electronic device, wherein the electronic device includes at least two different types of first communication modules and second communication modules, and the device control device includes:
[0028] A receiving module, configured to receive a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0029] An acquisition module, configured to acquire a target operation instruction in the device control request according to the device control request;
[0030] An execution module is used to call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to a corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0031] Correspondingly, another aspect of the embodiment of the present application further provides a storage medium, wherein the storage medium stores a plurality of instructions, wherein the instructions are suitable for loading by a processor to execute the device control method as described above.
[0032] Correspondingly, another aspect of an embodiment of the present application further provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the device control method as described above.
[0033] The embodiment of the present application provides a device control method, apparatus, medium and device, which receives a device control request initiated by a mobile terminal through a first communication module or a second communication module; obtains a target operation instruction in the device control request according to the device control request; calls a preset transmission function that simulates a preset communication bus, sends the target operation instruction to a data forwarding module that is respectively connected to a preset transmission interface and a preset execution module, and sends the target operation instruction to a corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction. This method is used to equip electronic devices such as washing machines with a variety of different types of communication modules to meet the needs of different user groups, and uses the transmission function of the simulated communication bus to replace the hardware structure of the communication bus, thereby achieving the purpose of reducing overall costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0035] Figure 1 A flowchart of a device control method provided in an embodiment of the present application.
[0036] Figure 2 Another flowchart of the device control method provided in an embodiment of the present application.
[0037] Figure 3 A schematic diagram of the structure of the device control device provided in an embodiment of the present application.
[0038] Figure 4 Another structural schematic diagram of the device control device provided in an embodiment of the present application.
[0039] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0041] An embodiment of the present application provides a device control method, which is used to equip electronic devices such as washing machines with a variety of different types of communication modules to meet the needs of different user groups, and to replace the hardware structure of the communication bus by simulating the transmission function of the communication bus, thereby achieving the purpose of reducing overall costs.
[0042] The term "and / or" in this application can be a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0043] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to the steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of modules in this application is a logical division. There may be other division methods when it is implemented in actual applications. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between modules can be electrical or other similar forms, which are not limited in this application. In addition, the modules or submodules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present application.
[0044] The device control method involved in the embodiments of the present application is mainly applied to electronic devices, which may be washing machines, smart phones, tablet computers, laptop computers, desktop computers, smart home appliances, servers, etc., which are not limited here. Optionally, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or an IoT cloud (Internet of Things cloud) that provides the ability to store, process and manage data generated by IoT devices, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, which are not limited here.
[0045] For ease of understanding, the specific process in the embodiments of the present application is described below. Figure 1 , Figure 1A flowchart of an embodiment of a device control method provided in an embodiment of the present application.
[0046] exist Figure 1 In the illustrated embodiment, the method is applied to an electronic device, the electronic device includes at least two different types of first communication modules and second communication modules, and may include the following steps:
[0047] S101: receiving a device control request initiated by a mobile terminal through the first communication module or the second communication module.
[0048] In this embodiment, the electronic device is equipped with a plurality of different types of communication modules, such as a first communication module and a second communication module, to meet the needs of different user groups.
[0049] In some embodiments, the first communication module and the second communication module of the electronic device can be any two of a Bluetooth module, a ZigBee module, an RFID module, and a WLAN module. For example, the first communication module can be a Bluetooth module, and the second communication module can be a ZigBee module. The specific type can be determined according to actual needs and is not limited here.
[0050] The above mentioned terms need to be explained:
[0051] Bluetooth is a wireless communication technology mainly used for short-distance data exchange. The Bluetooth module supports point-to-point (one-to-one) and point-to-many (one-to-many) communication modes, has good anti-interference ability, and has a long transmission distance (up to 100 meters). It is usually used in mobile terminals that support complex interactive scenarios, such as mobile phones.
[0052] ZigBee is a low-rate wireless communication technology designed for low-power devices. ZigBee modules support star, mesh and cluster tree network topologies, have low power consumption, can save more power resources and have strong anti-interference capabilities. They are usually used in devices that only need to meet simple functions, such as remote controls.
[0053] RFID (Radio Frequency Identification) is a communication technology that uses radio signals to identify specific targets and read and write related data. RFID modules have the characteristics of long reading distance (from a few meters to tens of meters), small data storage capacity, strong anti-interference ability and the ability to penetrate obstacles to read tags.
[0054] WLAN (Wireless Local Area Network) is a technology that connects computer devices to a local area network through wireless media (such as radio waves). WLAN modules support high data transmission rates (up to several MBps), have a wide coverage area, and can support more than 100 people accessing at the same time, but the power consumption is relatively high.
[0055] When a user remotely controls an electronic device through a mobile terminal, it is necessary to first determine the communication module equipped with the currently used mobile terminal and the type of communication connection currently supported by the electronic device, and turn on the communication module on the mobile terminal that can wirelessly connect to the electronic device, thereby achieving wireless connection pairing and establishing a wireless communication connection. After the wireless communication connection is established, the user can initiate a device control request to the electronic device through the mobile terminal, and the corresponding communication module of the electronic device receives the device control request issued by the mobile terminal. For example, when the mobile terminal is a mobile phone, the electronic device is a washing machine, and the first communication module or the second communication module is a Bluetooth module, the user can send a device control request to the washing machine through a mobile phone equipped with a Bluetooth module to control the washing machine to turn on the washing function. At this time, the device control request is received by the Bluetooth module equipped on the washing machine.
[0056] S102: According to the device control request, obtain a target operation instruction in the device control request.
[0057] In this embodiment, after receiving the device control request through the first communication module or the second communication module, the electronic device will parse the device control request to extract the target operation instruction carried in the device control request. For example, when the target operation instruction is "start washing program", the electronic device will activate the washing program according to the target operation instruction and control the water temperature, rotation speed and other operating data.
[0058] S103, calling a preset transmission function that simulates a preset communication bus, sending the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and sending the target operation instruction to a corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0059] It should be explained that the preset communication bus includes any one of the I2C bus, SPI bus, UART bus, CAN bus and USB bus. Taking the I2C bus as an example, the I2C bus is a simple, bidirectional two-wire synchronous serial bus. It only needs two wires to transmit information between devices connected to the bus, one is the data line SDA, and the other is the clock line SCL. The I2C bus adopts a multi-master-slave architecture, and each device has a unique address through which communication is carried out. The working principle of the I2C bus is based on serial communication. The data is stable during the high level of the clock line SCL and is only allowed to change during the low level. Each byte must be followed by a response bit, and data transmission can be continuous and unrestricted. The I2C bus has the advantages of few interface lines, simple control method, and high communication rate, and is suitable for a variety of devices and systems.
[0060] It should be noted that if Figure 2 As shown, during the wireless communication between the mobile terminal and the electronic device, after the mobile terminal sends a device control request through the mobile phone Bluetooth or the remote control ZigBee, it is received by the first communication module or the second communication module of the electronic device and sent to the main controller of the electronic device (such as GD32MCU), and then the main controller extracts the target operation instruction in the device control request, and transmits the target operation instruction to the data forwarding module (such as UART, i.e. universal asynchronous receiver-transmitter) connected to the preset execution module through a preset communication bus (such as I2C bus), and finally the data forwarding module sends the target operation instruction to the corresponding preset execution module (such as water inlet valve, motor, etc.), and then executes the corresponding function (such as controlling the opening of the water inlet valve or controlling the rotation of the motor, etc.).
[0061] According to the above introduction to the wireless communication process between the mobile terminal and the electronic device, in order to allow the device control request issued by the mobile terminal to smoothly reach the preset execution module and execute the corresponding function, the preset communication bus and the data forwarding module are generally indispensable hardware structures. Among them, the preset communication bus has the advantage of high-speed data transmission, can quickly respond to user requests, and the bus usually has strict protocol regulations to ensure reliable data transmission and synchronization between devices. The data forwarding module is suitable for simple control scenarios (such as controlling the opening of the water inlet valve or controlling the rotation of the motor, etc.), which can replace the main controller to convert data formats between different devices, which can not only reduce the burden of the main controller and improve the data processing efficiency of the system, but also improve the compatibility of the equipment, and then send the target operation instructions to different types of preset execution modules. In contrast, the preset communication bus has more advantages, but the corresponding preset communication bus has a higher cost. Since this scheme hopes to add a variety of different types of communication modules to the electronic device to meet the hardware requirements of different mobile terminals, and at the same time can achieve the purpose of reducing the overall cost on the original basis, considering that the hardware structure of the preset communication bus has a high cost, the preset communication bus in hardware form can be simulated by software, and to a certain extent, it can be equivalent to the effect achieved by the preset communication bus. Therefore, in this embodiment, the preset transmission function of the simulated preset communication bus can be called to send the target operation instruction to the data forwarding module respectively connected to the preset transmission interface and the preset execution module, and the target operation instruction is sent to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0062] It should be explained that the preset transmission function is obtained by writing code to simulate the timing of the preset communication bus, including start conditions, stop conditions, sending and receiving data, etc. This usually involves programming the GPIO (general input and output) pins of the main controller to simulate the level changes of the preset communication bus. Some main controllers or development boards provide special function libraries to simulate the preset communication bus. For example, on the STM32 microcontroller, the I2C simulation function in the HAL (hardware abstraction layer) library can be used as the preset transmission function to simulate the I2C bus.
[0063] In some embodiments, before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes:
[0064] Respectively obtain the working status of the first communication module and the second communication module;
[0065] If the current working states of the first communication module and the second communication module are both in the process of performing data transceiving operations, then according to the priority levels of the first communication module and the second communication module, the working state of the first communication module or the second communication module with a lower priority level is modified to suspend the data transceiving operation;
[0066] After the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0067] In actual application scenarios, it is possible that the main controller of an electronic device receives operation instructions sent from different communication modules at the same time, and even the operation instructions sent by different communication modules are the same. At this time, if the execution order is not distinguished, it is very likely that the main controller will not know which operation instruction to execute first, resulting in uncontrollable abnormal problems. In addition, in some specific scenarios, it may be agreed that some more important operation instructions are received by the first communication module, while less important operation instructions are received by the second communication module. If the execution order is not agreed in advance, it is possible that when the first communication module and the second communication module are simultaneously executing data transmission and reception operations, the more important operation instructions may not be given priority to be responded to.
[0068] In order to solve the above problem, in this embodiment, the working status of the first communication module and the second communication module are respectively obtained; if the current working status of the first communication module and the second communication module are both in executing data sending and receiving operations, then according to the priority levels of the first communication module and the second communication module, the working status of the first communication module or the second communication module with a lower priority level is modified to suspend the data sending and receiving operation; after the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0069] In some embodiments, before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes:
[0070] Respectively obtain the working status of the first communication module and the second communication module;
[0071] If the current working states of the first communication module and the second communication module are both in the process of executing a data sending and receiving operation, respectively obtaining a first target operation instruction corresponding to the first communication module and a second target operation instruction corresponding to the second communication module;
[0072] The sending of the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module is suspended, and after the target operation instruction with a higher priority is executed, the sending of the target operation instruction with a lower priority to the data forwarding module is resumed.
[0073] In some specific scenarios, it may be agreed that certain operation instructions are more important, and it does not distinguish whether they are received by the first communication module or the second communication module. If the execution order is not agreed in advance, it is possible that when the first communication module and the second communication module are simultaneously performing data sending and receiving operations, there is no priority to ensure that the more important operation instructions can be responded to.
[0074] In order to solve the above problems, in this embodiment, the working status of the first communication module and the second communication module are respectively obtained; if the current working status of the first communication module and the second communication module are both in executing data sending and receiving operations, the first target operation instruction corresponding to the first communication module and the second target operation instruction corresponding to the second communication module are respectively obtained; the sending of the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module is suspended, and after the target operation instruction with a higher priority is executed, the sending of the target operation instruction with a lower priority to the data forwarding module is resumed.
[0075] In some embodiments, after sending the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction, the method further includes:
[0076] Acquire operation data generated during the execution of the target operation instruction;
[0077] The preset transmission function is called to send the operating data to the data forwarding module, and the operating data is displayed on a display screen connected to the data forwarding module through the data forwarding module.
[0078] In this embodiment, if Figure 2 As shown, the operation data depends on the type of the target operation instruction. For example, if the target operation instruction is "start washing program", the corresponding operation data may be water temperature, motor rotation speed, washing mode and other operation data. By displaying the operation data on the display screen, the user can understand the current washing situation on the display screen. In some embodiments, the operation data may also be fault information that occurs during the operation of the washing machine.
[0079] In some embodiments, after acquiring the target operation instruction in the device control request, the method further includes:
[0080] Calling a preset transmission function simulating a preset communication bus, and writing the target operation instruction into an external memory;
[0081] The calling of the preset transmission function simulating the preset communication bus, and sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, comprises:
[0082] The preset transmission function simulating the preset communication bus is called to read the target operation instruction from the external memory, and the target operation instruction is sent to the data forwarding module connected to the preset transmission interface and the preset execution module respectively.
[0083] Considering that some electronic devices are designed with small available memory when leaving the factory, directly parsing the device control instructions may easily cause data overflow in the available memory. Figure 2 As shown, using external memory to store parsed data, such as target operation instructions, can alleviate the pressure on available memory and also avoid the loss of important data.
[0084] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0085] In specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.
[0086] As can be seen from the above, the device control method provided in the embodiment of the present application receives the device control request initiated by the mobile terminal through the first communication module or the second communication module; according to the device control request, obtains the target operation instruction in the device control request; calls the preset transmission function that simulates the preset communication bus, sends the target operation instruction to the data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and sends the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction. Utilizing the device control method provided in the embodiment of the present application, by equipping electronic devices such as washing machines with a variety of different types of communication modules to meet the needs of different user groups, and by utilizing the transmission function that simulates the communication bus, it is possible to replace the hardware structure of the communication bus, thereby achieving the purpose of reducing the overall cost.
[0087] An embodiment of the present application further provides a device control apparatus, which can be integrated into an electronic device.
[0088] See also Figure 3 , Figure 3A schematic diagram of the structure of a device control device provided in an embodiment of the present application. The device control device 30 may include:
[0089] A receiving module 31, configured to receive a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0090] An acquisition module 32, configured to acquire a target operation instruction in the device control request according to the device control request;
[0091] The execution module 33 is used to call the preset transmission function of the simulated preset communication bus, send the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0092] In some embodiments, the device also includes a first judgment module, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in executing data sending and receiving operations, then according to the priority levels of the first communication module and the second communication module, the working status of the first communication module or the second communication module with a lower priority level is modified to suspend the data sending and receiving operation; after the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0093] In some embodiments, the device also includes a second judgment module, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in the execution of data sending and receiving operations, then obtain the first target operation instruction corresponding to the first communication module and the second target operation instruction corresponding to the second communication module respectively; suspend sending the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module, and after the target operation instruction with a higher priority is executed, resume sending the target operation instruction with a lower priority to the data forwarding module.
[0094] In some embodiments, the device also includes a display module for obtaining operation data generated during the execution of the target operation instruction; calling the preset transmission function to send the operation data to the data forwarding module, and displaying the operation data on a display screen connected to the data forwarding module through the data forwarding module.
[0095] In some embodiments, the device also includes a storage module, which is used to call the preset transmission function of the simulated preset communication bus and write the target operation instruction into an external memory; the execution module 33 is used to call the preset transmission function of the simulated preset communication bus to read the target operation instruction from the external memory and send the target operation instruction to a data forwarding module respectively connected to the preset transmission interface and the preset execution module.
[0096] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same entity or several entities.
[0097] As can be seen from the above, the device control device 30 provided in the embodiment of the present application, wherein the receiving module 31 is used to receive the device control request initiated by the mobile terminal through the first communication module or the second communication module; the acquisition module 32 is used to obtain the target operation instruction in the device control request according to the device control request; the execution module 33 is used to call the preset transmission function that simulates the preset communication bus, and send the target operation instruction to the data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0098] See also Figure 4 , Figure 4 Another structural diagram of the device control device provided in the embodiment of the present application, the device control device 30 includes a memory 120, one or more processors 180, and one or more applications, wherein the one or more applications are stored in the memory 120 and configured to be executed by the processor 180; the processor 180 may include a receiving module 31, an acquisition module 32, and an execution module 33. For example, the structure and connection relationship of the above components may be as follows:
[0099] The memory 120 can be used to store applications and data. The applications stored in the memory 120 include executable codes. The applications can be composed of various functional modules. The processor 180 executes various functional applications and data processing by running the applications stored in the memory 120. In addition, the memory 120 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.
[0100] The processor 180 is the control center of the device, and uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the device and processes data by running or executing applications stored in the memory 120, and calling data stored in the memory 120, so as to monitor the device as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs.
[0101] Specifically in this embodiment, the processor 180 will load the executable code corresponding to the process of one or more applications into the memory 120 according to the following instructions, and the processor 180 will run the application stored in the memory 120 to implement various functions:
[0102] A receiving instruction is used to receive a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0103] An acquisition instruction is used to acquire a target operation instruction in the device control request according to the device control request;
[0104] An execution instruction is used to call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0105] In some embodiments, the program also includes a first judgment instruction, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in the execution of data sending and receiving operations, then according to the priority levels of the first communication module and the second communication module, the working status of the first communication module or the second communication module with a lower priority level is modified to suspend the data sending and receiving operation; after the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0106] In some embodiments, the program also includes a second judgment instruction, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in the execution of data sending and receiving operations, then obtain the first target operation instruction corresponding to the first communication module and the second target operation instruction corresponding to the second communication module respectively; suspend sending the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module, and after the target operation instruction with a higher priority is executed, resume sending the target operation instruction with a lower priority to the data forwarding module.
[0107] In some embodiments, the program also includes display instructions for obtaining operating data generated during the execution of the target operation instructions; calling the preset transmission function to send the operating data to the data forwarding module, and displaying the operating data on a display screen connected to the data forwarding module through the data forwarding module.
[0108] In some embodiments, the program also includes storage instructions for calling a preset transmission function that simulates a preset communication bus and writing the target operation instructions into an external memory; the execution module 33 is used to call a preset transmission function that simulates a preset communication bus to read the target operation instructions from the external memory and send the target operation instructions to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module.
[0109] The present application also provides an electronic device. Figure 5 , Figure 5 The electronic device 1200 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device can be used to implement the device control method provided in the above embodiment. The electronic device 1200 can be a washing machine, a smart phone, or a tablet computer.
[0110] like Figure 5 As shown, the electronic device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190. Those skilled in the art will understand that Figure 5 The structure of the electronic device 1200 shown in the figure does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0111] The RF circuit 110 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 110 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a user identity module (SIM) card, a memory, etc. The RF circuit 110 can communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices through a wireless network.
[0112] The memory 120 can be used to store software programs and modules, such as the program instructions / modules corresponding to the device control method in the above embodiment. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. The vibration reminder mode can be automatically selected according to the current scene of the electronic device to control the device, which can not only ensure that scenes such as meetings are not disturbed, but also ensure that users can perceive incoming calls, thereby improving the intelligence of the electronic device. The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 120 may further include a memory remotely arranged relative to the processor 180, and these remote memories may be connected to the electronic device 1200 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0113] The input unit 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or a touch pad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface 131 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch-sensitive surface 131 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the input unit 130 may further include other input devices 132. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0114] The display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 1200, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 131 may cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 5 In the embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to realize the input and output functions. However, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize the input and output functions.
[0115] The electronic device 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the electronic device 1200 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the electronic device 1200, they will not be repeated here.
[0116] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the electronic device 1200. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is processed by the output processor 180, and then sent to another terminal through the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earplug jack to provide communication between an external headset and the electronic device 1200.
[0117] The electronic device 1200 can help users send and receive emails, browse web pages, and access streaming media through the transmission module 170 (such as a Wi-Fi module), which provides users with wireless broadband Internet access. Figure 5 The transmission module 170 is shown, but it is understandable that it is not an essential component of the electronic device 1200 and can be omitted as needed without changing the essence of the invention.
[0118] The processor 180 is the control center of the electronic device 1200. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the electronic device 1200 and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.
[0119] The electronic device 1200 also includes a power supply 190 for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 180 through a power management system, so that the power management system can realize functions such as managing discharge and power consumption. The power supply 190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0120] Although not shown, the electronic device 1200 may also include a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit 140 of the electronic device 1200 is a touch screen display, and the electronic device 1200 also includes a memory 120, and one or more programs, wherein one or more programs are stored in the memory 120, and are configured to be executed by one or more processors 180. One or more programs include instructions for performing the following operations:
[0121] A receiving instruction is used to receive a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0122] An acquisition instruction is used to acquire a target operation instruction in the device control request according to the device control request;
[0123] An execution instruction is used to call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0124] In some embodiments, the program also includes a first judgment instruction, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in the execution of data sending and receiving operations, then according to the priority levels of the first communication module and the second communication module, the working status of the first communication module or the second communication module with a lower priority level is modified to suspend the data sending and receiving operation; after the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
[0125] In some embodiments, the program also includes a second judgment instruction, which is used to obtain the working status of the first communication module and the second communication module respectively; if the current working status of the first communication module and the second communication module are both in the execution of data sending and receiving operations, then obtain the first target operation instruction corresponding to the first communication module and the second target operation instruction corresponding to the second communication module respectively; suspend sending the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module, and after the target operation instruction with a higher priority is executed, resume sending the target operation instruction with a lower priority to the data forwarding module.
[0126] In some embodiments, the program also includes display instructions for obtaining operating data generated during the execution of the target operation instructions; calling the preset transmission function to send the operating data to the data forwarding module, and displaying the operating data on a display screen connected to the data forwarding module through the data forwarding module.
[0127] In some embodiments, the program also includes storage instructions for calling a preset transmission function that simulates a preset communication bus and writing the target operation instructions into an external memory; the execution module 33 is used to call a preset transmission function that simulates a preset communication bus to read the target operation instructions from the external memory and send the target operation instructions to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module.
[0128] The embodiment of the present application also provides an electronic device, which may be a washing machine, a smart phone, an electronic device, a computer, or the like.
[0129] As can be seen from the above, the embodiment of the present application provides an electronic device 1200, and the electronic device 1200 performs the following steps:
[0130] Receiving a device control request initiated by a mobile terminal through the first communication module or the second communication module;
[0131] According to the device control request, obtaining a target operation instruction in the device control request;
[0132] Call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
[0133] An embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the device control method described in any of the above embodiments.
[0134] It should be noted that, for the device control method described in the present application, ordinary testers in the field can understand that all or part of the process of implementing the device control method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process may include the process of the embodiment of the device control method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM, ReadOnly Memory), a random access memory (RAM, Random Access Memory), etc.
[0135] For the device control device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.
[0136] The device control method, apparatus, medium and equipment provided in the embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A device control method, applied to an electronic device, characterized in that: The electronic device comprises at least two different types of first communication modules and second communication modules, and the method comprises: Receiving a device control request initiated by a mobile terminal through the first communication module or the second communication module; According to the device control request, obtaining a target operation instruction in the device control request; Call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
2. The device control method according to claim 1, characterized in that: Before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes: Respectively obtain the working status of the first communication module and the second communication module; If the current working states of the first communication module and the second communication module are both in the process of performing data transceiving operations, then according to the priority levels of the first communication module and the second communication module, the working state of the first communication module or the second communication module with a lower priority level is modified to suspend the data transceiving operation; After the first communication module or the second communication module with a higher priority level completes the data sending and receiving operation, the first communication module or the second communication module with a lower priority level is restored to continue the data sending and receiving operation.
3. The device control method according to claim 1, characterized in that: Before sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, the method further includes: Respectively obtain the working status of the first communication module and the second communication module; If the current working states of the first communication module and the second communication module are both in the process of executing a data sending and receiving operation, respectively obtaining a first target operation instruction corresponding to the first communication module and a second target operation instruction corresponding to the second communication module; The sending of the target operation instruction with a lower priority among the first target operation instruction and the second target operation instruction to the data forwarding module is suspended, and after the target operation instruction with a higher priority is executed, the sending of the target operation instruction with a lower priority to the data forwarding module is resumed.
4. The device control method according to claim 1, characterized in that: After sending the target operation instruction to the corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction, the method further includes: Acquire operation data generated during the execution of the target operation instruction; The preset transmission function is called to send the operating data to the data forwarding module, and the operating data is displayed on a display screen connected to the data forwarding module through the data forwarding module.
5. The device control method according to claim 1, characterized in that: After acquiring the target operation instruction in the device control request, the method further includes: Calling a preset transmission function simulating a preset communication bus, and writing the target operation instruction into an external memory; The calling of the preset transmission function simulating the preset communication bus, and sending the target operation instruction to the data forwarding module connected to the preset transmission interface and the preset execution module respectively, comprises: The preset transmission function simulating the preset communication bus is called to read the target operation instruction from the external memory, and the target operation instruction is sent to the data forwarding module respectively connected to the preset transmission interface and the preset execution module.
6. The device control method according to any one of claims 1 to 5, characterized in that: The first communication module or the second communication module includes any one of a Bluetooth module, a ZigBee module, an RFID module and a WLAN module.
7. The device control method according to any one of claims 1 to 5, characterized in that: The preset communication bus includes any one of an I2C bus, an SPI bus, a UART bus, a CAN bus and a USB bus.
8. A device control device, applied to electronic equipment, characterized in that: The electronic device comprises at least two different types of first communication modules and second communication modules, and the device control device comprises: A receiving module, configured to receive a device control request initiated by a mobile terminal through the first communication module or the second communication module; An acquisition module, configured to acquire a target operation instruction in the device control request according to the device control request; An execution module is used to call a preset transmission function that simulates a preset communication bus, send the target operation instruction to a data forwarding module that is respectively connected to the preset transmission interface and the preset execution module, and send the target operation instruction to a corresponding preset execution module through the data forwarding module to execute the corresponding target operation instruction.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the device control method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the device control method according to any one of claims 1 to 7.
