CN113873436A - Electronic fence generation method, device and medium - Google Patents

Electronic fence generation method, device and medium Download PDF

Info

Publication number
CN113873436A
CN113873436A CN202111125470.7A CN202111125470A CN113873436A CN 113873436 A CN113873436 A CN 113873436A CN 202111125470 A CN202111125470 A CN 202111125470A CN 113873436 A CN113873436 A CN 113873436A
Authority
CN
China
Prior art keywords
electronic fence
coordinate point
point
coordinate
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111125470.7A
Other languages
Chinese (zh)
Inventor
丁超
舒舢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202111125470.7A priority Critical patent/CN113873436A/en
Publication of CN113873436A publication Critical patent/CN113873436A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/021Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method, a device and a medium for generating an electronic fence, wherein the method comprises the following steps: acquiring position coordinates of each household device; determining the relative position of each household device according to the position coordinates; and connecting coordinate points corresponding to the position coordinates of the household devices according to the relative positions to form an electronic fence, wherein the coordinate points corresponding to the household devices are on a boundary line of the electronic fence. The technical problem that the electronic fence is not convenient to generate is solved, and convenience of electronic fence generation is improved.

Description

Electronic fence generation method, device and medium
Technical Field
The present invention relates to the field of electronic fence technologies, and in particular, to a method, an apparatus and a computer-readable storage medium for generating an electronic fence.
Background
The current generation mode of the electronic fence mainly scans the environment by means of a Camera or a sensor of the device to obtain environment image information, determines boundary information of the fence according to the environment image information, or manually draws the electronic fence by a user after scanning. This approach requires corresponding hardware support depending on the device used. However, if the hardware of the device used is not enough to support the scanning environment, the electronic fence cannot be generated, and the convenience of generating the electronic fence is low.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a medium for generating an electronic fence, and aims to solve the technical problem that the electronic fence is low in generation convenience in the prior art.
In order to achieve the above object, an embodiment of the present invention provides a method for generating an electronic fence, where the method for generating an electronic fence includes:
acquiring position coordinates of each household device;
determining the relative position of each household device according to the position coordinates;
and connecting coordinate points corresponding to the position coordinates of the household devices according to the relative positions to form an electronic fence, wherein the coordinate points corresponding to the household devices are on a boundary line of the electronic fence.
Optionally, the step of determining the relative position of each home according to the position coordinates includes:
acquiring a mean value of the position coordinates, and determining a gravity center position point according to a coordinate point corresponding to the mean value;
according to the vector from the coordinate point corresponding to the position coordinate of each piece of home equipment to the gravity center position point;
and determining the relative position of each household device according to each vector.
Optionally, the step of determining the relative position of each piece of home equipment according to each vector includes:
determining the relative direction of adjacent vectors according to the cross product of each vector;
and determining the relative position of each household device according to the relative direction of the adjacent vectors.
Optionally, the step of connecting coordinate points corresponding to the position coordinates of the home devices according to the relative position to form the electronic fence includes:
determining a connection starting point of the electronic fence according to the relative position of each household device, and sequentially acquiring the type of each household device;
and sequentially connecting coordinate points corresponding to the household equipment according to the relative positions and types of the household equipment from the connection starting point to form the electronic fence.
Optionally, the step of sequentially connecting, starting from the connection starting point, coordinate points corresponding to the home devices according to the relative positions and types of the home devices to form the electronic fence includes:
sequentially acquiring coordinate points to be connected from the connection starting point according to the relative position;
when each coordinate point to be connected is obtained, obtaining the type of the household equipment corresponding to each coordinate point to be connected;
when the type of the household equipment corresponding to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the currently connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, taking an intersection point of a straight line formed by the household equipment corresponding to the current connected coordinate point and a straight line formed by the household equipment corresponding to the coordinate point to be connected as a boundary intersection point of the electronic fence;
and when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected to form the boundary of the electronic fence.
Optionally, after the step of obtaining the type of the home equipment corresponding to each coordinate point to be connected, the method further includes:
when the type of the household equipment corresponding to the coordinate point to be connected is a point type, acquiring the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the unconnected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the unconnected coordinate point is a point type, the coordinate point to be connected and the adjacent unconnected coordinate point form a straight line, and the intersection point of the straight line corresponding to the connected coordinate point and the straight line where the connected coordinate point is located, which is adjacent to the connected coordinate point, is the boundary intersection point of the electronic fence.
Optionally, after the step of connecting the coordinate points corresponding to the position coordinates of the home devices according to the relative position to form the electronic fence, the method further includes:
acquiring coordinates of a target object and linear equations of all edges of the electronic fence, wherein the linear equation corresponding to each edge is obtained according to coordinate information of coordinate points on the edge;
determining target values of all edges of the electronic fence according to the coordinates of the target object and each linear equation;
determining the relative position of the target object and the electronic fence according to the target value of each edge.
Optionally, after the step of determining the relative position of the target object and the electronic fence according to the target value of each edge, the method further includes:
when the relative position is that the target object is located in the electronic fence, comparing the target value with a preset threshold value;
and outputting early warning prompt information when the target value is smaller than the preset threshold value.
Optionally, after the step of determining the relative position of the target object and the electronic fence according to the target value of each edge, the method further includes:
comparing the target value of each edge with the preset conditions of the edge;
when the target value of each edge meets the preset condition of the edge, judging that the target object is positioned in the electronic fence;
when at least one of the target values of each edge does not meet the preset condition of the edge, judging that the target object is positioned outside the electronic fence;
and the preset condition corresponding to each edge is obtained by the linear equation of the edge and the coordinate information of the rest edges in the electronic fence.
In order to achieve the above object, an embodiment of the present invention further provides an electronic fence generating apparatus, where the electronic fence generating apparatus includes a memory, a processor, and an electronic fence generating program stored in the memory and executable on the processor, and the processor implements the method when executing the electronic fence generating program.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, on which a fence generation program is stored, and when the fence generation program is executed by a processor, the method is implemented.
According to the method, the device and the medium for generating the electronic fence, provided by the embodiment of the invention, the device for generating the electronic fence acquires the position coordinates of each household device; determining the relative position of each household device according to the position coordinates; and connecting the coordinate points corresponding to the position coordinates of the home devices according to the relative positions to form the electronic fence, so that the home devices in the environment are directly positioned, and the electronic fence is generated according to the position coordinates of the home devices, without using special scanning equipment to scan the surrounding environment to acquire environment image information to determine the boundary of the electronic fence so as to generate the electronic fence, and the convenience of electronic fence generation is improved.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for generating an electronic fence according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for generating an electronic fence according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for generating an electronic fence according to a second embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for generating an electronic fence according to a second embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment in which coordinate points corresponding to home devices are connected to form an electronic fence;
fig. 7 is a schematic diagram of an embodiment in which coordinate points corresponding to home devices are connected to form an electronic fence;
fig. 8 is a schematic diagram of an embodiment in which coordinate points corresponding to home devices are connected to form an electronic fence;
fig. 9 is a schematic diagram of an embodiment in which coordinate points corresponding to home devices are connected to form an electronic fence.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As an implementation manner, the generation apparatus of the electronic fence may be as shown in fig. 1.
The embodiment of the invention relates to a generation device of an electronic fence, which comprises: a processor 101, e.g. a CPU, a memory 102, a communication bus 103. Wherein a communication bus 103 is used for enabling the connection communication between these components.
The memory 102 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). As shown in fig. 1, a memory 102, which is a kind of computer storage medium, may include therein a generation program of an electronic fence; and the processor 101 may be configured to call the fence generation program stored in the memory 102, and perform the following operations:
acquiring position coordinates of each household device;
determining the relative position of each household device according to the position coordinates;
and connecting coordinate points corresponding to the position coordinates of the household devices according to the relative positions to form an electronic fence, wherein the coordinate points corresponding to the household devices are on a boundary line of the electronic fence.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
acquiring a mean value of the position coordinates, and determining a gravity center position point according to a coordinate point corresponding to the mean value;
according to the vector from the coordinate point corresponding to the position coordinate of each piece of home equipment to the gravity center position point;
and determining the relative position of each household device according to each vector.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
determining the relative direction of adjacent vectors according to the cross product of each vector;
and determining the relative position of each household device according to the relative direction of the adjacent vectors.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
determining a connection starting point of the electronic fence according to the relative position of each household device, and sequentially acquiring the type of each household device;
and sequentially connecting coordinate points corresponding to the household equipment according to the relative positions and types of the household equipment from the connection starting point to form the electronic fence.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
sequentially acquiring coordinate points to be connected from the connection starting point according to the relative position;
when each coordinate point to be connected is obtained, obtaining the type of the household equipment corresponding to each coordinate point to be connected;
when the type of the household equipment corresponding to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the currently connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, taking an intersection point of a straight line formed by the household equipment corresponding to the current connected coordinate point and a straight line formed by the household equipment corresponding to the coordinate point to be connected as a boundary intersection point of the electronic fence;
and when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected to form the boundary of the electronic fence.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
when the type of the household equipment corresponding to the coordinate point to be connected is a point type, acquiring the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected with the adjacent connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the unconnected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the unconnected coordinate point is a point type, connecting the coordinate point to be connected and the adjacent unconnected coordinate point to form a straight line, wherein the intersection point of the straight line corresponding to the adjacent connected coordinate point to be connected and the straight line where the coordinate point to be connected is located is the boundary intersection point of the electronic fence.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
acquiring coordinates of a target object and linear equations of all edges of the electronic fence, wherein the linear equation corresponding to each edge is obtained according to coordinate information of coordinate points on the edge;
determining target values of all edges of the electronic fence according to the coordinates of the target object and each linear equation;
determining the relative position of the target object and the electronic fence according to the target value of each edge. In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
when the relative position is that the target object is located in the electronic fence, comparing the target value with a preset threshold value;
and outputting early warning prompt information when the target value is smaller than the preset threshold value.
In one embodiment, the processor 101 may be configured to call the generation program of the electronic fence stored in the memory 102, and perform the following operations:
comparing the target value of each edge with the preset conditions of the edge;
when the target value of each edge meets the preset condition of the edge, judging that the target object is positioned in the electronic fence;
when at least one of the target values of each edge does not meet the preset condition of the edge, judging that the target object is positioned outside the electronic fence;
and the preset condition corresponding to each edge is obtained by the linear equation of the edge and the coordinate information of the rest edges in the electronic fence.
According to the scheme, the generating device of the electronic fence acquires the position coordinates of each household device; determining the relative position of each household device according to the position coordinates; and connecting the coordinate points corresponding to the position coordinates of the home devices according to the relative positions to form the electronic fence, so that the home devices in the environment are directly positioned, and the electronic fence is generated according to the position coordinates of the home devices, without using special scanning equipment to scan the surrounding environment to acquire environment image information to determine the boundary of the electronic fence so as to generate the electronic fence, and the convenience of electronic fence generation is improved.
Based on the hardware architecture of the air conditioner, the embodiment of the generation method of the electronic fence is provided.
Referring to fig. 2, fig. 2 is a first embodiment of the method for generating an electronic fence according to the present invention, and the method for generating an electronic fence includes the following steps:
s10, acquiring position coordinates of each household device;
it should be noted that, in this embodiment, each household device may be defaulted to be disposed close to a wall, or may be a device that forms a fence. Each household device can be a series of intelligent household, can be connected to the same hotspot network to realize communication, and can be controlled by the same application system, and the application system can be installed on a mobile terminal or a PC terminal and the like. Therefore, the position coordinates of each household device can be positioned according to a Wi-Fi hotspot, such as a triangulation method. Or positioning of each home device is realized by using methods such as bluetooth, infrared ray, ultra wide band, RFID, ZigBee, ultrasonic wave, and the like, which is not specifically limited herein. The execution subject of the electronic fence generating method, namely, the electronic fence generating device can be a mobile terminal.
S20, determining the relative position of each household device according to the position coordinates;
optionally, obtaining a mean value of the position coordinates, and determining a gravity center position point according to a coordinate point corresponding to the mean value;
according to the vector from the coordinate point corresponding to the position coordinate of each piece of home equipment to the gravity center position point;
and determining the relative position of each household device according to each vector.
Specifically, the relative direction of adjacent vectors is determined according to the cross product of each vector;
and determining the relative position of each household device according to the relative direction of the adjacent vectors.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating an embodiment of forming an electronic fence by connecting coordinate points corresponding to home devices. Wherein, A1a2, B1B1, S1, S2, S3 and S4 are coordinate points corresponding to the household devices. M point is the center of gravity position and the center of gravity position of a polygon enclosed by each household equipmentThe abscissa of the set point is the average of the abscissas of all the points, and the ordinate is the average of the ordinates of all the points. Connecting the point M and coordinate points corresponding to the household devices into a plurality of vectors such as vectors MA1, MA2, MB1, MB2, MS4, MS3, MS2 and MS1, performing cross product operation on every two vectors respectively to judge the relative direction between the vectors, for example, performing cross product operation on the vector MA2 and the vector MB1 to obtain the vector
Figure RE-GDA0003343699540000091
Then, the direction from vector MA2 to vector MB1 is clockwise, that is, coordinate B1 is clockwise of coordinate A2, and after sequentially calculating the cross products of all vectors, the relative position between the home devices can be known, for example, a clockwise coordinate set { A2B1B2S4S3S2S1a1} centered on the center of gravity M can be obtained.
And step S30, connecting coordinate points corresponding to the position coordinates of the household devices according to the relative positions to form an electronic fence, wherein the coordinate points corresponding to the household devices are on the boundary line of the electronic fence.
And sequentially connecting the coordinate points corresponding to the household devices according to the relative positions of the household devices to form an electronic fence, wherein the line segment connecting the household devices is the boundary of the electronic fence.
In the technical scheme provided by the embodiment, a generating device of the electronic fence acquires position coordinates of each household device; determining the relative position of each household device according to the position coordinates; and connecting the coordinate points corresponding to the position coordinates of the home equipment according to the relative positions to form the electronic fence, wherein the coordinate points corresponding to the home equipment are on the boundary line of the electronic fence, so that the home equipment in the environment is directly positioned, the electronic fence is generated according to the position coordinates of the home equipment, and a special scanning device is not needed to scan the surrounding environment to acquire environment image information to determine the boundary of the electronic fence so as to generate the electronic fence, so that the convenience of generating the electronic fence is improved.
Referring to fig. 3, fig. 3 is a second embodiment of the method for generating an electronic fence according to the present invention, and based on the first embodiment, the step S30 includes:
step S31, determining the connection starting point of the electronic fence according to the relative position of each household device, and sequentially acquiring the type of each household device;
it is understood that the home appliances may have a shape of a long bar such as a curtain or a large screen television, and may have a shape of a dot such as a hall lamp. Therefore, when the position coordinates of the home equipment are obtained, the home equipment cannot be simply obtained according to one coordinate point, and therefore the type of the home equipment needs to be known first, so that the position coordinates of the home equipment can be accurately obtained. For example, if the home equipment is long-strip-shaped, the position coordinates of two end points of the home equipment need to be obtained, and a line segment formed by connecting the two end points is used as the position coordinates of the long-strip-shaped home equipment. Optionally, before step S10, the method further includes: and obtaining the type of each household device.
Referring to table 1, table 1 is a classification table of each household device. The ID is identification information for distinguishing each household device, the name can be determined by a user to facilitate user identification, the type is divided into a point type and a linear type, the position identifies a room where the household device is located, the coordinate is a specific position coordinate of the household device in the room, and if the household device is a linear type household, the coordinates of two end points of the household device are obtained.
The household devices in the table are defaulted to be all close to the wall or can be used as devices for forming a fence.
Figure BDA0003278216600000091
And S32, sequentially connecting the coordinate points corresponding to the household devices according to the relative positions and types of the household devices from the connection starting point to form the electronic fence.
Optionally, sequentially obtaining coordinate points to be connected according to the relative positions from the connection starting point;
when each coordinate point to be connected is obtained, obtaining the type of the household equipment corresponding to each coordinate point to be connected;
when the type of the household equipment corresponding to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the currently connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, taking an intersection point of a straight line formed by the household equipment corresponding to the current connected coordinate point and a straight line formed by the household equipment corresponding to the coordinate point to be connected as a boundary intersection point of the electronic fence;
referring to fig. 7, fig. 7 is a schematic diagram illustrating an embodiment of forming an electronic fence by connecting coordinate points corresponding to home devices. The points A1A2 are linear household equipment, the points B1B2 are linear household equipment, and the points S1, S2, S3 and S4 are point type household equipment. The type of the household equipment corresponding to the adjacent connected coordinate point A1A2 of the coordinate point B1B2 to be connected is a linear type, the type of the household equipment corresponding to the coordinate point B1B2 to be connected is also a linear type, and when the two adjacent linear type household equipment are not on the same straight line, the intersection point B (Xb, Yb) of the straight lines corresponding to the two linear type household equipment is taken as the boundary intersection point of the electronic fence. The shape of the connected electronic fence is closer to the inner space of a room, so that the formed electronic fence is more accurate.
And when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected to form the boundary of the electronic fence.
Referring to fig. 7, when the type of the home equipment corresponding to the connected coordinate point S1 adjacent to the coordinate point A1a2 to be connected is a point type, and the type of the home equipment corresponding to the coordinate point A1a2 to be connected is a line type, the coordinate point S1 corresponding to the coordinate point type home equipment is connected to the end point A1 adjacent to the coordinate point S1 in the coordinate point A1a2 corresponding to the line type home equipment to form a boundary of an electronic fence, which is A1BCS3S2S1A1 in this embodiment.
Optionally, after the step of obtaining the type of the home equipment corresponding to each coordinate point to be connected, the method further includes:
when the type of the household equipment corresponding to the coordinate point to be connected is a point type, acquiring the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected with the adjacent connected coordinate point;
referring to fig. 7, when the type of the home equipment corresponding to the connected coordinate point S3 adjacent to the coordinate point S2 to be connected is a point type, and the type of the home equipment corresponding to the coordinate point S2 to be connected is also a point type, the coordinate point S2 to be connected is connected from the connected coordinate point S3 to form a boundary of an electronic fence.
When the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the unconnected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the unconnected coordinate point is a point type, connecting the coordinate point to be connected and the adjacent unconnected coordinate point to form a straight line, wherein the intersection point of the straight line corresponding to the adjacent connected coordinate point to be connected and the straight line where the coordinate point to be connected is located is the boundary intersection point of the electronic fence.
Referring to fig. 7, where the type of the home equipment corresponding to the connected coordinate point B1B2 adjacent to the coordinate point S4 to be connected is a linear type, the type of the home equipment corresponding to the coordinate point S4 to be connected is a point type, at this time, the type of the home equipment corresponding to the unconnected coordinate point S3 adjacent to the coordinate point S4 is obtained, when the type of the home equipment corresponding to the coordinate point S3 is a point type, the coordinate point S3 and the coordinate point S4 are connected to form a straight line, the straight line S3S4 and the B1B2 corresponding to the linear home equipment intersect at a point C (Xc, Yc), and the point C (Xc, Yc) is a boundary intersection point of an electronic fence.
Optionally, if the coordinate point to be connected is on a straight line corresponding to the connected coordinate point, connecting the coordinate point to be connected to form a boundary of the electronic fence. Referring to fig. 8, fig. 8 is a schematic diagram illustrating an embodiment of forming an electronic fence by connecting coordinate points corresponding to home devices. When the coordinate point S4 to be connected is on the straight line corresponding to the connected coordinate point B1B2, the coordinate point S4 is connected, the BS4 is the boundary of the electronic fence, and the electronic fence formed in this embodiment is A1BS4S3S2S1 A1.
Optionally, when the type of the household equipment corresponding to the coordinate point after the coordinate point to be connected is a linear type, the coordinate point to be connected is connected.
Optionally, in an embodiment, referring to fig. 6, coordinate points corresponding to all home devices are sequentially acquired, and the coordinate points are sequentially connected to form an electronic fence A1A2B1B2S4S3S2S1A1, where each coordinate point is a boundary intersection of the electronic fence.
In the technical scheme provided by this embodiment, the generation device of the electronic fence determines a connection starting point of the electronic fence according to the relative position of each household device, and sequentially obtains the type of each household device; and sequentially connecting coordinate points corresponding to the household devices according to the relative positions and types of the household devices from the connection starting point to form the electronic fence. The shape of the connected electronic fence is closer to the inner space of the room, so that the formed electronic fence is more accurate.
Referring to fig. 4, fig. 4 is a third embodiment of the method for generating an electronic fence according to the present invention, and based on the first or second embodiment, after step S30, the method further includes:
step S40, coordinates of the target object and linear equations of each edge of the electronic fence are obtained, and the linear equation corresponding to each edge is obtained according to coordinate information of coordinate points on the edge;
referring to fig. 9, fig. 9 is a schematic diagram illustrating an embodiment of forming an electronic fence by connecting coordinate points corresponding to home devices. Where AB, BC, CD, DA are the range of the electronic fence automatically formed by the home equipment, which is not necessarily a regular shape, where the point Q (Xq, Yq) is the location point of the target object, which may be the object used by the user or the sweeping robot for corresponding control through the electronic fence. The coordinates of the point Q (Xq, Yq) may be obtained according to a Wi-Fi hotspot location connected to the home device, which is not specifically limited herein.
Optionally, the equation of the AB line is: k is a radical ofABx+bAB-y=0;
The equation for the line BC is: k is a radical ofBCx+bBC-y=0;
The equation for the CD line is: k is a radical ofCDx+bCD-y=0;
The equation for the AD line is: k is a radical ofADx+bAD-y=0。
Step S50, determining the target value of each side of the electronic fence according to the coordinates of the target object and each linear equation;
the target value is the target value R of each edge of the electronic fence calculated by substituting the point Q into each linear equationAB,RBC,RCD,RADWherein, in the step (A),
kABXm+bAB-Ym=RAB
kBCXm+bBC-Ym=RBC
kCDXm+bCD-Ym=RCD
kADXm+bAD-Ym=RAD
step S60, determining the relative position of the target object and the electronic fence according to the target value of each edge.
Alternatively, referring to fig. 5, fig. 5 is a fourth embodiment of the method for generating an electronic fence according to the present invention, where, based on the first, second or third embodiment, the step S60 includes:
and S61, comparing the target value of each edge with the preset condition of the edge, wherein the preset condition corresponding to each edge is obtained by the linear equation of the edge and the coordinate information of the rest edges in the electronic fence.
In particular, taking the straight line AB as an example,the coordinate of the point C (or the point D) is taken to be substituted into an equation of the line AB to obtain kABXc+bAB-Yc>0. The result, illustrating that points in the fence ABCD are greater than 0 when put into the equation of the straight line AB. Therefore, when the target object is in the electronic fence, the result obtained by substituting the coordinate point Q (Xq, Yq) corresponding to the target object into the straight line AB equation is also greater than 0. When the point Q is in the inside of the electronic fence ABCD, the coordinate of the point Q is substituted into a target value R calculated by each straight line equationAB,RBC,RCD,RADThe preset conditions are as follows:
kABXm+bAB-Ym=RABand R isAB>0;
kBCXm+bBC-Ym=RBCAnd R isBC>0;
kCDXm+bCD-Ym=RCDAnd R isBC<0;
kADXm+bAD-Ym=RADAnd R isAD>0。
Step S62, when the target value of each edge meets the preset condition of the edge, judging that the target object is positioned in the electronic fence;
and when the target value obtained by substituting the target object into each linear equation meets a preset condition, judging that the target object is in the electronic fence.
Alternatively,
when the relative position is that the target object is located in the electronic fence, comparing the target value with a preset threshold value;
and outputting early warning prompt information when the target value is smaller than the preset threshold value.
The closer the target value is to zero, the closer the target object is to the boundary of the electronic fence ABCD, so a preset threshold value can be set, and when the target value is smaller than the preset threshold value, the too close distance of the target object from at least one side of the electronic fence is represented, so that early warning prompt information is output. For example, a preset threshold is set to be 10 cm, when at least one of target values obtained by substituting coordinates of a target object into a linear equation corresponding to each edge of the electronic fence is smaller than 10 cm, it is indicated that the distance between the target object and at least one edge of the electronic fence is smaller than 10 cm, and at this time, early warning prompt information can be output.
The prompt message can be output and displayed by a generating device of the electronic fence, such as a mobile terminal, or can be sent to the target object for display by the generating device of the electronic fence.
And step S63, when at least one of the target values of each edge does not meet the preset condition of the edge, judging that the target object is positioned outside the electronic fence.
When any one of the target values obtained by substituting the target object into each linear equation does not meet the preset condition, the coordinate Q point corresponding to the target object is not in the electronic fence, and an alarm prompt can be output at the moment.
The prompt message can be output and displayed by a generating device of the electronic fence, such as a mobile terminal, or can be sent to the target object for display by the generating device of the electronic fence.
In the technical scheme provided by this embodiment, a device for generating an electronic fence obtains coordinates of a target object and linear equations of each edge of the electronic fence, and the linear equation corresponding to each edge is obtained according to coordinate information of coordinate points on the edge; determining target values of all edges of the electronic fence according to the coordinates of the target object and each linear equation; determining the relative position of the target object and the electronic fence according to the target value of each edge. When the target values meet the preset conditions of the edges, the target object is judged to be located in the electronic fence, and therefore whether the target object is in the electronic fence or not can be obtained by bringing the position coordinates of the target object into the preset formula and comparing the result with the preset conditions, and convenience in judging whether the target object is in the electronic fence or not is improved. And when the target value is smaller than a preset threshold value, outputting early warning prompt information. Therefore, the early warning information is output when the target object is about to reach the boundary of the electronic fence, so that a user can know the running track of the target object in time conveniently, and the early warning effect of the electronic fence generating device is improved.
The embodiment of the present invention further provides an electronic fence generating apparatus, where the electronic fence generating apparatus includes a memory, a processor, and an electronic fence generating program stored in the memory and executable on the processor, and the processor implements the method when executing the electronic fence generating program.
An embodiment of the present invention further provides a computer-readable storage medium, on which a generation program of an electronic fence is stored, and when executed by a processor, the generation program of the electronic fence implements the method as described above.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is intended to include such modifications and variations.

