Communication method, readable storage medium, program product and electronic device

By implementing dynamic loading and unloading of functional components in gateway devices, the problem of increased storage and memory space requirements of gateway devices is solved, reducing manufacturing costs and improving resource management efficiency.

CN119276713APending Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410168696.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-06
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

With the increase in gateway equipment functions, the demand for storage and memory space also increases, resulting in an increase in manufacturing costs and it is difficult for the prior art to effectively manage and optimize storage and memory resources.

Method used

By storing the data of functional components in the server and downloading and initializing the corresponding components from the server when the gateway device detects a call request, dynamic loading and unloading of functional components is achieved, reducing storage and memory usage.

Benefits of technology

It effectively reduces the storage and memory requirements of gateway devices, reduces manufacturing costs, and improves resource management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276713A_ABST
    Figure CN119276713A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of terminals, in particular to a communication method, a readable storage medium, a program product and electronic equipment. The communication method is applied to first electronic equipment, and the first electronic equipment can be gateway equipment for example. Other functional components except the basic functional component in the gateway device can be stored in the server. After the gateway device detects the message of calling the functional component, the component data corresponding to the functional component can be downloaded from the server, and then the function corresponding to the functional component is executed. Therefore, the storage space of the gateway equipment for storing the functional component can be reduced, so that the cost of the gateway equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a communication method, a readable storage medium, a program product, and an electronic device. Background Art

[0002] The Internet of Things (IoT) is a network formed by combining various information sensing devices (such as smart home devices such as smart speakers and smart refrigerators, or smart manufacturing equipment such as industrial robots and automated production lines, hereinafter referred to as IoT devices) with the Internet. Its purpose is to connect IoT devices to the network for easy identification and management. Some gateway devices, as intermediaries connecting IoT devices and the Internet, can realize conversion between different protocols and data formats, for example, receiving data from IoT devices and sending control instructions to IoT devices.

[0003] In order to realize the functions of the Internet of Things (such as obtaining data from Internet of Things devices and controlling Internet of Things devices, etc.), the gateway device needs to configure different components for different functions (such as multiple protocol components connected to Internet of Things devices, or components for communicating and controlling mobile applications). In some cases, the component data corresponding to different functional components (such as instructions, configuration parameters, etc.) are usually all stored in the memory of the gateway device. However, as the functions of the gateway device increase, the storage space occupied by the component data corresponding to different functions is also increasing, which requires the configuration of a large-capacity memory for the gateway device, increasing the manufacturing cost. Summary of the invention

[0004] Embodiments of the present application provide a communication method, a readable storage medium, a program product, and an electronic device.

[0005] In a first aspect, an embodiment of the present application provides a communication method, applied to a first electronic device, comprising: detecting a request to call a first functional component; obtaining component data of the first functional component from a second electronic device; initializing the first functional component based on the component data of the first functional component, and calling the first functional component to execute a first function corresponding to the first functional component.

[0006] In some embodiments of the present application, the first electronic device may also be referred to as a gateway device, the functional component may also be referred to as an extension component (the first functional component may be, for example, an extension component), and the second electronic device may also be referred to as a server (for example, server 400 hereinafter). It can be understood that the component data corresponding to the functional component of the first electronic device is stored in the second electronic device, and when the first electronic device calls the first functional component, the component data of the first functional component may be downloaded from the second electronic device. In this way, the storage space of the first electronic device for storing the functional component may be reduced, saving the cost of the first electronic device. Furthermore, after downloading the component data of the first functional component, the first electronic device loads the first functional component into the memory for initialization. Therefore, the first electronic device does not need to load all the functional components into the memory for initialization, thereby saving the memory space of the first electronic device.

[0007] In a possible implementation of the first aspect, the method further includes: after the call to the first functional component is completed, deleting component data of the first functional component.

[0008] It can be understood that after the first electronic device calls the first functional component, the component data of the first functional component can be deleted, thereby clearing the storage space and memory space of the first electronic device and reducing the storage burden of the first electronic device.

[0009] In a possible implementation of the first aspect, the detecting of the request to call the first functional component includes: receiving a message to call the first functional component sent by a third electronic device; or detecting a request to call the first function.

[0010] Exemplarily, in some embodiments of the present application, the request to call the first functional component detected by the first electronic device may be, for example, a call request sent to the first electronic device when the third electronic device calls the first electronic device to implement the function of the first component. For example, the third electronic device sends an instruction to control the Internet of Things device to the first electronic device, and the instruction includes a call request for the control component. After the first electronic device detects the instruction to control the Internet of Things device sent by the third electronic device, it can detect the call request for the control component.

[0011] In other embodiments, the first electronic device may generate a request to call the first functional component based on the operation logic of the first function. For example, when the first electronic device detects that a system upgrade is available, the system upgrade component is required to perform a corresponding function. Thus, the first electronic device may generate a request to call the system upgrade component.

[0012] In a possible implementation of the first aspect, the component data of the first functional component includes instructions for executing the first function.

[0013] For example, in some embodiments of the present application, the component data of the first functional component may be, for example, source code of instructions for executing the first function. In the compilation phase of the functional component, the developer may compile the source code of the first functional component into an independent library file using a corresponding compilation tool, and then store the corresponding library file in the second electronic device, so that the first electronic device can download the corresponding component data from the second electronic device.

[0014] In a possible implementation of the first aspect, the first functional component includes any one of the following: a gateway component, a registration component, a control component, and a system upgrade component.

[0015] In a possible implementation of the first aspect, the first electronic device is a gateway device.

[0016] In a possible implementation of the first aspect above, the request for calling the first functional component includes a component identifier of the first functional component; and obtaining component data of the first functional component from the second electronic device includes: based on the component identifier, obtaining component data of the first functional component from the second electronic device.

[0017] In some embodiments of the present application, the request for calling the first functional component includes a component identifier of the first functional component. The first electronic device can obtain a download address of component data of the first functional component from the second electronic device based on the component identifier. Then the first electronic device downloads the component data of the first functional component based on the download address of the component data of the first functional component.

[0018] In a possible implementation of the first aspect above, the above-mentioned initialization of the first functional component based on the component data of the first functional component, and calling the first functional component to execute the first function corresponding to the first functional component include: obtaining a configuration file corresponding to the first functional component from the second electronic device, wherein the configuration file includes an initialization interface of the first functional component and a logical processing interface of the first functional component; initializing the first functional component based on the initialization interface of the first functional component; and executing the first function corresponding to the first functional component based on the logical processing interface of the first functional component.

[0019] In some embodiments of the present application, the second electronic device also stores a configuration file of a functional component corresponding to the first electronic device, in which, for example, component identifiers of each functional component, as well as initialization interfaces of each functional component and logic processing interfaces of each functional component may be configured. After downloading the component data of the first functional component, the first electronic device may continue to download a configuration file corresponding to the first functional component from the second electronic device based on the component identifier of the first functional component, wherein the configuration file of the first functional component includes an initialization interface and a logic processing interface of the first functional component. The first electronic device may initialize the first functional component through the initialization interface of the first functional component, and execute the first function corresponding to the first functional component according to the logic processing interface.

[0020] In a possible implementation of the first aspect above, the above configuration file also includes a deinitialization interface of the first functional component; after the call to the first functional component is completed, the component data of the first functional component is deleted, including: calling the deinitialization interface in the configuration file to delete the component data of the first functional component.

