Automatic batch control method based on interconnection of automobile position and smart homeTechnical Field
The invention relates to an automatic batch control method for smart home, in particular to an automatic batch control method based on interconnection of automobile positions and smart home.
Background
Along with the development of technologies such as artificial intelligence, thing networking, the house that the user possessed is also more intelligent, generally with after being connected to the internet with alright with in order to look over and control house equipment through cell-phone APP long-rangely, can postpone or in advance through the intelligent house stop of cell-phone APP control house or begin work when the user drives the vehicle and leaves or return to the house. However, with the increasing variety and number of home devices, the time required for the user to control the home devices one by one through the mobile phone APP is more and more, and in the face of numerous home devices, errors and missed operations can occur.
Meanwhile, due to the continuous development of the automobile internet of vehicles technology, more and more household automobiles start to carry the automobile internet of vehicles service, and the current position information of the automobiles can be reported to the cloud end in real time after the automobiles have the automobile internet of vehicles service. Therefore, it is particularly necessary to provide an automatic batch control method based on the interconnection of the automobile position and the smart home.
Disclosure of Invention
The invention aims to provide an automatic batch control method based on interconnection of an automobile position and an intelligent home, which can automatically control the intelligent home equipment to be closed or opened in batch through the change of the automobile position.
The invention relates to an automatic batch control method based on interconnection of automobile positions and smart homes, which comprises the following steps of:
(1) product registration
Registering the automobile as a product on the intelligent home platform, and defining the name and control attribute information of the product;
(2) vehicle binding
Binding the vehicle to the product registered by the intelligent home platform in the step (1) through the vehicle APP to become the next specific device of the product;
(3) scene setting
Setting a scene in the smart home APP, and triggering the sequential execution of one or more control commands of one or more smart home devices when a certain control attribute of the bound device in the step (2) is changed;
(4) region and action setting
Setting an area in a map function provided by a vehicle APP, and setting a control attribute which triggers the vehicle to change in the step (3) after the vehicle enters or leaves the set area;
(5) vehicle position reporting
After the vehicle carries the vehicle network service, reporting the current position information of the vehicle to a vehicle network cloud platform through a wireless network at a fixed frequency, wherein the current position information comprises longitude and latitude;
(6) batch control
After receiving the position data of the vehicle, the Internet of vehicles cloud platform judges whether the current behavior of the vehicle enters the region from the outside of the region set in the step (4) through longitude and latitude;
if yes, triggering the action of entering the area set in the step (4), modifying the attribute value corresponding to the intelligent home platform, and sequentially executing the set control command by the intelligent home platform according to the household appliance list in the scene setting;
if not, judging whether the current behavior of the vehicle is leaving the area, if so, triggering the action of leaving the area set in the step (4), modifying the attribute value corresponding to the intelligent home platform, and sequentially executing the set control command by the intelligent home platform according to the home appliance list in the scene setting.
Further, after the name and the control attribute information of the product are defined, the product information is stored in the intelligent home cloud platform, and the unique identification P _ ID of the product can be automatically generated after the product information is successfully stored.
Further, after the vehicle binding is finished, the Internet of vehicles cloud platform judges whether the vehicle is bound to the intelligent home platform according to the unique identifier CAR _ ID of the vehicle, and if so, prompts a user that the vehicle is bound; if not, the CAR _ ID, the P _ ID and the DEVICE name information are transmitted to finish the binding operation by calling a binding DEVICE API provided by the intelligent home cloud platform, the unique identification DEVICE _ ID of the current vehicle in the intelligent home platform is returned through the API after the intelligent home cloud platform is successfully bound, and the CAR networking cloud platform stores the corresponding relation between the CAR _ ID and the DEVICE _ ID in a database.
Further, after receiving the position information reported by the vehicle, executing the following steps:
judging whether the vehicle is bound to the intelligent home platform or not through the vehicle identification CAR _ ID, wherein the judgment is based on whether a relation record between CAR _ ID and DEVICE _ ID exists or not in a database; if not, ending;
if the relation record of CAR _ ID and DEVICE _ ID exists, judging whether the vehicle has the region setting information, if not, ending;
if the vehicle exists in the area setting information, judging whether the vehicle enters the area from the outside or leaves the area;
if the vehicle enters the area from the outside, executing an area entering action, and calling an API (application program interface) of the intelligent home cloud platform, wherein input parameters of the API comprise DEVICE _ ID, an attribute name K and an attribute value V; the attribute name K and the attribute value V are values saved in the region setting step;
if the vehicle leaves the area, executing an area leaving action, and calling an API (application program interface) of the intelligent home cloud platform;
after receiving the API call request, the smart home cloud platform finds out corresponding DEVICE information through the DEVICE _ ID to judge whether the value of the attribute name K of the DEVICE is consistent with the input attribute value V or not, if so, the smart home cloud platform directly returns a control result, and if not, the smart home cloud platform sequentially sends configured control commands to other smart home DEVICEs in the configuration according to the setting information of the scene; thereby achieving the effect of batch control.
Further, the method for judging that the vehicle enters the area from the outside of the area comprises the following steps:
(a) calculating a straight-line distance D between the current position of the vehicle and the central point P of the area, if the D is smaller than the set area radius R, indicating that the current position of the vehicle is located in the area, indicating that the condition (a) is met, otherwise, not meeting the condition (a);
(b) judging whether the position point reported last time by the vehicle is outside the area, if so, indicating that the condition (b) is satisfied, otherwise, not satisfying the condition (b);
when the condition (a) and the condition (b) are satisfied simultaneously, it indicates that the vehicle enters the region from outside the region.
Further, the method for judging that the vehicle leaves the area comprises the following steps:
(c) calculating a straight-line distance D between the current position of the vehicle and the central point P of the area, if D is larger than the set area radius R, indicating that the current position of the vehicle is outside the area, indicating that the condition (c) is met, otherwise, not meeting the condition (c);
(d) judging whether the position point reported last time by the vehicle is in the area, if so, indicating that the condition (d) is satisfied, otherwise, not satisfying the condition (d);
when the condition (c) and the condition (d) are simultaneously satisfied, it indicates that the vehicle leaves the area.
The invention has the following advantages: the intelligent household control system has the advantages that an automobile is used as intelligent equipment to be connected into an intelligent household platform, other intelligent household equipment is controlled in batch when a certain attribute value of the automobile equipment changes by setting a scene, meanwhile, an area is set in advance, and after the position of the automobile enters or leaves the set area, the change of the attribute value of the automobile equipment in the intelligent household platform is triggered, so that the automatic batch control of other intelligent household equipment is completed. The user sets up through simple several steps alright realize driving when leaving from the house self-closing electric light in the house, TV, humidifier, opens functions such as robot of sweeping the floor, need not to pass through intelligent house APP one by one operation driving on the way, has greatly promoted user's use and has experienced, has avoided the danger that the operation brought of user's temporary stopping, is the intelligent house linkage with the vehicle simultaneously, has expanded car networking use field, has increased the selling point of vehicle.
Drawings
FIG. 1 is a general logic flow diagram of the present invention;
FIG. 2 is a flow diagram of the product registration sub-logic;
FIG. 3 is a vehicle binding sub-logic flow diagram;
FIG. 4 is a scenario set sub-logic flow diagram;
FIG. 5 is a flow chart of region and action setting sub-logic;
FIG. 6 is a flow chart of the vehicle position reporting sub-logic;
FIG. 7 is a flow diagram of the automatic batch control sub-logic.
Detailed Description
The invention will be further explained with reference to the drawings.
In this embodiment, relate to vehicle, intelligent house equipment, car networking cloud platform and intelligent house cloud platform, vehicle APP, intelligent house APP. As shown in fig. 1, an automatic batch control method based on interconnection of automobile positions and smart homes is cooperatively completed through steps of product registration, vehicle binding, scene setting, region and action setting, vehicle position reporting and automatic batch control.
(1) Product registration
As shown in fig. 2, logging in to the intelligent home cloud platform, registering an automobile as an intelligent product, and defining information such as a product name and control attributes; at least one control attribute is set, and the attribute names of a plurality of control attributes cannot be the same; and after the product information is filled in, the product information is stored in the intelligent home cloud platform, and the unique identifier (P _ ID) of the product is automatically generated after the product information is successfully stored. For example: the product name is set to be XX brand automobile, and the control attributes are set to be 2, wherein the first attribute name is K1, and the second attribute name is K2.
(2) Vehicle binding
As shown in fig. 3, after a user logs in and enters a vehicle APP, the user operates to bind the vehicle to an intelligent home platform, the CAR networking cloud platform judges whether the vehicle is bound to the intelligent home platform according to a unique identifier (CAR _ ID) of the operated vehicle, if so, the user is prompted to be bound, if not, the binding operation is completed by calling a binding DEVICE API interface provided by the intelligent home cloud platform, the CAR _ ID, the P _ ID, the DEVICE name and other information is transmitted, the binding operation is completed by the intelligent home cloud platform after the binding is successful, the unique identifier (DEVICE _ ID) of the current vehicle in the intelligent home platform is returned through the API interface, and the CAR networking cloud platform stores the corresponding relationship between the CAR _ ID and the DEVICE _ ID in a database.
(3) Scene setting
Through the vehicle binding operation, the user binds the vehicle as an intelligent device to a set product, and can check the bound device information after logging in the intelligent home APP. As shown in fig. 4, a scene is newly created through a scene function provided by an intelligent home APP, a previously bound vehicle device is selected as a trigger device of the scene, a condition of configuration triggering is that a value of a device attribute name K is equal to V, the attribute name K is any one of those filled in during product registration, and for convenience of implementation, the value V of the attribute name K is only 0 or 1; then, one or more other intelligent household devices are selected to configure the action to be executed; and finally, storing the scene information to the intelligent home cloud platform. For example: when the attribute value K1=1 of the vehicular apparatus is configured, the following actions are performed in order:
turning on the desk lamp
Open humidifier
Opening curtain
Close robot of sweeping floor
………
(4) Region and action setting
As shown in fig. 5, after logging in the vehicle APP, a circle with a radius R (R > 0) is set as an area on a map with a certain point P as a center point by an area setting function in the vehicle APP, and an attribute name K and an attribute value V to be changed to enter or leave the set area are configured, and the attribute name K and the attribute value V need to be consistent with those configured in the scene setting step. And finally, storing the configuration information to the Internet of vehicles cloud platform.
(5) Vehicle position reporting
As shown in fig. 6, after the vehicle detects that the position information changes, the current position P1 is reported to the internet-of-vehicle cloud platform, the uploaded position information needs to include longitude, latitude and the like, and the internet-of-vehicle cloud platform stores and transmits the position information of the vehicle to the computing program.
(6) Automatic batch control
As shown in fig. 7, after receiving the location information P1 reported by the vehicle, the computing program executes the following steps:
judging whether the vehicle is bound to the intelligent home platform or not through the vehicle identification CAR _ ID, wherein the judgment is based on whether a relation record between CAR _ ID and DEVICE _ ID exists or not in a database; if not, the calculation is ended.
And judging whether the vehicle has the area setting information or not, and if not, finishing the calculation.
Whether the vehicle enters the area from the outside of the area is judged, and 2 conditions (a condition (a) and a condition (b)) are judged, and the 2 conditions are required to be simultaneously met.
Wherein:
condition (a): calculating a straight-line distance D between the current position P1 of the vehicle and the central point P of the area, and if D is smaller than the set area radius R, indicating that the current position of the vehicle is in the area, and the condition (a) is met;
condition (b): and (3) judging whether the position point reported last time by the vehicle is out of the area, wherein the calculation method is similar to the condition 1, and when the last position point is out of the area, the condition (b) is met.
And if the condition (a) and the condition (b) are simultaneously met, executing a region entering action, and calling an API (application program interface) of the smart home cloud platform, wherein input parameters of the API comprise DEVICE _ ID, an attribute name K and an attribute value V. The attribute name K and the attribute value V are values saved in the area setting step.
Whether the vehicle leaves the area is judged, and 2 conditions (the condition (c) and the condition (d)) are judged, and the 2 conditions are required to be simultaneously met.
Wherein:
condition (c): and (3) calculating a straight-line distance D between the current position P1 of the vehicle and the central point P of the area, and if D is larger than the set area radius R, indicating that the current position of the vehicle is outside the area, and satisfying the condition (c).
Condition (d): and (4) judging whether the position point reported last time by the vehicle is in the area, wherein the calculation method is similar to the condition (c), and the condition (d) is met when the last position point is in the area.
And if the condition (c) and the condition (d) are simultaneously met, executing an action of leaving the area, and calling an API (application program interface) of the smart home cloud platform, wherein input parameters of the API comprise DEVICE _ ID, an attribute name K and an attribute value V. The attribute name K and the attribute value V are values saved in the area setting step.
After receiving the API call request, the smart home cloud platform finds corresponding DEVICE information through the DEVICE _ ID to judge whether the value of the attribute name K of the DEVICE is consistent with the input attribute value V or not, and if so, directly returns a control result; if the scene information is inconsistent with the scene information, the configuration control commands are sequentially sent to other intelligent household equipment in the configuration according to the setting information of the scene; thereby achieving the effect of batch control.