Claims (11)

1. A method for generating an electronic fence, the method comprising:
acquiring position coordinates of each household device;
determining the relative position of each household device according to the position coordinates;
and connecting coordinate points corresponding to the position coordinates of the household devices according to the relative positions to form an electronic fence, wherein the coordinate points corresponding to the household devices are on a boundary line of the electronic fence.
2. The method for generating an electronic fence according to claim 1, wherein the step of determining the relative position of each home according to the position coordinates comprises:
acquiring a mean value of the position coordinates, and determining a gravity center position point according to a coordinate point corresponding to the mean value;
according to the vector from the coordinate point corresponding to the position coordinate of each household device to the gravity center position point;
and determining the relative position of each household device according to each vector.
3. The method for generating an electronic fence according to claim 2, wherein the step of determining the relative position of each household device according to each vector comprises:
determining the relative direction of adjacent vectors according to the cross product of each vector;
and determining the relative position of each household device according to the relative direction of the adjacent vectors.
4. The method for generating an electronic fence according to claim 1, wherein the step of connecting coordinate points corresponding to the position coordinates of the respective home devices according to the relative positions to form the electronic fence comprises:
determining a connection starting point of the electronic fence according to the relative position of each household device, and sequentially acquiring the type of each household device;
and sequentially connecting coordinate points corresponding to the household equipment according to the relative positions and types of the household equipment from the connection starting point to form the electronic fence.
5. The method for generating an electronic fence according to claim 4, wherein the step of sequentially connecting the coordinate points corresponding to the home devices according to the relative positions and types of the home devices from the connection starting point to form the electronic fence comprises:
sequentially acquiring coordinate points to be connected from the connection starting point according to the relative position;
when each coordinate point to be connected is obtained, obtaining the type of the household equipment corresponding to each coordinate point to be connected;
when the type of the household equipment corresponding to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the currently connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, taking an intersection point of a straight line formed by the household equipment corresponding to the current connected coordinate point and a straight line formed by the household equipment corresponding to the coordinate point to be connected as a boundary intersection point of the electronic fence;
and when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected to form the boundary of the electronic fence.
6. The method for generating an electronic fence according to claim 5, wherein after the step of obtaining the type of the home equipment corresponding to each coordinate point to be connected, the method further comprises:
when the type of the household equipment corresponding to the coordinate point to be connected is a point type, acquiring the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is point type, connecting the coordinate point to be connected with the adjacent connected coordinate point;
when the type of the household equipment corresponding to the connected coordinate point adjacent to the coordinate point to be connected is a linear type, acquiring the type of the household equipment corresponding to the unconnected coordinate point adjacent to the coordinate point to be connected;
when the type of the household equipment corresponding to the unconnected coordinate point is a point type, the to-be-connected coordinate point and the adjacent unconnected coordinate point are connected to form a straight line, and the intersection point of the to-be-connected coordinate point and the straight line corresponding to the connected coordinate point is the boundary intersection point of the electronic fence.
7. The method for generating an electronic fence according to claim 1, wherein after the step of connecting coordinate points corresponding to the position coordinates of the respective home devices according to the relative positions to form the electronic fence, the method further comprises:
acquiring coordinates of a target object and linear equations of all edges of the electronic fence, wherein the linear equation corresponding to each edge is obtained according to coordinate information of coordinate points on the edge;
determining target values of all edges of the electronic fence according to the coordinates of the target object and each linear equation;
determining the relative position of the target object and the electronic fence according to the target value of each edge.
8. The method of generating an electronic fence according to claim 7, wherein said step of determining the relative position of the target object to the electronic fence based on the target value of each edge is followed by the steps of:
when the relative position is that the target object is located in the electronic fence, comparing the target value with a preset threshold value;
and outputting early warning prompt information when the target value is smaller than the preset threshold value.
9. The method of generating an electronic fence according to claim 7, wherein the step of determining the relative position of the target object to the electronic fence according to the target value of each edge comprises:
comparing the target value of each edge with the preset conditions of the edge;
when the target value of each edge meets the preset condition of the edge, judging that the target object is positioned in the electronic fence;
when at least one of the target values of each edge does not meet the preset condition of the edge, judging that the target object is positioned outside the electronic fence;
and the preset condition corresponding to each edge is obtained by the linear equation of the edge and the coordinate information of the rest edges in the electronic fence.
10. An electronic fence generation apparatus, comprising a memory, a processor and an electronic fence generation program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 9 when executing the electronic fence generation program.
11. A computer-readable storage medium, on which a fence generation program is stored, the fence generation program implementing the method of any one of claims 1 to 9 when executed by a processor.
CN202111125470.7A 2021-09-24 2021-09-24 Electronic fence generation method, device and medium Pending CN113873436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111125470.7A CN113873436A (en) 2021-09-24 2021-09-24 Electronic fence generation method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111125470.7A CN113873436A (en) 2021-09-24 2021-09-24 Electronic fence generation method, device and medium