[0021] In some embodiments of the present application, the configuration file of the first functional component further includes a deinitialization interface of the first functional component. After the first electronic device completes the first function of the first functional component, the first electronic device can call the deinitialization interface of the first functional component to clean up the first functional component.

[0022] In a possible implementation of the first aspect above, the obtaining of component data of the first functional component from the second electronic device further includes: obtaining, from the second electronic device, component data of the first functional component corresponding to the first electronic device based on the device type of the first electronic device and the component identifier of the first functional component.

[0023] It can be understood that in some embodiments of the present application, the second electronic device is also configured with a functional component corresponding to the device type of the first electronic device. In other embodiments, the device type of the first electronic device can also be the system framework of the first electronic device. Therefore, when the first electronic device obtains the component data of the first functional component from the second electronic device, the device type of the first electronic device and the component identification of the first functional component are required to obtain the component identification of the first functional component from the second electronic device. In this way, functional components corresponding to different device types can be configured in the second electronic device, and multiple types of devices can store functional components in the second electronic device.

[0024] In a second aspect, the present application provides an electronic device, the electronic device comprising: a memory for storing instructions; at least one processor for executing instructions so that the device implements the first aspect and any possible implementation method of the first aspect. The beneficial effects that can be achieved in the second aspect can refer to the beneficial effects of the method provided in any implementation of the first aspect, and will not be repeated here.

[0025] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed by a device, the computer implements the method provided in the first aspect and any possible implementation of the first aspect. The beneficial effects that can be achieved in the third aspect can refer to the beneficial effects of the method provided in any implementation of the first aspect, and will not be repeated here.

[0026] In a fourth aspect, the present application provides a computer program product, which, when running on a device, enables the device to implement the method provided in the first aspect and any possible implementation of the first aspect. The beneficial effects that can be achieved in the fourth aspect can refer to the beneficial effects of the method provided in any implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 According to some embodiments of the present application, a schematic diagram of a compilation and operation process of a gateway device is shown;

[0028] Figure 2 According to some embodiments of the present application, an Internet of Things system is shown;

[0029] Figure 3 According to some embodiments of the present application, a flow chart of interaction between a gateway device 100 and a server 400 is shown;

[0030] Figure 4 According to some embodiments of the present application, a schematic diagram of the compilation and operation process of a main component and an extension component of a gateway device is shown;

[0031] Figure 5 According to some embodiments of the present application, a schematic diagram of a calling interface of a main component calling an extension component is shown;

[0032] Figure 6 According to some embodiments of the present application, an interaction flow chart of a gateway device 100 registering with a server 300 is shown;

[0033] Figure 7 According to some embodiments of the present application, a schematic diagram of the structure of a gateway device 100 is shown. DETAILED DESCRIPTION

[0034] Illustrative embodiments of the present application include, but are not limited to, a communication method, a readable storage medium, a program product, and an electronic device.

[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0036] To facilitate understanding, we first introduce the components in the gateway device.

[0037] For example, in some embodiments of the present application, the gateway device includes a main component and an extension component, wherein the main component can implement corresponding functions based on the extension component.

[0038] For example, the main component is used to implement the common basic functions of the gateway device. For example, in some embodiments, the main component can provide the underlying functions required by the gateway device, such as task scheduling, memory management, device drivers, etc., and implement the core functions of network communication. For example, support data transmission, routing and exchange operations, etc.

[0039] For example, the extension component is used to implement additional functions of the gateway device. For example, the extension component may include a registration component, a control component, a gateway component, and a system upgrade component.

[0040] Among them, in some embodiments, the registration component is used to manage the registration information of the IoT device, including device identification, attributes, configuration, etc. It is usually integrated in the software or firmware of the gateway device for device identification and authentication. For example, when a new IoT device is connected to the gateway device, the gateway device needs to call the registration component so that the new device is registered through the registration component to obtain authorization and start communicating with the gateway device. In some embodiments, when the gateway device is registered on the server corresponding to the IoT device, it is also necessary to complete the registration of the gateway device through the registration component.

[0041] In some embodiments, the control component can realize functions such as control and operation of the IoT device, status monitoring, data collection, remote control, and scalability. For example, the gateway device can call the control component to collect data from the IoT device according to the data collection component, and issue a command to drive the IoT device to perform a specified action. Alternatively, the gateway device can call the control component to drive the IoT device to perform a corresponding action based on the user's operation.

[0042] The gateway component is mainly responsible for transmitting, managing, storing and retransmitting network data when necessary. It can also control network connections and control the type of data transmission on all networks connected to it. In addition, it can also control the protocols used by devices or terminals on the network and issue various commands or requests to ensure the maximum availability and effectiveness of the network status. For example, after the gateway device is registered on the server through the registration component, the gateway device can communicate with the server through the gateway component. For example, receiving control instructions for IoT devices sent by the server, and registering new IoT devices with the server, etc.

[0043] The system upgrade component can provide the gateway device with functions such as firmware / software updates, automatic upgrades, version control, and rollback. These functions help ensure the continuous operation and performance optimization of the gateway device, and improve the security and reliability of the gateway device. For example, if the software system is updated on the server corresponding to the gateway device, the gateway device can download and install the new software system through the system upgrade component to achieve the software update.

[0044] That is to say, the main component of the gateway device can realize some basic functions of the gateway device, and the additional functions of the gateway device need to be realized by the main component and the corresponding extension components.

[0045] In some scenarios, as the functions of the gateway device increase, the corresponding expansion components also increase. The storage space occupied by each expansion component is also increasing, which requires the gateway device to be configured with a large-capacity memory, increasing the manufacturing cost.

[0046] Next, the process of compiling and running instructions of a gateway device is introduced.

[0047] For example, Figure 1 According to some embodiments of the present application, a schematic diagram of a compilation and operation process of a gateway device is shown.

[0048] refer to Figure 1 During the development phase, developers can write source code corresponding to different components. Source code is the original code for writing and implementing components (including main components and extension components), usually written in programming languages ​​(such as C, C++, Java, etc.). By writing source code, developers can define and implement the functions, logic, and behavior of components.

[0049] like Figure 2 As shown, the development phases include:

[0050] 1. Developers write source code for main components and extension components.

[0051] Exemplarily, in some embodiments of the present application, the developer can write the source code of the gateway device through the development device, and declare the dependency relationship between the main component and the extension component in the compilation script, so that when the gateway device implements the function corresponding to the extension component, the main component can load the corresponding extension component based on the dependency relationship with the extension component.

[0052] The dependency relationship between the main component and the extended component is, for example, a list of functions corresponding to the extended component, and different extended components correspond to different functions of the gateway device. When the gateway device calls a corresponding function, it can determine the extended component to call based on the function list.

[0053] 2. The developer compiles the source code.

[0054] For example, in some embodiments of the present application, the developer can compile the source code of the gateway device based on the development device. The compilation process is, for example, to define the functions and logical behaviors of the extension component, and to link the library file of the extension component to the main component so that the main component can access and use the functions of the extension component, thereby generating an executable file.

[0055] For example, in some embodiments, the source code of a component defines the structure, properties, and methods of the component. It contains the code that implements a specific function, as well as the logic related to the input, output, and internal processing of the component. The source code of a component is usually compiled or interpreted into an executable file or intermediate code to be executed at runtime. For example, each extension component has its own directory, containing its source code and related files. The directories of different extension components can be placed in the same root directory for management and organization. The source code of each extension component is placed in its own source file. In addition, the source code of each extension component needs to be compiled into an independent library file (e.g., a dynamic link library, etc.). It is necessary to ensure that the extension components are not mutually dependent during compilation, that is, each extension component is independent.

