Gateway control method and device, gateway and storage medium
By detecting the access device in the gateway and sending communication protocol identification information, the device can automatically identify and match the unit circuit of the gateway, solving the problem of limitations of the existing gateway interface, realizing the flexible access and user-friendly operation experience of the device .
Patent Information
- Application Number
- CN202411617213.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The existing multimode gateways have limitations in interface use, which limits the access flexibility of the device and increases the complexity and confusion of users, especially ordinary users cannot accurately judge the protocols supported by the gateway and their corresponding interface types.
When accessing the device through the first interface of the detection gateway, the device transmits identification information of the plurality of communication protocols included in the first interface to the device, so that the device determines the target identification information from the plurality of identification information, and corresponds to the plurality of interfaces. The target unit circuit is determined in the unit circuit and controlled to conduct the device to access the gateway.
Devices with different protocols can be automatically identified and matched, and users can connect devices to the gateway without being familiar with communication protocols and interfaces, which improves device access compatibility and ease of use and reduces the possibility of connection failure.
Smart Images

Figure CN119449915A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of gateway technology, and in particular to a gateway control method, device, gateway and storage medium. Background Art
[0002] In the IoT application scenario, although the existing multi-mode gateways on the market support multiple communication protocols, they still have great limitations in the use of interfaces. Current multi-mode gateways usually use a single interface protocol to access devices. For example, devices that support the UART protocol can only access the gateway through the UART interface and cannot use other interfaces. Such a design limits the access flexibility of the device and increases the complexity and confusion of users when using it. For ordinary users, they usually lack an in-depth understanding of the device communication protocol, and cannot accurately determine the protocols supported by the gateway and their corresponding interface types. In order to ensure normal communication between the device and the gateway, the user must match the correct protocol in the interface selection of the device and the gateway, which poses a significant obstacle to non-technical users. Due to this interface limitation, users may cause the device to fail to connect normally due to arbitrary interface selection, which leads to a large number of user complaints and product feedback.
[0003] Therefore, how to enable users to connect devices to the gateway without being familiar with the communication protocols and interfaces has become a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, in order to solve the above technical problems or part of the technical problems, the embodiments of the present invention provide a gateway control method, device, gateway and storage medium.
[0005] In a first aspect, an embodiment of the present invention provides a gateway control method, including:
[0006] When detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device, so that the device determines target identification information from the multiple identification information;
[0007] receiving the target identification information returned by the device;
[0008] Determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface;
[0009] The target unit circuit is controlled to be turned on, so that the device is connected to the gateway through the target unit circuit.
[0010] In a possible implementation, when detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device includes:
[0011] When the sensing device detects that the first interface of the gateway is connected to a device, the plurality of unit circuits included in the first interface are controlled to be turned on;
[0012] Acquire a communication protocol corresponding to each unit circuit included in the first interface to obtain multiple communication protocols;
[0013] The identification information of the plurality of communication protocols is sent to the device.
[0014] In a possible implementation manner, sending the identification information of the multiple communication protocols to the device includes:
[0015] Control each unit circuit of the first interface to send identification information of the communication protocol to the device, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the second communication protocol is included in the multiple first communication protocols, determine that the identification information corresponding to the second communication protocol is the target identification information.
[0016] In a possible implementation, the method further includes:
[0017] When it is detected that the first interface of the gateway is connected to a device, all unit circuits included in the non-first interface of the gateway are controlled to be disconnected;
[0018] When the device is connected to the gateway through the target unit circuit, the non-target unit circuit in the first interface is controlled to be disconnected.
[0019] In a possible implementation, the method further includes:
[0020] When the target identification information returned by the device is not received, determining a second interface from the non-first interface, the second interface including at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface;
[0021] Controlling all unit circuits included in the second interface to be turned on;
[0022] Generate reminder information, so as to remind the device to switch to the second interface through the reminder information;
[0023] When it is detected that the second interface is connected to the device, identification information of at least one of the third communication protocols is sent to the device.
[0024] In a possible implementation, when the device returns a plurality of pieces of identification information, the method further includes:
[0025] Acquire the current gateway attributes of the gateway and the data transmission attributes of the device, the gateway attributes include: network environment, and / or security requirements, and the data transmission attributes include: data transmission efficiency, and / or data transmission type;
[0026] The target identification information is determined from the plurality of identification information according to the gateway attribute and the data transmission attribute.
[0027] In a possible implementation manner, after controlling the multiple unit circuits in the gateway according to the target identification information, the method further includes:
[0028] Controlling the gateway to communicate with the device through the target unit circuit and the target communication protocol corresponding to the target identification information;
[0029] When the communication requirement of the device changes, the step of sending identification information of multiple communication protocols included in the first interface to the device is repeated so that the device determines target identification information from the multiple identification information.
[0030] In a second aspect, an embodiment of the present invention provides a control device for a gateway, including:
[0031] A sending module, configured to send identification information of a plurality of communication protocols included in the first interface to the device when detecting that the first interface of the gateway is connected to the device, so that the device determines target identification information from the plurality of identification information;
[0032] A receiving module, used for receiving the target identification information returned by the device;
[0033] A determination module, used to determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface;
[0034] The control module is used to control the target unit circuit to be turned on so that the device can access the gateway through the target unit circuit.
[0035] In a third aspect, an embodiment of the present invention provides a gateway, comprising: a processor and a memory, wherein the processor is used to execute a control program of the gateway stored in the memory to implement the control method of the gateway described in any one of the first aspects above.
[0036] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the gateway control method described in any one of the first aspects above.
[0037] The control scheme of the gateway provided by the embodiment of the present invention, when detecting that the first interface of the gateway is connected to a device, sends identification information of multiple communication protocols included in the first interface to the device, so that the device determines the target identification information from the multiple identification information; receives the target identification information returned by the device; determines the target unit circuit corresponding to the target identification information from the multiple unit circuits corresponding to the first interface; controls the target unit circuit to be turned on, so that the device is connected to the gateway through the target unit circuit. Thus, by detecting the access device status and controlling each unit circuit of the gateway according to the identification information of the communication protocol supported by the device, devices of different protocols can be smoothly connected to the gateway, realizing automatic identification and matching of multiple protocols, so that users can connect devices to the gateway without being familiar with the communication protocols and interfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a flow chart of a gateway control method provided by an embodiment of the present invention;
[0039] Figure 2 A flow chart of another gateway control method provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the structure of a control device of a gateway provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the structure of a gateway provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of the structure of another gateway provided by an embodiment of the present invention;
[0043] Figure 6 A schematic flow chart of another gateway control method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0046] Figure 1A flow chart of a gateway control method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method specifically includes:
[0047] S11. When it is detected that the first interface of the gateway is connected to a device, identification information of multiple communication protocols included in the first interface is sent to the device, so that the device determines target identification information from the multiple identification information.
[0048] The control method of the gateway provided by the embodiment of the present invention is applied to the gateway, which may include a power interface, multiple communication interfaces, etc. Each communication interface is connected to the main control unit of the gateway through multiple modularly designed unit circuits, and each unit circuit can correspond to devices that support different communication protocols. Devices with different communication protocols can access the gateway through the interface, and then convert them into a unified interface protocol through the unit circuit corresponding to the device, so that the main control can parse and report. Remote control is performed by accessing the cloud through a wired network or WiFi module connected to the gateway. Specifically, by detecting the access device status and controlling each unit circuit of the gateway according to the identification information of the communication protocol supported by the device, devices with different protocols can be smoothly connected to the gateway through the unit circuit.
[0049] In this embodiment, each unit circuit of each interface of the gateway corresponds to a connectable communication protocol, and each communication protocol corresponds to a unique identification information. While ensuring that the gateway and the device are powered on normally, the device accesses the gateway through any first interface of the gateway. After detecting that the first interface is accessed, the gateway actively sends the identification information of multiple communication protocols corresponding to the unit circuits included in the first interface to the device.
[0050] Furthermore, after receiving multiple identification information, the device parses the identification information and determines, from the multiple identification information, identification information corresponding to the communication protocol supported by the device as the target identification information.
[0051] S12. Receive target identification information returned by the device.
[0052] In this embodiment, the identification information may be a protocol identifier (Protocol Identifier), which is used to identify the type of communication protocol the device is using. The communication protocol may include, but is not limited to: MQTT (Message Queue Telemetry Transport Protocol), HTTP (Hypertext Transfer Protocol), Modbus protocol, UART protocol, RS-485 protocol, etc. The gateway can select the appropriate protocol stack by reading the protocol identifier to ensure compatibility with the device. Specifically, after the device determines the target identification information, it sends it to the main control of the gateway. The main control can determine the target communication protocol supported by the current device based on the target identification information, and determine the target unit circuit corresponding to the target communication protocol in the first interface. The target unit circuit and the target communication protocol are used to enable the device to access the gateway and communicate.
[0053] S13. Determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface; and control the target unit circuit to be turned on so that the device is connected to the gateway through the target unit circuit.
[0054] In this embodiment, the main control controls other interfaces other than the first interface and all unit circuits included in other interfaces to be disconnected to save energy and processing pressure. Determine the target communication protocol and target unit circuit corresponding to the target identification information, control the target unit circuit in the first interface to be turned on, and disconnect other unit circuits, so that the device is connected to the target unit circuit through the target communication protocol. The target communication protocol can be converted into a unified communication protocol that can communicate with the gateway through the target unit circuit, and communication with the network gateway is realized. When the gateway supports direct communication through the target communication protocol, the device can be directly connected to the gateway through the target communication protocol.
[0055] The control method of the gateway provided by the embodiment of the present invention, when detecting that the first interface of the gateway is connected to a device, sends identification information of multiple communication protocols included in the first interface to the device, so that the device determines the target identification information from the multiple identification information; receives the target identification information returned by the device; determines the target unit circuit corresponding to the target identification information from the multiple unit circuits corresponding to the first interface; controls the target unit circuit to be turned on, so that the device is connected to the gateway through the target unit circuit. Thus, by detecting the access device situation and controlling each unit circuit of the gateway according to the identification information of the communication protocol supported by the device, devices of different protocols can be smoothly connected to the gateway, realizing automatic identification and matching of multiple protocols, so that users can connect devices to the gateway without being familiar with the communication protocols and interfaces.
[0056] Figure 2 A flow chart of another gateway control method provided by an embodiment of the present invention is shown as follows: Figure 2 As shown, the method specifically includes:
[0057] S21. When the sensing device detects that the first interface of the gateway is connected to a device, the plurality of unit circuits included in the first interface are controlled to be turned on; the communication protocol corresponding to each unit circuit included in the first interface is obtained to obtain a plurality of communication protocols; and identification information of the plurality of communication protocols is sent to the device.
[0058] In this embodiment, when a device is detected to be connected to any interface of the gateway through the sensing device set on the interface, the sensing device sends the connection information of the interface to the gateway. The gateway determines that the interface is the first interface and triggers the connection logic to control all unit circuits included in the first interface to be turned on to wait for the connection of the device, while enabling the gateway to fully connect and identify the communication protocol of the device.
[0059] Furthermore, the gateway obtains the corresponding communication protocol type from each unit circuit of the first interface in advance to form a communication protocol list, which includes all protocol information supported by the first interface. The gateway uniformly sends the identification information of multiple communication protocols to the connected device, so that the device can identify the communication protocol options supported by the gateway through multiple identification information and select the most suitable communication protocol for communication connection.
[0060] As an example, Figure 5 The structure diagram of another gateway provided by an embodiment of the present invention is shown. The gateway may include: a first interface (interface 1), a second interface (interface 2) and a third interface (interface 3). Each interface is connected to the gateway master through a corresponding unit circuit (unit circuit 1, unit circuit 2 and unit circuit 3). The gateway master can also be connected to the power interface through a power conversion unit circuit, to the wired network interface through a conversion unit circuit, to the cloud through a wifi module, and to other unit circuits. When the first interface is connected to a device, all unit circuits in the second and third interfaces are disconnected, and the unit circuits in the first interface are controlled to be turned on, and each unit circuit of the first interface is controlled to send identification information of the communication protocol to the device.
[0061] In a possible implementation, when it is detected that the first interface of the gateway is connected to a device, other non-first interfaces included in the gateway and all unit circuits connected thereto are disconnected to ensure the uniqueness of the first interface connection and prevent interference between multiple interfaces while saving energy.
[0062] S22, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the multiple first communication protocols include the second communication protocol, the identification information corresponding to the second communication protocol is determined as the target identification information.
[0063] In this embodiment, the device extracts the communication protocols supported by all first interfaces contained in the target field from the multiple identification information sent by the gateway, and obtains multiple first communication protocols. At the same time, the device detects and lists the communication protocols supported by itself as the second communication protocol. The device compares its own second communication protocol with the multiple first communication protocols of the first interface one by one to find the commonly supported communication protocols. When the second communication protocol is included in the multiple first communication protocols, the device determines the identification information corresponding to the communication protocol as the target identification information, thereby matching the communication protocols. In this way, it can be ensured that the matching communication protocol can be automatically selected between the device and the gateway for connection without manual configuration by the user. Through the selection of the target identification information, the gateway and the device can achieve seamless communication, improve the compatibility and ease of use of device access, and reduce the possibility of connection failure.
[0064] As an example, assuming that the device parses the target field data as 111, indicating that the three unit circuits of the first interface of the gateway support 485, CAN, and UART protocols (multiple first communication protocols) respectively, and the device supports the 485 protocol (second communication protocol), the device returns 100 identification information to the gateway, indicating that the target communication protocol supported by the device is the 485 protocol.
[0065] S23. Receive target identification information returned by the device.
[0066] In this embodiment, similar to step S12, the specific Figure 1 For the sake of brevity, the relevant content will not be elaborated here.
[0067] S24, determining a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface; controlling the target unit circuit to be turned on so that the device can access the gateway through the target unit circuit; and controlling the non-target unit circuits in the first interface to be turned off.
[0068] In this embodiment, after receiving the target identification information, the gateway determines the target unit circuit of the first interface represented by the target identification information, and only controls the target unit circuit in the first interface to be turned on, so that the device connects to the gateway through the target unit circuit for communication, and at the same time controls the non-target unit circuit to be disconnected, so as to reduce communication interference and energy consumption.
[0069] In one possible implementation, when the target identification information returned by the device is not received, the second interface is determined from the non-first interface, all unit circuits included in the second interface in the control gateway are turned on, the second interface includes at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface; a reminder message is generated to remind the device to switch to the second interface through the reminder message; when it is detected that the second interface is connected to the device, identification information of at least one third communication protocol is sent to the device.
[0070] Specifically, when the target identification information is not received, it means that all the communication protocols supported by the current first interface do not match the communication protocols supported by the device. Therefore, it is necessary to determine whether the communication protocols of the unit circuits included in other interfaces match the device, that is, identify the communication protocols supported by all the unit circuits included in the non-first interface of the gateway. When any non-first interface contains at least one third communication protocol, the interface is determined to be the second interface, wherein the third communication protocol is a communication protocol that is not supported by the unit circuits of the first interface, and at the same time, all the unit circuits of the second interface are controlled to be turned on, or all the unit circuits corresponding to the third communication protocol are controlled to be turned on, and reminder information is generated according to the second interface, and the reminder information is sent to the device for display, so that the device is connected to the second interface. After the second interface is connected, the first interface and the included unit circuits can be controlled to be disconnected. When it is detected that the second interface is connected to the device, the identification information of at least one third communication protocol is sent to the device and the subsequent steps are re-executed. Or, the gateway can store the communication protocols supported by the device, determine the target interface and the unit circuit of the target interface that support the communication protocol, and generate reminder information according to the target interface and the unit circuit of the target interface, so as to remind the device to directly connect to the target interface through the reminder information, and communicate through the unit circuit of the target interface.
[0071] In a possible implementation, when the device returns multiple pieces of identification information, the method further includes:
[0072] Obtain the current gateway properties of the gateway and the data transmission properties of the device, the gateway properties include: network environment, and / or security requirements, and the data transmission properties include: data transmission efficiency, and / or data transmission type; determine the target identification information from multiple identification information based on the gateway properties and data transmission properties.
[0073] Specifically, when the device supports identification information included in multiple first interfaces, the target identification information can be selected according to the current gateway attributes and / or data attributes. When the gateway attributes include the network environment, some protocols may not be applicable in different network environments. Therefore, it is necessary to select the target identification information corresponding to the communication protocol supported by the current network environment. For example, in a low-bandwidth or high-latency environment, lightweight protocols (such as CoAP or MQTT) are more suitable for IoT devices than HTTP. In this case, a suitable communication protocol can be selected from the communication protocols supported by the device and the first interface.
[0074] When the gateway attributes include security requirements, since the device has high security requirements for data transmission in some application scenarios, it is necessary to select a communication protocol that can support encrypted transmission. The target identification information corresponding to the communication protocol that can support encrypted transmission can be determined from multiple identification information to make data transmission more secure (for example, HTTPS or MQTT overTLS)
[0075] When the data transmission attribute is data transmission efficiency, if the current scenario requires high transmission efficiency, the target identification information corresponding to the communication protocol with smaller protocol overhead and higher data transmission efficiency can be selected. For example, low-power devices usually choose lightweight communication protocols (such as CoAP or LoRa) rather than HTTP protocols with large data overhead.
[0076] When the data transmission attribute is the data transmission type, since different protocols support different data types, it is necessary to determine the target identification information corresponding to the communication protocol according to the data type that the current device needs to transmit. For example, real-time monitoring data may need to use UDP, while non-real-time data can use HTTP or other TCP protocols. The required communication protocol can be determined based on changes in data type and real-time requirements.
[0077] S25. The control gateway is connected to the device through the target unit circuit and the target communication protocol corresponding to the target identification information; when the communication requirements of the device change, repeat the step of sending the identification information of multiple communication protocols included in the first interface to the device, so that the device determines the target identification information from the multiple identification information.
[0078] In this embodiment, after the device is connected to the gateway through the target unit circuit, it can be connected to the gateway according to the target communication protocol, and the target communication protocol can be converted through the target unit circuit to achieve communication with the gateway. During the communication process, if the communication requirements of the device change, there may be a need to switch the communication protocol and then switch the unit circuit. At this time, it is necessary to re-execute the step of sending the identification information of multiple communication protocols included in the first interface to the device so that the device can determine the target identification information from multiple identification information. So that the device and the gateway can redetermine the communication interface and unit circuit. For example, when the application scenario changes, the communication requirements of the device will also change. When the device is upgraded from local monitoring to remote control, it may be necessary to switch from a local area network protocol (such as Modbus) to a protocol that supports cloud communication (such as MQTT).
[0079] As an example, Figure 6The flowchart of another control method of a gateway provided by an embodiment of the present invention is shown as follows: 1. When the gateway and the device are powered on normally, the device accesses the gateway through an interface. After the gateway detects that the interface is accessed, it actively sends identification information of multiple protocols to the device. 2. After receiving the identification information of multiple protocols, the device analyzes and compares the protocol matching, and after determining that the protocol matches, returns the determined target identification information to the gateway. 3. After the gateway receives the target identification information, it further analyzes and confirms. ① The gateway master control program separately develops each interface, unit circuit and its corresponding function in a modular manner, and makes strict module distinctions. Among them, the interface signal is a sign of starting the unit circuit and the corresponding function; the determined target identification information is a sign of starting the correct function. ② When the master control detects that a certain interface is connected, it starts all the unit circuits under the interface, and at the same time starts the modular function corresponding to the interface, so that the master control sends the identification information of multiple protocols. ③ When the master control receives the target identification information, it starts the function under the communication protocol corresponding to the target representation information. 4. Through the above analysis and confirmation, the communication protocol of the access device is finally confirmed, and then the correct unit circuit is used to work, without user identification, reducing the difficulty of user use. 5. Every three unit circuits of the gateway share one interface. The interface is equipped with a sensing device, which is connected to the main control and is used to detect the access status of the interface. The power supply of all the corresponding unit circuits of the unconnected interface is disconnected to reduce power consumption. After the access is detected, the power supply of the unit circuit involved in the interface is turned on. 6. The gateway has multiple interfaces, which can meet the access of devices with various protocols and work simultaneously. 7. After a certain interface of the gateway can communicate normally, it disconnects the power supply of other unit circuits of the interface with incorrect protocols to reduce power consumption. 8. Each unit circuit of the gateway is connected to the main control separately, each is independent and does not interfere with each other.
[0080] The control method of the gateway provided by the embodiment of the present invention can detect the access device status and control each unit circuit of the gateway according to the identification information of the communication protocol supported by the device, so that devices with different protocols can be smoothly connected to the gateway, and automatic identification and matching of multiple protocols can be realized, so that users can connect the device to the gateway without being familiar with the communication protocols and interfaces. At the same time, unconnected interfaces and unused unit circuits can be disconnected in time to achieve the effect of energy saving. It is also possible to remind the device to connect to other interfaces when there is no matching communication protocol for the current interface, thereby improving the success rate of the device connecting to the gateway. When there are multiple communication protocols matching the device on the interface, the communication protocol that best suits the current gateway attributes and data transmission attributes can be selected for communication connection, thereby improving the accuracy and efficiency of communication between the device and the gateway.
[0081] Figure 3 A schematic diagram of the structure of a control device of a gateway provided by an embodiment of the present invention, such as Figure 3 As shown, the device specifically includes:
[0082] The sending module 31 is used for sending identification information of multiple communication protocols included in the first interface to the device when detecting that the first interface of the gateway is connected to the device, so that the device determines the target identification information from the multiple identification information;
[0083] A receiving module 32, configured to receive the target identification information returned by the device;
[0084] A determination module 33, configured to determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface;
[0085] The control module 34 is used to control the target unit circuit to be turned on, so that the device can access the gateway through the target unit circuit.
[0086] In a possible implementation manner, the sending module is specifically configured to control a plurality of unit circuits included in the first interface to be turned on when a first interface access device of the gateway is detected through a sensing device;
[0087] Acquire a communication protocol corresponding to each unit circuit included in the first interface to obtain multiple communication protocols;
[0088] The identification information of the plurality of communication protocols is sent to the device.
[0089] In one possible implementation, the sending module is specifically used to control each unit circuit of the first interface to send identification information of the communication protocol to the device, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the second communication protocol is included in the multiple first communication protocols, the identification information corresponding to the second communication protocol is determined to be the target identification information.
[0090] In a possible implementation manner, the control module is further configured to control all unit circuits included in the non-first interface of the gateway to be disconnected when it is detected that the first interface of the gateway is connected to a device;
[0091] When the device is connected to the gateway through the target unit circuit, the non-target unit circuit in the first interface is controlled to be disconnected.
[0092] In a possible implementation, the determination module is further configured to, when the target identification information returned by the device is not received, determine a second interface from the non-first interface, wherein the second interface includes at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface;
[0093] The control module is further used to control all unit circuits included in the second interface to be turned on;
[0094] A generating module 35, configured to generate a reminder message, so as to remind the device to switch to the second interface through the reminder message;
[0095] The sending module is further configured to send at least one identification information of the third communication protocol to the device when it is detected that the second interface is connected to the device.
[0096] In a possible implementation, the acquisition module 36 is used to acquire the current gateway attributes of the gateway and the data transmission attributes of the device, the gateway attributes include: network environment, and / or security requirements, and the data transmission attributes include: data transmission efficiency, and / or data transmission type;
[0097] The target identification information is determined from the plurality of identification information according to the gateway attribute and the data transmission attribute.
[0098] In a possible implementation manner, the control module is further used to control the gateway to communicate with the device through the target unit circuit and the target communication protocol corresponding to the target identification information;
[0099] The sending module is also used to repeatedly execute the step of sending identification information of multiple communication protocols included in the first interface to the device when the communication demand of the device changes, so that the device determines the target identification information from the multiple identification information.
[0100] The device provided in this embodiment can be as follows Figure 3 The device shown in FIG. 1 may perform the following steps: Figure 1-2 All steps of the control method of the gateway in the Figure 1-2 For details on the technical effects of the gateway control method, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.
[0101] Figure 4 A schematic diagram of the structure of a gateway provided by an embodiment of the present invention, Figure 4 The gateway 400 shown includes: at least one processor 401, a memory 402, at least one network interface 404 and other user interfaces 403. The various components in the gateway 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 405 is not shown in FIG. Figure 4 Various buses are labeled as bus system 405 .
[0102] The user interface 403 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0103] It can be understood that the memory 402 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0104] In some implementations, the memory 402 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 4021 and application programs 4022 .
[0105] The operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 4022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 4022.
[0106] In the embodiment of the present invention, by calling the program or instruction stored in the memory 402, specifically, the program or instruction stored in the application 4022, the processor 401 is used to execute the method steps provided by each method embodiment, for example, including:
[0107] When detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device, so that the device determines target identification information from the multiple identification information;
[0108] receiving the target identification information returned by the device;
[0109] Determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface;
[0110] The target unit circuit is controlled to be turned on, so that the device is connected to the gateway through the target unit circuit.
[0111] In a possible implementation manner, when the sensing device detects that the first interface of the gateway is connected to a device, a plurality of unit circuits included in the first interface are controlled to be turned on;
[0112] Acquire a communication protocol corresponding to each unit circuit included in the first interface to obtain multiple communication protocols;
[0113] The identification information of the plurality of communication protocols is sent to the device.
[0114] In one possible implementation, each unit circuit of the first interface is controlled to send identification information of the communication protocol to the device, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the second communication protocol is included in the multiple first communication protocols, the identification information corresponding to the second communication protocol is determined to be the target identification information.
[0115] In a possible implementation manner, when it is detected that the first interface of the gateway is connected to a device, all unit circuits included in the non-first interface of the gateway are controlled to be disconnected;
[0116] When the device is connected to the gateway through the target unit circuit, the non-target unit circuit in the first interface is controlled to be disconnected.
[0117] In a possible implementation, when the target identification information returned by the device is not received, determining a second interface from the non-first interface, where the second interface includes at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface;
[0118] Controlling all unit circuits included in the second interface to be turned on;
[0119] Generate reminder information, so as to remind the device to switch to the second interface through the reminder information;
[0120] When it is detected that the second interface is connected to the device, identification information of at least one of the third communication protocols is sent to the device.
[0121] In a possible implementation, current gateway attributes of the gateway and data transmission attributes of the device are obtained, wherein the gateway attributes include: network environment and / or security requirements, and the data transmission attributes include: data transmission efficiency and / or data transmission type;
[0122] The target identification information is determined from the plurality of identification information according to the gateway attribute and the data transmission attribute.
[0123] In a possible implementation, controlling the gateway to communicate with the device through the target unit circuit and the target communication protocol corresponding to the target identification information;
[0124] When the communication requirement of the device changes, the step of sending identification information of multiple communication protocols included in the first interface to the device is repeated so that the device determines target identification information from the multiple identification information.
[0125] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 402, and the processor 401 reads the information in the memory 402 and completes the steps of the above method in combination with its hardware.
[0126] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0127] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0128] The gateway provided in this embodiment can be as follows Figure 3 The gateway shown in , can be executed as Figure 1-2 All steps of the control method of the gateway in the Figure 1-2 For details on the technical effects of the gateway control method, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.
[0129] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0130] When one or more programs in the storage medium can be executed by one or more processors, the gateway control method executed on the device side can be implemented.
[0131] The processor is used to execute the control program of the gateway stored in the memory to implement the following steps of the control method of the gateway executed on the device side:
[0132] When detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device, so that the device determines target identification information from the multiple identification information;
[0133] receiving the target identification information returned by the device;
[0134] Determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface;
[0135] The target unit circuit is controlled to be turned on, so that the device is connected to the gateway through the target unit circuit.
[0136] In a possible implementation manner, when the sensing device detects that the first interface of the gateway is connected to a device, a plurality of unit circuits included in the first interface are controlled to be turned on;
[0137] Acquire a communication protocol corresponding to each unit circuit included in the first interface to obtain multiple communication protocols;
[0138] The identification information of the plurality of communication protocols is sent to the device.
[0139] In one possible implementation, each unit circuit of the first interface is controlled to send identification information of the communication protocol to the device, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the second communication protocol is included in the multiple first communication protocols, the identification information corresponding to the second communication protocol is determined to be the target identification information.
[0140] In a possible implementation manner, when it is detected that the first interface of the gateway is connected to a device, all unit circuits included in the non-first interface of the gateway are controlled to be disconnected;
[0141] When the device is connected to the gateway through the target unit circuit, the non-target unit circuit in the first interface is controlled to be disconnected.
[0142] In a possible implementation, when the target identification information returned by the device is not received, determining a second interface from the non-first interface, where the second interface includes at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface;
[0143] Controlling all unit circuits included in the second interface to be turned on;
[0144] Generate reminder information, so as to remind the device to switch to the second interface through the reminder information;
[0145] When it is detected that the second interface is connected to the device, identification information of at least one of the third communication protocols is sent to the device.
[0146] In a possible implementation, current gateway attributes of the gateway and data transmission attributes of the device are obtained, wherein the gateway attributes include: network environment and / or security requirements, and the data transmission attributes include: data transmission efficiency and / or data transmission type;
[0147] The target identification information is determined from the plurality of identification information according to the gateway attribute and the data transmission attribute.
[0148] In a possible implementation, controlling the gateway to communicate with the device through the target unit circuit and the target communication protocol corresponding to the target identification information;
[0149] When the communication requirement of the device changes, the step of sending identification information of multiple communication protocols included in the first interface to the device is repeated so that the device determines target identification information from the multiple identification information.
[0150] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians 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 the present invention.
[0151] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0152] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A gateway control method, characterized in that: include: When detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device, so that the device determines target identification information from the multiple identification information; receiving the target identification information returned by the device; Determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface; The target unit circuit is controlled to be turned on, so that the device is connected to the gateway through the target unit circuit.
2. The method according to claim 1, characterized in that When detecting that the first interface of the gateway is connected to a device, sending identification information of multiple communication protocols included in the first interface to the device includes: When the sensing device detects that the first interface of the gateway is connected to a device, the plurality of unit circuits included in the first interface are controlled to be turned on; Acquire a communication protocol corresponding to each unit circuit included in the first interface to obtain multiple communication protocols; The identification information of the plurality of communication protocols is sent to the device.
3. The method according to claim 2, characterized in that The sending the identification information of the plurality of communication protocols to the device comprises: Control each unit circuit of the first interface to send identification information of the communication protocol to the device, so that the device obtains multiple first communication protocols supported by the first interface from the target field of each identification information, and obtains the second communication protocol supported by the device. When the second communication protocol is included in the multiple first communication protocols, determine that the identification information corresponding to the second communication protocol is the target identification information.
4. The method according to claim 2, characterized in that: The method further comprises: When it is detected that the first interface of the gateway is connected to a device, all unit circuits included in the non-first interface of the gateway are controlled to be disconnected; When the device is connected to the gateway through the target unit circuit, the non-target unit circuit in the first interface is controlled to be disconnected.
5. The method according to claim 4, characterized in that The method further comprises: When the target identification information returned by the device is not received, determining a second interface from the non-first interface, the second interface including at least one third communication protocol, and the third communication protocol is different from the multiple communication protocols included in the first interface; Controlling all unit circuits included in the second interface to be turned on; Generate reminder information, so as to remind the device to switch to the second interface through the reminder information; When it is detected that the second interface is connected to the device, identification information of at least one of the third communication protocols is sent to the device.
6. The method according to claim 1, characterized in that When the device returns a plurality of pieces of identification information, the method further includes: Acquire the current gateway attributes of the gateway and the data transmission attributes of the device, the gateway attributes include: network environment, and / or security requirements, and the data transmission attributes include: data transmission efficiency, and / or data transmission type; The target identification information is determined from the plurality of identification information according to the gateway attribute and the data transmission attribute.
7. The method according to any one of claims 1 to 6, characterized in that: After controlling the multiple unit circuits in the gateway according to the target identification information, the method further includes: Controlling the gateway to communicate with the device through the target unit circuit and the target communication protocol corresponding to the target identification information; When the communication requirement of the device changes, the step of sending identification information of multiple communication protocols included in the first interface to the device is repeated so that the device determines target identification information from the multiple identification information.
8. A gateway control device, characterized in that: include: A sending module, configured to send identification information of a plurality of communication protocols included in the first interface to the device when detecting that the first interface of the gateway is connected to the device, so that the device determines target identification information from the plurality of identification information; A receiving module, used for receiving the target identification information returned by the device; A determination module, used to determine a target unit circuit corresponding to the target identification information from a plurality of unit circuits corresponding to the first interface; The control module is used to control the target unit circuit to be turned on so that the device can access the gateway through the target unit circuit.
9. A gateway, characterized in that: include: A processor and a memory, wherein the processor is used to execute a gateway control program stored in the memory to implement the gateway control method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the gateway control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multimode gateway used for internet of things
CN102510362A
Adaptive Internet of things intelligent gateway implementation method and intelligent gateway equipment
CN106878459A
Control method and device based on multi-protocol gateway and computer readable storage medium
CN110460519A
Message processing method and gateway equipment
CN111614505A
Message sending method and device, gateway and storage medium
CN112153071A
Cited By
Data processing method and device, optical storage direct flexible equipment, system and storage medium
CN120881173A
Data processing method and device, optical storage and direct flexible device, system and storage medium
CN120881173B