Control method of intelligent device, electronic device, medium and program product
Patent Information
- Application Number
- CN202510882587.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-10-28
AI Technical Summary
[0005]本申请提供一种智能设备的控制方法、电子设备、介质和程序产品,用以解决现有技术中若采用单命令下发,每次只能调整一个位置,操作繁琐,若采用组命令下发,需要同时获取并下发其他属性值,操作复杂的问题
[0046]上述方法中,云平台获取用户对智能设备的控制指令,并根据控制指令生成具体可用于控制智能设备的目标指令数组,完成准确控制;智能设备对应有多个控制对象,控制对象对应有多个属性;这些控制对象和属性可以预先设置为智能设备和云平台可以识别的内容,这样智能设备可获得用户的控制指令,该控制指令包括目标控制对象和对目标控制对象的至少一个属性的操作指示;云平台基于控制对象设置数组配置信息,数组配置信息定义有多个元素,不同元素对应不同的控制对象,元素包括对应控制对象的标识以及一个或多个属性的取值;数组配置信息还定义有各属性的取值范围,不同的取值表示不同的操作指示;基于预先设置的数组配置信息和控制指令,确定目标控制对象对应的目标元素,并通过目标元素构成目标指令数组,以灵活的方式组成控制智能设备的目标指令数组,通过该目标指令数组控制智能设备,对多个控制对象进行修改时,可以更加专注于需要修改的控制对象,减少不需要的属性控制和数据交互,从而提高控制效率和交互效率。
Smart Images