[0056] In some embodiments, the main component includes header files of each extension component, and the header files include interfaces and related definitions of the corresponding extension components, so that when compiling, the main component can access the interfaces of the corresponding extension components through the header files. The source code of the main component should include calls to the interfaces provided by the extension components. When compiling the main component, the library files of the extension components need to be linked to the main component so that the main component can access and use the functions of the extension components.

[0057] Then, by compiling the main component and linking the library files of the extension components, the final executable file can be generated. This executable file will contain the functions of the main component and the linked extension components.

[0058] It should be understood that after the above development phase is completed, the source codes of the compiled main components and extension components are all integrated into the gateway device, occupying a portion of the storage space of the gateway device.

[0059] The operation phase includes:

[0060] 3. The main component loads the extension component based on the dependencies.

[0061] For example, in some embodiments of the present application, when the gateway device implements the corresponding function, the main component can download the corresponding extension component based on the dependency relationship with the corresponding extension component. For example, when the gateway device needs to implement registration-related functions, the registration component is loaded based on the dependency relationship between the main component and the registration component.

[0062] For example, when the gateway device is running, it can initialize the main component and the extended component and load the main component and the extended component into the memory. The initialization process can ensure that the extended component is correctly set up, prepared and operated, so as to provide the required extended functions and services for the main component.

[0063] It can be understood that when the gateway device is running, although the gateway component does not call the extension component, the extension component will also occupy a part of the memory space, resulting in a reduction in the available memory space of the gateway device.

[0064] 4. The main component calls the interface of the extended component through the header file.

[0065] For example, in some embodiments of the present application, after the main component loads the extension component, the calling interface of the corresponding extension component can be found in the header file. The main component can call the corresponding extension component based on the calling interface to execute the function of the extension component.

[0066] In summary, the component data (such as instructions, configuration parameters, etc.) corresponding to the main component and the extended component are stored in the gateway device. If there are many extended components, a large storage space will be occupied, resulting in the need to configure a larger memory for the gateway device, which increases the cost of the gateway device. In addition, during the operation of the gateway device, the relevant data of all extended components are loaded into the memory, resulting in a large amount of memory space occupied by the gateway device.

[0067] In order to solve the above problems, the present application proposes a communication method, in which component data corresponding to different functional components can be stored in a server. When a gateway device detects a call request for a target functional component, it can obtain component data corresponding to the target functional component from the server. Then, the gateway device can initialize the target functional component based on the obtained component data, and run the target functional component to implement related functions. After the call to the component data corresponding to the target functional component is completed, the gateway device can delete the component data corresponding to the target functional component from the gateway device.

[0068] In this way, the gateway device does not need to store component data corresponding to each functional component all the time, reducing the burden on the memory of the gateway device. In addition, the gateway device does not need to load all functional components into the memory for initialization, reducing the memory space occupied by each functional component.

[0069] In some embodiments of the present application, the calling interface of the target functional component and the component name of the target functional component are stored in a configuration file, and the calling interface of the target functional component includes an initialization interface, a logic processing interface, and a deinitialization interface. The gateway device can initialize the target functional component through the initialization interface to meet the operation requirements of the target functional component. Then, the gateway device implements the function of the target functional component through the logic processing interface. After the function corresponding to the target functional component is implemented, the gateway device cleans up the data generated when calling the target functional component through the deinitialization interface, thereby cleaning up the memory space of the gateway device.

[0070] In some embodiments of the present application, the configuration file of the target functional component may also be stored in the server, and the gateway device may continue to download the configuration file of the target functional component from the server after downloading the component data of the target functional component. The gateway device determines the calling interface of the target functional component based on the configuration file and the component name of the target functional component.

[0071] In some embodiments of the present application, the server may also store functional components corresponding to system frameworks of different gateway devices, and when downloading component data corresponding to the functional components, the gateway device may download component data of the functional components corresponding to the system framework of the gateway device from the server based on the component name of the functional component and the system framework of the gateway device, so that gateway devices of different system frameworks can store functional components through the server.

[0072] Next, an Internet of Things system is introduced.

[0073] For example, Figure 2 According to some embodiments of the present application, an Internet of Things system is shown.

[0074] like Figure 2As shown, the Internet of Things system 00 includes a gateway device 100, an Internet of Things device 200, a server 300 and a server 400.

[0075] For example, in some embodiments of the present application, the IoT device 200 may access the corresponding server 300 through the gateway device 100 .

[0076] The IoT device 200 may be a device with a sensor detection function, for example, a device supporting a temperature detection sensor. The IoT device 200 may also support certain control functions, such as restarting, firmware upgrade, etc.

[0077] The gateway device 100 can connect to multiple IoT devices 200 in the same area. For example, the gateway device 100 and the IoT device 200 are in the same building, the same family, the same street, etc. The gateway device 100 can receive data reported by the IoT device 200 (such as temperature data reported by a temperature sensor, or a work log, etc.), or issue a control command to the IoT device 200 (such as controlling the motor to start, or controlling the switch to open or disconnect, etc.). The gateway device 100 is connected to the server 300 at the same time, reports the data reported by the IoT device 200 to the server 300 (it can also be other devices, such as terminal devices, etc., which are not limited here), and also receives the control command issued by the server 300 to the IoT device 200, and sends the control instruction to the corresponding IoT device 200 for execution.

[0078] The server 300 can be connected to the IoT device 200 or the gateway device 100, support the IoT device 200 / gateway device 100 to report data, and provide the data for users to view.

[0079] The server 400 can be connected to the gateway device 100, and the functional components of each gateway device 100 are stored in the server 400. When the gateway device 100 needs to call a functional component, it can download the corresponding functional component from the server 400 to implement the corresponding function.

[0080] The way in which the IoT device 200 is connected to the gateway device 100 may be a near field communication technology, such as wireless fidelity (Wi-Fi), bluetooth low energy (BLE), ZigBee, etc., or a wired connection, such as power line communication (PLC), etc. The embodiment of the present application does not limit the connection method between the IoT device 200 and the gateway device 100.

[0081] Exemplarily, in some embodiments of the present application, a variety of IoT devices 200 can be connected to the gateway device 100 through different protocols. For example, the IoT device 200 may include a camera 210 and a speaker 220. Among them, the camera 210 is connected to the gateway device 100 via Wi-Fi, and the speaker 220 is connected to the gateway device 100 via BLE. Therefore, the gateway device 100 needs to configure functional components of different connection protocols to achieve the function of connecting with IoT devices 200 of different connection protocols. These functional components can be stored in the server 400, and when the gateway device 100 needs to call the corresponding components, they can be downloaded from the server 400.

[0082] The connection between the gateway device 100 and the server 300 and the server 400 may include a wired or wireless communication link or an optical fiber cable, etc. The network between the gateway device 100 and the server 300 and the server 400 may be a local area network (LAN), a wide area network (WAN) or a mobile network, etc. Exemplarily, the gateway device 100 can also connect to different servers 300 based on the Internet of Things device 200. For example, the camera 210 can be connected to the first server 310 based on the gateway device 100, and the speaker 220 can be connected to the second server 320 based on the gateway device 100.

