Method, apparatus, device and storage medium for graphically abstracting multifunctional devices
By rendering and combining parent devices and sub-devices in the IoT application editing area, abstracted multi-function devices are generated, which solves the problem that ordinary users cannot abstract multi-function devices and realizes simple IoT application development.
Patent Information
- Application Number
- CN202410034355.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-01-09
AI Technical Summary
Existing graphical IoT application development tools require developers to have a programming foundation in order to realize the abstraction of multi-functional devices by writing linkage logic of logic blocks, which limits the development capabilities of ordinary users.
By rendering the parent device and the child device in the IoT application editing area, and combining them through drag and drop operations, the parent device can inherit the ability of the child device and generate an abstracted multi-functional device. The user only needs to trigger the device identification to complete the abstraction.
It enables users without programming foundation to realize the abstraction of multi-functional devices, simplifying the development process of IoT applications and reducing the difficulty of development.
Smart Images

Figure CN117806620B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of Internet of Things, and in particular to a method, apparatus, device and storage medium for graphically abstracting a multifunctional device. Background Art
[0002] With the continuous development of science and technology, IoT devices with multiple functions are constantly being introduced, such as floor fans with temperature and humidity detection functions, home lights with human body sensing functions, etc. In order to realize the control of these multi-functional devices, it is necessary to develop IoT applications suitable for multi-functional devices.
[0003] At present, in order to simplify the development difficulty of IoT applications, some graphical IoT application development tools, such as IFTTT and Node-RED, have been launched on the market. When using these graphical development tools to develop IoT applications suitable for multi-function devices, it is usually necessary to first obtain the logic blocks that implement the various functions of the multi-function device, and then complete the abstraction of the multi-function device by writing the linkage logic of each logic block, and then develop IoT applications based on the abstracted multi-function device. Since it is necessary to write the linkage logic between logic blocks when abstracting a multi-function device, this requires developers to have a certain programming foundation. Therefore, how to provide a simpler multi-function device abstraction method so that ordinary users who do not have a programming foundation can also realize the abstraction of multi-function devices, and then realize the development of IoT applications suitable for multi-function devices, is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0004] In view of this, the present disclosure proposes a graphical abstract multi-function device method, apparatus and equipment. Users only need to trigger the device identification to complete the abstraction of the multi-function device, so that ordinary users who do not have a programming foundation can also realize the abstraction of the multi-function device, and then realize the development of Internet of Things applications suitable for multi-function devices.
[0005] According to a first aspect of the present disclosure, a method for graphically abstracting a multifunctional device is provided, comprising:
[0006] According to the trigger of the parent device identification, the corresponding parent device is rendered in the IoT application editing area;
[0007] According to the trigger of the sub-device identification, the corresponding sub-device is rendered in the IoT application editing area;
[0008] According to a trigger for combining the parent device and the child device, the parent device and the child device are combined to obtain an abstracted multifunctional device;
[0009] When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device.
[0010] In a possible implementation, the combined triggering of the parent device and the child device is implemented based on an operation of dragging the child device close to the parent device.
[0011] In a possible implementation, based on the operation of dragging the child device close to the parent device, triggering the combination of the parent device and the child device, and combining the parent device and the child device to obtain an abstracted functional device includes:
[0012] Rendering a first bounding box of the parent device according to the operation of dragging the child device close to the parent device;
[0013] In response to a trigger that the child device is dragged to an overlapping area with the parent device, the overlapping area is calculated, and when the overlapping area is greater than or equal to an area threshold, the first bounding box is adjusted to a second bounding box including the parent device and the child device;
[0014] According to the trigger of ending the dragging operation of the child device, the parent device and the child device in the second boundary box are combined to obtain the abstracted multifunctional device.
[0015] In a possible implementation, the triggering of combining the parent device and the child device is implemented based on an add child device control associated with the parent device.
[0016] In a possible implementation, based on the add child device control associated with the parent device, triggering the combination of the parent device and the child device, and combining the parent device and the child device to obtain an abstracted functional device includes:
[0017] Abstracting an initial multifunctional device including the parent device and the child device slot based on a trigger of adding a child device control associated with the parent device;
[0018] According to the operation of dragging the sub-device to the sub-device slot, the sub-device is combined with the initial multi-function device to obtain the abstracted multi-function device.
[0019] In one possible implementation, the multifunctional device includes an interface creation control;
[0020] After obtaining the multifunctional device, the method further includes: creating a control based on the interface to create a capability interface of the multifunctional device.
[0021] In a possible implementation, when creating a control based on the interface to create a capability interface of the multi-function device, the process includes:
[0022] Push and display the capability list of the multi-function device according to the triggering of the interface creation control, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child device;
[0023] A capability interface of the multi-function device is created according to the capability selected in the capability list.
[0024] According to a second aspect of the present disclosure, there is provided an apparatus for graphically abstracting a multifunctional device, comprising:
[0025] A parent device rendering module is used to render the corresponding parent device in the IoT application editing area according to the trigger of the parent device identifier;
[0026] The sub-device rendering module is used to render the corresponding sub-device in the IoT application editing area according to the trigger of the sub-device identification;
[0027] An abstraction module is used to combine the parent device and the child device according to a trigger for combining the parent device and the child device to obtain an abstracted functional device;
[0028] When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device.
[0029] According to a third aspect of the present disclosure, a graphical abstract multifunctional device is provided, comprising: a processor; 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.
[0030] 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.
[0031] The present disclosure discloses a method for graphically abstracting a multifunctional device, including: rendering a corresponding parent device in an IoT application editing area according to a trigger of a parent device identifier; rendering a corresponding child device in an IoT application editing area according to a trigger of a child device identifier; combining the parent device and the child device according to a trigger of combining the parent device and the child device to obtain an abstracted multifunctional device. Through the method disclosed in the present disclosure, users only need to trigger through a device identifier to complete the abstraction of a multifunctional device, so that ordinary users without programming knowledge can also realize the abstraction of a multifunctional device, and further realize the development of IoT applications suitable for multifunctional devices.
[0032] 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
[0033] 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.
[0034] Figure 1 An interface diagram of a graphical development tool according to an embodiment of the present disclosure is shown;
[0035] Figure 2 A flowchart showing a method for graphically abstracting a multifunctional device according to an embodiment of the present disclosure is shown;
[0036] Figure 3 An interface diagram of a floor fan according to an embodiment of the present disclosure is shown;
[0037] Figure 4 An interface diagram of an air temperature and humidity detector according to an embodiment of the present disclosure is shown;
[0038] Figure 5 A drag state interface diagram according to an embodiment of the present disclosure is shown;
[0039] Figure 6 A drag state interface diagram according to another embodiment of the present disclosure is shown;
[0040] Figure 7 An interface diagram of a floor fan with integrated temperature and humidity detection functions according to an embodiment of the present disclosure is shown;
[0041] Figure 8 An interface diagram of a floor fan integrating temperature and humidity detection functions and human body sensing functions according to an embodiment of the present disclosure is shown;
[0042] Fig. 9 An interface diagram after right-clicking a floor fan according to an embodiment of the present disclosure is shown;
[0043] Fig.10 An interface diagram showing an initial multi-functional device including a floor fan and a sub-device slot according to an embodiment of the present disclosure is shown;
[0044] Fig.11 An interface diagram of a multifunctional device including a floor fan, an air temperature and humidity detector, and a sub-device slot according to an embodiment of the present disclosure is shown;
[0045] Fig.12 An interface diagram including a device topology diagram according to an embodiment of the present disclosure is shown;
[0046] Fig.13 A schematic block diagram showing a graphical abstract multi-function device according to an embodiment of the present disclosure;
[0047] Fig.14 A schematic block diagram of a device showing a graphical abstract multi-function device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0048] 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.
[0049] 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.
[0050] 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.
[0051] <Method Example>
[0052] First of all, it should be noted that the method of graphically abstracting a multifunctional device disclosed in the present invention is implemented based on a pre-built graphical development tool. The development interface of the graphical development tool can be as follows: Figure 1 Specifically, the graphical development interface may include at least a device library, a logic list, and an IoT application editing area ( Figure 1). Among them, the device library is configured with device identifiers of various IoT devices such as single-button switches, floor fans, ceiling fan lights, air-conditioning fans, door and window sensors, lights (home) (home lights), etc. After detecting the trigger of the device identifier being dragged to the IoT application editing area, the corresponding IoT device can be rendered in the IoT application editing area. There are various visual logic block identifiers configured in the logic list. Based on these visual logic block identifiers, corresponding data processing logic can be created in the IoT application editing area. The following will be combined with the graphical development tool to explain in detail the method of visualizing abstract multifunctional devices in the present disclosure.
[0053] Figure 2 FIG. 1 is a flowchart of a method for graphically abstracting a multifunctional device according to an embodiment of the present disclosure. Figure 2 As shown, the method includes steps S1100-S1300.
[0054] S1100, according to the trigger of the parent device identifier, render the corresponding parent device in the IoT application editing area.
[0055] For a multifunctional device, the device that realizes its main function is the parent device, and the device that realizes its additional functions is the child device. For example, a floor fan with integrated temperature and humidity detection function is a multifunctional device. For this multifunctional device, the floor fan is the parent device, and the air temperature and humidity detector that realizes the temperature and humidity detection function is the child device.
[0056] When rendering the parent device, the user can select the device identifier corresponding to the parent device (i.e., the parent device identifier) in the device library, and drag the parent device identifier to the IoT application editing area. After the graphical development tool detects the trigger of the parent device identifier being dragged to the IoT application editing area, it will render the corresponding parent device in the IoT application editing area. Continuing with the above embodiment, when the floor fan with temperature and humidity detection function is abstractly integrated, the floor fan is the parent device. The user can find the floor fan identifier in the device library and drag the floor fan identifier to the IoT application editing area. At this time, the floor fan identifier will be rendered in the IoT application editing area. Figure 3 Floor fan shown.
[0057] S1200: Render a corresponding sub-device in an IoT application editing area according to the triggering of the sub-device identifier.
[0058] When rendering a sub-device, the user can select the device identifier (i.e., the sub-device identifier) corresponding to the sub-device in the device library, and drag the sub-device identifier to the IoT application editing area. After the graphical development tool detects the trigger of the sub-device identifier being dragged to the IoT application editing area, it will render the corresponding sub-device in the IoT application editing area. Continuing with the above embodiment, when abstracting a floor fan with integrated temperature and humidity detection functions, the air temperature and humidity detector is a sub-device. The user can find the air temperature and humidity detector identifier in the device library, and drag the air temperature and humidity detector identifier to the IoT application editing area. At this time, the IoT application editing area will be rendered as follows: Figure 4 The air temperature and humidity detector shown.
[0059] S1300, combining the parent device and the child device according to the trigger of combining the parent device and the child device to obtain an abstracted functional device. When combining the parent device and the child device, it means inheriting the parent device to implement the child device, so that the parent device has all the capabilities of the child device.
[0060] In a possible implementation, the combined triggering of the parent device and the child device is implemented based on an operation of dragging the child device close to the parent device.
[0061] In a possible implementation, based on the operation of dragging the child device close to the parent device, triggering the combination of the parent device and the child device, and combining the parent device and the child device to obtain an abstracted functional device, the following steps may be included:
[0062] First, according to the operation of dragging the child device close to the parent device, a first boundary box of the parent device is rendered.
[0063] When the parent device and the child device are rendered in the IoT editing area, the user can select the child device and drag the selected child device closer to the parent device. After the graphical development tool detects that the child device is dragged close to the parent device, it will render the first bounding box of the parent device. In this way, the user can identify the parent device in the multi-function device through the first bounding box. Continuing with the above embodiment, when abstracting a floor fan with integrated temperature and humidity detection functions, the user can select the air temperature and humidity detector in the IoT application editing area and drag it closer to the floor fan. At this time, when the graphical development tool detects that the air temperature and humidity detector is dragged close to the floor fan, it will render the first bounding box of the floor fan. The first bounding box of the floor fan can be as shown in the figure. Figure 5 shown.
[0064] Second, based on the trigger that the child device is dragged to overlap with the parent device, the overlapping area is calculated, and when the overlapping area is greater than or equal to an area threshold, the first bounding box is adjusted to a second bounding box including the parent device and the child device.
[0065] When a sub-device is dragged close to a parent device, it will be detected whether the sub-device overlaps with the parent device. After the trigger of the overlap between the sub-device and the parent device is detected, the overlapping area between the sub-device and the parent device will be calculated in real time, and it will be determined whether the overlapping area between the sub-device and the parent device is greater than or equal to the preset area threshold. When determining whether the overlapping area is greater than or equal to the preset area threshold, the first bounding box will be adjusted to a second bounding box including the parent device and the sub-device, so that the user can identify the sub-device and the parent device that currently need to be combined through the second bounding box. The overlapping area is the overlapping area between the sub-device tile and the parent device tile. The area threshold can be set according to specific needs. For example, the area threshold can be set to 1 / 4 of the area of the parent device.
[0066] Continuing with the above embodiment, when a floor fan with integrated temperature and humidity detection function is abstracted, when the air temperature and humidity detector is dragged close to the floor fan, it is detected whether the air temperature and humidity detector overlaps with the floor fan, and when it is detected that the overlapping area of the air temperature and humidity detector and the floor fan is greater than or equal to 1 / 4 of the area of the floor fan, the floor fan frame is adjusted to a second boundary frame including the air temperature and humidity detector and the floor fan, wherein the second boundary frame can be as follows Figure 6 shown.
[0067] Third, according to the trigger of ending the dragging operation of the child device, the parent device and the child device in the second boundary box are combined to obtain an abstracted multifunctional device.
[0068] When the second bounding box is rendered, the operation of combining the parent device and the child device is triggered, and at this time, the user can end the dragging operation on the child device. When the graphical development tool detects the second bounding box and the user ends the dragging operation on the child device, the child device and the parent device in the second bounding box can be combined to obtain an abstract multifunctional device including the parent device and the child device.
[0069] Continuing with the above embodiment, when abstracting a floor fan with integrated temperature and humidity detection functions, after rendering a second bounding box including the air temperature and humidity detector and the floor fan, the user can end the dragging of the air temperature and humidity detector. At this time, the graphical development tool will abstract the following Figure 7 The floor fan shown has integrated temperature and humidity detection functions.
[0070] In a possible implementation, the abstracted multifunctional device includes a parent device located at the upper side, a child device and a child device slot located at the lower side. The child device slot can be used to further integrate other child devices into the multifunctional device. Specifically, when the user drags other child devices to the child device slot, the child device dragged thereto will be rendered in the child device slot, thereby completing the integration of other child devices.
[0071] In a possible implementation, after other sub-devices are integrated into the multifunctional device, a new sub-device slot will be rendered, and other sub-devices can be further integrated based on the new sub-device slot. This design can realize the expansion of sub-devices in the multifunctional device, so that the multifunctional device has more sub-device functions.
[0072] For example, when abstracting a floor fan with air temperature and humidity detection function and human body sensing function, Figure 7 After selecting the multifunctional device shown in the figure, you can also select a human body sensor in the device library and drag the human body sensor to the IoT application editing area, so that the human body sensor is rendered in the IoT application editing area. Furthermore, after dragging the human body sensor to the sub-device slot of the multifunctional device, the human body sensor will be rendered in the device slot, and a new sub-device slot will be rendered to the right of the human body sensor. In this way, the following abstraction is obtained: Figure 8 The floor fan shown has air temperature and humidity detection function and human body sensing function.
[0073] In a possible implementation, the triggering of combining the parent device and the child device is based on the add child device control associated with the parent device. When the parent device is clicked, an operation list associated with the parent device is pushed, and the operation list includes an add child device control, a delete control, and a disable control. The add child device control in the list is the add child device control associated with the parent device.
[0074] In a possible implementation, when triggering the combination of the parent device and the child device based on the add child device control associated with the parent device, and combining the parent device and the child device to obtain the abstracted multifunctional device, the following steps may be included:
[0075] First, based on the triggering of adding a child device control associated with the parent device, an initial multi-function device including a parent device and a child device slot is abstracted.
[0076] Specifically, based on the trigger of right-clicking the parent device, an operation list including the add child device control will be pushed and displayed near the parent device. When the add child device control in the list is triggered, the initial multi-function device including the parent device and the child device slot will be abstracted.
[0077] For example, when abstracting a floor fan with integrated temperature and humidity detection functions, after rendering the floor fan and the air temperature and humidity detector, the user right-clicks the floor fan, and a push notification is displayed near the floor fan. Fig. 9 The operation list described above, the user clicks the add sub-device control in the operation list, and the abstraction is as follows Fig.10 An initial multifunctional device including a floor fan and a sub-device slot is shown.
[0078] Second, according to the operation of dragging the sub-device to the sub-device slot, the sub-device is combined with the initial multi-function device to obtain an abstracted multi-function device.
[0079] Specifically, according to the operation of dragging the sub-device to the sub-device slot of the sub-initial multi-function device, the sub-device is rendered in the sub-device slot, and at the same time, a new sub-device slot is rendered, thereby abstracting a multi-function device including a parent device, a sub-device and a sub-device slot.
[0080] Continuing with the above embodiment, after the initial multi-function device is abstracted, the rendered air temperature and humidity detector is dragged to the sub-device slot of the initial multi-function device. At this time, the air temperature and humidity detector is rendered in the sub-device slot, and a new sub-device slot is rendered on the right side of the air temperature and humidity detector, thereby abstracting the following Fig.11 The multifunctional device shown includes a floor fan, an air temperature and humidity sensor, and a sub-device slot.
[0081] Furthermore, referring to the operation of the above-mentioned sub-device slots, other sub-devices can also be integrated into the generated multi-functional device, which will not be described in detail here.
[0082] In a possible implementation, the abstracted multifunctional device includes an interface creation control, through which a capability interface of the multifunctional device can be created.
[0083] After obtaining the multifunctional device, the method further includes: creating a control based on the interface and creating a capability interface of the multifunctional device.
[0084] In a possible implementation, when creating a control based on an interface and creating a capability interface of a multi-function device, the following steps may be included:
[0085] First, according to the triggering of the interface creation control, the capability list of the multi-function device is pushed and displayed, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child devices.
[0086] It should be noted here that the device capability is used to characterize the functions of the device. For example, if a floor fan has the ability to switch, swing, wind speed, and time, it means that the floor fan has the function of switching, swinging, wind speed, and timing. For another example, if an air temperature and humidity detector has the ability to detect temperature and humidity, it means that the air temperature and humidity detector has the function of detecting air temperature and humidity.
[0087] Furthermore, for each IoT device in the device library, a corresponding device capability list is provided, and the device capability list includes all capabilities of similar devices on the market. For example, some floor fans on the market have switch capability and wind speed capability, some floor fans have switch capability and timing capability, and some floor fans have switch capability, wind speed capability and swing head capability at the same time. The capability list for floor fans includes switch capability, wind speed capability, swing head capability and timing capability.
[0088] Since the multifunctional device integrates all the capabilities of the parent device and the child device, when the multifunctional device is abstracted, the capability list of the multifunctional device is also synthesized based on the capability list of the parent device and the capabilities of the child device. Specifically, the device identification of the parent device is obtained, the capability list of the parent device is obtained according to the device identification of the parent device, and the character "mother-" is added to each capability in the capability list of the parent device; the device identification of the child device is obtained, the capability list of the child device is obtained according to the device identification of the child device, and the character "child-" is added to each capability in the capability list of the child device; the adjusted parent device list and child device list are merged to obtain the capability list of the multifunctional device.
[0089] For example, after abstracting a multifunctional floor fan with integrated temperature and humidity detection functions, the device identification of the floor fan is obtained, and the floor fan capability list is obtained based on the device identification of the floor fan, and the character "mother-" is added to each capability in the floor fan capability list to obtain the first capability list as shown in Table 1. The device identification of the air temperature and humidity detector is obtained, and the air temperature and humidity detector capability list is obtained based on the device identification of the air temperature and humidity detector, and the character "child-" is added to each capability in the air temperature and humidity detector capability list to obtain the second capability list as shown in Table 2. Finally, the first capability list and the second capability list are combined to obtain the third capability list as shown in Table 3, and the third capability list is used as the capability list of the multifunctional floor fan.
[0090] Table 1
[0091]
[0092] Table 2
[0093]
[0094] Table 3
[0095]
[0096] Furthermore, for the abstracted multifunctional device, a unique device identifier will be configured for the multifunctional device, and the device identifier is the multifunctional device identifier. After obtaining the multifunctional device capability list, an application relationship between the multifunctional device identifier and the multifunctional device capability list will be established, so that when the interface creation control of the multifunctional device is triggered, the multifunctional device identifier can be obtained, and the corresponding multifunctional device list can be obtained based on the multifunctional device identifier, and the obtained multifunctional device list can be pushed and displayed to the adjacent position of the triggered interface creation control.
[0097] Second, a capability interface of the multi-function device is created according to the capabilities selected in the capability list.
[0098] It should be noted here that the purpose of graphically abstracting the multi-function device is to develop applications suitable for the multi-function device based on the abstracted multi-function device. Therefore, if the developed application needs to call a certain capability of the multi-function device, it is necessary to select that capability in the multi-function device capability list and create a corresponding capability interface based on the selected capability.
[0099] For example, the user has a multifunctional floor fan with integrated air temperature and humidity detectors and a humidifier. The user hopes that when the air temperature and humidity detector in the multifunctional floor fan detects that the humidity is less than 30, the humidifier will be controlled to turn on, and 50 will be used as the target humidity. When generating the first application that meets this application scenario, it is necessary to call the humidity detection capability of the air temperature and humidity detector in the multifunctional floor fan. At this time, when the multifunctional floor fan is abstracted by the above-mentioned graphical development tool, the interface creation control of the multifunctional floor fan can be clicked. At this time, the capability list shown in Table 3 will be pushed. After selecting the "sub-humidity" capability in the capability list, the "sub-humidity" capability will be displayed on the triggered interface creation control, thereby completing the creation of the "sub-humidity" capability interface. Through this "sub-humidity" capability interface, the humidity data detected by the air temperature and humidity detector in the multifunctional floor fan can be called.
[0100] In a possible implementation, the rendered multifunctional device includes a first interface creation control on the left and a second interface creation control on the right. The data transmission attribute of the first interface creation control is data input by default, and the data transmission attribute of the second interface creation control is data output by default. In this way, when creating a capability interface, the operation of configuring the data transmission attribute of the capability interface can be omitted, and the connection between subsequent capability interfaces can be more concise and clear.
[0101] Continuing with the above embodiment, the first application needs to call the humidity data output by the air temperature and humidity detector in the multifunctional floor fan. Therefore, it is necessary to create a "sub-humidity" capability interface with data output attributes for the abstracted multifunctional floor fan. After abstracting the multifunctional floor fan, click on the second interface creation control on the right side of the multifunctional floor fan. At this time, the capability list shown in Table 3 will be pushed. After selecting the "sub-humidity" capability in the capability list, the "sub-humidity" capability will be displayed on the triggered second interface creation control, thereby completing the above. Fig.12 The creation of the "sub-humidity" capability interface is shown.
[0102] After the capability interface of the multifunctional device is created, an application suitable for the multifunctional device can be developed based on the abstracted multifunctional device. Continuing with the above embodiment, after the multifunctional floor fan is abstracted, an application can be developed based on the abstracted multifunctional floor fan.
[0103] When developing an application based on an abstract multi-function device, the following steps can be included:
[0104] First, according to the connection trigger between the multi-function device capability interface and other device capability interfaces, a connection between the multi-function device capability interface and other device capability interfaces is established.
[0105] It should be noted here that when generating an application, in addition to multi-function devices, the application needs to call several other devices, so it is necessary to render several other devices in the IoT application editing area. The application needs to call several capabilities of other devices, so it is necessary to create several corresponding capability interfaces for other devices.
[0106] Continuing with the above embodiment, in addition to calling the abstracted "sub-humidity" capability interface of the multifunctional floor fan, the first application also needs to call the "switch" capability interface and the "target humidity" capability interface of the humidifier. Therefore, after abstracting the multifunctional floor fan, it is also necessary to select the household humidifier device identifier in the device library, and drag the household humidifier device identifier to the Internet of Things application editing area to render the household humidifier in the Internet of Things application editing area. Further, click on the first interface creation control on the left side of the household humidifier, and the capability list of the household humidifier will be pushed and displayed. Select the "switch" capability in the capability list, and the switch capability will be displayed on the triggered first interface creation control, thereby completing the creation of the "switch" capability interface with data input attributes for the household humidifier. Referring to the creation process of the "switch" capability interface, a "target humidity" capability interface with data input attributes is created for the household humidifier. The final household humidifier can be as follows Fig.12 as shown in .
[0107] Furthermore, after the rendering of other devices and the creation of capability interfaces are completed, the connection between the multi-function device capability interface and the other device capability interfaces can be established according to the control relationship between the multi-function device capability interface and the other device capability interfaces.
[0108] Continuing with the above embodiment, in the first application, it is necessary to control the switch of the household humidifier according to the humidity of the multifunctional floor fan. Therefore, it is necessary to click the "sub-humidity" capability interface of the multifunctional floor fan and the "switch" capability interface of the household humidifier in sequence to create a connection between the two interfaces clicked in sequence.
[0109] Second, according to the triggering of the connection, a logic editing area is created between the multi-function device capability interface and other device capability interfaces, and the input interface name and the output interface name of the logic editing area are configured.
[0110] Continuing with the previous example, click the line between the "sub-humidity" capability interface of the multi-function floor fan and the "switch" capability interface of the household humidifier to create an entry and exit at the midpoint of the line. Fig.12 The logic editing area shown. Further, the input interface connecting the logic editing area with the "sub-humidity" capability interface is configured as A1, and the output interface connecting the logic editing area with the "switch" capability interface is configured as B1.
[0111] Third, based on the triggering of the visualized logic block identifier, the control logic between the multi-function device capability interface and other device capability interfaces is created in the logic editing area.
[0112] Continuing from the previous example, select in the logic list: Fig.12 Drag the visualized logic blocks shown in the figure to the logic editing area, and set the parameters of each visualized logic block according to the control requirements to obtain the following Fig.12 The control logic shown in . Fig.12 There are two control logics shown in: First, when the humidity data received by A1 is 30, set the B1 interface to output "on", and send the "on" data to the "switch" capability interface of the household humidifier, so that the household humidifier can perform the operation of turning on the humidifier according to the "on" data. Second, when the humidity data received by A1 is 30, set the B2 interface to output "50", and send the "50" data to the "target humidity" capability interface of the household humidifier, so that the household humidifier can set the target humidity of the household humidifier to 50 according to the "50" data. It should be noted here that if there are several control logics in the logic editing area, several output interfaces need to be created. Therefore, it is also necessary to create an output interface named B2 for the logic editing area, and establish a connection between the output interface B2 and the "target humidity" capability interface of the household humidifier.
[0113] Fourth, based on the device topology diagram combined from the above three steps, generate the corresponding application.
[0114] Continuing from the above embodiment, based on the above three steps, the following Fig.12 The device topology shown is based on Fig.12 Generate an application based on the device topology diagram shown.
[0115] In a possible implementation, when generating a corresponding application based on the device topology map, the following steps may be included:
[0116] First, the device at the starting point of the connection is identified as the sending device, and the device at the end point of the connection is identified as the receiving device. Fig.12 In the device topology diagram shown, the multifunctional floor fan located at the starting point of the connection is identified as a sending device, and the household humidifier located at the end point of the connection is identified as a receiving device.
[0117] Second, the abstract class of the sending device is obtained, and the abstract class of the sending device is instantiated to obtain the first code declaring the sending device.
[0118] It should be noted here that the sending device may be an integrated multi-functional device, such as Fig.12 A multifunctional floor fan in a room may also be a non-integrated single-function device, such as Fig.12 Household humidifier in.
[0119] In the case where the sending device is a multi-function device, generating a first code declaring the multi-function device comprises the following steps:
[0120] First, the device identification of the sub-device in the multi-function device is obtained, and based on the device identification of the sub-device, the abstract class of the sub-device is obtained from a plurality of pre-stored abstract classes. It should be noted here that abstract classes corresponding to various device identifications are pre-stored in the graphical development tool, so that when the device identification of the sub-device is obtained, the abstract class of the sub-device can be obtained based on its device identification. Among them, how to construct various device identifications, that is, abstract classes of various devices is common knowledge in the art and will not be repeated here.
[0121] Secondly, the device identification of the parent device in the multifunctional device is obtained, and based on the device identification of the parent device, the abstract class of the parent device is obtained from a plurality of pre-stored abstract classes. The specific acquisition method is described in the child device, which will not be described in detail here.
[0122] Next, the abstract class of the parent device inherits the abstract class of the child device, thereby obtaining the abstract class of the multi-function device.
[0123] Finally, the abstract class of the multi-function device is instantiated to obtain the first code declaring the multi-function device.
[0124] In the case where the sending device is a single-function device, generating a first code declaring the single-function device comprises the following steps:
[0125] First, the device identification of the single-function device is obtained, and based on the device identification of the single-function device, the abstract class of the single-function device is obtained from a plurality of pre-stored abstract classes. The specific acquisition method is described in the sub-device, which will not be described in detail here.
[0126] Secondly, the abstract class of the single-function device is instantiated to obtain the first code declaring the single-function device.
[0127] Third, the abstract class of the receiving device is obtained, and the abstract class of the receiving device is instantiated to obtain the second code declaring the receiving device. For details, please refer to the first code generation process, which will not be repeated here.
[0128] Fourth, the control logic in the logic editing area is converted into the third code. Specifically, a corresponding mapping code is set for each visual logic block provided in the graphical development tool. Therefore, when converting the control logic in the logic editing area into the third code, each visual logic block in the logic editing area can be traversed in order, and for the currently traversed visual logic block (i.e., the current visual logic block), the mapping code corresponding to the current visual logic block is obtained, the logic parameters in the current visual logic block are extracted, and the extracted logic parameters are filled into the corresponding mapping code, thereby obtaining the final mapping code of the current visual logic block. After the traversal is completed, the third code corresponding to the control logic can be obtained.
[0129] Fifth, the output capability of the sending device is obtained, and a fourth code for calling the capability status of the output capability is generated. Specifically, the capability displayed by the output capability interface connected to the connection starting point in the sending device is obtained, and it is used as the output capability of the sending device, and a subcode for calling the subscribe method in the sending device instance and monitoring the capability status of its output capability is generated, and a subcode for judging whether the monitored capability status satisfies the conversion condition in the third code (such as Fig.12 When the value is less than 30 as shown in the logic block in, and when the conditions are met, the third code is called to convert the capability state, and the fourth code for calling the capability state of the output capability is generated based on the two generated sub-codes.
[0130] Sixth, generate a fifth code to send the capability status output by the logic editing area to the receiving device. Specifically, first generate a subcode to call the data after the control logic conversion, then generate a subcode to call the method in the receiving device instance in the second code and pass the converted data to the parameters of the method in the receiving device instance, and obtain the fifth code based on the two generated subcodes.
[0131] Seventh, based on the above first to fifth codes, an application is generated. Specifically, how to generate an application based on the first to fifth codes is common knowledge in the art and will not be described in detail here.
[0132] It should be noted here that in this application, the application is built based on the device capability abstract interface. Therefore, it can be compatible with similar devices of different brands and models, thereby improving the device compatibility of the application.
[0133] Furthermore, for IoT devices of different brands and models on the market, interface conversion modules corresponding to their brands and models are provided respectively. When receiving a call instruction issued by an IoT application, the interface conversion module can convert the call instruction into a call instruction executable by its own device. In this way, as long as the corresponding interface conversion module is set in the IoT device on the market, the IoT application developed by this application can be used for control, thereby improving the compatibility of the application with the device. It should be noted here that how to generate an interface conversion module for IoT devices of different brands and models based on the generated application is common knowledge in the art and will not be repeated here.
[0134] The present disclosure provides a method for graphically abstracting a multifunctional device, including: rendering a corresponding parent device in an IoT application editing area according to a trigger of a parent device identifier; rendering a corresponding child device in an IoT application editing area according to a trigger of a child device identifier; combining the parent device and the child device according to a trigger of combining the parent device and the child device to obtain an abstracted multifunctional device. Through the method of the present disclosure, users only need to trigger through a device identifier to complete the abstraction of a multifunctional device, so that ordinary users without programming knowledge can also realize the abstraction of a multifunctional device, and further realize the development of IoT applications suitable for multifunctional devices.
[0135] <Device Example>
[0136] Fig.13 FIG. 1 is a schematic block diagram of a graphical abstract multifunctional device according to an embodiment of the present disclosure. Fig.13 As shown, the graphical abstract multifunctional device 100 includes:
[0137] The parent device rendering module 110 is used to render the corresponding parent device in the IoT application editing area according to the trigger of the parent device identifier;
[0138] The sub-device rendering module 120 is used to render the corresponding sub-device in the IoT application editing area according to the trigger of the sub-device identification;
[0139] An abstraction module 130, configured to combine the parent device and the child device according to a trigger for combining the parent device and the child device, to obtain an abstracted functional device;
[0140] When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device.
[0141] <Equipment Embodiment>
[0142] Fig.14 A schematic block diagram of a device for graphically abstracting a multifunctional device according to an embodiment of the present disclosure is shown. Fig.14 As shown, the graphical abstract multifunctional device 200 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 aforementioned graphical abstract multifunctional device methods when executing the executable instructions.
[0143] Here, it should be noted that the number of processors 210 may be one or more. Meanwhile, in the graphical abstract multifunctional device 200 of the embodiment of the present disclosure, an input device 230 and an output device 240 may also be included. 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.
[0144] 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 graphical abstract multifunctional device method of the embodiment of the present disclosure. The processor 210 executes various functional applications and data processing of the graphical abstract multifunctional device 200 by running the software programs or modules stored in the memory 220.
[0145] 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.
[0146] <Storage Medium Embodiment>
[0147] 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 above-mentioned graphical abstract multi-functional device methods is implemented.
[0148] 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 method for graphically abstracting a multifunctional device, characterized in that: include: According to the trigger of the parent device identification, the corresponding parent device is rendered in the IoT application editing area; According to the trigger of the sub-device identification, the corresponding sub-device is rendered in the IoT application editing area; According to a trigger for combining the parent device and the child device, the parent device and the child device are combined to obtain an abstracted multifunctional device; When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device; The multifunctional device is a new device including the parent device and the child device; The multifunctional device includes an interface creation control; After obtaining the multifunctional device, the method further includes: creating a control based on the interface to create a capability interface of the multifunctional device; When creating a control based on the interface and creating a capability interface of the multi-function device, the method includes: Push and display the capability list of the multi-function device according to the triggering of the interface creation control, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child device; Creating a capability interface of the multifunctional device according to the capability selected in the capability list; The triggering of combining the parent device and the child device is implemented based on the operation of dragging the child device close to the parent device. Specifically, based on the operation of dragging the child device close to the parent device, the triggering of combining the parent device and the child device is implemented, and the parent device and the child device are combined to obtain an abstracted functional device, including: Rendering a first bounding box of the parent device according to an operation of dragging the child device close to the parent device; In response to a trigger that the child device is dragged to an overlapping area with the parent device, the overlapping area is calculated, and when the overlapping area is greater than or equal to an area threshold, the first bounding box is adjusted to a second bounding box including the parent device and the child device; According to the trigger of ending the dragging operation of the child device, the parent device and the child device in the second boundary box are combined to obtain the abstracted multifunctional device.
2. A method for graphically abstracting a multifunctional device, characterized in that: include: According to the trigger of the parent device identification, the corresponding parent device is rendered in the IoT application editing area; According to the trigger of the sub-device identification, the corresponding sub-device is rendered in the IoT application editing area; According to a trigger for combining the parent device and the child device, the parent device and the child device are combined to obtain an abstracted multifunctional device; When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device; The multifunctional device is a new device including the parent device and the child device; The multifunctional device includes an interface creation control; After obtaining the multifunctional device, the method further includes: creating a control based on the interface to create a capability interface of the multifunctional device; When creating a control based on the interface and creating a capability interface of the multi-function device, the method includes: Push and display the capability list of the multi-function device according to the triggering of the interface creation control, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child device; Creating a capability interface of the multifunctional device according to the capability selected in the capability list; The triggering of combining the parent device and the child device is implemented based on the add child device control associated with the parent device. Specifically, based on the add child device control associated with the parent device, the triggering of combining the parent device and the child device is implemented, and the parent device and the child device are combined to obtain an abstracted functional device, including: Abstracting an initial multifunctional device including the parent device and the child device slot based on a trigger of adding a child device control associated with the parent device; According to the operation of dragging the sub-device to the sub-device slot, the sub-device is combined with the initial multi-function device to obtain the abstracted multi-function device.
3. A graphical abstract multifunctional device, characterized in that: include: A parent device rendering module is used to render the corresponding parent device in the IoT application editing area according to the trigger of the parent device identifier; The sub-device rendering module is used to render the corresponding sub-device in the IoT application editing area according to the trigger of the sub-device identification; An abstraction module is used to combine the parent device and the child device according to a trigger for combining the parent device and the child device to obtain an abstracted functional device; When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device; The multifunctional device is a new device including the parent device and the child device; The multifunctional device includes an interface creation control; After obtaining the multifunctional device, the method further includes: creating a control based on the interface to create a capability interface of the multifunctional device; When creating a control based on the interface and creating a capability interface of the multi-function device, the method includes: Push and display the capability list of the multi-function device according to the triggering of the interface creation control, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child device; Creating a capability interface of the multifunctional device according to the capability selected in the capability list; The triggering of combining the parent device and the child device is implemented based on the operation of dragging the child device close to the parent device. Specifically, based on the operation of dragging the child device close to the parent device, the triggering of combining the parent device and the child device is implemented, and the parent device and the child device are combined to obtain an abstracted functional device, including: Rendering a first bounding box of the parent device according to an operation of dragging the child device close to the parent device; In response to a trigger that the child device is dragged to an overlapping area with the parent device, the overlapping area is calculated, and when the overlapping area is greater than or equal to an area threshold, the first bounding box is adjusted to a second bounding box including the parent device and the child device; According to the trigger of ending the dragging operation of the child device, the parent device and the child device in the second boundary box are combined to obtain the abstracted multifunctional device.
4. A graphical abstract multifunctional device, characterized in that: include: A parent device rendering module is used to render the corresponding parent device in the IoT application editing area according to the trigger of the parent device identifier; The sub-device rendering module is used to render the corresponding sub-device in the IoT application editing area according to the trigger of the sub-device identification; An abstraction module is used to combine the parent device and the child device according to a trigger for combining the parent device and the child device to obtain an abstracted functional device; When the parent device and the child device are combined, it means that the parent device is inherited to implement the child device, so that the parent device has all the capabilities of the child device; The multifunctional device is a new device including the parent device and the child device; The multifunctional device includes an interface creation control; After obtaining the multifunctional device, the method further includes: creating a control based on the interface to create a capability interface of the multifunctional device; When creating a control based on the interface and creating a capability interface of the multi-function device, the method includes: Push and display the capability list of the multi-function device according to the triggering of the interface creation control, wherein the capability list of the multi-function device includes all capabilities of the parent device and all capabilities of the child device; Creating a capability interface of the multifunctional device according to the capability selected in the capability list; The triggering of combining the parent device and the child device is implemented based on the add child device control associated with the parent device. Specifically, based on the add child device control associated with the parent device, the triggering of combining the parent device and the child device is implemented, and the parent device and the child device are combined to obtain an abstracted functional device, including: Abstracting an initial multifunctional device including the parent device and the child device slot based on a trigger of adding a child device control associated with the parent device; According to the operation of dragging the sub-device to the sub-device slot, the sub-device is combined with the initial multi-function device to obtain the abstracted multi-function device.
5. A graphical abstract multifunctional 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 2 when executing the executable instructions.
6. 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 2 is implemented.
