Internet of Things gateway data synchronization method, system and device and medium
By creating a gateway theme for IoT gateways and using the MQTT protocol for version number comparison and offline storage, the configuration synchronization problem of IoT gateways in an unstable network environment is solved, improving user experience and platform efficiency.
Patent Information
- Application Number
- CN202510784144.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-02
AI Technical Summary
In the Internet of Things scenario, when the Internet of Things gateway and cloud platform network are not connected or the network environment is poor, the information such as object model, access script and user configuration cannot be synchronized in time, affecting the user experience and causing a major impact on the platform.
Create a corresponding gateway theme for each IoT gateway, update the version number of the parameter shadow on the IoT platform through the MQTT protocol, and subscribe to the theme content when the IoT gateway is online for configuration comparison, temporarily store it to the server when offline, and configure and update after it is online.
Ensure the success rate of IoT gateway configuration modification in a weak network environment, improve user experience, reduce platform computing pressure, and realize instant configuration updates.
Smart Images

Figure CN120583102A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an Internet of Things gateway data synchronization method, system, device and medium. Background Art
[0002] In IoT scenarios, the cloud-based IoT management platform needs to send information such as object models, access scripts, and user configurations to the edge-side IoT gateway. This can lead to two common problems: The IoT gateway may be offline due to network disconnection with the cloud platform, preventing the sent commands from reaching the gateway; and the IoT network environment is often poor, preventing frequent communication of large amounts of data, such as object models, access scripts, and user configurations.
[0003] The existing technology generally adopts the following two solutions: In the first solution, when editing device information of the gateway and its sub-devices, the device must be online to perform addition, deletion, and modification operations, otherwise the operation is not allowed. This solution has a poor user experience. If the gateway is broken and offline, it cannot be directly deleted on the platform, resulting in garbage data.
[0004] The second solution allows for addition, deletion, and modification operations regardless of the online status of the gateway and device. If the device is offline, the platform temporarily stores these operations until the gateway comes online, at which point the platform proactively sends them to the gateway for final completion. This solution temporarily stores operations on the platform and then sends them back online, functionally resolving the poor user experience issue. However, the platform performs the majority of logical decision-making and calculations, leading to a significant impact on the platform when batch operations are performed on offline gateway devices and the gateway comes online at the same time. Summary of the Invention
[0005] The present invention provides an Internet of Things gateway data synchronization method, system, device and medium to solve the problem that when batch operations are performed on offline gateways and devices, logical decision calculations are performed on the platform, resulting in a large impact on the platform when the gateways are online at the same time.
[0006] To solve the above technical problems, the technical solution adopted by the present invention is to provide an IoT gateway data synchronization method, comprising the following steps: a user modifies the configuration of an IoT gateway based on an IoT platform, and the IoT platform updates the content of a gateway topic corresponding to the IoT gateway based on a first protocol; if the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic; if the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform issues configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway based on the received configuration parameters.
[0007] In some embodiments, the step in which the user modifies the configuration of the IoT gateway based on the IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on the first protocol, specifically includes: after the user modifies the configuration of the IoT gateway based on the IoT platform, the IoT platform updates the parameter shadow corresponding to the IoT gateway and modifies the version number of the parameter shadow; and the IoT platform publishes the version number of the parameter shadow to the gateway topic corresponding to the IoT gateway based on the first protocol.
[0008] In some embodiments, the step of determining whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic specifically includes: the IoT gateway compares the version number of the parameter shadow in the gateway topic with the version number stored locally by the IoT gateway; if the version number of the parameter shadow in the gateway topic is consistent with the version number stored locally by the IoT gateway, the configuration of the IoT gateway does not need to be updated; if the version number of the parameter shadow in the gateway topic is inconsistent with the version number stored locally by the IoT gateway, the configuration of the IoT gateway needs to be updated.
[0009] In some embodiments, if the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic, and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic, further comprising the step of: if the IoT gateway is offline, the IoT platform temporarily stores the content of the gateway topic corresponding to the IoT gateway in the first server, and waits for the IoT gateway to come back online.
[0010] In some embodiments, the first protocol is the MQTT protocol, and the first server is an MQTT server.
[0011] The present invention also provides an Internet of Things gateway data synchronization method for an Internet of Things platform, comprising the following steps: based on a user's configuration modification of the Internet of Things gateway, updating the content of the gateway theme corresponding to the Internet of Things gateway through a first protocol; determining whether the Internet of Things gateway is online; if the Internet of Things gateway is online, waiting for the Internet of Things gateway to determine whether its configuration needs to be updated; if the configuration of the Internet of Things gateway needs to be updated, receiving a configuration update request from the Internet of Things gateway, and issuing configuration parameters to the corresponding Internet of Things gateway based on the first protocol; if the Internet of Things gateway is offline, temporarily storing the content of the gateway theme corresponding to the Internet of Things gateway in a first server.
[0012] The present invention also provides an Internet of Things gateway data synchronization method, which is used for an Internet of Things gateway and includes the following steps: based on the online status of the Internet of Things gateway, subscribing to the corresponding gateway topic, and judging whether the configuration of the Internet of Things gateway needs to be updated according to the content of the gateway topic; if the configuration of the Internet of Things gateway needs to be updated, sending a configuration update request to the Internet of Things platform; receiving the configuration parameters issued by the Internet of Things platform, and updating the configuration of the Internet of Things gateway according to the configuration parameters.
[0013] The present invention also provides an Internet of Things gateway data synchronization system, comprising: a user, used to log in to an Internet of Things platform and modify the configuration of the Internet of Things gateway through the Internet of Things platform; an Internet of Things platform, used to update the content of the gateway topic corresponding to the Internet of Things gateway through a first protocol based on the configuration modification of the Internet of Things gateway by the user; further used to determine whether the Internet of Things gateway is online; further used to receive a configuration update request from the Internet of Things gateway when the Internet of Things gateway is online, and to issue configuration parameters to the corresponding Internet of Things gateway based on the first protocol; an Internet of Things gateway, used to subscribe to the corresponding gateway topic when it is online, and to determine whether the configuration of the Internet of Things gateway needs to be updated based on the content of the gateway topic; further used to send a configuration update request to the Internet of Things platform when the configuration of the Internet of Things gateway needs to be updated; further used to receive the configuration parameters issued by the Internet of Things platform, and to update the configuration of the Internet of Things gateway based on the configuration parameters; an Internet of Things device, used to connect to the Internet of Things gateway.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0015] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0016] The beneficial effects of the present invention are as follows: the present application discloses a method, system, device and medium for synchronizing data of an IoT gateway, the method comprising the following steps: a user modifies the configuration of an IoT gateway based on an IoT platform, and the IoT platform updates the content of a gateway topic corresponding to the IoT gateway based on a first protocol; if the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic; if the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform sends configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway based on the received configuration parameters. The present application creates a corresponding gateway topic for each IoT gateway, so that when a user modifies the configuration of the IoT gateway, regardless of whether the IoT gateway is online or the network environment is good, the IoT platform can save the modified version number to the gateway topic, and obtain it in time after the IoT gateway comes online, and compare the locally stored version number to determine whether an update is required. This application not only ensures the success rate of IoT gateway configuration modifications in weak network environments, but also improves the user experience. At the same time, it places the decision-making power of whether the IoT gateway needs to be updated on its own side, greatly reducing the computing pressure of the IoT platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a method for synchronizing data of an Internet of Things gateway according to the present invention; Figure 2 This is a flow chart of a method for synchronizing data between IoT gateways in the present invention for use on an IoT platform; Figure 3 This is a flow chart of an Internet of Things gateway data synchronization method used in an Internet of Things gateway according to the present invention; Figure 4 This is a schematic diagram of the composition of an Internet of Things gateway data synchronization system of the present invention; Figure 5 This is a schematic diagram of the architecture of an electronic device according to an embodiment of the present invention; Figure 6 It is a schematic block diagram of an embodiment of a computer-readable storage medium of the present invention. DETAILED DESCRIPTION
[0018] To facilitate understanding of the present invention, the present invention will be described in more detail below with reference to the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of the present invention.
[0019] It should be noted that, unless otherwise defined, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which this invention pertains. The terms used in this specification are intended solely for the purpose of describing specific embodiments and are not intended to limit the invention. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0020] Figure 1 The flowchart of the implementation of the IoT gateway data synchronization method provided by the present application is shown, including the steps: S101: The user modifies the configuration of the IoT gateway based on the IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on the first protocol.
[0021] S102: If the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic.
[0022] S103: If the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform sends configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway according to the received configuration parameters.
[0023] This application creates a corresponding gateway theme for each IoT gateway. This allows the IoT platform to save the modified version number to the gateway theme whenever a user modifies the IoT gateway configuration, regardless of whether the IoT gateway is online or the network is good. The platform then retrieves the modified version number once the IoT gateway is online and compares it with the locally stored version number to determine whether an update is needed. This application not only ensures the success rate of IoT gateway configuration modifications in weak network environments but also improves the user experience. It also places the decision-making power on the IoT gateway itself, significantly reducing the computing pressure on the IoT platform.
[0024] The following combination Figures 1 to 6 , this application is further described in detail with specific embodiments.
[0025] like Figure 1 As shown, the IoT gateway data synchronization method provided by the embodiment of the present application is described in detail as follows: S101: The user modifies the configuration of the IoT gateway based on the IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on the first protocol.
[0026] Combine Figure 4As shown, it should be noted that User 1 in this application refers to an administrator with login privileges to IoT Platform 2. User 1 can log in to IoT Platform 2 via a webpage or app, and use IoT Platform 2 to modify the configuration of IoT Gateway 3 or add, delete, or modify IoT Devices 4. Modifying the configuration of IoT Gateway 3 refers to modifying the configuration parameters of IoT Gateway 3. Configuration parameters include IP information, connection information, and the ID information of IoT Device 4. IoT Gateway 3 connects to each IoT Device 4 using these configuration parameters. Adding, deleting, or modifying IoT Devices 4 refers to increasing or decreasing the number of IoT Devices 4 connected to IoT Gateway 3, as well as modifying IoT Device 4 information (such as name, configuration, status, etc.). When the number of IoT Devices 4 connected to IoT Gateway 3 changes, its configuration parameters also change accordingly.
[0027] Among them, the IoT platform 2 is a centralized management and control system that can connect multiple device ends and service ends. Its main functions include data collection, statistics, analysis and organization, as well as transmitting the processed data to each terminal device, guiding the device to automatically execute the corresponding instructions and operations. The IoT gateway 3 is a converter that connects the IoT device 4 and the IoT platform 2. It is responsible for converting the data format of the IoT device 4 into a format that the IoT platform 2 can understand, and forwarding commands from the IoT platform 2 to the IoT device 4. It plays the role of an intermediary connecting the IoT device 4 and the IoT platform 2, and is an indispensable part of the IoT system. IoT devices 4 are the basic components of the IoT, including various sensors, smart home appliances, industrial equipment, etc. They are interconnected through IoT technology, can collect and send data to the IoT platform 2, and perform corresponding operations according to the instructions of the IoT platform 2. IoT devices 4 are the concrete embodiment of IoT applications. By connecting to the IoT platform 2, the possibility of intelligence and automation is realized.
[0028] In this embodiment, if Figure 4As shown, user 1 first logs in to IoT platform 2 and uses IoT platform 2 to modify the configuration of the IoT gateway 3 that requires configuration changes. For example, they modify the ID information of one of the IoT devices 4 connected to one of the IoT gateways 3. The modifications are then saved in the database of IoT platform 2. It should be noted that the database of IoT platform 2 stores a parameter shadow corresponding to each IoT gateway 3. Each parameter shadow records the latest configuration parameters of the corresponding IoT gateway 3. When the configuration of an IoT gateway 3 is modified, the corresponding parameter shadow on IoT platform 2 is updated accordingly. After the update is complete, the version number of the parameter shadow is incremented by one. Each time user 1 modifies the configuration of an IoT gateway 3, the version number of the corresponding parameter shadow is incremented by one. For example, before modifying the configuration of IoT gateway 3, the version number of the parameter shadow on IoT platform 2 is V1.0. After modifying the configuration of IoT gateway 3, the corresponding parameter shadow on IoT platform 2 is updated, and the version number of the parameter shadow changes from V1.0 to V1.1.
[0029] Furthermore, in this embodiment, IoT platform 2 creates a corresponding gateway topic for each IoT gateway 3. Each IoT gateway 3 can only access the content of its corresponding gateway topic. Based on the first protocol, IoT platform 2 publishes the modified parameter shadow version number to the gateway topic corresponding to that IoT gateway 3. For example, the modified parameter shadow version number V1.1 is published to its corresponding gateway topic.
[0030] In this embodiment, the first protocol is the MQTT protocol, and the first server is a server corresponding to the first protocol. In this embodiment, the first server is an MQTT server. It should be noted that MQTT (Message Queuing Telemetry Transport) is an instant messaging protocol developed by IBM and is used as a communication protocol for sensors and actuators. It is a publish / subscribe messaging protocol designed for remote devices with low-performance hardware and poor network conditions. The MQTT protocol has a retention mechanism, meaning that information published via the MQTT protocol (such as version numbers) is permanently retained. This allows IoT Gateway 3 to retrieve information by subscribing when it comes back online, even if it is offline.
[0031] S102: If the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic.
[0032] After the IoT platform 2 publishes the version number of the modified parameter shadow to the corresponding gateway topic, it determines whether the corresponding IoT gateway 3 is online.
[0033] If the IoT gateway 3 is online, the IoT gateway 3 subscribes to the corresponding gateway topic and obtains the content in the gateway topic.
[0034] Furthermore, IoT Gateway 3 compares the version number of the parameter shadow in the corresponding gateway topic with the version number stored locally on IoT Gateway 3. If the version number of the parameter shadow in the gateway topic (e.g., V1.1) matches the version number stored locally on IoT Gateway 3 (e.g., V1.1), the configuration of IoT Gateway 3 does not need to be updated. If the version number of the parameter shadow in the gateway topic (e.g., V1.1) does not match the version number stored locally on IoT Gateway 3 (e.g., V1.0), the configuration of IoT Gateway 3 needs to be updated.
[0035] If the IoT gateway 3 is offline, the IoT platform 2 temporarily stores the content of the gateway topic corresponding to the IoT gateway 3 (ie, the version number of the parameter shadow) in the first server, and waits for the IoT gateway 3 to come back online and subscribe to the gateway topic.
[0036] S103: If the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform sends configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway according to the received configuration parameters.
[0037] After comparing the version numbers of the IoT Gateway 3, if they are inconsistent, the configuration of the IoT Gateway 3 needs to be updated.
[0038] Specifically, IoT Gateway 3 sends a configuration update request to IoT Platform 2. Upon receiving the configuration update request, IoT Platform 2 distributes the configuration parameters of IoT Gateway 3 within the parameter shadow corresponding to IoT Platform 2 to the corresponding IoT Gateway 3. Furthermore, IoT Gateway 3 modifies its own configuration based on the latest received configuration parameters and updates the locally stored version number.
[0039] IoT Gateway 3 uses a hot update method to update its configuration. Hot updates are a common update method used by app developers; simply put, they are instant updates that occur when you open an app after downloading and installing it. Hot updates dynamically distribute code, allowing developers to fix bugs and release features without releasing a new version.
[0040] Based on the same inventive concept, Figure 2 As shown, the present invention also provides an Internet of Things gateway data synchronization method for an Internet of Things platform, comprising the steps of: S201: Based on the configuration modification of the IoT gateway by the user, the content of the gateway topic corresponding to the IoT gateway is updated through the first protocol.
[0041] S202: Determine whether the IoT gateway is online.
[0042] S203: If the IoT gateway is online, wait for the IoT gateway to determine whether its configuration needs to be updated; if the configuration of the IoT gateway needs to be updated, receive a configuration update request from the IoT gateway and send configuration parameters to the corresponding IoT gateway based on the first protocol.
[0043] S204: If the IoT gateway is in an offline state, temporarily storing the content of the gateway theme corresponding to the IoT gateway in the first server.
[0044] In this application, other technical features of the above-mentioned method for synchronizing IoT gateway data for an IoT platform are the same as the features disclosed in the aforementioned method embodiment and will not be repeated here.
[0045] Based on the same inventive concept, Figure 3 As shown, the present invention also provides an Internet of Things gateway data synchronization method for an Internet of Things gateway, comprising the steps of: S301: Based on the online status of the IoT gateway, subscribe to the corresponding gateway topic, and determine whether the configuration of the IoT gateway needs to be updated according to the content of the gateway topic.
[0046] S302: If the configuration of the IoT gateway needs to be updated, a configuration update request is sent to the IoT platform.
[0047] S303: Receive the configuration parameters issued by the IoT platform and update the configuration of the IoT gateway according to the configuration parameters.
[0048] In this application, other technical features of the above-mentioned IoT gateway data synchronization method for IoT gateway are the same as the features disclosed in the aforementioned method embodiment and will not be repeated here.
[0049] Based on the same inventive concept, Figure 4 As shown, the present invention also provides an Internet of Things gateway data synchronization system, including: User 1 is used to log in to IoT platform 2 and modify the configuration of IoT gateway 3 through IoT platform 2.
[0050] IoT platform 2 is configured to update the content of the gateway topic corresponding to IoT gateway 3 via the first protocol based on configuration modifications made by user 1 to IoT gateway 3; determine whether IoT gateway 3 is online; and, when IoT gateway 3 is online, receive a configuration update request from IoT gateway 3 and issue configuration parameters to the corresponding IoT gateway 3 based on the first protocol.
[0051] IoT Gateway 3 is used to subscribe to the corresponding gateway topic when it is online, and determine whether the configuration of IoT Gateway 3 needs to be updated based on the content of the gateway topic; it is also used to send a configuration update request to IoT Platform 2 when the configuration of IoT Gateway 3 needs to be updated; it is also used to receive configuration parameters issued by IoT Platform 2 and update the configuration of IoT Gateway 3 based on the configuration parameters.
[0052] The IoT device 4 is used to connect to the IoT gateway 3.
[0053] In this application, other technical features of the above-mentioned IoT gateway data synchronization system are the same as the features disclosed in the aforementioned method embodiment and will not be repeated here.
[0054] Based on the same inventive concept, the present application also provides an electronic device, which includes a processor, a memory and a communication circuit, and the processor is connected to the memory and the communication circuit respectively; wherein the communication circuit is used for communication connection, the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above method.
[0055] See also Figure 5 The electronic device described in the embodiment of the present application may specifically include a processor 210 and a memory 220 . The memory 220 is coupled to the processor 210 .
[0056] Processor 210 is used to control the operation of the electronic device. Processor 210 may also be referred to as a CPU (Central Processing Unit). Processor 210 may be an integrated circuit chip with signal processing capabilities. Processor 210 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor may be a microprocessor, or processor 210 may be any conventional processor.
[0057] The memory 220 is used to store computer programs and can be RAM, ROM, or other types of storage terminals. Specifically, the memory 220 may include one or more computer-readable storage media, which may be non-transitory or transient. The memory 220 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage terminals and flash memory storage terminals. In some embodiments, the non-transitory computer-readable storage medium in the memory 220 is used to store at least one program code.
[0058] The processor 210 is configured to execute the computer program stored in the memory 220 to implement the methods described in the various method embodiments of the present application.
[0059] In some embodiments, the electronic device may further include a peripheral terminal interface 230 and at least one peripheral terminal. The processor 210, memory 220, and peripheral terminal interface 230 may be connected via a bus or signal lines. Each peripheral terminal may be connected to the peripheral terminal interface 230 via a bus, signal lines, or circuit boards. Specifically, the peripheral terminal includes at least one of a radio frequency circuit 240, a display screen 250, an audio circuit 260, and a power supply 270.
[0060] The peripheral terminal interface 230 can be used to connect at least one peripheral terminal related to I / O (Input / Output) to the processor 210 and the memory 220. In some embodiments, the processor 210, the memory 220, and the peripheral terminal interface 230 are integrated on the same chip or circuit board; in some other implementations, any one or two of the processor 210, the memory 220, and the peripheral terminal interface 230 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0061] The RF circuit 240 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 240 communicates with communication networks and other IoT devices via electromagnetic signals, and is therefore the communication circuitry of the electronic device. The RF circuit 240 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 240 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, an operator identification module card, and the like. The RF circuit 240 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 240 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0062] The display screen 250 is used to display a user interface (UI). This UI may include graphics, text, icons, videos, or any combination thereof. When the display screen 250 is a touch screen, it is also capable of collecting touch signals on or above the surface of the display screen 250. These touch signals can be input as control signals to the processor 210 for processing. In this case, the display screen 250 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be one display screen 250, disposed on the front panel of the electronic device; in other embodiments, there can be at least two display screens 250, disposed on different surfaces of the electronic device or in a foldable design; in still other embodiments, the display screen 250 can be a flexible display, disposed on a curved or foldable surface of the electronic device. Furthermore, the display screen 250 can be configured as a non-rectangular irregular shape, i.e., a special-shaped screen. The display screen 250 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0063] The audio circuit 260 may include a microphone and a speaker. The microphone is used to collect sound waves from the operator and the environment, and convert the sound waves into electrical signals to be input into the processor 210 for processing, or input into the radio frequency circuit 240 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged in different parts of the electronic device. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signals from the processor 210 or the radio frequency circuit 240 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signals into sound waves audible to humans, but also convert the electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 260 may also include a headphone jack.
[0064] Power supply 270 is used to power various components in the electronic device. Power supply 270 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 270 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0065] For a detailed description of the functions and execution processes of the various functional modules or components in the electronic device embodiments of the present application, reference can be made to the descriptions in the above-mentioned method embodiments of the present application, which will not be repeated here.
[0066] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the various embodiments of the electronic devices described above are merely illustrative. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0067] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0068] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0069] Based on the same inventive concept, the present application also provides a computer-readable storage medium storing a computer program, which can be executed by a processor to implement the above method.
[0070] See also Figure 6 If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 300. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions / computer programs to enable an IoT device (which can be a personal computer, server, or network terminal, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, as well as electronic terminals such as computers, mobile phones, laptops, tablet computers, cameras, etc. that have the above-mentioned storage media.
[0071] The description of the execution process of the program data in the computer-readable storage medium can refer to the description in the above-mentioned method embodiments of the present application, and will not be repeated here.
[0072] It can be seen that the present invention discloses a method, system, device and medium for synchronizing data of an IoT gateway. The method includes the following steps: a user modifies the configuration of an IoT gateway based on an IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on a first protocol; if the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic, and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic; if the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform sends configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway based on the received configuration parameters. This application creates a corresponding gateway topic for each IoT gateway, so that when a user modifies the configuration of the IoT gateway, regardless of whether the IoT gateway is online or the network environment is good, the IoT platform can save the modified version number to the gateway topic, and obtain it in time after the IoT gateway is online, and compare the locally stored version number to determine whether it needs to be updated. This application not only ensures the success rate of IoT gateway configuration modifications in weak network environments, but also improves the user experience. At the same time, it places the decision-making power of whether the IoT gateway needs to be updated on its own side, greatly reducing the computing pressure of the IoT platform.
[0073] The above are merely embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any equivalent structural transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of protection of the present invention.
Claims
1. A method for synchronizing data of an Internet of Things gateway, characterized in that: The steps include: The user modifies the configuration of the IoT gateway based on the IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on the first protocol; If the IoT gateway is online, the IoT gateway subscribes to the corresponding gateway topic and determines whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic; If the configuration of the IoT gateway needs to be updated, the IoT gateway sends a configuration update request to the IoT platform; in response to the configuration update request, the IoT platform sends configuration parameters to the corresponding IoT gateway based on the first protocol; the IoT gateway updates the configuration of the IoT gateway according to the received configuration parameters.
2. The method for synchronizing IoT gateway data according to claim 1, wherein: In the step where the user modifies the configuration of the IoT gateway based on the IoT platform, and the IoT platform updates the content of the gateway topic corresponding to the IoT gateway based on the first protocol, the method specifically includes: After the user modifies the configuration of the IoT gateway based on the IoT platform, the IoT platform updates the parameter shadow corresponding to the IoT gateway and modifies the version number of the parameter shadow; The IoT platform publishes the version number of the parameter shadow to the gateway topic corresponding to the IoT gateway based on the first protocol.
3. The method for synchronizing Internet of Things gateway data according to claim 2, characterized in that: The step of determining whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic specifically includes: The IoT gateway compares the version number of the parameter shadow in the gateway topic with the version number stored locally on the IoT gateway; If the version number of the parameter shadow in the gateway topic is consistent with the version number stored locally on the IoT gateway, the configuration of the IoT gateway does not need to be updated; If the version number of the parameter shadow in the gateway topic is inconsistent with the version number stored locally in the IoT gateway, the configuration of the IoT gateway needs to be updated.
4. The method for synchronizing data of an Internet of Things gateway according to claim 1, wherein: The step of, if the IoT gateway is online, subscribing the IoT gateway to the corresponding gateway topic, and determining whether the configuration of the IoT gateway needs to be updated based on the content of the gateway topic, further includes the following steps: If the IoT gateway is in an offline state, the IoT platform temporarily stores the content of the gateway theme corresponding to the IoT gateway in the first server and waits for the IoT gateway to come back online.
5. The method for synchronizing IoT gateway data according to claim 4, characterized in that: The first protocol is the MQTT protocol, and the first server is an MQTT server.
6. A method for synchronizing data of an Internet of Things gateway, characterized in that: For IoT platforms, the following steps are included: Based on the user's configuration modification of the IoT gateway, updating the content of the gateway topic corresponding to the IoT gateway through the first protocol; Determine whether the IoT gateway is online; If the IoT gateway is online, wait for the IoT gateway to determine whether its configuration needs to be updated; If the configuration of the IoT gateway needs to be updated, receiving a configuration update request from the IoT gateway, and issuing configuration parameters to the corresponding IoT gateway based on the first protocol; If the Internet of Things gateway is in an offline state, the content of the gateway theme corresponding to the Internet of Things gateway is temporarily stored in the first server.
7. A method for synchronizing data of an Internet of Things gateway, characterized in that: For IoT gateway, including the following steps: Based on the online status of the IoT gateway, subscribe to the corresponding gateway topic, and determine whether the configuration of the IoT gateway needs to be updated according to the content of the gateway topic; If the configuration of the IoT gateway needs to be updated, a configuration update request is sent to the IoT platform; Receive the configuration parameters issued by the IoT platform, and update the configuration of the IoT gateway according to the configuration parameters.
8. An Internet of Things gateway data synchronization system, characterized in that: include: Users, used to log in to the IoT platform and modify the configuration of the IoT gateway through the IoT platform; an IoT platform, configured to update content of a gateway topic corresponding to the IoT gateway via a first protocol based on configuration modifications made by the user to the IoT gateway; further configured to determine whether the IoT gateway is online; and further configured to receive a configuration update request from the IoT gateway when the IoT gateway is online, and to issue configuration parameters to the corresponding IoT gateway based on the first protocol; The IoT gateway is configured to, when online, subscribe to a corresponding gateway topic and, based on the content of the gateway topic, determine whether the configuration of the IoT gateway needs to be updated; send a configuration update request to the IoT platform when the configuration of the IoT gateway needs to be updated; and receive configuration parameters issued by the IoT platform and update the configuration of the IoT gateway based on the configuration parameters. An Internet of Things device, used to connect to the Internet of Things gateway.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data configuration method based on digital home intelligent gateway
CN103747067A
Method, device and system for determining configuration information
CN114124924A
Intelligent gateway and regional upgrade control method of intelligent gateway
CN115022170A
Internet of Things gateway data processing method for water operation charging equipment
CN115361447A
Method, device and equipment for realizing configuration data consistency and readable medium
CN115756304A