[0083] In some embodiments, the user can access the server 300 through the electronic device 500, for example, through a mobile application (Mobile APP) or a web portal. At this time, the user can view the gateway device 100 connected to the server 300 through the electronic device 500, and can also view the data reported by the Internet of Things device 200, and can also issue control commands to the Internet of Things device 200 through the gateway device 100. Therefore, the server 400 can also be configured with functional components for the gateway device 100 to communicate and control with the electronic device 500. After the gateway device 100 downloads the corresponding functional components, the functions of remote control and operation can be realized.

[0084] Next, the interaction process between the gateway device 100 and the server 400 when acquiring functional components in the embodiment of the present application is introduced.

[0085] For example, in some embodiments of the present application, the gateway device is a device that realizes connection and control between two different networks, such as a router, a switch, a smart home gateway, a medical gateway, a vehicle gateway, a whole-house smart host, etc. Some embodiments of the present application do not limit the specific form of the gateway device.

[0086] For example, Figure 3According to some embodiments of the present application, a flow chart of interaction between a gateway device 100 and a server 400 is shown.

[0087] like Figure 3 As shown, the process includes:

[0088] S101 , the gateway device 100 detects a request to call a target functional component.

[0089] Exemplarily, in some embodiments of the present application, the main component of the gateway device 100 needs to load the corresponding extension component to implement the corresponding function. The gateway device 100 can receive a request to call the target functional component (as the called extension component) sent from other electronic devices or servers. In some embodiments, the request to call the target functional component includes the component identification of the target functional component. The gateway device 100 can download the corresponding functional component based on the component identification. For example, the gateway device 100 can monitor near-field broadcasting and receive a message calling the gateway component, which carries the component identification of the gateway component. The gateway device 100 can download the component data of the gateway component based on the component identification of the gateway component.

[0090] In other embodiments, when the gateway device 100 executes certain functions, it may also generate a request to call the corresponding functional component according to the operation logic of the part of the function, and the request includes the component identification of the corresponding functional component. For example, when the gateway device 100 is upgrading the system, it may generate a request to call the system upgrade component, and the request includes the component identification of the system upgrade component. The gateway device 100 may download the system upgrade component based on the component identification of the system upgrade component to perform the system upgrade.

[0091] In other embodiments, when the server 300 controls the IoT device 200 connected to the gateway device 100 through the gateway device 100, an instruction for controlling the IoT device 200 may be sent to the gateway device 100, and the instruction may include, for example, a request for calling a control component, and the request includes a component identifier of the control component. After detecting the request for calling a control component, the gateway device 100 may download the control component based on the component identifier of the control component.

[0092] S102 : The gateway device 100 downloads component data of the target functional component from the server 400 based on the component identifier of the target functional component.

[0093] Exemplarily, in some embodiments of the present application, after the gateway device 100 detects a message calling a target functional component, it can send a component identifier of the target functional component to the server 400, and then download component data of the target functional component from the server 400 based on the component identifier of the target functional component.

[0094] In some embodiments, the gateway device 100 may send a component identification of the target functional component to the server 400. The server 400 returns a download address of the component data of the target functional component to the gateway device 100 according to the component identification. The gateway device 100 downloads the component data of the target functional component from the server 400 based on the download address.

[0095] In some embodiments, the server 400 also stores a configuration file of an extension component corresponding to the gateway device 100, and the configuration file includes a calling interface for calling the extension component. After the gateway device 100 downloads the component data of the target functional component, it can also download the configuration file of the corresponding target functional component from the server 400 according to the component identifier of the target functional component.

[0096] In some embodiments, the server 400 also stores extension components corresponding to the system frameworks of different gateway devices 100. When downloading the target functional component, the gateway device 100 also needs to send the system framework of the gateway device 100 to the server 400, and then, based on the system framework of the gateway device 100 and the component identifier of the target functional component, the component data of the target functional component corresponding to the system framework of the gateway device 100 is downloaded from the server 400.

[0097] S103 , the gateway device 100 initializes the target functional component based on the component data of the target functional component, and runs the target functional component.

[0098] Exemplarily, in some embodiments of the present application, after the gateway component 100 downloads the component data of the target functional component and the configuration file of the target functional component, the target functional component can be initialized according to the calling interface in the configuration file. The configuration file also includes a logic processing interface. After the gateway device 100 initializes the target functional component, it can run the target functional component through the logic processing interface to implement the corresponding function.

[0099] S104: the gateway device 100 detects that the call to the target functional component is completed, and uninstalls the component data of the target functional component.

[0100] Exemplarily, in some embodiments of the present application, the configuration file corresponding to the target functional component also includes a deinitialization interface. After running the target functional component, the gateway device 100 can uninstall the component data of the target functional component according to the deinitialization interface, thereby clearing the memory space occupied by the target functional component.

[0101] In summary, the gateway device 100 does not need to store component data of the extended component, thereby saving storage space of the memory of the gateway device 100. When loading the target functional component, the gateway device 100 can download the component data of the target functional component from the server 400 according to the component identifier of the target functional component. When the gateway device 100 initializes the target functional component, it only needs to load the target functional component into the memory, so that all extended components do not need to be loaded into the memory, thereby saving memory resources.

[0102] The following describes the compilation and operation process of the main component and the extended component of the gateway device 100 in the embodiment of the present application. Figure 4 According to some embodiments of the present application, a schematic diagram of the compilation and operation process of a main component and an extension component of a gateway device is shown.

[0103] like Figure 4 As shown, the process includes a development phase and an operation phase.

[0104] in, Figure 4 The source code in is the source code of the main component and the extended component (corresponding to each functional component) of the gateway device 100. The server 400 is used to store the component data and configuration files of each extended component. After the developer has compiled the main component, the extended component and the configuration file, the component data and configuration file of the extended component can be uploaded to the server 400 to configure the main component into the gateway device 100.

[0105] The development phase includes:

[0106] 01. The developer compiles the source code.

[0107] Exemplarily, in some embodiments, a developer compiles source code corresponding to the gateway device 100 .

[0108] The compilation process may be, for example, that the developer compiles the main component and the extension component, and when compiling the extension component, the source code of each extension component is stored in a separate directory or file to ensure that they are not mutually dependent. For each extension component, it is compiled into an independent library file through appropriate compilation tools and options.

[0109] In some embodiments, the developer may also compile corresponding extension components for different system architectures of the gateway device 100 to generate corresponding library files.

[0110] For example, during the compilation process, the developer may also compile the file name of the library file corresponding to the extension component and the external interface information of the extension component into the configuration file of the extension component so that the main component can call the extension component through the corresponding interface.

[0111] For example, in some embodiments of the present application, the configuration file can adopt the JSON (javascript object notation) format (a data exchange format), and each extension component corresponds to a JSON object, including fields such as library name, initialization function name, deinitialization function name, logic processing function name, component identification (identity document, ID), etc.

[0112] For example, the following is a configuration file in JSON format:

[0113]

[0114] In the above configuration file, each JSON element represents an extension component and contains the following fields:

[0115] "libraryName": The library name of the extension component, that is, the compiled library file name.

[0116] "initFunction": the initialization function name of the extension component (as the initialization interface). The main component will call this function for initialization when loading the extension component.

[0117] "deinitFunction": the deinitialization function name of the extension component (as the deinitialization interface). The main component will call this function to clean up the component data of the extension component when the extension component is no longer needed.