Publications (1)

Publication Number Publication Date
CN113873436A true CN113873436A (en) 2021-12-31

Family

ID=78994253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111125470.7A Pending CN113873436A (en) 2021-09-24 2021-09-24 Electronic fence generation method, device and medium

Country Status (1)

Country Link
CN (1) CN113873436A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106840139A (en) * 2016-12-29 2017-06-13 深圳众思科技有限公司 The acquisition methods of fence, device and terminal
CN106932805A (en) * 2017-01-20 2017-07-07 广东侨兴宇航科技有限公司 It is a kind of to be suitable to the swift electron fence method of mobile device application
CN109819403A (en) * 2019-01-28 2019-05-28 北京摩拜科技有限公司 Generate the method, apparatus and electronic equipment of fence
CN112087708A (en) * 2020-08-14 2020-12-15 江苏省电力试验研究院有限公司 Layout method and layout device of electronic fence and storage medium
WO2021103628A1 (en) * 2019-11-27 2021-06-03 苏宁云计算有限公司 Method and apparatus for deleting fence points on electronic fence, and computer device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106840139A (en) * 2016-12-29 2017-06-13 深圳众思科技有限公司 The acquisition methods of fence, device and terminal
CN106932805A (en) * 2017-01-20 2017-07-07 广东侨兴宇航科技有限公司 It is a kind of to be suitable to the swift electron fence method of mobile device application
CN109819403A (en) * 2019-01-28 2019-05-28 北京摩拜科技有限公司 Generate the method, apparatus and electronic equipment of fence
WO2021103628A1 (en) * 2019-11-27 2021-06-03 苏宁云计算有限公司 Method and apparatus for deleting fence points on electronic fence, and computer device
CN112087708A (en) * 2020-08-14 2020-12-15 江苏省电力试验研究院有限公司 Layout method and layout device of electronic fence and storage medium