Figure CN120848286A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home / intelligent home technology, and more particularly to a control method, electronic device, medium, and program product for a smart device. Background Technology
[0002] Smart home appliances refer to home appliances that achieve automation and remote control by embedding sensors, connecting to the Internet, and using artificial intelligence technology. Their main feature is that they can exchange data through network connections, thereby achieving more efficient operation and user experience.
[0003] However, in existing technologies, smart home appliances typically use cloud platforms to issue single or group commands to smart devices when processing data. After a single command is issued, only one parameter or device is controlled at a time, while after a group command is issued, control is performed based on multiple predefined parameters or devices. If a smart device has a large number of repetitive parameters that need to be controlled, adjusting multiple parameters is complex when using a single command, and even parameters that do not need to be modified are controlled when using a group command, resulting in redundant operations.
[0004] Therefore, this application proposes a method to solve the above problems. Summary of the Invention
[0005] This application provides a control method, electronic device, medium, and program product for a smart device, which solves the problems in the prior art where single command issuance only allows adjustment of one position at a time, resulting in cumbersome operation, and group command issuance requires simultaneous acquisition and issuance of other attribute values, leading to complex operation.
[0006] In a first aspect, this application provides a control method for a smart device, applied to a cloud platform, comprising:
[0007] The system receives control instructions sent by a smart device; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control instructions include a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects.
[0008] Based on the array configuration information and the control instructions, the target elements corresponding to the target control object are determined, and the target instruction array composed of the target elements is sent to the smart device so that the smart device can control the smart device based on the target instruction array;
[0009] The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
[0010] In one possible implementation, based on array configuration information and the control instructions, target elements corresponding to the target control object are determined, and a target instruction array consisting of the target elements is sent to the smart device so that the smart device can control the smart device based on the target instruction array, including:
[0011] Obtain multiple arrays pre-constructed based on the array configuration information. Different arrays are used to describe different sets of attributes, and each array includes multiple elements.
[0012] From the plurality of arrays, determine an array that matches at least one attribute corresponding to the control instruction;
[0013] Based on the matching array, the control instructions, and the array configuration information, a target element is determined, and the smart device is controlled according to the target instruction array formed by the target element.
[0014] In one possible implementation, determining a target element based on the matching array, the control instructions, and the array configuration information, and controlling the smart device based on a target instruction array composed of the target elements, includes:
[0015] The elements corresponding to the target control object are determined from the matching array to form a new array;
[0016] Based on the operation instruction of at least one attribute of the target controlled object in the control command and the array configuration information, update the value of the attribute of the corresponding element in the new array to obtain the target element;
[0017] The smart device is controlled according to the target instruction array composed of the target elements.
[0018] In one possible implementation, determining the element corresponding to the target control object from the matching array to form a new array includes:
[0019] If the number of target control objects does not exceed the threshold, then the elements corresponding to the target control objects are taken from the matching array to construct a new array;
[0020] If the number of target control objects exceeds the threshold, the elements corresponding to non-target control objects are deleted from the matching array to obtain a new array.
[0021] In one possible implementation, the plurality of controllable objects are a plurality of controllable objects included in the smart device;
[0022] Alternatively, the multiple controlled objects may include multiple time periods.
[0023] In one possible implementation, the method further includes:
[0024] Obtain configuration information input by the user, the configuration information including the identifiers of multiple control objects and the values corresponding to the operation instructions of each attribute;
[0025] Based on the configuration information, an array configuration information is constructed and added to the configuration file so that after obtaining control instructions, a target instruction array is generated according to the array configuration information in the configuration file to control the corresponding smart device.
[0026] Secondly, this application provides a control method for a smart device, applied to a smart device, comprising:
[0027] The system acquires user control commands for smart devices and sends them to a cloud platform; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects;
[0028] The system receives a target instruction array sent by the cloud platform. The target instruction array is used to indicate the target element corresponding to the target control object. The target element is determined by the cloud platform based on the array configuration information and the control instruction. The target element includes: the identifier of the corresponding control object and the value of one or more attributes.
[0029] The target control object is determined based on the identifier of the control object;
[0030] Control the target control object to execute operation instructions corresponding to the values of one or more attributes.
[0031] Thirdly, this application provides a control device for a smart device, comprising:
[0032] A receiving module is used to receive control instructions sent by a smart device; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control instruction includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects;
[0033] The first processing module is used to determine the target element corresponding to the target control object based on the array configuration information and the control instructions, and send the target instruction array composed of the target elements to the smart device so that the smart device can control the smart device based on the target instruction array;
[0034] The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
[0035] Fourthly, this application provides a control device for a smart device, comprising:
[0036] An interaction module is used to acquire user control commands for smart devices and send them to a cloud platform; wherein, the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects;
[0037] The interaction module is also used to receive a target instruction array sent by the cloud platform. The target instruction array is used to indicate the target element corresponding to the target control object. The target element is determined by the cloud platform based on the array configuration information and the control instruction. The target element includes: the identifier of the corresponding control object and the value of one or more attributes.
[0038] The determination module is used to determine the target control object based on the identifier of the control object;
[0039] The second processing module is used to control the target control object to execute operation instructions corresponding to the values of one or more attributes.
[0040] Fifthly, this application provides an electronic device, comprising: at least one processor and a memory;
[0041] The memory stores computer-executed instructions;
[0042] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method described above.
[0043] Sixthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0044] In a seventh aspect, this application provides a computer program product comprising instructions that, when executed on an electronic device, cause the electronic device to perform the method described above.
[0045] This application provides a control method, electronic device, medium, and program product for a smart device, which acquires user control commands for the smart device. The smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes. The control commands include a target control object and an operation instruction for at least one attribute of the target control object. The target control object is at least a subset of the multiple control objects. Based on array configuration information and the control commands, target elements corresponding to the target control object are determined, and the smart device is controlled according to a target instruction array composed of the target elements. The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes an identifier for the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
[0046] In the above method, the cloud platform obtains the user's control commands for the smart device and generates a target command array that can be used to control the smart device based on the control commands, thus achieving accurate control. The smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes. These control objects and attributes can be pre-set to be recognizable by both the smart device and the cloud platform. This allows the smart device to obtain the user's control commands, which include the target control object and an operation instruction for at least one attribute of the target control object. The cloud platform sets array configuration information based on the control objects. The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions. Based on the pre-set array configuration information and control commands, the target elements corresponding to the target control object are determined, and the target command array is constructed using these target elements. This allows for a flexible approach to forming the target command array for controlling the smart device. By controlling the smart device through this target command array, when modifying multiple control objects, the platform can focus more on the control object that needs modification, reducing unnecessary attribute control and data interaction, thereby improving control and interaction efficiency. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 A hardware environment diagram provided for an embodiment of this application;
[0049] Figure 2 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 1 ;
[0050] Figure 3 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 2 ;
[0051] Figure 4 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 3 ;
[0052] Figure 5 A configuration device for a smart device provided in an embodiment of the present invention. Figure 1 ;
[0053] Figure 6 A configuration device for a smart device provided in an embodiment of the present invention. Figure 2 ;
[0054] Figure 7 This is a hardware schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0057] Common data types for smart home appliances include Boolean (power on / off), enumeration (high fan, medium fan, low fan), floating point (temperature setting range 15-30 degrees), and time type (oven time in hours, minutes, and seconds).
[0058] In existing technologies, smart home appliances typically use single command issuance and group command issuance when processing data. After a single command is issued, only one parameter or device is controlled at a time, while after a group command is issued, control is performed based on multiple predefined parameters or devices. If a smart device has a large number of repetitive parameters that need to be controlled, adjusting multiple parameters is complex when using single command issuance, and even parameters that do not need to be modified are controlled when using group command issuance, resulting in redundant operations.
[0059] Taking a wine cabinet as an example, if the cabinet can store 100 bottles of wine, and each bottle has 3 attributes, then 300 attributes need to be defined, leading to configuration redundancy and difficulty in flexible adjustment. If a single command is used, only one attribute can be adjusted at a time, making the operation cumbersome. If a group command is used, multiple attributes need to be retrieved and issued simultaneously, making the operation complex. Due to the structural limitations of group commands, a fixed binary length is defined when configuring group commands; for example, defining the binary length required for 10 attributes requires information to be filled in each binary bit to form a command, but in reality, only one attribute needs to be modified, so the other 9 attributes are redundant data. In addition, the command issuance format is fixed, lacking flexibility.
[0060] Therefore, this application introduces an array-type data structure to reduce redundant configurations and improve the efficiency and flexibility of device model configuration; users can modify one or more storage location attributes without having to repeatedly carry other irrelevant data, simplifying operations.
[0061] The implementation process of a control method for an intelligent device proposed in this application is described below with reference to the accompanying drawings and specific embodiments.
[0062] Figure 1This document provides a hardware environment diagram for an embodiment of this application. According to one aspect of this application, a control method for a smart device is provided. This control method for a smart device is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and smart house ecosystems. Optionally, in this embodiment, the above method can be applied to scenarios such as... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0063] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0064] Figure 2 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 1 .like Figure 2 As shown, applied to a cloud platform, the method includes:
[0065] S201. Receive a control command sent by a smart device; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects.
[0066] In intelligent devices or software systems, a series of functional activities that can be performed by the device or system include data processing, user interaction, and device control. Data processing includes data collection, analysis, storage, and transmission. User interaction includes users interacting with the device or system via voice or other means. Device control includes temperature regulation, lighting control, security monitoring, timed device startup, and automatic software updates.
[0067] Operations in smart devices may involve a large amount of repetitive data or a large amount of non-repetitive data; this application involves a large amount of repetitive data, such as adjusting the values of multiple identical attributes; taking a wine cabinet as an example, it manages each wine storage location and its corresponding attributes (origin and status, etc.), the attribute type of each wine storage location is consistent, each wine storage location and its corresponding attribute corresponds to one piece of data, and multiple wine storage locations and their corresponding attributes correspond to multiple pieces of repetitive data.
[0068] When the smart device is a wine cabinet, the controlled object can be the wine storage location, and information such as the place of origin is the corresponding attribute of the controlled object; which attributes correspond to the wine storage location can be set by the personnel opening the wine cabinet when it leaves the factory; which attributes are specifically set can be obtained by the developers based on their work experience and user needs analysis, and can be written into the corresponding device and platform through programs; the controlled object corresponds to at least one attribute, each wine storage location usually corresponds to multiple attributes, and the attributes of each wine storage location are consistent;
[0069] In order to determine how to control the smart device, the cloud platform needs to obtain the user's control instructions from the smart device. The control instructions are also the user's control intentions, including the target control object and operation instructions on at least one attribute of the target control object. The target control object is at least some of the multiple control objects. For example, the user intends to control some of the multiple wine storage locations. The specific operation instructions are, for example, deleting all attributes of a wine storage location, which may indicate that the wine in that storage location has been taken away by the user.
[0070] When the smart device is a feeder, the controlled object can be a time period:
[0071] For example, the plurality of controllable objects are a plurality of controllable objects included in the smart device;
[0072] Alternatively, the multiple controlled objects may include multiple time periods.
[0073] Each wine storage location in the wine cabinet is a controllable object; each time period of the feeder is a different controllable object, and the amount of food fed in each time period is a corresponding attribute.
[0074] S202. Based on the array configuration information and the control instructions, determine the target element corresponding to the target control object, and send the target instruction array composed of the target elements to the smart device.
[0075] The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
[0076] With the support of the cloud platform, array configuration information can be pre-set so that after the cloud platform receives the control command, it can combine the array configuration information and the control command to determine the target element corresponding to the target control object in the array. The pre-set array configuration information can define multiple elements according to the control object settings of the smart device. Each element corresponds to a control object, and each element corresponds to a different control object. The elements include an identifier and attributes. Each element has at least one attribute and each attribute has a value.
[0077] The array configuration information also defines the value range of each attribute. For example, when the attribute is temperature, the upper and lower limits of the temperature are limited by the array configuration information; different values of the attribute represent different operation instructions, such as adjusting the temperature to a new value.
[0078] The target control object can correspond to the elements in the array configuration information to determine the target element corresponding to the target control object based on the array configuration information and control instructions. The target elements can form a target instruction array and control the smart device through the target instruction array. The data in the target instruction array corresponds to the target control object to be adjusted. The amount of data sent to the smart device is less than that of group commands, which can reduce data redundancy and improve efficiency, because group commands may send all data with the same attributes to the smart device, regardless of whether the attributes of one or more control objects need to be modified.
[0079] In this embodiment, the cloud platform acquires the user's control commands to the smart device and generates a target command array that can be used to control the smart device based on the control commands, thus achieving accurate control. The smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes. These control objects and attributes can be pre-set to be recognizable by both the smart device and the cloud platform. This allows the smart device to obtain the user's control commands, which include a target control object and an operation instruction for at least one attribute of the target control object. The cloud platform sets array configuration information based on the control objects. The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions. Based on the pre-set array configuration information and control commands, the target elements corresponding to the target control object are determined, and a target command array is constructed using these target elements. This allows for a flexible formation of a target command array for controlling the smart device. By controlling the smart device through this target command array, when modifying multiple control objects, the platform can focus more on the control object that needs modification, reducing unnecessary attribute control and data interaction, thereby improving control and interaction efficiency.
[0080] Figure 3 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 2 .like Figure 3 As shown, the method includes:
[0081] S301. Obtain multiple arrays pre-constructed according to the array configuration information. Different arrays are used to describe different sets of attributes, and each array includes multiple elements.
[0082] Developers set at least one property for the control object of the smart device. If there are multiple properties, one or more arrays can be created. If an array is created, the array includes multiple elements, each element corresponding to a different control object, and the identifier of each element covers all control objects and the properties corresponding to all control objects.
[0083] If multiple arrays are created, each array contains multiple elements, each element corresponds to a different control object, the identifier value of each element is consistent across different arrays, and the attributes of different arrays are inconsistent. That is, different arrays are used to describe different sets of attributes, and each set of attributes has at least one attribute. When there are multiple arrays, the attributes of each array can cover all the preset attributes.
[0084] Each array corresponds to multiple elements, and each element needs to select a data as a unique identifier to facilitate operations on specific control objects; for example, the number of elements in the array corresponds to the number of wine storage locations that need to be managed.
[0085] Table 1 shows the wine cabinet location status table. As shown in Table 1, when the smart device is a wine cabinet, the serial number of each wine storage location can be used as an identifier. The number of elements in the array is the same as the number of wine storage locations. The attribute set of the elements in array 1 includes the origin and temperature, and the attribute set of the elements in array 2 includes the status of the wine storage location. The serial number of the wine storage location can be used as the identifier of array 1 and array 2. The status of the wine storage location in Table 1 includes empty, stored, pending retrieval, pending placement, and invalid. For example, if the status of wine storage location 1 is empty, it means that there is no wine stored in wine storage location 1. If the wine in a certain wine storage location is reserved, then the status of the wine storage location is pending retrieval. If a wine storage location is reserved to store wine, but there is no wine in that wine storage location, then the status of the wine storage location is pending placement. If a wine storage location has a malfunction or other problems, the status value obtained may be invalid.
[0086] The attributes of the wine in each storage location in the wine cabinet include the origin, condition, and optimal storage temperature; the serial number of the storage location, the origin, and the optimal storage temperature can also be set as the data type of each element in an array, with the origin often listed by country.
[0087] Table 1. Wine Cabinet Location Status Table
[0088]
[0089] S302. From the plurality of arrays, determine the array that matches at least one attribute corresponding to the control instruction.
[0090] When multiple arrays are set, the array with the corresponding attribute of the target controlled object can be determined from among the multiple arrays according to the control command; when only one array is set, the control command, when used as a valid command, will be matched with the unique array.
[0091] S303. Based on the matching array, the control instructions, and the array definition information, determine the target element, and control the smart device according to the target instruction array formed by the target element.
[0092] The array matching the target controlled object is determined according to the control instructions. Based on the operation instructions for at least one attribute of the target controlled object and the array configuration information in the control instructions, it can be determined how to process the matching array to obtain the target element. Finally, the target element is used to construct the target data, and the smart device is controlled according to the target instruction array.
[0093] In this embodiment, an array is pre-constructed based on array configuration information. When multiple arrays are constructed, the array that matches the target control object in the control instruction is selected. This allows the target element that can constitute the target instruction array to be determined based on the matching array, control instruction, and array configuration information. This completes the array selection and lays the groundwork for reducing the amount of data in the future. Setting multiple arrays can also allow for the preliminary selection of the elements corresponding to the target control object, which is convenient for subsequent calculations.
[0094] Figure 4 A flowchart illustrating a control method for a smart device provided in this application embodiment. Figure 3 .like Figure 4 As shown, the method includes:
[0095] S401. Determine the element corresponding to the target control object from the matching array to form a new array.
[0096] Regardless of whether multiple arrays exist, the corresponding array can be matched when the control instruction is executed effectively. Since the target control object may be some of the multiple control objects, the target control object only corresponds to some elements in the array. Based on these elements, a new array can be constructed. For example, if the control instruction corresponds to modifying the origin of several wine storage locations, then based on the identifiers of those wine storage locations, the corresponding elements can be selected from the array that includes the origin. The selected elements include the identifiers of those wine storage locations and the origin.
[0097] The way to construct a new array:
[0098] For example, if the number of target control objects does not exceed the threshold, then the elements corresponding to the target control objects are taken from the matching array to construct a new array;
[0099] If the number of target control objects exceeds the threshold, the elements corresponding to non-target control objects are deleted from the matching array to obtain a new array.
[0100] For ease of calculation, if the number of target control objects does not exceed the threshold, it means that the number of target control objects is relatively small, making selection easier. In this case, the elements corresponding to the target control objects can be taken from the matching array to construct a new array. If the number of target control objects exceeds the threshold, it means that the number of target control objects is relatively large, making deletion easier. In this case, the elements corresponding to non-target control objects can be deleted from the matching array to obtain a new array.
[0101] Another way to construct a new array is to extract the identifier corresponding to the target control object and the attribute corresponding to the identifier from the matching array as a new array. In this case, the attributes contained in the elements of the new array and the elements of the matching array may be inconsistent. For example, the elements of the matching array have multiple attributes, while the target control object only corresponds to one attribute.
[0102] S402. Based on the operation instruction of at least one attribute of the target controlled object in the control command and the array configuration information, update the attribute value of the corresponding element in the new array to obtain the target element.
[0103] The control instruction has an operation instruction with at least one attribute corresponding to the target control object. Based on the operation instruction with at least one attribute and the array configuration information, the adjustment corresponding to the operation instruction can be updated to the attribute value of the corresponding element in the new array. The value required for the adjustment of the operation instruction meets the data definition and range restriction of the array configuration information. For example, if the original temperature of a wine storage location is 15℃ and the temperature is limited to the range of 10℃ to 100℃, the operation instruction for the wine storage location is modified to 12℃, and the temperature value of the target element in the new array is 12℃.
[0104] S403. Control the intelligent device according to the target instruction array composed of target elements.
[0105] Based on the target instruction array composed of target elements, the smart device can be controlled to update the attribute values. If the attribute of the target element has no value, the smart device can be controlled to delete the attribute of the target element.
[0106] One example of controlling elements in an array is as follows:
[0107] Each wine storage location is defined as an element of an array, and each element in the array contains three attributes (data types). The serial number of the wine storage location is used as the unique identifier of the element. When a user needs to adjust multiple wine storage locations, they can modify only the attributes that need to be adjusted for those multiple wine storage locations or the attributes corresponding to the elements for those multiple wine storage locations, without having to carry too much irrelevant data, thereby improving operational efficiency.
[0108] Array property control method: cmdName is used to represent the control action of the property in the array (the operation instruction obtained from the control command), including: deleteArrayItem (delete an array element), addArrayItem (add an array element), deleteArrayAllItem (delete all array elements). When the key in the command (cmdArgs) is an array property name, the value has the corresponding operation.
[0109] When cmdName is deleteArrayItem, the key in cmdArgs is the array attribute name, and the value is a string composed of the IDs of the sub-items of the group to be deleted (i.e., the element corresponding to the ID value in the new array is deleted).
[0110] When cmdName is addArrayItem, the key in cmdArgs is the array attribute name, and the value is a string consisting of the IDs of the sub-items of the group to be deleted and the attribute string.
[0111] When cmdName is deleteArrayAllItem, the key in cmdArgs is the array attribute name, and the value is ignored.
[0112] If the operation instruction is to delete all elements, then based on the attributes of the target controlled object, all corresponding attribute values will be deleted.
[0113] If the operation instruction in the operation command is not to delete all elements, then the target elements are obtained according to the attributes of the target controlled object, and the corresponding elements are deleted or added according to the target instruction array composed of the target elements. Adding can also be adjusting.
[0114] In this embodiment, arrays are used to store and match control objects. The corresponding elements are found based on the target control object to form a new array. This reduces the processing and control of repetitive attributes that do not need to be updated, thus improving control efficiency. At the same time, the way the new array is constructed can flexibly adapt to different types of control instructions and devices. Appropriate control commands are generated based on the control instructions, reducing memory redundancy.
[0115] Before using arrays to control smart devices, the cloud platform needs to complete some configurations in advance:
[0116] For example, the method also includes:
[0117] Obtain configuration information input by the user, the configuration information including the identifiers of multiple control objects corresponding to the smart device and the values corresponding to the operation instructions of each attribute;
[0118] Based on the configuration information, an array configuration information is constructed and added to the configuration file so that after obtaining control instructions, a target instruction array is generated according to the array definition information in the configuration file to control the smart device.
[0119] When developing on a cloud platform and configuring arrays, users, i.e. developers, can input control object information, including the identifiers of multiple control objects corresponding to the smart device and the values corresponding to the operation instructions of each attribute. Based on the control object information, array configuration information can be constructed. The constructed array configuration information is then added to the configuration file. After receiving control commands, the cloud platform can generate a target command array based on the array configuration information in the configuration file to control the smart device.
[0120] Understandably, the above array configuration information can be updated according to actual needs. For example, configuration information corresponding to the control object can be added to the array configuration information, or, according to actual needs, the value range corresponding to each operation instruction can be updated for at least one operation instruction corresponding to the attribute of the control object.
[0121] The control process of smart devices controlled by a cloud platform, applied to smart devices:
[0122] For example, the system obtains user control commands for a smart device and sends them to a cloud platform; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects;
[0123] The system receives a target instruction array sent by the cloud platform. The target instruction array is used to indicate the target element corresponding to the target control object. The target element is determined by the cloud platform based on the array configuration information and the control instruction. The target element includes: the identifier of the corresponding control object and the value of one or more attributes. The system determines the target control object based on the identifier of the control object. The system controls the target control object to execute the operation instruction corresponding to the value of one or more attributes.
[0124] Smart devices obtain user operation commands through an interactive interface. After configuring array configuration information in the configuration file, the operation commands input by the user need to correspond to the relevant control objects. Therefore, the interactive interface is configured according to the array configuration information. In this way, after the smart device receives the operation command, it can perform the operation in the array according to the target control object carried by the operation command.
[0125] Users interact with smart devices through an interactive interface, which can be the smart device's own interface or an application interface on a mobile terminal (such as a smartphone or tablet).
[0126] After receiving the target instruction array sent by the cloud platform, the smart device refers to the array configuration information in the configuration file and determines at least one corresponding target control object based on at least one identifier in the target instruction array. Furthermore, each identifier corresponds to at least one attribute. Referring to the array configuration information in the configuration file, the device determines the corresponding operation instruction based on the value range of each attribute, and then sends the operation instruction to the corresponding target control object so that the target control object executes the aforementioned operation instruction.
[0127] To set an array for a smart device using code, you can define the following:
[0128] The optimal wine storage temperature is named Temperature, its data type is double-precision floating-point (double), doubleStep is the operation name used to define the specific operation, the minimum value of this temperature (minValue) can be set to 20, the maximum value (maxValue) can be set to 100, unit indicates the unit of measurement, and the variable (step) is 1 (that is, the temperature can be adjusted in increments of 1).
[0129] The name of the production area is "Country", which represents the country and is a string. The name of the storage location is "id", which is an integer. "intStep" is the operation name used to define the specific operation. The minimum value of the storage location is 0, the maximum value is 127, and the variable "step" is 1 (meaning the storage location number can be adjusted in increments of 1).
[0130] Figure 5 A configuration device for a smart device provided in an embodiment of the present invention. Figure 1 ,like Figure 5 As shown, the device is applied to a cloud platform and includes: a receiving module 501 and a first processing module 502;
[0131] The receiving module 501 is used to receive control instructions sent by a smart device; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control instruction includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects.
[0132] The first processing module 502 is used to determine the target element corresponding to the target control object based on the array configuration information and the control instructions, and send the target instruction array composed of the target elements to the smart device so that the smart device can control the smart device based on the target instruction array;
[0133] The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
[0134] Figure 6 A configuration device for a smart device provided in an embodiment of the present invention. Figure 2 ,like Figure 6 As shown, the device is applied to a smart device and includes: an interaction module 601, a determination module 602, and a second processing module 603.
[0135] The interaction module 601 is used to acquire user control commands for a smart device and send them to a cloud platform; wherein, the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects.
[0136] The interaction module 601 is also used to receive a target instruction array sent by the cloud platform. The target instruction array is used to indicate the target element corresponding to the target control object. The target element is determined by the cloud platform based on the array configuration information and the control instruction. The target element includes: the identifier of the corresponding control object and the value of one or more attributes.
[0137] The determining module 602 is used to determine the target control object based on the identifier of the control object;
[0138] The second processing module 603 is used to control the target control object to execute operation instructions corresponding to the values of one or more attributes.
[0139] This application also provides an electronic device, including: at least one processor and a memory;
[0140] The memory stores computer-executed instructions;
[0141] The at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the above-described method.
[0142] Figure 7This is a hardware schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. The device 70 also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0143] In a specific implementation, at least one processor 701 executes computer execution instructions stored in the memory 702, causing at least one processor 701 to perform the above method.
[0144] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0145] In the above Figure 7 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0146] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0147] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0148] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0149] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described above.
[0150] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0151] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0152] The division of units described herein is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0153] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0154] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0155] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A control method for an intelligent device, characterized in that, Applied to cloud platforms, including: The system receives control instructions sent by a smart device; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control instructions include a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects. Based on the array configuration information and the control instructions, the target elements corresponding to the target control object are determined, and the target instruction array composed of the target elements is sent to the smart device so that the smart device can control the smart device based on the target instruction array; The array configuration information defines multiple elements, each corresponding to a different control object. Each element includes the identifier of the corresponding control object and the value of one or more attributes. The array configuration information also defines the value range of each attribute, with different values representing different operation instructions.
2. The method according to claim 1, characterized in that, Based on the array configuration information and the control instructions, the target elements corresponding to the target control object are determined, and the target instruction array composed of the target elements is sent to the smart device so that the smart device can control the smart device based on the target instruction array, including: Obtain multiple arrays pre-constructed based on the array configuration information. Different arrays are used to describe different sets of attributes, and each array includes multiple elements. From the plurality of arrays, determine an array that matches at least one attribute corresponding to the control instruction; Based on the matching array, the control instructions, and the array configuration information, a target element is determined, and the smart device is controlled according to the target instruction array formed by the target element.
3. The method according to claim 2, characterized in that, Based on the matching array, the control commands, and the array configuration information, a target element is determined, and the smart device is controlled according to the target command array formed by the target element, including: The elements corresponding to the target control object are determined from the matching array to form a new array; Based on the operation instruction of at least one attribute of the target controlled object in the control command and the array configuration information, update the value of the attribute of the corresponding element in the new array to obtain the target element; The smart device is controlled according to the target instruction array composed of the target elements.
4. The method according to claim 3, characterized in that, From the matching array, determine the element corresponding to the target control object to form a new array, including: If the number of target control objects does not exceed the threshold, then the elements corresponding to the target control objects are taken from the matching array to construct a new array; If the number of target control objects exceeds the threshold, the elements corresponding to non-target control objects are deleted from the matching array to obtain a new array.
5. The method according to claim 1, wherein The multiple controllable objects are multiple controllable objects included in the intelligent device; Alternatively, the multiple controlled objects may include multiple time periods.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain configuration information input by the user, the configuration information including the identifiers of multiple control objects and the values corresponding to the operation instructions of each attribute; Based on the configuration information, an array configuration information is constructed and added to the configuration file so that after obtaining control instructions, a target instruction array is generated according to the array configuration information in the configuration file to control the corresponding smart device.
7. A control method for an intelligent device, characterized in that, Applied to smart devices, including: The system acquires user control commands for smart devices and sends them to a cloud platform; wherein the smart device corresponds to multiple control objects, and each control object corresponds to multiple attributes; the control command includes a target control object and an operation instruction on at least one attribute of the target control object, and the target control object is at least a portion of the multiple control objects; The system receives a target instruction array sent by the cloud platform. The target instruction array is used to indicate the target element corresponding to the target control object. The target element is determined by the cloud platform based on the array configuration information and the control instruction. The target element includes: the identifier of the corresponding control object and the value of one or more attributes. The target control object is determined based on the identifier of the control object; Control the target control object to execute operation instructions corresponding to the values of one or more attributes.
8. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Clustered intelligent control method for traffic tunnel devices
CN103543697A
Intelligent household system and group control method based on the intelligent household system
CN105093942A
Control page generation method and device, intelligent equipment and storage medium
CN114327709A
Equipment control instruction processing method, storage medium and electronic device
CN117667199A
Data processing method and device, storage medium and electronic equipment
CN118283116A