[0118] "logicFunction": the name of the extended component's logic processing function (as a logic processing interface). The main component will call this function to perform specific logic processing as required.

[0119] "componentID": A unique identifier for the extension component, used to identify the extension component when it is transferred and recognized.

[0120] It is understandable that in other embodiments, the configuration file may also adopt other types of data formats, such as extensible markup language (XML), etc. The embodiment of the present application does not limit the format of the data type of the configuration file.

[0121] 02. The developer uploads the component data and configuration file of the extension component to the server 400.

[0122] 03. The server 400 returns a message indicating successful upload to the developer.

[0123] After the developer completes the above compilation, the source code of the main component can be configured into the gateway device 100. When the gateway device 100 implements the function of the extension component, the main component can be used to call the extension component to run, thereby implementing the function of the extension component.

[0124] It should be understood that the developer deploys the extension component library files compiled according to different system architectures to the server 400. Ensure that the component data corresponding to the library extension components are available for download and access in the cloud.

[0125] In some embodiments, the gateway device 100 can receive messages for calling extension components sent by other electronic devices 500. For example, after some electronic devices 500 are bound to the gateway device 100, they can control the Internet of Things devices 200 connected to the gateway device 100 through the gateway device 100. When the electronic device 500 implements certain functions through the gateway device 100, it can generate a request for calling the corresponding functional component according to the operating logic of the part of the function, and the request includes the component identification of the corresponding extension component. After the electronic device 500 sends the request for calling the extension component to the gateway device 100, the gateway device 100 downloads the component data of the corresponding extension component from the server 400 through the component identification of the extension component, thereby implementing the corresponding function. The following introduces the process of the main component loading the extension component to run.

[0126] 04. The electronic device 500 adds the component identification of the extended component to the main component of the gateway device 100.

[0127] Exemplarily, in some embodiments of the present application, the electronic device 500 may add a component identifier of an extended component to a main component of the gateway device 100. For example, when the electronic device 500 binds a new IoT device 200 to the gateway device 100, the new IoT device 200 needs to be registered through a registration component so that the new IoT device 200 is authorized to communicate with the gateway device 100. The electronic device 500 may send the component identifier of the registration component to the gateway device 100 so that the gateway device 100 can call the registration component.

[0128] 05, the main component returns a confirmation character to the electronic device 500.

[0129] For example, in some embodiments of the present application, after receiving the component identification of the extension component, the main component may return a confirmation character to the electronic device 500 .

[0130] 06. The main component requests the download address of the extension component from the server 400 based on the component identifier of the extension component.

[0131] For example, in some embodiments of the present application, the developer stores the extension component corresponding to the main component in the server 400. When the main component calls the extension component, it can obtain the component data of the extension component from the server 400 according to the component identifier of the extension component.

[0132] For example, the main component may send the component identifier of the registration component to the server 400 , and then obtain the download address of the registration component from the server 400 .

[0133] In other embodiments, the main component may also send the system framework and component identification of the corresponding gateway device 100 to the group server 400 , so as to obtain the download address of the extension component of the system framework of the corresponding gateway device 100 from the server 400 .

[0134] For example, after the main component is started, according to the message message sent by the electronic device 500, or the extended component identifier carried in the scan broadcast message, combined with the central processing unit (CPU) architecture of the main component, an HTTP request is sent to the server 400. Among them, the HTTP request is a request method sent by the client to the server, which uses the HTTP protocol for communication. The HTTP request consists of a request line and a request header. For example, an HTTP request is introduced below.

[0135]

[0136]

[0137] In this embodiment, the HTTP request uses the POST method and sends the key information as a JSON payload. The POST request is used to submit data to a specified resource for processing the request. It is usually used to submit a form or upload a file, and the data is included in the request body. In other implementations, the HTTP request may also include other methods, such as GET, PUT, DELETE, etc.

[0138] In the above HTTP request, the request uniform resource identifier (URI) is / extensions, and the HTTP protocol version is 1.1. The request header contains a Host header, whose value is cloud.example.com. The payload contains the following fields:

[0139] "extensionID": the identifier of the extension component, used to specify the required extension component. For example, in some embodiments of the present application, the identifier of the specified extension component is "extension1".

[0140] "cpuArchitecture": CPU architecture information of the device on which the main component runs, used to determine the applicable extension component. For example, in some embodiments of the present application, the CPU architecture of the gateway device 100 is "x86_64".

[0141] In other embodiments, the request sent by the main component to the server 400 may include other formats, such as file transfer protocol (FTP), etc. The embodiment of the present application does not limit the format of the request sent by the main component to the server 400.

[0142] 07. The server 400 returns the download address of the extension component to the main component.

[0143] For example, in some embodiments of the present application, after receiving a request from the main component to obtain a download address of the extension component, the server 400 may respond to the main component.

[0144] For example, the HTTP response for server 400 is as follows:

[0145]

[0146] As you can understand, the HTTP response payload also uses the JSON format. The payload contains the following fields:

[0147] "downloadURL": The download URL of the component, which is used to instruct the main component to download the required extension component from this URL. That is, the main component can download the component data of the extension component from https: / / cloud.example.com / extensions / extension1 / download.

[0148] 08. The main component downloads the component data of the extension component from the server 400 based on the download address of the extension component.

[0149] Illustratively, in some embodiments of the present application, after the main component obtains the download address of the extension component, the component data of the extension component can be downloaded based on the download address.

[0150] 09. The server 400 returns a message to the main component indicating that the component data of the extension component has been downloaded successfully.

[0151] Exemplarily, after the main component has downloaded the component data of the extended component, the server 400 may return a message to the main component indicating that the component data of the extended component has been downloaded successfully.

[0152] 010, the main component downloads the configuration file of the corresponding extension component from the server 400.

[0153] Exemplarily, after the main component downloads the component data of the extension component, it can download the configuration file of the corresponding extension component from the server 400. The configuration file can be in the above-mentioned JSON format, for example.

[0154] 011. The server 400 returns a message to the main component indicating that the configuration file has been downloaded successfully.

[0155] Exemplarily, after the main component has downloaded the configuration file, the server 400 returns a message to the main component indicating that the configuration file has been downloaded successfully.

[0156] 012, the main component loads the extension component.

[0157] Exemplarily, after the main component has downloaded the component data and configuration files of the extension component, the extension component may be loaded.

[0158] It is understandable that in some embodiments of the present application, when the main component loads the extension component, it only needs to load the extension component to be called into the memory. Therefore, the memory space occupied by the extension component is small, reducing the memory burden of the gateway device 100.

[0159] 013, the main component determines the calling interface of the extension component according to the configuration file.

[0160] Exemplarily, after the main component loads the extension component into the memory, the calling interface of the extension component can be determined through the configuration file of the extension component, thereby initializing the extension component and running the extension component.

[0161] For example, Figure 5 According to some embodiments of the present application, a schematic diagram of a calling interface of a main component calling an extension component is shown.

[0162] like Figure 5 As shown, the extension component defines three interfaces: initialization interface, deinitialization interface, and business processing interface.

[0163] For example, after the main component loads the extension component, the extension component initialization interface is called. In addition to the necessary resource application, the extension component initialization interface will also register the business processing interface to the business processing function list in the main component through the registration function provided by the main component. The main component has a thread to execute the business processing functions registered by each extension component.

[0164] After the main component initializes the extension component, the extension component can be run through the business processing interface to execute the corresponding function of the extension component.

[0165] 014, the main component uninstalls the extension component.