Similar Documents

Publication Publication Date Title
CN111104341B (en) Automatic testing method, device, equipment and storage medium for intelligent household equipment
US20170263050A1 (en) Automatic three-dimensional solid modeling method and program based on two-dimensional drawing
CN110686648A (en) Method, device and equipment for generating house type graph based on image detection and storage medium
JP6904683B2 (en) Systems and methods that utilize machine-readable code for testing communication networks
CN106455049B (en) Positioning method and device based on wireless local area network
US11499732B2 (en) Method, device and system for wireless networking of air conditioning unit
CN104735348A (en) Double-camera photographing method and system
CN108199935B (en) Distribution network code display method, terminal, server and computer readable storage medium
CN107831467B (en) Node positioning method, server, system and computer readable storage medium
CN113873436A (en) Electronic fence generation method, device and medium
CN110673493A (en) Home equipment linkage control method and device, home controller and storage medium
CN111489762A (en) Three-dimensional spectrogram generation method and device, terminal and storage medium
WO2024125041A1 (en) Sensing range calibration method and apparatus, and ceiling electric appliance, device and storage medium
US10270548B2 (en) Target operation device communicating system, mobile terminal, and target operation device communication cooperating method
JP2015231128A (en) Adjusting terminal, adjusting method, and computer program
CN109523481B (en) Method and device for correcting projector image distortion and computer readable storage medium
CN107241628B (en) Configuration synchronization method of television equipment, television equipment and storage medium
CN115633302A (en) Equipment deployment method and device, storage medium and electronic equipment
CN104200817A (en) Speech control method and system
CN111696198A (en) Recommendation method for equipment installation position, computer equipment and storage medium
CN106792765A (en) Wi-Fi signal strength processing method, processing device and server
CN112533187A (en) Network access method, equipment, storage medium and device of Bluetooth low energy consumption equipment
CN110278291B (en) Wireless device naming method, storage medium and system
CN112283892A (en) Visualization method for temperature of air conditioner, air conditioner and storage medium
CN112533161B (en) Internet of things control method and device based on indoor positioning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination