Floor discrimination method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of fire safety, in particular to a floor distinguishing method and device, electronic equipment and a storage medium.
Background
When a fire disaster occurs in a high-rise building, due to the fact that various pipeline lines are staggered, smoke of the fire disaster can spread rapidly to cause that the visual field of a fireman is limited when the fireman participates in rescue, once the fireman is trapped in a predicament, the rescue position is not clear, rescue work is delayed, and the life of the fireman is threatened, and therefore an algorithm capable of positioning the fireman in the middle of a floor is urgently needed. The existing indoor positioning technology mainly builds a network topology structure indoors, finds a network node closest to the position of a person according to the position of the person, and the position of the node is equivalent to the position of the person. The network space positioning technology needs to arrange a large number of network nodes indoors in advance, is high in cost and easy to be influenced by the environment, and when a fire disaster happens, the network nodes are easily damaged by the temperature generated by flame, so that rescue work is influenced.
Disclosure of Invention
The invention aims to provide a floor judging method, a floor judging device, electronic equipment and a storage medium. According to the floor judging method, the accurate judgment of the floor where the floor is located can be completed only by the inertial navigator and the barometer, and the floor judging method is simple in structure and convenient to carry.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a floor discrimination method comprises the following steps:
receiving track data of an inertial navigator and altitude data of a barometer, wherein the inertial navigator and the barometer are located at the same position;
replacing the vertical coordinate in the track data with the altitude data, and defining the replaced track data as a running track graph;
acquiring an inflection point of a floor according to the running track diagram;
and determining the position of the target floor according to the initial floor and the number of the inflection points.
Further, the inertial navigator and the barometer are both located on the body of the firefighter.
Further, the obtaining of the inflection point of the floor according to the operation trajectory diagram includes:
when the running trends of the running track graphs before and after a certain position are opposite, the certain position is an inflection point.
Further, the obtaining of the inflection point of the floor according to the operation trajectory diagram includes:
when the running trends of the running track graphs before and after a certain position are opposite, the certain position is marked as a suspected inflection point:
confirming the suspected inflection point: when the distance between the target suspected inflection point and the adjacent suspected inflection point is not less than the threshold value, the target suspected inflection point is the inflection point.
Further, the distance between the target suspected inflection point and the adjacent suspected inflection point is an absolute value of a difference between the altitude data corresponding to the target suspected inflection point and the altitude data corresponding to the adjacent suspected inflection point in the moving trajectory graph.
Further, the threshold is H/(n +1) -0.5m, wherein H is the height difference between adjacent floors, and n is the number of inflection points between adjacent floors.
Further, determining the position of the target floor according to the initial floor and the number of inflection points includes:
determining the floor number of an initial floor and the altitude data of the initial floor and a target floor according to the operation trajectory diagram;
confirming the position relation between the initial floor and the target floor according to the size between the altitude data of the initial floor and the altitude data of the target floor;
acquiring the quantity of inflection points between an initial floor and a target floor according to the operation trajectory diagram;
and determining the floor number of the target floor according to the floor number of the initial floor, the position relation between the initial floor and the target floor and the inflection point number.
A floor discrimination apparatus, comprising:
the receiving module is used for receiving track data of an inertial navigator and altitude data of a barometer, and the inertial navigator and the barometer are located at the same position;
the replacing module is used for replacing the vertical coordinate in the track data with the altitude data and defining the replaced track data as a running track graph;
the acquisition module is used for acquiring inflection points of floors according to the running track graph;
and the determining module is used for determining the position of the target floor according to the initial floor and the quantity of the inflection points.
An electronic device comprising a processor, a storage medium, and a computer program, the computer program being stored in the storage medium, the computer program, when executed by the processor, implementing the above-described floor determination method.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned floor determination method.
Compared with the prior art, the floor distinguishing method, the floor distinguishing device, the electronic equipment and the storage medium have the following technical effects:
1. the network nodes are not laid in advance in a target building and are not influenced by the external environment, and the fire fighters can judge the floors where the fire fighters are located only by carrying the inertial navigator and the barometer (particularly, the fire is unpredictable, and the algorithm provided by the equipment carried by the fire fighters has stronger adaptability and is not influenced by external conditions).
2. Simple structure, portable can extensively be applicable to current fire rescue work. The inertial navigator that the fire fighter carried is the rectangle cube, and the size is only cell-phone lithium cell size, can not cause any extra burden to the fire fighter in the middle of imbedding into the special shoe-pad that designs.
3. Has better stability. Under the condition of fire, the network equipment powered by an external power supply in the prior art is easy to lose power and cannot transmit signals, and the hardware equipment used by the invention is special fire-fighting equipment and is not easy to be influenced by the external temperature environment.
Drawings
Fig. 1 is a flowchart of a floor determination method according to a first embodiment of the present invention;
FIG. 2 is an effect diagram of a travel track diagram;
FIG. 3 is a graph of a polyline trajectory in a floor;
fig. 4 is a block diagram of a floor determination device according to a second embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
A detailed description of a floor determination method, an apparatus, an electronic device, and a storage medium according to the present invention will be provided with reference to the accompanying drawings to explain and illustrate the scope of the present invention.
Example one
Referring to fig. 1, a method for determining a floor includes the following steps:
110. receiving trajectory data of an inertial navigator and altitude data of a barometer, the inertial navigator and the barometer being located at a same position.
The trajectory data output by the inertial navigator is a point set formed by X, Y, Z coordinates, and the barometer can output the altitude data of a certain point, namely the ordinate data. The inertial navigator and the barometer are located at the same position, which means that the inertial navigator and the barometer are located on the same firefighter. The inertia navigator all adopts fire control professional equipment with the barometer, and these equipment are difficult for receiving the influence of ambient temperature environment, and are small moreover, can hand-carry by the fire fighter, and the inertia navigator is the rectangle cube, and the size is only the cell-phone lithium cell size, can not cause any extra burden to the fire fighter in the middle of imbedding into the special shoe-pad of design.
The device for receiving the trajectory data and the altitude data (referred to as a receiving device) may be an intelligent terminal, such as a mobile device like a mobile phone, a PDA, a tablet, etc., or a terminal dedicated to firefighters, which can receive data related to the inertial navigator and the barometer in a wireless manner. The receiving equipment can be carried by a fireman, and can also be placed at a remote command center or an on-site command center.
120. And replacing the vertical coordinate in the track data with the altitude data, and defining the replaced track data as a running track graph.
And after receiving the data, the receiving equipment preprocesses the data. Because the longitudinal moving height of the inertial navigator is not accurate and needs to be replaced by data of the barometer, the preprocessing is to replace the ordinate in the trajectory data with the altitude data, that is, the altitude data output by the barometer replaces the ordinate in the trajectory data.
Finally, after the preprocessing, the receiving device can display the operation trajectory diagram, the trajectory data of the inertial navigator read by the display effect diagram is displayed as shown in fig. 2, and the number in fig. 2 is the altitude marked by the barometer. In order to ensure the synchronism between the inertial navigator and the barometer, which are received by the receiving device, the data transmission frequencies of the inertial navigator and the barometer may be set to be the same, for example, the data may be output once per second on average, or naturally, the preprocessing operation may be performed according to the acquisition time.
130. And acquiring the inflection point of the floor according to the running track graph.
When a person goes upstairs or downstairs, the broken line track shown in fig. 3 is generated, and when the track appears in the data, the fact that the firefighter reaches a certain floor can be judged. Therefore, it is necessary to identify all inflection points in the trajectory, where an inflection point is a middle point of the polyline.
In general, when a series of data with the same motion trend has a motion trend opposite to the previous one, the point is an inflection point. In other words, the moving trends in the moving trajectory diagrams before and after the inflection point are opposite, and in a strict sense, the moving trajectory of the X axis is opposite. In the example of the above building, the X-axis coordinate of the lower segment in fig. 3 is gradually increased, and the X-axis coordinate of the upper segment is gradually decreased, so that the point between the two segments is considered as an inflection point. Of course, if the inflection point is long enough, it can be referenced to the Y-axis change, i.e., if the data of the X-axis or Z-axis continuously changes and the data of the Y-axis continuously lasts for 2s or more, then these points are considered to be inflection points.
In the preferred embodiment of the present invention, it is set that the value of the corresponding Y axis is continuously changed every time the data of the X axis or the Z axis is changed. Because the slight movement of the firefighter may also generate two sections of data with different movement trends, the inflection point needs to be screened to avoid the misjudgment caused by the above situation.
The points among the different trends are firstly determined as suspected inflection points, and then the following judgment is carried out: when the distance between the target suspected inflection point and the adjacent suspected inflection point is not less than the threshold value, the target suspected inflection point is the inflection point. The distance between the target suspected inflection point and the adjacent suspected inflection point is an absolute value of a difference value between altitude data corresponding to the target suspected inflection point and altitude data corresponding to the adjacent suspected inflection point in the operation trajectory graph, the threshold value is a preset value and is obtained by inputting the floor height and the number of the inflection points between floors, and the threshold value is H/(n +1) -0.5m, wherein H is the height difference between the adjacent floors, and n is the number of the inflection points between the adjacent floors.
140. And determining the position of the target floor according to the initial floor and the number of the inflection points.
Specifically, the floor number of an initial floor and the altitude data of the initial floor and a target floor are determined according to the operation trajectory graph;
confirming the position relation between the initial floor and the target floor according to the size between the altitude data of the initial floor and the altitude data of the target floor;
acquiring the quantity of inflection points between an initial floor and a target floor according to the operation trajectory diagram;
and determining the floor number of the target floor according to the floor number of the initial floor, the position relation between the initial floor and the target floor and the inflection point number.
The number of floors of the target floor can be determined by the following calculation formula:
N1=N0. + -. ceil (m/(N +1)), where N is1Number of floors as target floor, N0The number of floors of the initial floor is required to be input by a fireman in advance according to the floor, and the fireman can generally take 1 floor as a basis. The plus or minus is selected according to specific conditions, if plus or minus is added, the initial floor is indicated to be at the target floorThe lower side between floors, if minus, indicates the upper side of the initial floor between the target floors. m is the number of inflection points between the initial floor and the target floor, ceil () is rounded up. n is the number of inflection points between adjacent floors generally, there is one inflection point between two adjacent floors, although other cases without an inflection point or with multiple inflection points are also possible.
For example, when N is0N is 5, N is 1, m is 1, and the altitude data of the initial floor is smaller than the altitude data of the target floor, then N1When m is 2, N is 61Still equal to 6, the difference is that when m is 1, the sixth floor is reached (also the fifth floor is reached), and when m is 2, the sixth floor is reached.
Through above-mentioned embodiment for do not need to lay a large amount of network nodes in advance before the fire rescue, satisfy the instantaneity and the unpredictability of fire rescue promptly, simultaneously, the fireman only need carry a mobile device, portable barometer and dress contain the shoe-pad of inertial navigation appearance and can know the floor that oneself is located, can not bring extra burden for the fireman.
Example two
The second embodiment discloses a floor determination device corresponding to the second embodiment, which is a virtual device structure of the second embodiment, and as shown in fig. 4, the floor determination device includes:
a receiving module 210, configured to receive trajectory data of an inertial navigator and altitude data of a barometer, where the inertial navigator and the barometer are located at the same position;
a replacing module 220, configured to replace the ordinate in the trajectory data with the altitude data, and define the replaced trajectory data as a trajectory graph;
an obtaining module 230, configured to obtain an inflection point of a floor according to the trajectory diagram;
a determining module 240 for determining the location of the target floor based on the initial floor and the number of inflection points.
Further, the inertial navigator and the barometer are both located on the body of the firefighter.
As an embodiment, the obtaining module 230 includes: when the running trends of the running track graphs before and after a certain position are opposite, the certain position is an inflection point.
As another embodiment, the obtaining module 230 includes: when the running trends of the running track graphs before and after a certain position are opposite, marking the certain position as a suspected inflection point; confirming the suspected inflection point: when the distance between the target suspected inflection point and the adjacent suspected inflection point is not less than the threshold value, the target suspected inflection point is the inflection point. The distance between the target suspected inflection point and the adjacent suspected inflection point is the absolute value of the difference between the altitude data corresponding to the target suspected inflection point and the altitude data corresponding to the adjacent suspected inflection point in the operation trajectory graph; the threshold is H/(n +1) -0.5m, wherein H is the height difference between adjacent floors, and n is the number of inflection points between adjacent floors.
Further, the determining module 240 includes: determining the floor number of an initial floor and the altitude data of the initial floor and a target floor according to the operation trajectory diagram; confirming the position relation between the initial floor and the target floor according to the size between the altitude data of the initial floor and the altitude data of the target floor; acquiring the quantity of inflection points between an initial floor and a target floor according to the operation trajectory diagram; and determining the floor number of the target floor according to the floor number of the initial floor, the position relation between the initial floor and the target floor and the inflection point number.
EXAMPLE III
Fig. 5 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention, as shown in fig. 5, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of the processors 310 in the computer device may be one or more, and one processor 310 is taken as an example in fig. 5; the processor 310, the memory 320, the input device 330 and the output device 340 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 5.
The memory 320 is a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the floor determination method in the embodiment of the present invention (e.g., the receiving module 210, the replacing module 220, the obtaining module 230, and the determining module 240 in the floor determination device). The processor 310 executes various functional applications and data processing of the electronic device by executing software programs, instructions, and modules stored in the memory 320, thereby implementing the above-described floor determination method.
The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 320 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 320 may further include memory located remotely from the processor 310, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 330 may be used to receive input user identification information, as well as initial data such as floor height, number of inflection points between floors, and the like. The output device 340 may include a display device such as a display screen.
Example four
A fourth embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for floor determination, the method including:
receiving track data of an inertial navigator and altitude data of a barometer, wherein the inertial navigator and the barometer are located at the same position;
replacing the vertical coordinate in the track data with the altitude data, and defining the replaced track data as a running track graph;
acquiring an inflection point of a floor according to the running track diagram;
and determining the position of the target floor according to the initial floor and the number of the inflection points.
Of course, the storage medium provided by the embodiments of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the method described above, and may also perform related operations in the method for determining a floor based on a floor provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for enabling an electronic device (which may be a mobile phone, a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the floor-based determination device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Variations and modifications to the above-described embodiments may occur to those skilled in the art, which fall within the scope and spirit of the above description. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and variations of the present invention should fall within the scope of the claims of the present invention. Furthermore, although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.