[0166] Illustratively, in some embodiments of the present application, after the main component has finished running the extension component, the extension component can be uninstalled, thereby cleaning up the component data of the extension component and reducing the storage space of the gateway device occupied by the extension component.

[0167] For example, Figure 5 As shown, the main component can call the deinitialization interface of the extension component to uninstall the component data of the extension component.

[0168] It is understood that in some embodiments of the present application, the component data of the extension component corresponding to the gateway device 100 is stored in the server 400. Therefore, the gateway device 100 does not need to allocate more storage space to store the component data corresponding to the extension component. In addition, when loading the extension component, the main component of the gateway device 100 only needs to load the corresponding extension component that has been downloaded into the memory, and does not need to load all the extension components into the memory, thereby saving the memory space occupied by the extension component. After the main component runs the extension component, the extension component can also be uninstalled through the deinitialization interface, thereby clearing the storage space of the gateway device 100.

[0169] Next, the process of registering the gateway device 100 to the server 300 is described.

[0170] It is understood that the server 300 can be connected to the IoT device 200 to store the data and registration status of the IoT device 200, and the server 300 can control the IoT device 200 through the gateway device 100. However, the gateway device 100 needs to be registered on the server 300, and the server 300 can control the gateway device 100 and control the IoT device 200 connected to the gateway device 100 through the gateway device 100. In some embodiments, the gateway device 100 can be registered with the server 300 through the gateway component, so that the gateway device 100 can use the gateway component agent to register the IoT device 200 connected to the gateway device 100.

[0171] Since the extension component of the gateway device 100 is stored on the server 400, the gateway device 100 can download the component data of the gateway component from the server 400 based on the component identification of the gateway component, thereby using the gateway capability. Next, the process of adding the extension component to the gateway device 100 is first introduced.

[0172] For example, Figure 6 According to some embodiments of the present application, an interaction flow chart of registering a gateway device 100 with a server 300 is shown.

[0173] The server 400 is used to store the expansion components corresponding to the gateway device 100 .

[0174] The electronic device 500 can be connected to the gateway device 100, so as to control, register or obtain data of the IoT device 200 connected to the gateway device 100. In some embodiments of the present application, the electronic device 500 can be a mobile phone, a tablet, a wearable device, a desktop computer, an augmented reality (AR) / virtual reality (VR) device, a personal digital assistant (PDA), etc. The embodiments of the present application do not limit the electronic device.

[0175] The component management module is used to manage the extended components in the gateway device 100. For example, it manages the loading and unloading of extended components.

[0176] like Figure 6 As shown, the process includes:

[0177] S201, the main component of the gateway device 100 is connected to the Internet.

[0178] Exemplarily, after the gateway device 100 is started, it can connect to the Internet to communicate with other devices. For example, the gateway device 100 can communicate with the electronic device 500 through the Internet, thereby receiving an instruction for the electronic device 500 to register the gateway device 200.

[0179] S202 , the electronic device 500 sends a near field discovery broadcast to the main component of the gateway device 100 .

[0180] Exemplarily, in some embodiments of the present application, the electronic device 500 may send a near field discovery broadcast to the main component of the gateway device 100 to discover the gateway device 100, thereby establishing a switched virtual circuit (SVC) with the gateway device 100. The electronic device 500 may send a signal to the gateway device 100 via the SVC to control the gateway device 100. For example, the signal sent by the electronic device 500 to the gateway device 100 via the SVC is a signal for adding an expansion component, or sending a device registration instruction, etc.

[0181] S203 , the main component of the gateway device 100 sends a response (carrying the device type) to the electronic device 500 .

[0182] Illustratively, in some embodiments of the present application, after the main component of the gateway device 100 establishes a connection with the electronic device 500 , it may respond to the electronic device 500 , and the response may carry the device type of the gateway device 100 .

[0183] Exemplarily, in some embodiments of the present application, the device type of the gateway device 100 may be, for example, a system framework, a CPU framework, etc. of the gateway device 100 .

[0184] In some embodiments, the gateway device 100 may send the capabilities it supports to the electronic device 500 during the device discovery phase, and the electronic device 500 may add corresponding extension components to the gateway device 100 according to the capabilities supported by the gateway device 100. For example, in some embodiments of the present application, the gateway device 100 also supports gateway capabilities, and the electronic device 500 determines that the gateway device 100 supports gateway capabilities during the device discovery phase of the gateway device 100. Afterwards, the electronic device 500 may add a gateway component to the gateway device 100.

[0185] S204, the electronic device 500 queries the server 400 for the extension components supported by the gateway device 100 according to the device type.

[0186] For example, in some embodiments of the present application, after the electronic device 500 receives the device type carried in the response of the gateway device 100 , it can query the server 400 for the extension component corresponding to the device type.

[0187] It is understandable that the server 400 may store component data corresponding to a variety of extension components, and different types of gateway devices 100 may call different extension components. Therefore, after the electronic device 500 establishes a connection with the gateway device 100, the electronic device 500 may query the server 400 for the extension components supported by the corresponding gateway device 100 based on the device type of the gateway device 100.

[0188] For example, in some embodiments of the present application, the gateway device 100 supports gateway capabilities, and the electronic device 500 can query the server 400 for the component identification of the gateway component corresponding to the gateway device 100 .

[0189] S205 , the server 400 sends the component identifier of the extended component supported by the gateway device 100 to the electronic device 500 .

[0190] Exemplarily, after confirming the component identification of the extension component supported by the gateway device 100 according to the device type of the gateway device 100 , the server 400 returns the identification of the extension component supported by the gateway device 100 to the electronic device 500 .

[0191] For example, the server 400 may return the component identification of the gateway component corresponding to the gateway device 100 to the electronic device 500, so that the electronic device 500 sends the corresponding component identification to the gateway device 100, allowing the gateway device 100 to add the extended component.

[0192] S206 , the electronic device 500 sends the component identification of the extended component to be added to the main component of the gateway device 100 .

[0193] Illustratively, in some embodiments of the present application, after the electronic device 500 determines the component identification of the extended component supported by the gateway device 100 , it sends the component identification of the extended component to be added to the main component of the gateway device 100 .

[0194] For example, the electronic device 500 may send the component identification of the gateway component to the gateway device 100, so that the gateway device 100 can add the gateway component.

[0195] S207 , the main component of the gateway device 100 returns a confirmation character to the electronic device 500 .

[0196] Illustratively, in some embodiments of the present application, after receiving the component identification of the extension component, the main component of the gateway device 100 returns a confirmation character to the electronic device 500 .

[0197] S208 , the main component of the gateway device 100 queries the component management module of the gateway device 100 based on the component identifier whether the corresponding extended component has been configured.

[0198] Exemplarily, the component management module of the gateway device 100 is used to manage the extended components of the gateway device 100. Therefore, after the main component of the gateway device 100 receives a message to add an extended component, it can query the component management module based on the component identifier of the extended component whether the extended component with the corresponding component identifier has been configured in the gateway device 100.

[0199] For example, the gateway device 100 may query the component management module whether the gateway component has been configured in the gateway device 100 .

[0200] If the judgment result is yes, the gateway device 100 does not need to download the component data of the extended component.

[0201] If the judgment result is no, S109 is executed, and the main component of the gateway device 100 requests the server 400 for the download address of the extension component.

