Data transmission method, device, equipment and storage medium for Internet of Things devices
Data packages constructed through custom data types solve the problem of data transmission compatibility between IoT devices, enable communication between different devices, and improve user experience and system applicability.
Patent Information
- Application Number
- CN202410034370.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-01-09
AI Technical Summary
Existing IoT technology cannot realize data transmission between devices with different data types, which limits the development of the Internet of Everything.
Through the data package constructed by custom data type, obtain the capability status of the output device, generate matching data packets based on this status, obtain the receivable data type of the input device, generate and send control instructions, and achieve communication compatibility between different devices. .
Data transmission between incompatible devices is realized, improving user experience and universal applicability of the system.
Smart Images

Figure CN117768511B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of Internet of Things, and in particular to a data transmission method, apparatus, device and storage medium for Internet of Things devices. Background Art
[0002] At present, the application of IoT technology has been widely penetrated into all aspects of people's lives and work. More and more devices and sensors are interconnected, forming massive data, providing people with a more intelligent living and working environment. However, the current IoT technology cannot realize data transmission between IoT devices with different data types, thus limiting the development of the Internet of Everything. Summary of the invention
[0003] In view of this, the present disclosure proposes a data transmission method, apparatus, device and storage medium for IoT devices. The method achieves communication compatibility between incompatible devices through data packets constructed with custom data types.
[0004] According to a first aspect of the present disclosure, a data transmission method for an Internet of Things device is provided, comprising:
[0005] Get the capability status of the output device;
[0006] Acquire a data packet matching the capability state, wherein the data packet includes at least two preset data types and data values corresponding to each of the data types;
[0007] Acquire a receivable data type of an input device, and generate a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device;
[0008] The control instruction is sent to the input device.
[0009] In a possible implementation manner, the data type preset in the data packet includes at least one of a Boolean type, an integer type, a character type, a floating point type, and an enumeration type.
[0010] In a possible implementation, the data value corresponding to each of the data types in the data packet is determined based on a user's usual control requirements.
[0011] In a possible implementation, when generating a control instruction of the input device based on the data packet, the receivable data type, and the capability of the input device, the step includes:
[0012] Extracting a data value corresponding to the receivable data type from the data packet;
[0013] Acquire a control instruction template for controlling the capability of the input device;
[0014] The data value corresponding to the receivable data type is filled into the preset position of the control instruction template to obtain the control instruction of the input device.
[0015] In a possible implementation, the data transmission method is implemented based on a data transmission application, wherein the data transmission application is generated based on a graphical Internet of Things application development tool.
[0016] In a possible implementation, when the data transmission application is generated based on a graphical Internet of Things application development tool, the following steps are included:
[0017] Rendering output device tiles and input device tiles in an IoT application editing area according to triggering of device identifiers corresponding to the output device and the input device;
[0018] Creating an output capability interface on the output device tile according to the configured output device capability;
[0019] Creating an input capability interface on the input device tile according to the configured input device capability;
[0020] According to the connection trigger of the output capability interface and the input capability interface, a connection between the output capability interface and the input capability interface is established to obtain a device topology diagram of the output device and the input device;
[0021] Based on the device topology map, the data transmission application is generated.
[0022] In a possible implementation, when the data transmission application is generated based on the device topology map, the process includes:
[0023] Acquire the output device tile information and output capability interface information to determine the output device and the capability of the output device;
[0024] Based on the output device and the capability of the output device, generating a first code for acquiring a capability status of the output device and a second code for acquiring a data packet matching the capability status of the device;
[0025] Acquire the input device tile information and input capability interface information to determine the input device and the capability of the input device;
[0026] generating, based on the input device and the capability of the input device, a third code for acquiring a data type that can be received by the input device, and generating, based on the data packet, the data type that can be received and the capability of the input device, a control instruction for the input device;
[0027] generating a fourth code for sending the control instruction to the input device;
[0028] The first code, the second code, the third code and the fourth code are combined in sequence to obtain the data transmission application.
[0029] According to a second aspect of the present disclosure, a data transmission device for an Internet of Things device is provided, comprising:
[0030] A capability status acquisition module is used to acquire the capability status of the output device;
[0031] A data packet acquisition module, used to acquire a data packet matching the capability state, wherein the data packet includes at least two preset data types and data values corresponding to each of the data types;
[0032] A control instruction generation module, used for acquiring a receivable data type of an input device, and generating a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device;
[0033] A sending module is used to send the control instruction to the input device.
[0034] According to a third aspect of the present disclosure, a data transmission device of an Internet of Things device is provided, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to execute the method described in the first aspect of the present disclosure.
[0035] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the method described in the first aspect of the present disclosure.
[0036] The present disclosure provides a data transmission method for an IoT device, including obtaining the capability status of an output device; obtaining a data packet that matches the capability status, wherein the data packet includes at least two pre-set data types and data values corresponding to each data type; obtaining the receivable data type of an input device, and generating a control instruction for the input device based on the data packet, the receivable data type, and the capability of the input device; and sending the control instruction to the input device. Since the data packet of the output device includes data values corresponding to multiple types of data, when the input device receives the data packet, it can select the corresponding data value for processing according to the data type it supports, thereby achieving communication compatibility between incompatible devices through a data packet constructed with a custom data type.
[0037] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0039] Figure 1 A flow chart of a data transmission method for an Internet of Things device according to an embodiment of the present disclosure is shown.
[0040] Figure 2 A development interface display diagram of a graphical development tool according to an embodiment of the present disclosure is shown.
[0041] Figure 3 A device topology diagram according to an embodiment of the present disclosure is shown;
[0042] Figure 4 A device topology diagram is shown according to another embodiment of the present disclosure;
[0043] Figure 5 A schematic block diagram of a data transmission device of an Internet of Things device according to an embodiment of the present disclosure is shown.
[0044] Figure 6 A schematic block diagram of a data transmission device of an Internet of Things device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0045] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0046] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0047] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0048] <Method Example>
[0049] Figure 1 A flow chart of a data transmission method of an Internet of Things device according to an embodiment of the present disclosure is shown. Figure 1 As shown, the method includes steps S1100-S1400.
[0050] S1100, obtaining the capability status of the output device.
[0051] In IoT application scenarios, if IoT device A can control IoT device B, then IoT device A is an output device, and IoT device B is an input device. For example, door and window sensors can detect the switch status of doors and windows. When the door and window sensors detect that the doors and windows are in the open state, they will control the floor fan to be closed; when the door and window sensors detect that the doors and windows are in the closed state, they will control the floor fan to be opened; that is, the door and window sensors can control the switch status of the floor fan, so the door and window sensors are output devices, and the floor fan is an input device.
[0052] Device capabilities refer to the functions that a device has. For example, a home lamp has switch capabilities, brightness capabilities, and color temperature capabilities, which represent the switch function, brightness adjustment function, and color temperature adjustment function of the home lamp.
[0053] The capability state of a device is the functional state of the device. For example, the switch capability of a home light can have two capability states: on and off; the brightness capability can have three capability states: high, medium, and low; and the color temperature adjustment capability can have three capability states: warm light, neutral light, and cool light.
[0054] In this embodiment, the output device and the input device are respectively connected to the cloud platform for communication, and the cloud platform executes the data transmission method of this embodiment to achieve data interaction between the output device and the input device.
[0055] In a possible implementation, the cloud platform can actively obtain the capability status of the output device. Specifically, the cloud platform can send a device status query instruction to the output device to detect the capability status of the current output device through the instruction, and then obtain the capability status of the current output device.
[0056] In another possible implementation, when the capability status of the output device changes, the current capability status is reported to the cloud platform, so that the cloud platform can obtain the capability status of the output device.
[0057] S1200: Acquire a data packet that matches the capability status, wherein the data packet includes at least two preset data types and data values corresponding to each data type.
[0058] In one possible implementation, when obtaining a data packet that matches the capability status of an output device, it can be implemented based on a preconfigured first mapping relationship table, wherein the first mapping relationship table includes a plurality of IoT devices, and each IoT device is configured with a plurality of device capabilities, each device capability is configured with a plurality of capability states, and each capability state is configured with a data packet that matches it. In this way, after obtaining the capability status of the output device, the data packet that matches the capability status of the output device can be obtained by querying the first mapping relationship table.
[0059] It should be noted here that the multiple device capabilities configured for each IoT device in the first mapping relationship table cover the capabilities of all IoT devices of the same type on the market. For example, some home lamps on the market only have the ability to switch on and off, some have both the ability to switch on and off and the ability to adjust brightness, and some have the ability to switch on and off, adjust brightness, and have the ability to set color temperature. In the first mapping relationship table, the device capabilities configured for IoT devices such as home lamps include the ability to switch on and off, the ability to adjust brightness, and the ability to set color temperature.
[0060] Furthermore, the multiple capability states configured for each device capability in the first mapping relationship table cover all capability states that the capability may have in the market. For example, some home lamps in the market have only one capability state of brightness, some have two capability states of brightness, high and low, and some have three capability states of brightness, high, medium and low. In this case, the brightness capability of home lamps in the first mapping relationship table is configured with three capability states of high, medium and low.
[0061] Furthermore, a matching data packet is configured for each capability state in the first mapping relationship table, that is, data packets corresponding to various capability states of various IoT devices on the market can be queried in the first mapping relationship table, thereby ensuring the universal applicability of the data transmission method.
[0062] In a possible implementation, the data type pre-set in each data packet may include at least one of a Boolean type, an integer type, a character type, a floating point type, and an enumeration type. Specifically, the Boolean data type may be recorded as bool, the integer data type may be recorded as int, the character data type may be recorded as string, the floating point data type may be recorded as float, and the enumeration type data type may be recorded as enum. Based on this, the content of the data packet may be as shown in Table 1.
[0063] In one possible implementation, the data value corresponding to each data type in the data packet is determined based on the user's usual control needs, so that the control of the IoT device can meet the user's usual control needs, thereby improving the user's usage experience.
[0064] For example, users usually expect that when the doors and windows are open, the floor fan can be controlled to be closed, the wind speed of the floor fan is 0, the working mode is selected to be closed, and the monitoring device can display the words "doors and windows are open". At the same time, it is expected that when the doors and windows are closed, the floor fan can be controlled to be opened, and the fan can be operated at the most comfortable wind speed of 60, and the working mode is automatic. The monitoring device can display the words "doors and windows are closed". The opening of the floor fan is usually controlled by bool data, the wind speed is usually controlled by int data, the working model is usually controlled by enum data, and the display words of the monitoring device are usually controlled by string data. At this time, the data packet of the closing capability state of the door and window sensor opening capability can be set to the form of Table 1, and the data packet of the separation capability state of the door and window sensor opening capability can be set to the form of Table 2.
[0065] Table 1
[0066]
[0067] Table 2
[0068]
[0069] S1300, obtaining a receivable data type of the input device, and generating a control instruction for the input device based on the data packet, the receivable data type and the capability of the input device.
[0070] In a possible implementation, the receivable data types of the input device are determined according to the capabilities of the input device to be controlled. Specifically, in the above-mentioned first mapping relationship table, for each capability of each IoT device, the data type that the corresponding capability interface can support is also recorded. In this way, when the capability of the input device to be controlled is determined, the data type that the capability interface corresponding to the capability of the input device to be controlled can be queried by querying the first mapping relationship table, and it can be used as the receivable data type of the input device.
[0071] For example, the output device is a door and window sensor, and the input device is a floor fan. The switching capability of the floor fan needs to be controlled by the switching capability of the door and window sensor. At this time, you can query the first mapping relationship table and find that the data type supported by the capability interface corresponding to the switching capability of the floor fan is bool. Then use bool as the data type that the floor fan switching capability interface can accept.
[0072] In a possible implementation, when generating a control instruction for an input device based on a data packet, a receivable data type, and the capability of the input device, the following steps may be included: first, extracting a data value corresponding to the receivable data type from the data packet. Secondly, obtaining a control instruction template for controlling the capability of the input device. Finally, filling the data value corresponding to the receivable data type into a preset position of the control instruction template to obtain a control instruction for the input device.
[0073] In one possible implementation, when obtaining a control instruction template for the capability of controlling an input device, it can be implemented based on a preconfigured second mapping relationship table, wherein the second mapping relationship table includes a plurality of Internet of Things devices, and each Internet of Things device is configured with a plurality of device capabilities, and each device capability is configured with a control instruction template that matches it. In this way, after obtaining the capability of the input device, the control instruction template that matches the capability of the input device can be obtained by querying the second mapping relationship table.
[0074] Furthermore, the control instruction template includes capability control parameters to be assigned. Therefore, after obtaining the control instruction template for controlling the capability of the input device, the data value corresponding to the receivable data type can be filled in the capability control parameter to be assigned to obtain the control instruction of the input device.
[0075] S1400: Send the control instruction to the input device.
[0076] The above steps S1100 - S1400 will be further explained below with reference to specific examples.
[0077] Example 1: Control the switching capability of a floor fan through the switching capability of a door and window sensor.
[0078] Specifically, when the cloud platform obtains that the door and window sensors are in a separated state, it will obtain the data packet shown in Table 1; at the same time, the cloud platform obtains that the data type that the floor fan switch capability interface can receive is bool type, then the data value False corresponding to the bool type is extracted from the data packet in Table 1, and the data value False is filled into the control instruction template that can control the floor fan switch, and the first control instruction that can control the floor fan to turn off is obtained; the first control instruction is sent to the switch capability interface of the floor fan; the floor fan receives and executes the first control instruction to close the fan.
[0079] Similarly, when the cloud platform obtains that the door and window sensors are in a closed state, it will obtain the data packet shown in Table 2; at the same time, the cloud platform obtains that the data type that the floor fan switch capability interface can receive is bool type, then the data value True corresponding to the bool type is extracted from the data packet in Table 2, and the data value True is filled into the control instruction template that can control the floor fan switch, and the second control instruction that can control the floor fan to open is obtained; the second control instruction is sent to the switch capability interface of the floor fan; the floor fan receives and executes the second control instruction to turn on the floor fan.
[0080] Example 2: Control the wind speed of a floor fan through the switching capability of door and window sensors.
[0081] Specifically, when the cloud platform obtains that the door and window sensors are in a separated state, it will obtain the data packet shown in Table 1; at the same time, the cloud platform obtains that the data type that the floor fan wind speed capability interface can receive is int type, then the data value 0 corresponding to the int type is extracted from the data packet in Table 1, and the data value 0 is filled into the control instruction template that can control the floor fan wind speed, and the third control instruction that can adjust the floor fan wind speed to 0 is obtained; the third control instruction is sent to the wind speed capability interface of the floor fan; the floor fan receives and executes the third control instruction to adjust the floor fan wind speed to 0.
[0082] Similarly, when the cloud platform obtains that the door and window sensors are in a closed state, it will obtain the data packet shown in Table 2; at the same time, the cloud platform obtains that the data type that the floor fan wind speed capability interface can receive is int type, then the data value 60 corresponding to the int type is extracted from the data packet in Table 2, and the data value 60 is filled into the control instruction template that can control the floor fan wind speed, and the fourth control instruction that can adjust the floor fan wind speed to 60 is obtained; the fourth control instruction is sent to the wind speed capability interface of the floor fan; the floor fan receives and executes the fourth control instruction to adjust the floor fan wind speed to 60.
[0083] Example 3, the ability to control the working mode of the floor fan through the switching ability of the door and window sensors.
[0084] Specifically, when the cloud platform obtains that the door and window sensors are in a separated state, it will obtain the data packet shown in Table 1; at the same time, the cloud platform obtains that the data type that the floor fan wind speed working mode capability interface can receive is enum type, then the data value Close corresponding to the enum type is extracted from the data packet in Table 1, and the data value Close is filled into the control instruction template that can control the working mode of the floor fan, and the fifth control instruction that can control the working mode of the floor fan is obtained; the fifth control instruction is sent to the working mode capability interface of the floor fan; the floor fan receives and executes the fifth control instruction to put the working mode in the closed state.
[0085] Similarly, when the cloud platform obtains that the door and window sensors are in a closed state, it will obtain the data packet shown in Table 2; at the same time, the cloud platform obtains that the data type that the floor fan working mode capability interface can receive is enum type, then the data value Auto corresponding to the enum type is extracted from the data packet in Table 2, and the data value Auto is filled into the control instruction template that can control the working mode of the floor fan, so as to obtain the sixth control instruction that can adjust the working mode of the floor fan to automatic; the sixth control instruction is sent to the working mode capability interface of the floor fan; the floor fan receives and executes the sixth control instruction to set the working mode of the floor fan to automatic.
[0086] Example 4: Controlling the display capability of the monitoring device through the switching capability of the door and window sensors.
[0087] Specifically, when the cloud platform obtains that the door and window sensors are in a separated state, it will obtain the data packet shown in Table 1; at the same time, the cloud platform obtains that the data type receivable by the display capability interface of the monitoring device is string type, then the data value doors and windows open corresponding to the string type is extracted from the data packet in Table 1, and the data value doors and windows open is filled into the control instruction template that can control the display of the monitoring device, and the seventh control instruction that can control the monitoring device to display the doors and windows open is obtained; the seventh control instruction is sent to the display capability interface of the monitoring device; the monitoring device receives and executes the seventh control instruction to display the words "doors and windows open" on the display screen.
[0088] Similarly, when the cloud platform obtains that the door and window sensors are in a closed state, it will obtain the data packet shown in Table 2; at the same time, the cloud platform obtains that the data type receivable by the display capability interface of the monitoring device is string type, then the data value doors and windows closed corresponding to the string type is extracted from the data packet in Table 2, and the data value doors and windows closed is filled into the control instruction template that can control the display of the monitoring device, and the eighth control instruction that can control the monitoring device to display the doors and windows closed is obtained; the eighth control instruction is sent to the display capability interface of the monitoring device; the monitoring device receives and executes the eighth control instruction to display the words "doors and windows closed" on the display screen.
[0089] In a possible implementation, the data transmission method of the present disclosure is implemented based on a data transmission application, wherein the data transmission application is generated based on a graphical Internet of Things application development tool.
[0090] In a possible implementation, the development interface of the graphical development tool can be as follows: Figure 2 As shown. Specifically, the graphical development interface may include at least a device library, a logic list, and an IoT application editing area. The device library is configured with device identifiers of various IoT devices, and based on these device identifiers, the corresponding IoT devices can be rendered in the IoT application editing area. The logic list is configured with a variety of visualized logic block identifiers, and based on these logic block identifiers, the corresponding data processing logic can be created in the IoT application editing area.
[0091] In a possible implementation, when the image-based IoT application development tool generates a data transmission application, the following steps may be included:
[0092] First, according to the triggering of the device identifiers corresponding to the output device and the input device, the output device tile and the input device tile are rendered in the IoT application editing area.
[0093] For example, the device library may include device identifiers of various IoT devices, such as door and window sensor identifiers, floor fan identifiers, and ceiling fan lamp identifiers. When a user needs to generate a data transmission application that controls the on / off capability of a floor fan through the on / off capability of a door and window sensor, the user may select the window sensor identifier in the device library and drag the window sensor identifier to the IoT application editing area to render the application as shown below. Figure 3 Select the floor fan logo and drag it to the IoT application editing area to render the following Figure 3 Floor fan block shown.
[0094] Second, create an output capability interface on the output device tile according to the configured output device capability.
[0095] In a possible implementation, when an output capability interface is created on an output device tile, a control implementation may be created based on the capability interface on the device tile.
[0096] Specifically, the device block rendered by the graphical Internet of Things application development tool is provided with the following Figure 3 The [+] button (i.e., capability interface creation control) shown in the figure, where the [+] button (i.e., input capability interface creation control) on the left side of the device block is used to create an input capability interface, and the [+] button (i.e., output capability interface creation control) on the right side of the device block is used to create an output capability interface.
[0097] In one possible implementation, a corresponding device capability list is provided for each IoT device in the device library, and the device capability list includes at least two capabilities of the device. The device list can be a set of capabilities possessed by all similar devices on the market. For example, some home lamps on the market only have the ability to switch, some have both the ability to switch and the ability to adjust brightness, and some have the ability to switch, adjust brightness, and have color temperature conditions. The capability list for home lamps may include the ability to switch, the ability to adjust brightness, and the ability to set color temperature. Furthermore, custom capabilities can also be set in the capability list, and device capabilities can be added according to specific application scenarios by triggering custom capabilities.
[0098] Furthermore, the system also stores a first mapping relationship between various device identifiers and corresponding capability lists. In this way, when the capability interface creation control on the device block is triggered, the triggered device identifier will be obtained, and the capability list corresponding to the device identifier will be obtained by querying the first mapping relationship, and the obtained capability list will be pushed and displayed to a position adjacent to the currently triggered capability interface creation control. In this way, the user can select the target capability to be configured in the pushed capability list, and the system will display the selected target capability on the triggered capability interface creation control to complete the creation of the corresponding capability interface.
[0099] Continuing with the above embodiment, the user needs to create an output capability interface for the window sensor block, which is used to transmit the opening status of doors and windows. At this time, the user can trigger the [+] button on the right side of the door and window sensor block. At this time, the capability list of the window sensor will be displayed near the triggered [+] button. The user selects the door and window status capability in the capability list of the door and window sensor. At this time, the system will display the words "door and window status" on the currently triggered [+] button, completing the creation of the door and window status output capability interface of the window sensor block. For the specific creation results, see 3.
[0100] Third, create an input capability interface on the input device tile according to the configured input device capabilities.
[0101] Continuing with the above embodiment, the user needs to create an input capability interface for the floor fan block. The input capability interface is used to control the on state of the floor fan. At this time, the user can trigger the [+] button on the left side of the floor fan block. At this time, the capability list of the floor fan will be displayed near the triggered [+] button. The user selects the switch capability in the capability list of the floor fan. At this time, the system will display the word switch on the currently triggered [+] button to complete the creation of the floor fan input capability interface. For details on the creation result, see Figure 3 .
[0102] Fourth, according to the connection trigger of the output capability interface and the input capability interface, a connection between the output capability interface and the input capability interface is established to obtain a device topology diagram of the output device and the input device.
[0103] Continuing with the above embodiment, the user clicks on the door and window status output capability interface and the floor fan input capability interface on the window sensor block in turn. At this time, a connection will be established between the two capability interfaces to complete the construction of the device topology map of the window sensor and the floor fan.
[0104] Fifth, based on the device topology map, generate a data transmission application.
[0105] In a possible implementation, when generating a data transmission application based on a device topology diagram, the following steps may be included:
[0106] First, obtain output device tile information and output capability interface information to determine the output device and the output device's capabilities.
[0107] Second, based on the output device and the capability of the output device, generate a first code for acquiring the capability status of the output device and a second code for acquiring a data packet matching the capability status of the device;
[0108] Third, obtain input device tile information and input capability interface information to determine the input device and the capability of the input device;
[0109] Fourth, based on the input device and the capability of the input device, generate a third code for acquiring a receivable data type of the input device, and based on the data packet, the receivable data type and the capability of the input device, generate a control instruction of the input device;
[0110] Fifth, generating a fourth code for sending the control command to the input device;
[0111] Sixth, the first code, the second code, the third code and the fourth code are combined in sequence to obtain a data transmission application.
[0112] In one possible implementation, after generating a data transmission application, users can also be supported to query data packets that match the capability status of the output device. In this way, it can be determined whether the data value in the default matching data packet meets the current control requirements. If it does not meet the control requirements, a logical editing area can be established by connecting the capability interface of the device topology diagram, and the data value in the default data packet can be modified through the visual logic block set in the logical editing area.
[0113] For example, in an embodiment of controlling the wind speed of a floor fan by means of the door and window status of a door and window sensor, the following are rendered in the IoT application editing area: Figure 4The door and window sensor block and floor fan block shown in the figure are used, and the door and window status capability interface is set for the door and window sensor block, and the wind speed capability interface is set for the floor fan block; then the connection between the door and window status capability interface of the door and window sensor block and the wind speed capability interface of the floor fan block is established. Because the graphical development tool sets a matching default data packet for the status of each capability in the capability list in addition to the corresponding capability list for each IoT device in the device library, after the connection generates the device topology diagram, the first default data packet corresponding to the closed state of the door and window sensor (as shown in Table 2) and the second default data packet corresponding to the separated state (as shown in Table 1) can be queried. Through the first default data packet, the floor fan can be controlled to run at a wind speed of 60 when the door and window state of the window sensor is closed, and through the second default data packet, the floor fan can be controlled to run at a wind speed of 0 when the door and window state of the window sensor is separated. If at this time, you want to control the floor fan to run at a wind speed of 80 when the door and window state of the door and window sensor is closed, you can click the midpoint of the connection to establish the following at the midpoint of the connection. Figure 4 The logic editing area shown in the figure is configured with the input interface connected to the door and window state capability interface as A1, and the output interface connected to the wind speed capability interface as B1. Further, the following is set in the logic editing area through the visualization logic block: Figure 4 The modification logic shown, through the above modification logic, the data value in the first default data packet can be modified from 60 to 80.
[0114] In the present disclosure, a data transmission method for an Internet of Things device includes obtaining the capability status of an output device; obtaining a data packet that matches the capability status, wherein the data packet includes at least two pre-set data types and data values corresponding to each data type; obtaining the receivable data type of an input device, and generating a control instruction for the input device based on the data packet, the receivable data type, and the capability of the input device; and sending the control instruction to the input device. Since the data packet of the output device includes data values corresponding to multiple types of data, when the input device receives the data packet, it can select the corresponding data value for processing according to the data type it supports, thereby enabling data transmission between Internet of Things devices that support different data types. That is, in the present disclosure, communication compatibility between incompatible devices is achieved by using data packets constructed with custom data types.
[0115] <Device Example>
[0116] Figure 5 A schematic block diagram of a data transmission device for an Internet of Things device according to an embodiment of the present disclosure is shown. Figure 5 As shown, the data transmission device 100 of the Internet of Things device includes:
[0117] A capability status acquisition module 110 is used to acquire the capability status of the output device;
[0118] A data packet acquisition module 120, configured to acquire a data packet matching the capability state, wherein the data packet includes at least two preset data types and data values corresponding to each of the data types;
[0119] A control instruction generating module 130, configured to obtain a receivable data type of an input device, and generate a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device;
[0120] The sending module 140 is used to send the control instruction to the input device.
[0121] <Equipment Embodiment>
[0122] Figure 6 A schematic block diagram of a data transmission device for an Internet of Things device according to an embodiment of the present disclosure is shown. Figure 6 As shown, the data transmission device 200 of the Internet of Things device includes: a processor 210 and a memory 220 for storing executable instructions of the processor 210. The processor 210 is configured to implement any of the above-mentioned data transmission methods of the Internet of Things device when executing the executable instructions.
[0123] Here, it should be noted that the number of processors 210 may be one or more. At the same time, the data transmission device 200 of the IoT device of the embodiment of the present disclosure may also include an input device 230 and an output device 240. The processor 210, the memory 220, the input device 230, and the output device 240 may be connected via a bus or in other ways, which are not specifically limited here.
[0124] The memory 220 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and various modules, such as the program or module corresponding to the data transmission method of the IoT device of the embodiment of the present disclosure. The processor 210 executes various functional applications and data processing of the data transmission device 200 of the IoT device by running the software program or module stored in the memory 220.
[0125] The input device 230 may be used to receive input numbers or signals. The signals may be key signals related to user settings and function control of the device / terminal / server. The output device 240 may include display devices such as display screens.
[0126] <Storage Medium Embodiment>
[0127] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium is also provided, on which computer program instructions are stored. When the computer program instructions are executed by the processor 210, any of the data transmission methods for the Internet of Things devices described above is implemented.
[0128] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A data transmission method for an Internet of Things device, characterized in that: include: Get the capability status of the output device; Acquire a data packet matching the capability state, wherein the data packet includes at least two preset data types and data values corresponding to each of the data types; Acquire a receivable data type of an input device, and generate a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device; sending the control instruction to the input device; When obtaining a data packet matching the capability state of the output device, it is implemented based on a pre-configured first mapping relationship table, wherein the first mapping relationship table includes a plurality of IoT devices, a plurality of device capabilities are configured for each IoT device, a plurality of capability states are configured for each device capability, and a data packet matching the capability state is configured for each capability state, so that after obtaining the capability state of the output device, the data packet matching the capability state of the output device can be obtained by querying the first mapping relationship table; When generating a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device, the control instruction includes: Extracting a data value corresponding to the receivable data type from the data packet; Acquire a control instruction template for controlling the capability of the input device; The data value corresponding to the receivable data type is filled into the preset position of the control instruction template to obtain the control instruction of the input device.
2. The method according to claim 1, characterized in that The data type preset in the data packet includes at least one of a Boolean type, an integer type, a character type, a floating point type and an enumeration type.
3. The method according to claim 1, characterized in that The data value corresponding to each of the data types in the data packet is determined based on the user's usual control requirements.
4. The method according to claim 1, characterized in that: The data transmission method is implemented based on a data transmission application, wherein the data transmission application is generated based on a graphical Internet of Things application development tool.
5. The method according to claim 4, characterized in that When the data transmission application is generated based on the graphical Internet of Things application development tool, it includes: Rendering output device tiles and input device tiles in an IoT application editing area according to triggering of device identifiers corresponding to the output device and the input device; Creating an output capability interface on the output device tile according to the configured output device capability; Creating an input capability interface on the input device tile according to the configured input device capability; According to the connection trigger of the output capability interface and the input capability interface, a connection between the output capability interface and the input capability interface is established to obtain a device topology diagram of the output device and the input device; Based on the device topology map, the data transmission application is generated.
6. The method according to claim 5, characterized in that When the data transmission application is generated based on the device topology diagram, it includes: Acquire the output device tile information and output capability interface information to determine the output device and the capability of the output device; Based on the output device and the capability of the output device, generating a first code for acquiring a capability status of the output device and a second code for acquiring a data packet matching the capability status of the device; Acquire the input device tile information and input capability interface information to determine the input device and the capability of the input device; generating, based on the input device and the capability of the input device, a third code for acquiring a data type that can be received by the input device, and generating, based on the data packet, the data type that can be received and the capability of the input device, a control instruction for the input device; generating a fourth code for sending the control instruction to the input device; The first code, the second code, the third code and the fourth code are combined in sequence to obtain the data transmission application.
7. A data transmission device for an Internet of Things device, characterized in that: include: A capability status acquisition module is used to acquire the capability status of the output device; A data packet acquisition module, used to acquire a data packet matching the capability state, wherein the data packet includes at least two preset data types and data values corresponding to each of the data types; A control instruction generation module, used for acquiring a receivable data type of an input device, and generating a control instruction of the input device based on the data packet, the receivable data type and the capability of the input device; A sending module, used for sending the control instruction to the input device; The data packet acquisition module is implemented based on a pre-configured first mapping relationship table when acquiring a data packet matching the capability state of the output device. The first mapping relationship table includes multiple IoT devices, multiple device capabilities are configured for each IoT device, multiple capability states are configured for each device capability, and a data packet matching the capability state is configured for each capability state. In this way, after acquiring the capability state of the output device, the data packet matching the capability state of the output device can be acquired by querying the first mapping relationship table. The control instruction generating module, when generating the control instruction of the input device based on the data packet, the receivable data type and the capability of the input device, is specifically used to: Extracting a data value corresponding to the receivable data type from the data packet; Acquire a control instruction template for controlling the capability of the input device; The data value corresponding to the receivable data type is filled into the preset position of the control instruction template to obtain the control instruction of the input device.
8. A data transmission device for an Internet of Things device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method described in any one of claims 1 to 6 when executing the executable instructions.
9. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for generating control interface of Internet of Things (IOT) device
CN106406127A
Internet of Things application processing method, and Internet of Things application system
CN108810053A
Graphical programming system oriented to NB-IoT terminal
CN110941426A
Internet of things equipment control method and system, configuration terminal, equipment and storage medium
CN112448989A
Internet of Things data processing method and device, computer equipment and storage medium
CN116431719A
