Gateway of Internet of Things, method for controlling radio frequency module by gateway of Internet of Things, medium and equipment
By using a universal input/output interface and microprocessing unit in the IoT gateway to control the power supply of the RF module, and combining the USB to serial chip and USB interface to expand the chip to monitor plug-in and unplug events, the problem of inefficiency in traditional control methods is solved, and the problem of inefficiency in traditional control methods is realized. Accurate management and failure recovery of RF modules improve the stability and adaptability of IoT systems.
Patent Information
- Application Number
- CN202411107183.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-06
AI Technical Summary
Traditional RF module control methods are inefficient and have poor accuracy, making it difficult to meet the needs of IoT device management, especially in multi-module environments, which leads to communication chaos, data loss and system inefficiency.
Design an IoT gateway, which includes multiple general input/output interfaces and microprocessing units, controls the power supply of the RF module through the GPIO port, and uses the USB to serial chip and USB interface extension chip to monitor hot-swap events to determine the RF module's Interface location information, create symbolic link files for easy management and positioning modules, and realize accurate control and fault recovery of RF modules.
It realizes precise management of power supply for multiple RF modules, improves the flexibility and stability of the system, can quickly identify and respond to changes in RF modules, adapt to different application scenarios, reduces energy consumption and maintenance costs, and improves the Internet of Things system. Overall performance and reliability.
Smart Images