[0202] It is understandable that if the gateway device 100 has been configured with an extension component corresponding to the component identifier, the gateway device 100 can directly call the corresponding extension component without downloading the corresponding extension component from the server 400 .

[0203] S209, the main component of the gateway device 100 requests the server 400 for the download address of the extension component.

[0204] S210 , the server 400 returns the download address of the extension component to the main component of the gateway device 100 .

[0205] S211, the main component of the gateway device 100 downloads component data from the server 400 based on the download address of the extension component.

[0206] S212, the server 400 returns a message to the main component of the gateway device 100 indicating that the download of the extension component is successful.

[0207] S213, the main component of the gateway device 100 downloads the configuration file corresponding to the extension component from the server 400.

[0208] S214, the server 400 returns a message to the main component of the gateway device 100 indicating that the configuration file has been downloaded successfully.

[0209] For example, the above-mentioned S109-S114 process can refer to Figure 4 The 06-011 process in the embodiment will not be described in detail here.

[0210] S215 , the main component of the gateway device 100 adds an extended component to the component management module of the gateway device 100 .

[0211] Exemplarily, in some embodiments of the present application, after the main component of the gateway device 100 downloads the component data and configuration file of the extension component, the extension component can be added to the component management module, and the component management module controls the loading and unloading of the extension component.

[0212] For example, the gateway device 100 may add the downloaded component data of the gateway component to the component management module, and the component management module manages the gateway component, for example, loading the gateway component and uninstalling the gateway component.

[0213] S216 , the component management module of the gateway device 100 returns a message indicating that the addition is completed to the main component of the gateway device 100 .

[0214] Exemplarily, after the component management module has added the extended component, it returns a message to the main component indicating that the addition of the extended component is complete.

[0215] It can be understood that, through the above process, the gateway device 100 can send the capabilities it supports to the electronic device 500 in the discovery phase, and the electronic device 500 queries the server 400 for the component identifier of the extension component corresponding to the gateway device 100, and adds the corresponding extension component to the gateway device 100. When the gateway device 100 is registered on the server 300, it can be registered on the server 300 with a corresponding role according to its own function.

[0216] For example, if the gateway device 100 supports gateway capabilities, the gateway device 100 can be registered on the server 300 as an agent + controlled role. In some embodiments of the present application, the gateway capability represents the ability to communicate with different devices, for example, to establish a communication connection with the IoT device 200, receive control instructions from the server 300, communicate with the server 300, and be able to register and manage the IoT device 200 on behalf of the server 300. Among them, the server 300 pair can correspond to the server 300, and the server 300 is used to store the data and registration status of the IoT device 200. The server 300 can manage the registered IoT devices 200 or gateway devices 100, and register new IoT devices 200 or gateway devices 100.

[0217] The proxy role indicates that the gateway device 100 can register the IoT device 200 connected to the gateway device 100 to the corresponding server 300. The controlled role indicates that the gateway device 100 can receive control instructions from the server 300, but cannot register the IoT device 200 to the server 300 on its behalf.

[0218] Next, the process of registering the gateway device 100 with the server 300 in the embodiment of the present application will be described.

[0219] S217 , the electronic device 500 sends a device registration instruction to the main component of the gateway device 100 .

[0220] For example, in some embodiments of the present application, when a user registers the gateway device 100 with the server 300 via the electronic device 500 , a device registration instruction may be sent to the main component of the gateway device 100 .

[0221] It is understood that in some embodiments of the present application, the registration instruction may include, for example, a component identifier of the registration component. When the gateway device 100 registers with the server 300, Figure 4 The process in the embodiment downloads the registration component and then registers with the server 300 based on the registration component.

[0222] S218 , the main component of the gateway device 100 returns a confirmation character to the electronic device 500 .

[0223] Exemplarily, after receiving the device registration instruction, the main component of the gateway device 100 returns a confirmation character to the electronic device 500 .

[0224] S219, the main component of the gateway device 100 determines whether the gateway component exists.

[0225] Exemplarily, after receiving the device registration instruction, the main component of the gateway device 100 needs to load the registration component to perform the device registration function. When the gateway device 100 is registered, the capabilities supported by the gateway device 100 can also be sent to the server 300, thereby determining the role of the gateway device 100 registered on the server 300. For example, the main component of the gateway device 100 can determine whether a gateway component already exists in the gateway device 100 through the component management module, thereby determining whether the gateway device 100 has gateway capabilities.

[0226] If the judgment result is yes, S220 is executed, and the main component of the gateway device 100 enables the gateway capability.

[0227] If the result of the judgment is no, then S223 is executed, and the main component of the gateway device 100 turns off the gateway capability.

[0228] S220 , the main component of the gateway device 100 enables the gateway capability.

[0229] Exemplarily, if there is a gateway component in the gateway device 100 (for example, the gateway device 100 adds a gateway component through the above process), the gateway device 100 may enable the gateway capability.

[0230] The gateway device 100 enabling the gateway capability indicates that the gateway capability of the gateway device 100 is in an activated state, and the gateway device 100 can use the gateway capability to communicate with the server 300, thereby receiving control instructions from the server 300, and registering new IoT devices 200 to the server 300, etc.

[0231] S221, the main component of the gateway device 100 registers the device with the server 300 (registration role: agent + controlled).

[0232] For example, in some embodiments of the present application, the gateway device 100 can download the registration component from the server 400 through the above process, and call the registration component to register with the server 300. After the gateway device 100 is registered on the server 300, the server 300 can control the gateway device 100 to realize the controlled function of the gateway device 100.

[0233] If the gateway device 100 has a gateway component, the gateway device 100 can also implement a proxy function through the gateway component after registering with the server 300. For example, the gateway component of the gateway device 100 can communicate with the server 300 and register a new IoT device 200 as a proxy. When the IoT device 200 accesses the gateway device 100, the gateway component can identify the identity, type and related information of the IoT device 200 and send this information to the server 300 for registration. In this way, the server 300 can manage and control the device.

[0234] Similarly, the server 300 can also remotely control and manage the IoT device 200 through the gateway device 100, including device configuration, status monitoring, remote operation, etc. For example, the main component of the gateway device 200 can receive control instructions from the server 300 through the gateway component, and then forward them to the IoT device 200 for execution, thereby realizing the controlled function of the IoT device 200.

[0235] S222 , the server 300 returns the registration result to the main component of the gateway device 100 .

[0236] Exemplarily, after the main component of the gateway device 100 completes the registration of the IoT device 200 through the gateway component, the server 300 may return the registration result to the main component of the gateway device 100. The registration result is, for example, a message returned when the gateway device 100 successfully or fails to register on the server 300.

[0237] S223, the main component of the gateway device 100 turns off the gateway capability.

[0238] Exemplarily, when the main component of the gateway device 100 is not configured with a gateway component, for example, the gateway device 100 does not support the gateway component, the main component of the gateway device 100 may turn off the gateway capability. In other words, the main component of the gateway device 100 cannot use the gateway capability.

[0239] When the gateway device 100 cannot use the gateway capability, the gateway device 100 can receive control instructions from the server 300. However, the gateway device 100 cannot send the registration information of the IoT device 200 to the server 300, and cannot complete the registration of the IoT device 200 on behalf of the IoT device 200.

[0240] S224, the main component of the gateway device 100 registers the device with the server 300 (registration role: controlled).

