Firmware development methods, application control methods, and devices for Internet of Things (IoT) devices
By identifying bubbling commands and writing functional functions in IoT devices, firmware is generated, and API interface functions and automatically generated command cards are used to solve the communication anomaly problem in IoT device firmware development, thus improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-10
AI Technical Summary
During the firmware development process of IoT devices, communication anomalies often occur between embedded software engineers and platform application software engineers when negotiating data interaction formats, leading to extended development cycles. Improving firmware development efficiency has become an urgent problem to be solved.
By defining the functional control bubbling commands for IoT devices, writing corresponding functional functions, encapsulating them into bubbling data and sending them to the application, generating firmware, and using API interface functions to simplify the development process, command cards are automatically generated to control device operation.
It improves the development efficiency of IoT device firmware, reduces the need to negotiate data interaction with platform application software engineers, and simplifies the development process.
Smart Images

Figure CN119002879B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a firmware development method, an application control method and device of an Internet of Things (IoT) equipment. BACKGROUND
[0002] With the increasing popularity of IoT technology, more and more embedded software engineers are involved in the firmware development of IoT embedded equipment.
[0003] Since the IoT equipment needs to communicate with the IoT platform, the embedded software engineer must consult the data interaction format with the platform application software engineer during the firmware development, and explicitly specify the specific structure and fields of various data transmitted between the equipment and the IoT platform, such as control commands (such as "turn_leds_on", "get_temperature_value", "get_battery_level"), command parameter information, etc. After the data structure is specified, the embedded software engineer can start firmware development, and the platform application software engineer writes the cloud platform application program.
[0004] The above agreement work needs to be very detailed, and once a detail is wrong, it will cause abnormal communication between the equipment and the platform. In fact, when the embedded software engineer and the platform application software engineer jointly debug, various communication abnormalities often occur, and the development engineer needs to spend a lot of time and effort to troubleshoot data format problems, which seriously affects the development cycle. Therefore, how to improve the development efficiency of the firmware is a technical problem to be solved by the technical personnel in the field. SUMMARY
[0005] Therefore, the present disclosure provides a firmware development method, an application control method and device of an IoT equipment, which can improve the development efficiency of the firmware of the IoT equipment.
[0006] According to a first aspect of the present disclosure, a firmware development method of an IoT equipment is provided, comprising:
[0007] According to the function of the IoT equipment, a bubble command for controlling the function is determined, and a first function function for implementing the bubble command is written;
[0008] According to the first function function for implementing the bubble command, bubble command information of the bubble command is determined, and a second function function for encapsulating the bubble command information into first bubble data and sending to the corresponding application program is written;
[0009] Based on the first function function and the second function function, the firmware of the IoT equipment is generated;
[0010] The bubble command information includes at least one of a bubble command interface, a bubble command name, and bubble command parameter information.
[0011] In a possible implementation, the second function function is implemented according to an API interface function for adding a bubble command.
[0012] In a possible implementation, the first function function includes a sub-function function for obtaining response information of the Internet of Things device and encapsulating the response information into second bubble data and sending the second bubble data to a corresponding application program.
[0013] In a possible implementation, the sub-function function is implemented according to an API interface function for sending a response message.
[0014] According to a second aspect of the present disclosure, an application control method of an Internet of Things device is provided, including:
[0015] obtaining first bubble data sent by an Internet of Things device;
[0016] extracting bubble command information of a bubble command from the first bubble data, wherein the bubble command information includes at least one of a bubble command interface, a bubble command name, and bubble command parameter information;
[0017] generating a command card of the bubble command based on the bubble command information of the bubble command, and pushing and displaying the command card of the bubble command to an interactive interface of an application program;
[0018] controlling the Internet of Things device to perform a corresponding operation based on the command card of the bubble command.
[0019] In a possible implementation, when the command card of the bubble command is generated based on the bubble command information of the bubble command, the following steps are included:
[0020] extracting a bubble command name from the bubble command information of the bubble command, and generating a command card labeled with the bubble command name;
[0021] establishing a mapping relationship between the command card and the bubble command information of the bubble command.
[0022] In a possible implementation, when the Internet of Things device is controlled to perform a corresponding operation based on the command card of the bubble command, the following steps are included:
[0023] in a case where the command card of the bubble command is triggered, obtaining bubble command information associated with the command card based on the mapping relationship;
[0024] Bubble command parameter information is extracted from the bubble command information associated with the command card, and the at least two optional parameters are pushed and displayed according to the bubble command parameter information;
[0025] If any optional parameter is selected, the value corresponding to the selected optional parameter will be used as the target parameter value.
[0026] The bubble command interface and bubble command name are extracted from the bubble command information associated with the command card, and the extracted bubble command interface, bubble command name and target parameter value are encapsulated into third bubble data and sent to the IoT device so as to control the IoT device to perform corresponding operations through the third bubble data.
[0027] In one possible implementation, after the command card, based on the bubbling command, controls the IoT device to perform the corresponding operation, it further includes:
[0028] Receive the second bubbling data sent by the IoT device;
[0029] The response information of the IoT device is parsed from the second bubbling data, and the response information is pushed and displayed.
[0030] According to a third aspect of this disclosure, a firmware development apparatus for an Internet of Things (IoT) device is provided, comprising:
[0031] The first function development module is used to determine the bubbling command to control the function based on the function of the Internet of Things device, and to write the first function to implement the bubbling command.
[0032] The second function development module is used to determine the bubbling command information of the bubbling command according to the first function that implements the bubbling command, and to write a second function that encapsulates the bubbling command information into first bubbling data and sends it to the corresponding application.
[0033] A firmware synthesis module is used to generate firmware for the IoT device based on the first function and the second function;
[0034] The bubbling command information includes at least one of the following: bubbling command interface, bubbling command name, and bubbling command parameter information.
[0035] According to a fourth aspect of this disclosure, an application control device for an Internet of Things (IoT) device is provided, comprising:
[0036] The data receiving module is used to acquire the first bubbling data sent by the IoT device;
[0037] A bubble command extraction module is used to extract bubble command information from the first bubble data, wherein the bubble command information includes at least one of bubble command interface, bubble command name and bubble command parameter information;
[0038] The command card generation module is used to generate a command card for the bubbling command based on the bubbling command information, and push and display the command card of the bubbling command to the interactive interface of the application.
[0039] The device control module is used to control the IoT device to perform corresponding operations based on the command card of the bubbling command.
[0040] This disclosure provides a firmware development method, application control method, and apparatus for an Internet of Things (IoT) device. The firmware development method includes: determining a bubbling command to control the functions of the IoT device, and writing a first function to implement the bubbling command; determining bubbling command information based on the first function, and writing a second function to encapsulate the bubbling command information into first bubbling data and send it to a corresponding application; and generating firmware for the IoT device based on the first and second functions. The bubbling command information includes at least one of a bubbling command interface, a bubbling command name, and bubbling command parameter information. This firmware development method can improve firmware development efficiency.
[0041] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0042] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.
[0043] Figure 1 A flowchart illustrating a firmware development method for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown.
[0044] Figure 2 A flowchart illustrating an application control method for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown.
[0045] Figure 3 A diagram showing an application interface including a command card according to an embodiment of the present disclosure is provided.
[0046] Figure 4 The diagram illustrates an interface displaying corresponding optional parameters when a command card labeled for controlling an LED light switch is triggered, according to an embodiment of the present disclosure.
[0047] Figure 5 The diagram illustrates an interface displaying corresponding optional parameters when a command card for setting the color of an LED strip is triggered, according to an embodiment of the present disclosure.
[0048] Figure 6 An interactive flowchart illustrating a firmware development method and an application control method for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown.
[0049] Figure 7 A schematic block diagram of a firmware development apparatus for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown.
[0050] Figure 8 A schematic block diagram of an application control device for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0051] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0052] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0053] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0054] <Method Example 1>
[0055] First, it should be noted that the application for controlling IoT devices in this disclosure is named Bubble Connect APP; therefore, the interaction commands between IoT devices and this application are named Bubble Commands. This disclosure is based on a pre-built bubbling library, which provides API interfaces for adding bubbling commands, API interfaces for sending response messages, a first data template for encapsulating first bubbling data, a second data template for encapsulating second bubbling data, and a third data template for encapsulating third bubbling data. The specific implementation scheme will be described in detail below.
[0056] Figure 1 A flowchart illustrating a firmware development method for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown. Figure 1As shown, the method includes steps S1100-S1300.
[0057] S1100: Based on the function of the IoT device, determine the bubbling command to control the function, and write the first function to implement the bubbling command.
[0058] It's important to note that for each function of an IoT device, a bubbling command needs to be determined to implement its control. In other words, the number of bubbling commands needed corresponds to the number of functions the IoT device has. The bubbling command can be determined based on the specific function. For example, for an LED light with on / off and color setting functions, the bubbling command for controlling the LED light's on / off state can be set to control the LED light to be on / off, and the bubbling command for setting the LED light's color can be set to set the color of the LED strip.
[0059] After determining the bubbling commands corresponding to each function of the IoT device, we can further write the first function to implement each bubbling command. Continuing from the previous example, after determining the bubbling command to control the LED light switch, we can write the following first function to control the LED light switch:
[0060]
[0061] Meanwhile, after determining the bubbling command to set the LED strip color, a first function is written to implement LED strip color control, so as to adjust the LED strip color through the first function to implement LED strip color control.
[0062] After completing the writing of the first function for each bubbling command, step S1200 can be executed. Based on the first function for implementing the bubbling command, the bubbling command information corresponding to the bubbling command is determined, and a second function is written to encapsulate the bubbling command information into first bubbling data and send it to the corresponding application. The bubbling command information includes at least one of the following: bubbling command interface, bubbling command name, and bubbling command parameter information.
[0063] Specifically, each of the first functional functions contains the bubbling command interface and bubbling command parameter information. Therefore, after completing the writing of each first functional function, the bubbling command interface and bubbling command parameter information of each bubbling command can be determined based on the written first functional functions. Furthermore, the bubbling command name corresponding to each bubbling command is set according to the function of each bubbling command.
[0064] Continuing with the previous embodiment, when the first function corresponding to the bubbling command for controlling the LED light switch is as shown above, the bubbling command interface for this command can be determined to be `setSwitch`, the parameter type in the bubbling command parameter information is `bool`, and the parameter name is `value`. Further, based on the function of the bubbling command, the corresponding bubbling command name is determined to be "controlling the LED light strip switch". Thus, all bubbling command information for the "controlling the LED light switch" command can be determined based on the first function implementing the bubbling command for controlling the LED light switch.
[0065] By referring to the above method, the bubble command information corresponding to each bubble command can be determined.
[0066] Once the bubble command information corresponding to each bubble command is determined, a second function can be written for each bubble command to encapsulate its corresponding bubble command information into first bubble data and send it to the corresponding application.
[0067] In one possible implementation, to reduce the difficulty of firmware development, the Maopao library provides a simple and easy-to-use API interface for adding bubbling commands. In this embodiment, the interface functions of the API interface for adding bubbling commands can be directly used to implement the second function corresponding to each bubbling command. The API interface functions for adding bubbling commands are shown below:
[0068] MAOPAO_FUNCTION(method api, method name,__GEN_CMD__)
[0069] The function calls the API for adding bubbling commands, encapsulates the bubbling command information into first bubbling data, and sends it to the corresponding application, which is used to control IoT devices. This application is denoted as the Bubble Connect APP. The function includes at least three parameters: one is the `method api` (bubbling command interface); another is the `method name` (bubbling command name), which is generally in Chinese and displayed to the user on the Bubble Connect APP, but can also be set to English as needed; the last is `__GEN_CMD__`, used to prompt the Bubble Connect APP whether to display the bubbling command.
[0070] Continuing with the previous embodiment, the bubbling command interface for controlling the LED light switch is setSwitch, the bubbling command name is "Control LED strip switch", and the parameter type in the bubbling command parameter information is bool with the parameter name "value". The second function, implemented using the API interface function for adding bubbling commands, encapsulates the bubbling command information for controlling the LED light switch into first bubbling data and sends it to the corresponding application, is as follows:
[0071] MAOPAO_FUNCTION(setSwitch, "Control LED strip switch",__GEN_CMD__)
[0072] It should be noted that when the parameter type of the bubbling command is an enumeration, the API function used to add the bubbling command will also include multiple optional parameters corresponding to the enumeration parameters. For example, if the bubbling command interface corresponding to setting the LED strip color is `setColor`, the bubbling command name is "Set LED Strip Color", the parameter type in the bubbling command parameter information is an enumeration, the parameter name is `value`, and the multiple optional parameters corresponding to the enumeration parameters include `BLUE`, `GREEN`, and `RED`, then the second function implemented using the API function for adding the bubbling command to encapsulate the bubbling command information of the "Set LED Strip Color" bubbling command into first bubbling data and send it to the corresponding application is as follows:
[0073] MAOPAO_FUNCTION(setColor, "Set LED strip color", __GEN_CMD__, MAOPAO_CMD_OPTIONS("BLUE", "GREEN", "RED"))
[0074] The second function, implemented using the API function for adding bubbling commands, calls the API for adding bubbling commands. When the API for adding bubbling commands is called, a preset first data template is retrieved, and based on this first data template, the bubbling command information corresponding to the bubbling command is encapsulated into first bubbling data and sent to the corresponding application. The first data template can be as follows:
[0075]
[0076] It should be noted that the bubbling command in the template is the bubbling command interface. The bubbling parameter information not involved in the parameters of the second function can be obtained by parsing the corresponding first function through the API interface used to add the bubbling command.
[0077] Continuing with the previous embodiment, the second function MAOPAO_FUNCTION(setSwitch, "Control LED light strip switch",__GEN_CMD__) corresponding to the bubbling command for controlling the LED light switch is run. Based on the first data template mentioned above, the bubbling command information for controlling the LED light switch is encapsulated into the first bubbling data shown below:
[0078]
[0079] The second function corresponding to the bubbling command for setting the LED strip color, MAOPAO_FUNCTION(setColor, "Set LED strip color", __GEN_CMD__, MAOPAO_CMD_OPTIONS("BLUE", "GREEN", "RED")), is executed. Based on the first data template mentioned above, it encapsulates the bubbling command information for setting the LED strip color into the first bubbling data shown below:
[0080]
[0081] S1300: Based on the first and second function functions, the firmware of the IoT device is generated. Specifically, referring to the steps above, the first and second function functions corresponding to each function of the IoT device can be obtained. Then, the code including all the first and second function functions is combined to obtain the firmware of the IoT device.
[0082] After obtaining the firmware of the IoT device, the firmware will be compiled and then burned to the IoT device. Specifically, how to compile the firmware and burn it to the IoT device is common knowledge and will not be elaborated upon here.
[0083] It should be further explained that after the compiled firmware is burned to the IoT device, the IoT device will execute the various second function functions in the firmware in sequence after powering on. At the same time as the IoT device powers on, the bubbling command information of each bubbling command will be sent to the corresponding application in sequence. This allows the corresponding application to control the various functions of the IoT device based on the bubbling command information of each bubbling command received in sequence.
[0084] In one possible implementation, the first function includes a sub-function for obtaining response information from the IoT device executing the bubbling command, and encapsulating the response information into second bubbling data and sending it to the corresponding application.
[0085] To reduce the development difficulty of this sub-function, the Maopao library provides a simple and easy-to-use API interface for sending response messages. In this embodiment, the sub-functions in each first function can be implemented directly using the interface function of the API interface for sending response messages. The API interface function for sending response messages is shown below:
[0086] void Maopao::say(const char *format, ...)
[0087] The function of this interface is to obtain the response information of the IoT device executing the bubbling command, encapsulate the response information into second bubbling data, and send it to the corresponding application. This application is used to control the IoT device, and is denoted as the Bubble Connect APP. The parameter of this interface function is the response information of the IoT device.
[0088] Continuing with the previous embodiment, in the first function for implementing the bubbling command to control the LED light switch: For the response message "Switch is on" after the switch is turned on, the sub-function implemented directly using the API function for sending the response message is: maopao.say("Switch is on"). For the response message "Switch is off" after the switch is turned off, the sub-function implemented directly using the API function for sending the response message is: maopao.say("Switch is off").
[0089] The sub-function implemented by the interface function that uses the API interface for sending response messages will call the API interface for sending response messages. When the API interface for sending response messages is called, a preset second data template will be obtained, and the response information will be encapsulated into second bubbling data based on the second data template and sent to the corresponding application. The second data template can be as follows:
[0090]
[0091] Continuing with the previous embodiment, for the response information "Switch is on" after the switch is turned on, running maopao.say("Switch is on") will encapsulate the response information into the second bubbling data shown below based on the second data template:
[0092]
[0093] Continuing with the previous example, for the response message "Switch is off" after the switch is turned off, running maopao.say("Switch is off") will encapsulate the response message into the following second bubbling data based on the second data template:
[0094]
[0095] This disclosure provides a firmware development method for an Internet of Things (IoT) device, comprising: determining bubbling commands to control the functions of the IoT device based on the functions of the IoT device, and writing a first function to implement the bubbling commands; determining bubbling command information of the bubbling commands based on the first function to implement the bubbling commands, and writing a second function to encapsulate the bubbling command information into first bubbling data and send it to the corresponding application; generating firmware for the IoT device based on the first function and the second function; compiling the firmware, and burning the compiled firmware to the IoT device; wherein the bubbling command information includes at least one of a bubbling command interface, a bubbling command name, and bubbling command parameter information. Because the firmware development process of this disclosure includes code written into the firmware for reporting the bubbling command information of each bubbling command in the form of standard first bubbling data, after the firmware development is completed, running the firmware can automatically send the bubbling command information of each bubbling command used in the firmware to the corresponding application, thereby eliminating the need to negotiate the bubbling command information used in data interaction with platform application software engineers, and thus improving the development efficiency of IoT device firmware.
[0096] <Method Example 2>
[0097] Figure 2 A flowchart illustrating an application control method for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown. Figure 2 As shown, the method includes steps S2100-S2400.
[0098] S2100: Acquire the first bubbling data sent by the IoT device. The format of the first bubbling data is described above and will not be repeated here.
[0099] S2200, extract the bubbling command information of the bubbling command from the first bubbling data, wherein the bubbling command information includes at least one of the following: bubbling command interface, bubbling command name, and bubbling command parameter information. The bubbling command parameter information includes at least one of the following: parameter name, parameter type, and optional parameters, as described above.
[0100] S2300 generates a command card for the bubbling command based on the bubbling command information and pushes the command card to the application's interactive interface. The interactive interface of this application is the same as the interactive interface of the Bubble Link APP mentioned above.
[0101] In one possible implementation, when generating a command card for bubbling commands based on bubbling command information, the following steps may be included:
[0102] First, the bubbling command name is extracted from the command information of the bubbling command, and a command card labeled with the bubbling command name is generated. When triggered, this command card will send third bubbling data, including the corresponding bubbling command information, to the IoT device that sent the first bubbling data, so as to control the IoT device through the third bubbling data.
[0103] Continuing with the previous embodiment, in the embodiment of controlling the bubbling command of the LED light switch, the bubbling command name extracted from the bubbling command information of the LED light switch control command is "Control LED strip switch". In this case, for the bubbling command controlling the LED light switch, the following will be pushed out: Figure 3 The command card shown is for controlling the LED light strip switch. This command card enables subsequent control of the LED lights' on / off state.
[0104] Continuing with the previous embodiment, in the embodiment of setting the LED strip color bubbling command, the bubbling command name extracted from the bubbling command information of the setting LED strip color bubbling command is "Set LED strip color". In this case, for the setting LED strip color bubbling command, the following will be pushed out: Figure 3 The command card shown is for setting the color of the LED light strip. This command card allows for subsequent control of the LED light color.
[0105] Second, establish a mapping relationship between the command card and the bubbling command information. Specifically, after the command card is constructed, a mapping relationship is established between the command card and the bubbling command, bubbling command name, and bubbling command parameter information in the bubbling command information. In this way, when the command card is touched, the corresponding bubbling command information can be obtained based on the mapping relationship.
[0106] After constructing the command card for bubbling commands, step S2400 can be executed to control the IoT device to perform corresponding operations based on the command card for bubbling commands. The specific steps are as follows:
[0107] First, when the command card is triggered, the bubbling command information associated with the command card is obtained based on the mapping relationship.
[0108] Continuing with the previous embodiment, when the command card labeled to control the LED light switch is triggered, the bubbling command information of the bubbling command to control the LED light switch will be obtained. The bubbling command information includes the bubbling command interface setSwitch, the bubbling command name control LED light strip switch, and the parameter type bool and parameter name value in the bubbling command parameter information.
[0109] Continuing with the previous embodiment, when a command card marked with setting LED strip color is triggered, the bubbling command information of the bubbling command for setting LED strip color will be obtained. This bubbling command information includes the bubbling command interface setColor, the bubbling command name set LED strip color, and the parameter type in the bubbling command parameter information is an enumeration type, the parameter name is value, and the multiple optional parameters are BLUE, GREEN, and RED.
[0110] Second, extract the bubbling command parameter information from the bubbling command information associated with the command card, and push and display at least two optional parameters of the bubbling command parameter information.
[0111] Specifically, when the parameter type in the bubbling command parameter information is boolean, the optional parameters displayed include true and false. Continuing with the previous example, when a command card labeled as controlling the LED light switch is triggered, and the parameter type in its associated bubbling parameter information is boolean, then when this command card is triggered, the following will be pushed out: Figure 4 The two optional parameters shown are true and false.
[0112] When the parameter type in the bubbling command parameter information is enumeration, the push notification displays multiple optional parameters corresponding to the enumeration type. Continuing with the previous example, when the command card marked "Set LED strip color" is triggered, the parameter type in its associated bubbling parameter information is enumeration. The optional parameters corresponding to this enumeration type include BLUE, GREEN, and RED. Therefore, when this command card is triggered, the following will be pushed: Figure 5 The three optional parameters shown are BLUE, GREEN, and RED.
[0113] Third, if any optional parameter is selected, the value corresponding to the selected optional parameter will be used as the target parameter value. The values for each optional parameter are pre-defined when the first function is constructed.
[0114] Continuing with the previous embodiment, when the command card labeled as controlling the LED light switch is triggered, a message will be pushed and displayed as follows: Figure 4The two optional parameters shown are true and false. If the optional parameter true is selected, clicking OK to send will use the value 1 corresponding to true as the target parameter value for the command to control the LED light strip switch.
[0115] Continuing with the previous embodiment, when a command card labeled "Setting LED Strip Color" is triggered, a notification will be pushed out and displayed as follows: Figure 5 The three optional parameters BLUE, GREEN, and RED are shown. If the optional parameter BLUE is selected, clicking OK to send will use the value 0 corresponding to BLUE as the target parameter value for the command to set the LED strip color.
[0116] Fourth, extract the command and command name from the bubbling command information associated with the command card, and encapsulate the extracted command, command name and target parameter value into third bubbling data and send it to the IoT device so as to control the IoT device to perform corresponding operations through the third bubbling data.
[0117] In one possible implementation, when encapsulating the extracted bubbling command, bubbling command name, and target parameter value into third bubbling data, a preset third data template is used. This third data template can be as follows:
[0118]
[0119] Continuing with the previous embodiment, when the command card labeled as controlling the LED light switch is triggered, a message will be pushed and displayed as follows: Figure 4 The two optional parameters, true and false, are shown. When the optional parameter true is selected, clicking OK to send will use the value 1 corresponding to true as the target parameter value of the command to control the LED light strip switch. Then, the bubble command interface setSwitch corresponding to the command card labeled to control the LED light switch is extracted. The bubble command name is control the LED light strip switch, and the target parameter value value=1 is encapsulated into the third bubble data shown below. The LED light is then controlled to perform the operation of turning on through the third bubble data shown below.
[0120]
[0121] When a command card labeled "Setting LED Strip Color" is triggered, a notification will be pushed out, displaying something like this. Figure 5The three optional parameters BLUE, GREEN, and RED are shown. When the optional parameter BLUE is selected, clicking "OK" will use the value 0 corresponding to BLUE as the target parameter value for the command to set the LED strip color. Then, the bubbling command interface `setColor` corresponding to the command card labeled "Set LED Strip Color" is extracted. The bubbling command name is "Set LED Strip Color," and the target parameter value `value=0` is encapsulated into the third bubbling data shown below. This third bubbling data controls the LED to perform the operation of setting its color to blue.
[0122]
[0123] It should be noted that after the third bubbling data is sent to the IoT device, the IoT device will extract the bubbling command interface, the bubbling command name, and the target parameter value from the third bubbling data. In this way, the corresponding first function can be called to realize the control operation of the IoT device.
[0124] Furthermore, after the IoT device completes the control operation, it encapsulates the operation response information into second bubbling data and sends it to the application, allowing the application to display the corresponding operation result. For details on how to encapsulate the second bubbling data, please refer to the relevant description in Example 1, which will not be repeated here.
[0125] This disclosure provides an application control method for an Internet of Things (IoT) device, comprising: acquiring first bubbling data sent by the IoT device; extracting bubbling command information from the first bubbling data, wherein the bubbling command information includes at least one of a command, a command name, and command parameter information; generating a command card based on the bubbling command information, and pushing and displaying the command card to the interactive interface of an application; and controlling the IoT device to perform corresponding operations based on the command card. Through the method of this embodiment, a corresponding command card can be automatically generated based on the bubbling command information sent by the IoT device, thereby enabling control of the IoT device through the command card. This eliminates the need for platform application software engineers to write corresponding cloud platform applications, thus improving application development efficiency.
[0126] <Method Example 3>
[0127] Figure 6 This diagram illustrates the interaction flowchart of a firmware development method and an application control method for an Internet of Things (IoT) device according to an embodiment of the present disclosure. The following is in conjunction with... Figure 6 To reiterate the concept of this disclosure, as follows: Figure 6 As shown, the entire interaction process includes steps S3100-S4000.
[0128] S3100 determines the bubbling commands for controlling each pair of functions based on the functions of the IoT device, and writes the first function to implement each bubbling command.
[0129] S3200 determines the bubbling command information of each bubbling command based on the first function that implements each bubbling command, and writes a second function to report the bubbling command information of each bubbling command based on the API interface function used to add bubbling commands, and generates the firmware of the IoT device based on all the first and second function functions.
[0130] The S3300 compiles the firmware and burns the compiled firmware to IoT devices.
[0131] After the IoT device is powered on, the S3400 encapsulates the bubble command information corresponding to each bubble command into first bubble data based on all the second function functions in the firmware and sends it to the Bubble Connect APP.
[0132] S3500, the Bubble Connect APP sequentially receives the first bubble data corresponding to each bubble command sent by the IoT device.
[0133] S3600, BubbleLink APP extracts the bubble command information of the corresponding bubble command for each first bubble data, and maps it to the corresponding command card to obtain the command card corresponding to each bubble command.
[0134] The S3700, when triggered by any command card in the Bubble Connect APP, will generate corresponding third bubble data including bubble command data, and send the third bubble data to the IoT device.
[0135] After receiving the third bubble data sent by the Bubble Connect APP, the S3800 IoT device extracts the corresponding bubble command information from the third bubble data.
[0136] S3900: Based on the extracted bubble command information, the IoT device executes the corresponding operation and encapsulates the response information after the operation into the form of second bubble data and sends it to the Bubble Connect APP.
[0137] S4000, the Bubble Connect APP receives the second bubble data, extracts the response information from the second bubble data, and displays the response information.
[0138] <Device Example 1>
[0139] Figure 7 A schematic block diagram of a firmware development apparatus for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown. Figure 7 As shown, the device 100 includes:
[0140] The first function development module 110 is used to determine the bubbling command to control the function according to the function of the Internet of Things device, and to write the first function to implement the bubbling command.
[0141] The second function development module 120 is used to determine the bubbling command information of the bubbling command according to the first function that implements the bubbling command, and to write a second function that encapsulates the bubbling command information into first bubbling data and sends it to the corresponding application.
[0142] Firmware synthesis module 130 is used to generate firmware for the Internet of Things device based on the first function and the second function;
[0143] The bubbling command information includes at least one of the following: bubbling command interface, bubbling command name, and bubbling command parameter information.
[0144] <Device Example 2>
[0145] Figure 8 A schematic block diagram of an application control device for an Internet of Things (IoT) device according to an embodiment of the present disclosure is shown. Figure 8 As shown, the device 200 includes:
[0146] Data receiving module 210 is used to acquire the first bubble data sent by the IoT device;
[0147] The bubble command extraction module 220 is used to extract bubble command information of bubble commands from the first bubble data, wherein the bubble command information includes at least one of bubble command interface, bubble command name and bubble command parameter information;
[0148] The command card generation module 230 is used to generate a command card for the bubbling command based on the bubbling command information of the bubbling command, and push and display the command card of the bubbling command to the interactive interface of the application.
[0149] The device control module 240 is used to control the IoT device to perform corresponding operations based on the command card of the bubbling command.
[0150] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A firmware development method of an Internet of Things device, characterized by, Based on the pre-constructed bubble library implementation, comprising: According to the function of the Internet of Things device, determine the bubble command for controlling the function, and write the first function function for implementing the bubble command; wherein the bubble command is an interactive instruction between the Internet of Things device and the application program of the user terminal; According to the first function function for implementing the bubble command, determine the bubble command information of the bubble command, and write the second function function for encapsulating the bubble command information into the first bubble data and sending it to the corresponding application program; Wherein, the bubble command information includes at least one of bubble command interface, bubble command name and bubble command parameter information; The first bubble data is encapsulated and generated based on the first data template contained in the bubble library; The second function function is implemented according to the API interface function for adding bubble command; that is, the second function function corresponding to the bubble command is directly implemented using the interface function of the API interface for adding bubble command contained in the bubble library; Based on the first function function and the second function function, the firmware of the Internet of Things device is generated.
2. The method of claim 1, wherein, The first function function includes a sub-function function for obtaining response information of the Internet of Things device and encapsulating the response information into second bubble data and sending it to the corresponding application program.
3. The method of claim 2, wherein, The sub-function function is implemented according to the API interface function for sending response message.
4. An application control method of an Internet of Things device, characterized by, Comprising: Obtain the first bubble data sent by the Internet of Things device, wherein the firmware of the Internet of Things device is developed based on the firmware development method of any one of claims 1-3; Extract the bubble command information of the bubble command from the first bubble data, wherein the bubble command information includes at least one of bubble command interface, bubble command name and bubble command parameter information; Based on the bubble command information of the bubble command, generate the command card of the bubble command, and push the command card of the bubble command to the interactive interface of the application program for display; Based on the command card of the bubble command, control the Internet of Things device to perform corresponding operation.
5. The method of claim 4, wherein, When generating the command card of the bubble command based on the bubble command information of the bubble command, comprising: Extract the bubble command name from the bubble command information of the bubble command, and generate the command card labeled with the bubble command name; Establish the mapping relationship between the command card and the bubble command information of the bubble command.
6. The method of claim 5, wherein, When controlling the Internet of Things device to perform corresponding operation based on the command card of the bubble command, comprising: In the case that the command card of the bubble command is triggered, based on the mapping relationship, obtain the bubble command information associated with the command card; Extract the bubble command parameter information from the bubble command information associated with the command card, and push display at least two optional parameters according to the bubble command parameter information; In the case that any one of the optional parameters is selected, the value corresponding to the selected optional parameter is taken as the target parameter value; The bubble command interface and the bubble command name are extracted from the bubble command information associated with the command card, and the extracted bubble command interface, bubble command name and target parameter value are encapsulated into third bubble data and sent to the Internet of Things device to control the Internet of Things device to perform corresponding operations through the third bubble data.
7. The method of claim 5, wherein, After controlling the Internet of Things device to perform corresponding operations based on the command card of the bubble command, the method further comprises: receiving second bubble data sent by the Internet of Things device; The response information of the Internet of Things device is parsed from the second bubble data, and the response information is pushed and displayed.
8. A firmware development apparatus of an Internet of Things device, characterized by, Based on the pre-constructed bubble library implementation, comprising: A first function development module is configured to determine a bubble command for controlling a function of an Internet of Things device based on the function, and to write a first function for implementing the bubble command; wherein the bubble command is an interactive instruction between the Internet of Things device and an application program of a user terminal; A second function development module is configured to determine bubble command information of the bubble command based on the first function for implementing the bubble command, and to write a second function for encapsulating the bubble command information into first bubble data and sending the first bubble data to a corresponding application program; the first bubble data is encapsulated and generated based on a first data template contained in the bubble library; The second function is implemented based on an API interface function for adding a bubble command; that is, the second function corresponding to the bubble command is implemented directly using the interface function of the API interface for adding a bubble command contained in the bubble library A firmware synthesis module is configured to generate firmware of the Internet of Things device based on the first function and the second function; The bubble command information includes at least one of a bubble command interface, a bubble command name and bubble command parameter information.
9. An application control apparatus of an Internet of Things device, characterized by comprising: Comprising: A data receiving module is configured to obtain first bubble data sent by an Internet of Things device, wherein the firmware of the Internet of Things device is developed based on the firmware development device of claim 8; A bubble command extraction module is configured to extract bubble command information of a bubble command from the first bubble data, wherein the bubble command information includes a bubble command interface, a bubble command name and bubble command parameter information; A command card generation module is configured to generate a command card of the bubble command based on the bubble command information of the bubble command, and to push and display the command card of the bubble command to an interactive interface of an application program; A device control module is configured to control the Internet of Things device to perform corresponding operations based on the command card of the bubble command.
Citation Information
Patent Citations
Intelligent equipment online debugging method, device and system and electronic equipment
CN110471845A