Figure CN119094278A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, specifically to the field of Internet of Things technology, and more specifically to an Internet of Things gateway and a method, medium and device for controlling a radio frequency module thereof. Background Art
[0002] In today's highly digitalized and intelligent era, IoT technology is developing at an unprecedented speed and is widely used in many fields such as industrial automation, smart home, smart transportation, etc. As a key node connecting different types of sensing devices and networks, IoT gateways play a vital role.
[0003] In the process of IoT gateways realizing communication and data interaction between IoT devices and cloud platforms, RF modules (such as Bluetooth modules) are important components for wireless communication. However, different RF modules may have different physical locations and functions.
[0004] Since the locations and functions of these RF modules vary, if the location and status of each RF module cannot be accurately identified, it may lead to communication confusion, data loss, system inefficiency and other problems. In addition, with the increasing number of IoT devices and the increasing complexity of application scenarios, the need for management and optimization of RF modules is becoming more and more urgent. However, traditional RF module control methods are often inefficient and inaccurate, making it difficult to meet actual management needs. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an Internet of Things gateway and a method, medium and device for controlling a radio frequency module thereof, aiming to solve the technical problems that traditional radio frequency module control methods are inefficient, poorly accurate, and difficult to meet actual management needs.
[0006] To achieve the above object, according to a first aspect of the present application, an Internet of Things gateway is provided, wherein the Internet of Things gateway is used to control multiple radio frequency modules connected thereto, including:
[0007] A plurality of universal input / output interfaces, each of which is connected to a power control terminal of a corresponding radio frequency module;
[0008] The microprocessing unit is connected to the plurality of universal input / output interfaces and is used to control the level state of the universal input / output interface corresponding to the radio frequency module so as to correspondingly turn on or off the power of the radio frequency module.
[0009] Optionally, in a possible implementation manner of the first aspect, the Internet of Things gateway further includes:
[0010] A plurality of USB-to-serial port chips, each of which is connected to a corresponding one of the radio frequency modules via a communication pin;
[0011] A USB interface expansion chip connected to the microprocessing unit via a USB bus;
[0012] The microprocessing unit is connected to the plurality of USB-to-serial port chips respectively through the USB interface expansion chip, and is used to determine the path of any one of the USB-to-serial port chips relative to the USB interface expansion chip when a hot plug event of any one of the USB-to-serial port chips is detected, and to determine the interface position information of the radio frequency module corresponding to any one of the USB-to-serial port chips according to the path, wherein the interface position information is used to characterize the universal input / output interface to which the radio frequency module is connected, and the hot plug event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway.
[0013] Optionally, in a possible implementation of the first aspect, the microprocessing unit is further used to, after determining the interface location information of the RF module corresponding to any one of the USB-to-serial port chips according to the path, create a symbolic link file corresponding to the RF module based on the interface location information of the RF module corresponding to any one of the USB-to-serial port chips, and locate and use the RF module through the symbolic link file.
[0014] Optionally, in a possible implementation of the first aspect, the microprocessing unit is also used to determine the corresponding universal input / output interface based on the interface location information of any faulty RF module when any faulty RF module is detected, and reset the power supply of any faulty RF module by controlling the corresponding universal input / output interface.
[0015] Optionally, in a possible implementation of the first aspect, the microprocessing unit is further used to determine the type and current operating mode of the RF module by identifying a device identifier of the RF module, wherein the device identifier is used to uniquely identify the type and operating mode of the RF module, and the current operating mode includes: normal mode and upgrade mode.
[0016] According to a second aspect of the present application, a method for controlling a radio frequency module by an Internet of Things gateway is provided, the method comprising:
[0017] When each of the plurality of universal input / output interfaces of the IoT gateway is connected to a power control terminal of a corresponding RF module, receiving a power control instruction for a target RF module;
[0018] In response to the power control instruction, the level state of the universal input / output interface corresponding to the target radio frequency module is controlled to correspondingly turn on or off the power of the target radio frequency module.
[0019] Optionally, in a possible implementation manner of the first aspect, the method further includes:
[0020] When the USB interface expansion chip of the Internet of Things gateway is respectively connected to the plurality of USB-to-serial port chips, and each of the USB-to-serial port chips is connected to a corresponding one of the radio frequency modules, a hot plug event of any one of the USB-to-serial port chips is monitored;
[0021] When a hot-swap event of any one of the USB-to-serial port chips is detected, determining a path of any one of the USB-to-serial port chips relative to the USB interface expansion chip, wherein the hot-swap event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway;
[0022] The interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips is determined according to the path, wherein the interface location information is used to characterize the universal input / output interface to which the radio frequency module is connected.
[0023] Optionally, in a possible implementation manner of the first aspect, after determining the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips according to the path, the method further includes:
[0024] Based on the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips, create a symbolic link file corresponding to the radio frequency module;
[0025] The radio frequency module is located and used through the symbolic link file.
[0026] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the methods described above.
[0029] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.
[0030] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0031] The embodiment of the present application provides an Internet of Things gateway and a method, medium and device for controlling a radio frequency module thereof. The Internet of Things gateway provided by the present application is used to control multiple radio frequency modules connected thereto, including: multiple universal input / output interfaces, each universal input / output interface is connected to the power control end of a corresponding radio frequency module; a microprocessing unit is connected to the multiple universal input / output interfaces, and is used to control the level state of each universal input / output interface to correspondingly turn on or off the power of the radio frequency module.
[0032] The IoT gateway provided in this application has a high degree of accuracy and flexibility in managing RF modules, can achieve precise management of the power supplies of multiple RF modules, meet the flexible control requirements of the working status of RF modules in different application scenarios, and provide reliable and efficient support for diverse application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 This is a schematic diagram of the structure of an Internet of Things gateway provided by an embodiment of the present application;
[0035] Figure 2 This is a schematic diagram of the structure of an optional Internet of Things gateway provided in an embodiment of the present application;
[0036] Figure 3 is a schematic flow chart of a method for controlling a radio frequency module by an Internet of Things gateway according to an example of the present application;
[0037] Figure 4 is a schematic flow chart of a method for controlling a radio frequency module by an Internet of Things gateway according to an example of the present application;
[0038] Figure 5 is a schematic flow chart of a method for controlling a radio frequency module by an Internet of Things gateway according to an example of the present application;
[0039] Figure 6 It is a structural diagram of a device for controlling a radio frequency module of an Internet of Things gateway provided in an embodiment of the present application;
[0040] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0042] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0043] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0044] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0045] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0046] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0047] First, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0048] The IoT gateway is a key device between IoT devices and cloud servers, playing an important role in connection and conversion.
[0049] A general purpose input / output (GPIO) interface is a pin on a microcontroller, microprocessor or other integrated circuit that can be configured as an input pin or an output pin through software programming.
[0050] Hot plugging refers to the system's ability to automatically identify and handle the insertion and removal of RF module devices when the device is plugged in or unplugged during system operation.
[0051] In Linux system, device files are special files used to represent various hardware devices. Through device files, hardware devices can be accessed and controlled. Symbolic link is a special type of file that points to another file or directory.
[0052] The above is a brief introduction to the nouns involved in the embodiments of the present application, which will not be repeated below.
[0053] In today's highly digitalized and intelligent era, IoT technology is developing at an unprecedented speed and is widely used in many fields such as industrial automation, smart home, smart transportation, etc. As a key node connecting different types of sensing devices and networks, IoT gateways play a vital role.
[0054] In the process of IoT gateways realizing communication and data exchange between IoT devices and cloud platforms, RF modules (such as Bluetooth modules) are important components for wireless communication. However, different RF modules may have different physical locations and functions. For example, in a complex industrial IoT environment, there may be multiple Bluetooth modules distributed on different devices, some of which are used to monitor the operating status of equipment on the production line, and some are used to transmit cargo information in the warehouse.
[0055] The different locations and functions of these RF modules pose a huge challenge to their management and optimization. If the location and status of each RF module cannot be accurately identified, communication confusion, data loss, and system inefficiency may result.
[0056] In addition, with the increasing number of IoT devices and the increasing complexity of application scenarios, the need for management and optimization of RF modules is becoming more and more urgent. Traditional identification methods are often inefficient and inaccurate, and it is difficult to meet actual needs. Therefore, there is an urgent need for an innovative method to accurately identify the location and status of each RF module in order to better manage and optimize its use and improve the overall performance and stability of the IoT system.
[0057] In addition, it is also very important to be able to quickly identify and restore the working state of the RF module when it fails. In actual applications, the RF module may fail due to various reasons, such as hardware damage, software conflicts, electromagnetic interference, etc. If these failures are not discovered and resolved in time, it may cause partial or complete paralysis of the entire IoT system, causing serious economic losses and adverse effects.
[0058] At the same time, when the RF module enters the upgrade mode, a method is needed to identify the current mode of the RF module. With the continuous advancement of technology, RF modules need to be upgraded regularly to improve performance and fix vulnerabilities. However, if it is not possible to accurately identify whether it is in the upgrade mode, it may cause upgrade failure, system instability and other problems. For example, in the field of industrial control, misjudgment during the RF module upgrade process may cause the production process to be interrupted.
[0059] Therefore, there is an urgent need for an innovative method to accurately identify the location, status, fault condition, and current mode of each RF module in order to better manage, optimize usage, quickly troubleshoot, and smoothly upgrade, thereby improving the overall performance and stability of the IoT system.
[0060] To solve the above technical problems, this application example provides an example of an IoT gateway, please refer to Figure 1 As shown, Figure 1 The schematic structure diagram of an Internet of Things gateway provided by the present application is shown. As an example but not limited, the Internet of Things gateway 100 is used to control multiple radio frequency modules connected thereto such as Figure 1 200a, 200b, 200c shown are examples and not limitations), the Internet of Things gateway 100 includes:
[0061] Multiple general purpose input / output interfaces (such as Figure 1 101a, 101b, 101c shown are examples and not limitations), each universal input / output interface is connected to a power control terminal of a corresponding RF module;
[0062] The microprocessor unit 102 is connected to a plurality of general purpose input / output interfaces (such as Figure 1 The connections 101a, 101b, and 101c shown are examples and not limitations, and are used to control the level state of each universal input / output interface to correspondingly turn on or off the power of the RF module.
[0063] Optionally, in the example of the present application, the radio frequency module may include but is not limited to any one or more of the following: a long-distance radio LoRa module, a narrowband Internet of Things NB-I oT module, an Internet of Things wireless transmission Zigbee module, a Wi-Fi module, a Bluetooth module, etc.
[0064] Since in the example of this application, each general input / output GPIO port is a pin on a microcontroller, microprocessor or other integrated circuit, it can be configured as an input pin or an output pin. When configured as an input pin, the GPIO port can detect the level state (high level or low level) of an external signal, such as a signal from a sensor or other device. When configured as an output pin, the level state of the GPIO port is configured or controlled, and a high level or a low level can be output, thereby controlling the on and off of external devices such as LED lights, relays, etc.
[0065] As an example but not limitation, the IoT gateway is used to enable IoT devices to communicate and exchange data with the cloud platform. In the IoT gateway, effective control and identification of the RF module are achieved through the following steps:
[0066] First, multiple general purpose input / output interfaces (GPIO ports) are connected to the power control terminals of the corresponding RF modules, and then the microprocessor unit is connected to these GPIO ports. Through specific software programming or software scripts, the microprocessor unit can accurately control the high or low level state of each GPIO port.
[0067] When a certain RF module needs to be turned on, the microprocessor sets the corresponding GPIO port to a high level, allowing current to pass through, thereby powering the RF module and putting it into operation. Conversely, when the RF module needs to be turned off, the GPIO port is set to a low level to cut off the power supply.
[0068] For example, in a large-scale industrial IoT environment, when production equipment in a certain area is temporarily out of service, energy can be saved and interference reduced by turning off the power of the corresponding RF modules. In a smart home system, when a room is temporarily unoccupied, the RF modules in that area can be turned off to reduce energy consumption and ensure system stability.
[0069] The IoT gateway adopted in this application example can realize precise control of the power supply of each RF module through the cooperation of the GPIO port and the microprocessor unit, avoiding unnecessary energy consumption and improving energy utilization efficiency. According to actual needs, specific RF modules can be dynamically turned on or off to achieve optimal allocation of system resources and adapt to different application scenarios and workloads.
[0070] Please refer to Figure 2 As shown, Figure 2 A schematic structural diagram of an Internet of Things gateway provided by the present application is shown. In a possible implementation, the Internet of Things gateway further includes:
[0071] Multiple USB to serial port chips (such as Figure 2 103a, 103b, 103c shown are examples and not limitations), each USB to serial port chip is connected to a corresponding RF module via a communication pin.
[0072] The USB interface expansion chip 104 is connected to the microprocessing unit 102 via a USB bus.
[0073] The microprocessor unit 102 is connected to a plurality of USB to serial port chips (such as Figure 2 The connections 103a, 103b, and 103c shown are examples and not limitations, and are used to determine the path of any USB-to-serial port chip relative to the USB interface expansion chip when a hot-swap event of any USB-to-serial port chip is monitored, and to determine the interface position information of the RF module corresponding to any USB-to-serial port chip according to the path, wherein the interface position information is used to characterize the universal input / output interface to which the RF module is connected, and the hot-swap event is used to indicate that the RF module is inserted into or unplugged from the IoT gateway.
[0074] In the above optional implementation, multiple USB-to-serial port chips and USB interface expansion chips are introduced to further enhance the management and monitoring capabilities of the IoT gateway for the RF module.
[0075] As an example but not a limitation, multiple USB to serial port chips are connected to corresponding RF modules through communication pins to achieve data transmission and interaction. This enables the RF module to efficiently exchange data with the gateway in the form of serial port communication.
[0076] In addition, the USB interface expansion chip is connected to the microprocessor unit through the USB bus, which builds a bridge between multiple USB-to-serial port chips and the microprocessor unit. When a hot plug event of any USB-to-serial port chip is detected, the microprocessor unit can respond quickly. Specifically, by determining the path of the USB-to-serial port chip relative to the USB interface expansion chip, the interface location information of the RF module corresponding to this chip can be accurately known.
[0077] For example, when a new RF module is inserted into the IoT gateway, the microprocessor will immediately detect the hot-swap event of the corresponding USB-to-serial chip. Then, based on the determined path of the USB-to-serial chip relative to the USB-HUB chip, the location of the universal input / output interface to which the newly inserted RF module is connected can be identified, so that it can be quickly incorporated into the management and control system and configured with corresponding parameters and working modes.
[0078] On the contrary, if a RF module is unplugged from the IoT gateway, the microprocessor unit can also sense it in time through the same mechanism and make corresponding resource release or other processing operations to ensure the stable and efficient operation of the system.
[0079] The IoT gateway design provided in the example of this application enables the IoT gateway to respond to dynamic changes in RF modules more flexibly and efficiently, improving the scalability and adaptability of the system. Whether it is the need to frequently replace equipment at industrial sites or to continuously add new smart modules in smart home environments, fast and accurate identification and management can be achieved.
[0080] In one possible implementation, the microprocessing unit is also used to, after determining the interface location information of the RF module corresponding to any USB-to-serial port chip according to the path, create a symbolic link file corresponding to the RF module based on the interface location information of the RF module corresponding to any USB-to-serial port chip, and locate and use the RF module through the symbolic link file.
[0081] In the example of this application, the software script (i.e., hot-swap script) run by the microprocessor unit and the GPIO port work together to achieve accurate identification of the RF module. The information contained in the hot-swap script includes, but is not limited to: the path of the device, the processing logic of the plug-in and plug-out events, the creation of symbolic links, and the fault detection and recovery logic, etc. The hot-swap script can detect the insertion or removal events given by the USB-to-serial port chip corresponding to the RF module, and the GPIO port is used to control the power supply of the RF module. The combination of the two enables the microprocessor unit to accurately obtain the status and location information of the RF module.
[0082] In the above optional implementation, when the microprocessor unit determines the interface location information of the RF module corresponding to any USB-to-serial port chip according to the path, a symbolic link file will be created based on this. The purpose of creating a symbolic link file is to establish a convenient access and operation path for the RF module. Through this symbolic link file, the microprocessor unit can locate and use the corresponding RF module more efficiently and accurately.
[0083] For example, if there are multiple similar RF modules connected to the IoT gateway, the microprocessor can clearly distinguish them through the symbolic link file to avoid confusion and erroneous operation.
[0084] For example, since the RF performance of each RF module may be different, such as RF module 1 has better scanning performance, the software can accurately control RF module 1 to work in the scanning state by clarifying its position (i.e. the corresponding GPIO port) to achieve performance optimization. For another example, if an RF module fails, such as RF module 1, since its position (corresponding GPIO port) is known in advance, the software can accurately call the corresponding GPIO port to restart the RF module without mistakenly restarting other RF modules.
[0085] In actual application scenarios, this means that the system can respond to changes in RF modules more quickly and achieve real-time configuration and control. For example, when a new RF module is connected, the system can immediately initialize and set it, transmit data, and perform other operations through the corresponding symbolic link file without the need for tedious search and identification processes, thus improving the overall response speed and efficiency of the system.
[0086] At the same time, symbolic link files also help with system management and maintenance. When troubleshooting or upgrading the system, staff can quickly locate specific RF modules through these symbolic link files and perform related operations and processing.
[0087] In one possible implementation, the microprocessing unit is also used to determine the corresponding universal input / output interface based on the interface location information of any faulty RF module when any faulty RF module is detected, and reset the power supply of any faulty RF module by controlling the corresponding universal input / output interface.
[0088] In the above optional implementation, when the microprocessor detects that any RF module fails, it can respond quickly. With the help of the previously determined and stored interface location information of the faulty RF module, the corresponding general input / output interface (GPIO port) is accurately found. By controlling this specific GPIO port, the microprocessor can effectively reset the power supply of the faulty RF module.
[0089] For example, assuming that the RF module 3 fails, the microprocessor unit determines that the corresponding interface is GPIO 5 according to the previously recorded interface location information. Then, the microprocessor unit performs corresponding operations on GPIO 5 to reset the power supply of the RF module 3.
[0090] Since the power supply of the faulty module can be directly reset, the efficiency of fault recovery is greatly improved, and the time of overall performance degradation or interruption of the system due to a single RF module failure is reduced. It reflects the intelligence and self-recovery capabilities of the system and enhances the stability and reliability of the IoT gateway in complex environments. Whether it is the continuous monitoring of key equipment in industrial automation or the management of multiple smart devices in smart home systems, it can effectively ensure the normal operation of the system and reduce maintenance costs and potential losses.
[0091] At the same time, this targeted fault handling method also avoids unnecessary interference to other normally working RF modules, ensuring the operating order and stability of the entire system.
[0092] In one possible implementation, the microprocessor unit is also used to determine the type and current operating mode of the RF module by identifying the device identifier of the RF module, wherein the device identifier is used to uniquely identify the type and operating mode of the RF module, and the current operating mode includes: normal mode and upgrade mode.
[0093] In the above possible implementations, the microprocessor has the important function of identifying the device identification of the RF module to determine its type and current working mode. The device identification, as a unique identifier of the RF module, carries key information about the module type and working mode.
[0094] For example, a specific device identification code may represent a specific type of RF module, such as a Bluetooth 5.0 module or a Wi-Fi 6 module. At the same time, certain fields or coding rules in the identification can also indicate whether the current working mode is normal mode or upgrade mode.
[0095] When the microprocessor obtains the device identification, it can use the pre-set algorithm or rules for analysis. In normal mode, the RF module works according to the preset functions and parameters, such as stable data transmission, device connection, etc. When in upgrade mode, the microprocessor can adjust the control strategy of the RF module, such as suspending certain routine operations to provide the necessary resources and environment for the upgrade process.
[0096] For example, in a smart home IoT gateway, the microprocessor unit can identify the device identifier of the radio frequency module in different smart devices (such as smart lamps or smart door locks), and not only determine its type (whether it is used to control lights or door locks), but also know whether it is currently in normal working mode or in software upgrade mode, and then make corresponding control and scheduling decisions.
[0097] Through the above implementation, the microprocessor can accurately understand the status and needs of each RF module, thereby achieving more refined and targeted management and control, and helping to optimize system resource allocation, improve overall performance, and ensure stable operation and effective operation of the RF module in various working modes.
[0098] In addition, in the example of this application, once a RF module fails and causes power supply abnormality, the faulty module can be quickly located through the status of the GPIO port, and its power can be turned off in time to prevent it from affecting the entire system, and quickly troubleshoot and recover.
[0099] When the RF module is upgraded, it can accurately identify that it has entered the upgrade mode, and ensure the stability and reliability of the upgrade process by controlling the power supply, reducing the risk of upgrade failure. In addition, accurately identifying the location and working mode of the RF module helps optimize the system's communication and data processing, reduce system confusion and instability caused by improper module management, and improve the stability and reliability of the entire IoT gateway system.
[0100] According to the example of this application, a method for controlling the RF module by an IoT gateway is also provided. Please refer to Figure 3 As shown, Figure 3 This is a schematic flow chart of a method for controlling a radio frequency module by an IoT gateway according to an example of the present application. As an example but not a limitation, the method can be applied to the IoT gateway described above. The method includes:
[0101] S301, receiving a power control instruction for a target RF module when each of a plurality of GPIO interfaces of the IoT gateway is connected to a power control terminal of a corresponding RF module;
[0102] S302, in response to the power control instruction, controlling the level state of each universal input / output interface to correspondingly turn on or off the power of the target radio frequency module.
[0103] First, in the example of this application, multiple general input / output interfaces (GPIO ports) of the IoT gateway have been connected to the power control end of the corresponding RF module (one RF module corresponds to one GPIO port), establishing a physical control channel.
[0104] Then, when the power control command for the RF module is received, the system enters the response phase. The specific operation of the response is to control each GPIO port to output a high level or a low level. When the GPIO port is set to a high level, current can pass through, thereby turning on the power of the connected RF module so that it can work normally; when it is set to a low level, the power supply is cut off and the RF module is turned off.
[0105] For example, in an industrial IoT scenario, if a radio frequency module used to monitor the temperature of a device needs to be started, the system will receive the corresponding power control command, and then set the GPIO port connected to the radio frequency module to a high level to power it and start working. When the module completes its task or is no longer needed, the system receives the command again, sets the corresponding GPIO port to a low level, and turns off its power to save energy and reduce unnecessary interference.
[0106] The method of controlling the RF module by the IoT gateway provided in the example of this application can be simple, direct, efficient and reliable, and can achieve precise management of the power supplies of multiple RF modules, meeting the flexible control requirements of the working status of the RF modules in different application scenarios.
[0107] Please refer to Figure 4 As shown, Figure 4 This is a schematic flow chart of a method for controlling a radio frequency module by an IoT gateway according to an example of the present application. In a possible implementation, the method further includes:
[0108] S401, monitoring a hot-swap event of any USB-to-serial port chip when the USB interface expansion chip of the IoT gateway is respectively connected to a plurality of USB-to-serial port chips and each USB-to-serial port chip is connected to a corresponding radio frequency module;
[0109] S402, when a hot-swap event of any USB-to-serial port chip is detected, determining a path of any USB-to-serial port chip relative to the USB interface expansion chip, wherein the hot-swap event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway;
[0110] S403, determining the interface location information of the radio frequency module corresponding to any USB-to-serial port chip according to the path, wherein the interface location information is used to represent the universal input / output interface to which the radio frequency module is connected.
[0111] In this optional implementation, the connection between the USB-to-serial port chip and the USB interface expansion chip in the IoT gateway is further considered to enhance the management capability of the RF module.
[0112] First, at the hardware connection level, the USB interface expansion chip of the IoT gateway is connected to multiple USB-to-serial port chips, and each USB-to-serial port chip is connected to the corresponding RF module.
[0113] Next, the system will continue to monitor the hot-plug event of any USB-to-serial port chip. The hot-plug event is a key trigger signal that indicates the insertion or removal of the RF module. When a hot-plug event of any USB-to-serial port chip is detected, the system will determine the path of the USB-to-serial port chip where the event occurred relative to the USB interface expansion chip. Through this path information, the interface location information of the target RF module corresponding to the USB-to-serial port chip can be further determined. The interface location information indicates the specific universal input / output interface to which the target RF module is connected.
[0114] For example, in a smart warehouse IoT system where equipment is constantly updated, when a new device with a radio frequency module is plugged into the gateway or an existing device is unplugged, the system can quickly identify and make corresponding configuration and control adjustments by monitoring hot-swap events and determining the path and interface location information, ensuring stable operation and efficient management of the entire system.
[0115] The above-mentioned mechanism of monitoring hot plug events and determining interface location information based on paths provided in the example of this application improves the adaptability of the IoT gateway to dynamic changes, allowing the system to handle the connection and disconnection of the RF module more flexibly and efficiently.
[0116] Please refer to Figure 5 As shown, Figure 5 It is a schematic flow chart of a method for controlling a radio frequency module by an IoT gateway according to an example of the present application. In a possible implementation, after determining the interface location information of the radio frequency module corresponding to any USB-to-serial port chip according to the path, the method further includes:
[0117] S501, based on the interface location information of the radio frequency module corresponding to any USB-to-serial port chip, create a symbolic link file corresponding to the radio frequency module;
[0118] S502, locating and using the radio frequency module through the symbolic link file.
[0119] After the interface location information of the target RF module corresponding to any USB-to-serial port chip is determined according to the above steps, the system will take further actions to optimize the management and use of the target RF module.
[0120] First, based on the obtained interface location information of the target RF module, a corresponding symbolic link file is created. The symbolic link file is like a shortcut or index established for the target RF module. Through this symbolic link file, the IoT gateway can locate and use the target RF module more conveniently and accurately.
[0121] For example, in a complex smart factory IoT environment, there may be multiple similar RF modules. When a new RF module is connected and its interface location information is determined, the created symbolic link file enables the system to quickly find and accurately operate this specific target RF module among many modules, whether it is reading data, sending control instructions or other related operations.
[0122] The above optional examples improve the system's operating efficiency and accuracy of the RF module and reduce the risk of errors and failures caused by module identification and positioning errors. Especially in scenarios where multiple RF modules need to be frequently and dynamically managed and operated, the performance and stability of the entire IoT system can be significantly improved.
[0123] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0124] Corresponding to the method of controlling the radio frequency module by the Internet of Things gateway in the above embodiment, Figure 6 is a schematic diagram of the structure of a device for controlling a radio frequency module of an Internet of Things gateway provided in an embodiment of the present application. The device can be implemented as part or all of a computer device by software, hardware, or a combination of both. The computer device can be Figure 7 Electronic equipment shown.
[0125] Reference Figure 6 , the device for controlling the radio frequency module of the Internet of Things gateway includes:
[0126] The receiving unit 601 is used to receive a power control instruction for a target RF module when each of the plurality of GPIO interfaces of the IoT gateway is connected to a power control terminal of a corresponding RF module;
[0127] The control unit 602 is used to control the level state of each universal input / output interface in response to the power control instruction to correspondingly turn on or off the power of the target radio frequency module.
[0128] Further, based on any of the above embodiments, as an example of the present application, the device further includes:
[0129] A monitoring unit, for monitoring a hot-swap event of any USB-to-serial port chip when the USB interface expansion chip of the IoT gateway is respectively connected to a plurality of USB-to-serial port chips and each USB-to-serial port chip is connected to a corresponding radio frequency module;
[0130] A first determination unit is used to determine a path of any USB-to-serial port chip relative to the USB interface expansion chip when a hot-plug event of any USB-to-serial port chip is detected, wherein the hot-plug event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway;
[0131] The second determining unit is used to determine the interface location information of the radio frequency module corresponding to any USB-to-serial port chip according to the path, wherein the interface location information is used to characterize the universal input / output interface corresponding to the radio frequency module.
[0132] Further, based on any of the above embodiments, as an example of the present application, the device further includes:
[0133] A creation unit, used for creating a symbolic link file corresponding to the radio frequency module based on the interface location information of the radio frequency module corresponding to any USB-to-serial port chip;
[0134] Locating unit, used to locate and use the RF module through symbolic link files.
[0135] It should be noted that the device for controlling the radio frequency module of the Internet of Things gateway provided in the above embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0136] The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
[0137] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0138] An embodiment of the present application further provides an electronic device, the electronic device comprising one or more processors and a memory;
[0139] The memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to enable the electronic device to execute the method of controlling the radio frequency module of the Internet of Things gateway shown above.
[0140] The electronic device may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, or a communication device such as a server, a storage device, a base station, or a smart car, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0141] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored; when the computer-readable storage medium is executed on an electronic device, the electronic device executes the method of controlling a radio frequency module via an Internet of Things gateway as shown above.
[0142] Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated therein. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media, or semiconductor media (e.g., solid-state drives (SSDs)), etc.
[0143] An embodiment of the present application also provides a computer program product including computer instructions, which, when executed on an electronic device, enables the electronic device to execute the aforementioned method for controlling a radio frequency module by an Internet of Things gateway.
[0144] The computer storage medium and computer program product provided in the above-mentioned embodiments of the present application are used to execute the method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the method provided above, and will not be repeated here.
[0145] In the above embodiments, it can also be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server, data center, etc. that contains one or more available media integrations. The available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital versatile discs (DVD)), or semiconductor media (such as solid-state drives (SSD)).
[0146] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0147] The memory 701 can be used to store computer software programs 702 and modules. The processor 703 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 701. The memory 701 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 701 can include a high-speed random access memory, and can 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.
[0148] Among them, the processor 703 may include one or more processors such as a central processing unit, an application processor (AP), a baseband processor, etc. The processor may be the nerve center and command center of the wireless router. The processor 703 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching instructions and executing instructions. The memory 701 may be used to store computer executable program codes, and the executable program codes include instructions. The processor 703 executes various functional applications and data processing of the network device by running the instructions stored in the memory. The memory 701 may include a program storage area and a data storage area, such as storing data of a sound signal to be played. For example, the memory may be a double rate synchronous dynamic random access memory DDR or a flash memory Flash, etc.
[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0150] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments applied for herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0151] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An Internet of Things gateway, It is characterized in that The IoT gateway is used to control multiple radio frequency modules connected thereto, including: A plurality of universal input / output interfaces, each of which is connected to a power control terminal of a corresponding radio frequency module; The microprocessing unit is connected to the plurality of universal input / output interfaces and is used to control the level state of the universal input / output interface corresponding to the radio frequency module so as to correspondingly turn on or off the power of the radio frequency module.
2. The Internet of Things gateway according to claim 1, It is characterized in that The Internet of Things gateway also includes: A plurality of USB-to-serial port chips, each of which is connected to a corresponding one of the radio frequency modules via a communication pin; A USB interface expansion chip connected to the microprocessing unit via a USB bus; The microprocessing unit is connected to the plurality of USB-to-serial port chips respectively through the USB interface expansion chip, and is used to determine the path of any one of the USB-to-serial port chips relative to the USB interface expansion chip when a hot plug event of any one of the USB-to-serial port chips is detected, and to determine the interface position information of the radio frequency module corresponding to any one of the USB-to-serial port chips according to the path, wherein the interface position information is used to characterize the universal input / output interface to which the radio frequency module is connected, and the hot plug event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway.
3. The Internet of Things gateway according to claim 2, It is characterized in that The microprocessing unit is also used to, after determining the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips according to the path, create a symbolic link file corresponding to the radio frequency module based on the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips, and locate and use the radio frequency module through the symbolic link file.
4. The Internet of Things gateway according to claim 2, It is characterized in that The microprocessing unit is also used to determine the corresponding universal input / output interface based on the interface position information of any faulty RF module when any faulty RF module is detected, and reset the power supply of any faulty RF module by controlling the corresponding universal input / output interface.
5. The Internet of Things gateway according to claim 1, It is characterized in that The microprocessing unit is also used to determine the type and current working mode of the RF module by identifying the device identifier of the RF module, wherein the device identifier is used to uniquely identify the type and working mode of the RF module, and the current working mode includes: normal mode and upgrade mode.
6. A method for controlling a radio frequency module by an Internet of Things gateway, It is characterized in that include: When each of the plurality of universal input / output interfaces of the IoT gateway is connected to a power control terminal of a corresponding RF module, receiving a power control instruction for a target RF module; In response to the power control instruction, the level state of the universal input / output interface corresponding to the target radio frequency module is controlled to correspondingly turn on or off the power of the target radio frequency module.
7. The method according to claim 6, It is characterized in that The method further comprises: When the USB interface expansion chip of the Internet of Things gateway is respectively connected to the plurality of USB-to-serial port chips, and each of the USB-to-serial port chips is connected to a corresponding one of the radio frequency modules, a hot plug event of any one of the USB-to-serial port chips is monitored; When a hot-swap event of any one of the USB-to-serial port chips is detected, determining a path of any one of the USB-to-serial port chips relative to the USB interface expansion chip, wherein the hot-swap event is used to indicate that the radio frequency module is inserted into or unplugged from the Internet of Things gateway; The interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips is determined according to the path, wherein the interface location information is used to characterize the universal input / output interface to which the radio frequency module is connected.
8. The method according to claim 7, It is characterized in that After determining the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips according to the path, the method further includes: Based on the interface location information of the radio frequency module corresponding to any one of the USB-to-serial port chips, create a symbolic link file corresponding to the radio frequency module; The radio frequency module is located and used through the symbolic link file.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