[0241] Exemplarily, in some embodiments of the present application, the gateway device 100 can download the registration component from the server 400 through the above process, and call the registration component to register with the server 300. Since the gateway device 100 does not have a gateway component (does not support gateway capabilities), the gateway device 100 can only act as a controlled role after registering with the server 300. In other words, the gateway device 100 can only receive control instructions sent by the server 300 and then execute them. It is not possible to register the Internet of Things device 200 that accesses the gateway device 100 on behalf of it.

[0242] S225 , the server 300 returns the registration result to the main component of the gateway device 100 .

[0243] Exemplarily, after the gateway device 100 is registered, the server 300 returns a registration result to the gateway device 100. The registration result is, for example, a message returned when the gateway device 100 is successfully registered on the server 300, or when the registration fails.

[0244] It can be understood that the above process introduces the process of the gateway device 100 registering with the server 300. In the discovery phase of the gateway device 100, the gateway device 100 can send the capabilities it supports (such as gateway capabilities) to the electronic device 500, and the electronic device 500 can obtain the component identification of the extension component (such as the gateway component) of the corresponding capability from the server 400, thereby adding the corresponding extension component to the gateway device 100. When the gateway device 100 is registered on the server 300, the role of the gateway device 100 registered on the server 300 can be determined based on the functions supported by the gateway device 100 (for example, if the gateway device 100 supports gateway capabilities, it can be registered on the server 300 as an agent).

[0245] Furthermore, an embodiment of the present application also provides a gateway device 100 for implementing the detection methods provided in the aforementioned embodiments.

[0246] For example, Figure 7 According to some embodiments of the present application, a schematic diagram of the structure of a gateway device 100 is shown.

[0247] like Figure 7 As shown, the gateway device 100 includes a processor 110 , a memory 120 , a communication interface 130 , and a bus 140 .

[0248] The processor 110 may include one or more processing units, for example, the processor 110 may include a central processing unit (CPU), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a microcontroller unit (MCU), a video codec, a digital signal processor (DSP), a baseband processor, a neural-network processing unit (NPU), a field programmable gate array (FPGA), etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors 110.

[0249] In some embodiments, the processor 110 may be configured to execute one or more programs to implement the communication methods provided in the aforementioned embodiments.

[0250] For example, the processor 110 may be configured to execute instructions for downloading component data of the extended component from the server 400 based on the component identification based on the extended component in the gateway device 100 , and running the main component and the extended component.

[0251] The memory 120 may include one or more memories for storing data or program codes. For example, in some embodiments, the memory 120 may be used to store data, such as component data of the extension component downloaded in various embodiments of the present application. For another example, in some embodiments, the memory 120 may be used to store instructions corresponding to the communication methods provided in the aforementioned embodiments.

[0252] In some embodiments, the memory 120 may include a hard disk drive, a solid state drive, a flash memory, an optical disk, or a magneto-optical disk.

[0253] In some embodiments, memory 120 may include removable or non-removable or fixed media.

[0254] In some embodiments, the memory 120 may be internal or external to the gateway device 100 .

[0255] The communication interface 130 is used to implement communication between the gateway device 100 and other devices (eg, the electronic device 500, the server 300, the server 400, or the IoT device 200, etc.) In some embodiments, the communication interface 130 may include a wireless communication interface and a wired communication interface.

[0256] In some embodiments, the wireless communication interface can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (blue tooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), etc. applied to the gateway device 100. The wireless communication module can be one or more devices integrating at least one communication processing module.

[0257] The wired communication interface may include an Ethernet interface (such as a fiber optic interface, an RJ-45 interface, etc.), a universal serial bus (USB), a power line carrier communication (PLC) interface, a high definition multimedia interface (HDMI) interface, a digital audio interface, and other wired communication interfaces, which are used to provide a wired communication solution applied to the gateway device 100.

[0258] The bus 140 is used to connect the processor 110 , the memory 120 , the communication interface 130 , and other possible modules or circuits.

[0259] It should be understood that Figure 7 The structure of the gateway device 100 is only an example. In other embodiments, the gateway device 100 may include more or fewer modules, which is not limited here.

[0260] An embodiment of the present application also provides a program product, which, when executed on an electronic device, can enable the electronic device to implement the communication methods provided in the aforementioned embodiments.

[0261] An embodiment of the present application further provides a readable storage medium, in which one or more programs are stored. When the one or more programs are executed by an electronic device, the electronic device implements the communication methods provided by the aforementioned embodiments.

[0262] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0263] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.

[0264] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0265] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable media. Therefore, the machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy disks, optical disks, optical discs, compact disc-read only memory (CD-ROMs), magneto-optical disks, read-only memory (ROM), random-access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or tangible machine-readable storage for transmitting information using the Internet in electrical, optical, acoustic or other forms of propagation signals (e.g., carrier waves, infrared signals, digital signals, etc.). Therefore, the machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0266] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0267] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0268] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0269] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims

1. A communication method, applied to a first electronic device, characterized in that: include: detecting a request to invoke a first functional component; Acquire component data of the first functional component from a second electronic device; Initialize the first functional component based on the component data of the first functional component, and call the first functional component to execute a first function corresponding to the first functional component.

2. The method according to claim 1, characterized in that The method further comprises: After the call to the first functional component is completed, the component data of the first functional component is deleted.

3. The method according to claim 1, characterized in that The detecting a request to call the first functional component comprises: receiving a message sent by a third electronic device to call the first functional component; or A call request for the first function is detected.

4. The method according to claim 1, characterized in that: The component data of the first functional component includes instructions for performing a first function.

5. The method according to claim 1, characterized in that The first functional component includes any one of the following: a gateway component, a registration component, a control component, and a system upgrade component.

6. The method according to claim 1, characterized in that The first electronic device is a gateway device.

7. The method according to claim 2, characterized in that The request to call the first functional component includes a component identifier of the first functional component; and The acquiring component data of the first functional component from the second electronic device includes: Based on the component identification, component data of the first functional component is acquired from the second electronic device.

8. The method according to claim 7, characterized in that Initializing the first functional component based on the component data of the first functional component, and calling the first functional component to execute the first function corresponding to the first functional component includes: Acquire a configuration file corresponding to the first functional component from the second electronic device, wherein the configuration file includes an initialization interface of the first functional component and a logic processing interface of the first functional component; Initializing the first functional component based on the initialization interface of the first functional component; And based on the logic processing interface of the first functional component, the first function corresponding to the first functional component is executed.

9. The method according to claim 8, characterized in that The configuration file also includes a deinitialization interface of the first functional component; After the calling of the first functional component is completed, deleting the component data of the first functional component includes: The deinitialization interface in the configuration file is called to delete the component data of the first functional component.

10. The method according to claim 7, characterized in that The acquiring the component data of the first functional component from the second electronic device further includes: Based on the device type of the first electronic device and the component identification of the first functional component, component data corresponding to the first functional component of the first electronic device is acquired from the second electronic device.

11. An electronic device, characterized in that: include: A memory for storing instructions; At least one processor is used to execute the instructions so that the electronic device implements the method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 10.

13. A computer program product, characterized in that When the computer program product is executed on a device, the device is caused to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Management method of gateway software version and home gateway

    CN101616430A

  • Function component installation method, terminal and server thereof

    CN107645521A

  • Interface calling method and device, interface docking configuration method and device, equipment and medium

    CN111459475A

  • Function configuration method, server, terminal equipment and storage medium

    CN111552460A

  • Gateway control method and device, electronic equipment and storage medium

    CN111818158A