CN110958565A - Method and device for calculating signal distance, computer equipment and storage medium - Google Patents

Method and device for calculating signal distance, computer equipment and storage medium Download PDF

Info

Publication number
CN110958565A
CN110958565A CN201911288908.6A CN201911288908A CN110958565A CN 110958565 A CN110958565 A CN 110958565A CN 201911288908 A CN201911288908 A CN 201911288908A CN 110958565 A CN110958565 A CN 110958565A
Authority
CN
China
Prior art keywords
base station
distance
signal
calculating
rss
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.)
Granted
Application number
CN201911288908.6A
Other languages
Chinese (zh)
Other versions
CN110958565B (en
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.)
Hon Hai Precision Industry Co Ltd
Original Assignee
Hon Hai Precision Industry 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 Hon Hai Precision Industry Co Ltd filed Critical Hon Hai Precision Industry Co Ltd
Priority to CN201911288908.6A priority Critical patent/CN110958565B/en
Publication of CN110958565A publication Critical patent/CN110958565A/en
Application granted granted Critical
Publication of CN110958565B publication Critical patent/CN110958565B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/33Services specially adapted for particular environments, situations or purposes for indoor environments, e.g. buildings

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

The invention is applicable to the field of mobile communication, and provides a method, a device, computer equipment and a storage medium for calculating a signal distance, wherein the method for calculating the signal distance comprises the following steps: calculating a set of annual ring distances of the reference node relative to the first base station from the signal information; and judging the first base station according to the set of annual ring distances according to a preset rule to determine a calculation base station so as to calculate the Euclidean distance of the RSS vector between any two reference nodes. According to the method for calculating the signal distance, provided by the embodiment of the invention, the first base station is judged through the preset rule to determine the calculation base station, the strong correlation and the high consistency between the RSS distance and the physical distance can be still achieved when only a small amount of first base stations are used for calculating the RSS distance, the workload is small, the positioning accuracy is high, and the problems that the workload is large and the positioning accuracy is easy to reduce in the conventional method for calculating the signal distance through the wireless signal strength are solved.

Description

Method and device for calculating signal distance, computer equipment and storage medium
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a method and an apparatus for calculating a signal distance, a computer device, and a storage medium.
Background
With the development of communication technology, wireless local area networks are widely used in indoor environments, and different terminals are interconnected through wireless communication technology to form a network system capable of communicating with each other and realizing resource sharing. At present, the indoor positioning technology based on the wireless local area network can realize the position positioning of personnel, objects and the like in an indoor space through a great amount of wireless signals in an indoor environment, and has the advantages of no need of extra infrastructure, low cost, higher positioning precision and the like.
For the indoor positioning technology, the current method generally represents the distance of the physical distance between two nodes by using the difference of Signal Strength vectors between the two nodes, i.e. RSS (Radio Signal Strength) distance, so as to realize the positioning function.
However, at present, a large number of available base station nodes exist in most public places, and the method for calculating the RSS distance has the problems of large workload and easy reduction of positioning accuracy.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a computer device, and a storage medium for calculating a signal distance, which are used to solve the technical problems of a large workload and an easy decrease in positioning accuracy in the existing method for calculating a signal distance by using wireless signal strength.
The embodiment of the invention is realized as follows: a method of calculating a signal distance, the method comprising:
acquiring signal information, wherein the signal information at least comprises coordinate information of a reference node used for receiving the signal sent by a first base station and signal strength information of the signal received by the reference node, and at least a plurality of first base stations and the reference nodes are provided;
calculating from the signal information a set of annual ring distances of the reference nodes relative to the first base station, the annual ring distances being the absolute value of the difference between any two of the reference nodes relative to the first base station RSS value;
judging the first base station according to the set of the annual ring distances and a preset rule, and determining the first base station as a calculation base station when the set of the annual ring distances meets the preset rule, wherein the calculation base station is used for calculating the signal distances and at least a plurality of calculation base stations are provided;
and acquiring the signal strength information of the signals transmitted by the computing base station and received by any two of the reference nodes, so as to compute the Euclidean distance of the RSS vector between any two of the reference nodes, and outputting the Euclidean distance to a database, wherein the Euclidean distance is used for representing the difference of the wireless signal strength vectors between any two of the reference nodes.
Another object of an embodiment of the present invention is to provide an apparatus for calculating a signal distance, including:
an obtaining module, configured to obtain signal information, where the signal information at least includes coordinate information of a reference node used to receive the signal sent by a first base station and signal strength information of the signal received by the reference node, where at least a plurality of the first base stations and the plurality of the reference nodes are provided;
a first calculation module configured to calculate, according to the signal information, a set of annual ring distances of the reference nodes with respect to the first base station, where the annual ring distances are absolute values of differences between any two of the reference nodes with respect to the first base station RSS values;
the judging module is used for judging the first base station according to the set of annual ring distances and a preset rule, and when the set of annual ring distances meets the preset rule, the first base station is determined to be a calculation base station which is used for calculating the signal distances, and at least a plurality of calculation base stations are provided;
and a second calculating module, configured to obtain signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes, to calculate a euclidean distance of an RSS vector between any two of the reference nodes, and output the euclidean distance to a database, where the euclidean distance is used to represent a difference in wireless signal strength vectors between any two of the reference nodes.
It is a further object of embodiments of the present invention to provide a computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the above-mentioned method of calculating a signal distance.
It is a further object of embodiments of the present invention to provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, causes the processor to perform the above-mentioned steps of the method of calculating a signal distance.
The method for calculating the signal distance provided by the embodiment of the invention comprises the following steps: acquiring signal information; calculating a set of annual ring distances of the reference node relative to the first base station from the signal information; judging the first base station according to the set of annual ring distances and a preset rule to determine a calculation base station; and acquiring the signal strength information of the signals transmitted by the computing base station and received by any two of the reference nodes to compute the Euclidean distance of the RSS vector between any two of the reference nodes. The first base station is judged according to the set of annual ring distances according to a preset rule to determine the calculation base station, so that the first base stations generating different annual ring distances acquire the power participating in calculating the RSS distance in a post competition mode, the requirements of strong correlation and high consistency of the RSS distance and the physical distance can be still met when only a small number of optimized first base stations are used for calculating the RSS distance, signal distance calculation is not needed for all indoor first base stations, the workload is small, the positioning accuracy is high, and the technical problems that the workload is large and the positioning accuracy is easy to reduce in the conventional method for calculating the signal distance through the wireless signal strength are solved.
Drawings
Fig. 1 is an application environment diagram of a method for calculating a signal distance according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for calculating a signal distance according to an embodiment of the present invention;
fig. 3 is a block diagram of an apparatus for calculating a signal distance according to an embodiment of the present invention;
fig. 4 is a graph illustrating the correlation and consistency between euclidean distances and physical distances in the method for calculating signal distances according to the embodiment of the present invention;
fig. 5 is a comparison diagram of the correlation between euclidean distances and physical distances in the method for calculating signal distances according to the embodiment of the present invention;
fig. 6 is a comparison diagram of the consistency between euclidean distances and physical distances in the method for calculating signal distances according to the embodiment of the present invention;
FIG. 7 is a block diagram showing an internal configuration of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another. For example, a first script that calculates a signal distance may be referred to as a second script that calculates a signal distance, and similarly, a second script that calculates a signal distance may be referred to as a first script that calculates a signal distance, without departing from the scope of the present application.
Fig. 1 is a diagram of an application environment of a method for calculating a signal distance according to an embodiment of the present invention, as shown in fig. 1, in the application environment, including a terminal 110 and a server 120, the number of the terminal 110 may be multiple, and the specific number is not limited.
The server 120 may be an independent physical server or terminal, or may be a server cluster formed by a plurality of physical servers, and may be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN (Content Delivery Network), but is not limited thereto, and may be used for data transmission and data processing.
The terminal 110 may be an intelligent terminal, such as a computer device like a desktop computer or a notebook computer, or may be an intelligent terminal that is convenient to carry, such as a tablet computer, a smart phone, a palm computer, smart glasses, a smart watch, a smart band, a smart speaker, etc., but is not limited thereto, and may be used for data transmission and data processing.
The terminal 110 and the server 120 may be connected through a wired network or a wireless network, and the present invention is not limited thereto.
As an application scenario provided by an embodiment of the present invention, when a user needs to use an RSS distance to perform indoor positioning at home, due to a large amount of wireless signals existing indoors, the distance of the physical distance between two nodes is often represented by using the signal strength vector difference between the two nodes, that is, the RSS distance, so as to achieve the positioning function. In the embodiment of the invention, the terminal is a notebook computer in the home of the user, the home of the user is also provided with a plurality of wireless routers as a first base station and a reference node, at least a plurality of first base stations and at least a plurality of reference nodes are arranged, the first base station transmits signals, and the reference node receives the signals transmitted by the first base station; when a user needs to perform indoor positioning, a request is sent to the server 120 through a notebook computer, after the server 120 receives the request, the server 120 obtains signal information, the signal information at least comprises coordinate information of a reference node used for receiving the signal sent by a first base station and signal strength information of the signal received by the reference node, then a set of annual ring distances of the reference node relative to the first base station is calculated according to the signal information, the annual ring distance is an absolute value of a difference between any two reference nodes relative to an RSS value of the first base station, then the first base station is evaluated according to a preset rule according to the set of annual ring distances, when the set of annual ring distances meets the preset rule, the first base station is determined to be a calculation base station, and then the signal strength information of the signal sent by the calculation base station and received by any two reference nodes is obtained, the RSS distance map for indoor positioning is formed by calculating the Euclidean distance of the RSS vector between any two reference nodes, a user can be directly connected to the server 120 through a notebook computer, the RSS distance map is obtained from the server 120, signal distance calculation is not needed to be carried out on all indoor wireless routers serving as first base stations, the workload is small, the positioning accuracy is high, and the technical problems that the workload is large and the positioning accuracy is easy to reduce in the existing method for calculating the signal distance through the wireless signal strength are solved.
In this embodiment, because a large number of available wireless routers with strong signals exist in most public places at present as the first base stations, not only is the workload of calculating RSS distances increased, which leads to problems of low calculation efficiency, increased positioning delay, and the like, but also the deployment and management of a large number of first base stations in the environment are difficult to control, so that RSS differences generated by some first base stations to different positions are difficult to characterize the distances between the positions, and RSS values generated by some abnormal first base stations completely lose or even deteriorate the characterization capability of physical distances. Such a first base station not only reduces the calculation efficiency in the RSS distance calculation process, but also causes a large position sensing error, and reduces the positioning accuracy.
As shown in fig. 2, in an embodiment, a method for calculating a signal distance is provided, and this embodiment is mainly illustrated by applying the method to the server 120 in fig. 1.
The embodiment of the present invention provides a method for calculating a signal distance, which may specifically include the following steps, as shown in fig. 2:
in step S202, signal information is obtained, where the signal information at least includes coordinate information of a reference node used for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node, where there are at least a plurality of reference nodes and the first base station.
In the embodiment of the present invention, the first base station is a device for transmitting a wireless signal, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a handheld computer, etc., but is not limited thereto, and may be used to transmit a wireless signal; the reference node may be a computer device such as a desktop computer, a notebook computer, or the like, or may also be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, or the like, but is not limited thereto, and may be used to receive a wireless signal; the signal information acquisition can be performed through a server, the server can be an independent physical server or a terminal, or a server cluster formed by a plurality of physical servers, and can be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage and a CDN.
As an embodiment of the present invention, the number of the terminals 110 is multiple, the server 120 communicates with the multiple terminals 110 through a wireless network, the first base station and the reference node both communicate with the server 120 through the wireless network, at least two of the first base station and the reference node are provided, the server obtains coordinate information of the reference node for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node, and wirelessly communicates with the mobile device through the server, and the mobile device may sample a wireless signal vector from the first base station nearby, and associate position coordinates of the reference node to form a matrix, which is also referred to as an RSS fingerprint.
As another embodiment of the present invention, the number of the terminals 110 may be multiple, and the specific number is not limited, the server 120 communicates with multiple terminals 110 through a wireless network, the first base station and the reference node also belong to the terminals 110, the terminals 110 further include indoor computer devices such as desktop computers and notebook computers, and devices such as tablet computers, smart phones and handheld computers that can be connected to the wireless local area network, coordinate information of the reference node in the terminals 110 for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node can be obtained through the server, wireless communication is performed with all the terminals 110 through the server, the terminal 110 is used to sample a wireless signal vector from the first base station nearby, and the position coordinates of the reference node are associated to form a matrix, also known as RSS fingerprints.
According to the embodiment of the invention, the coordinate information of the reference node for receiving the signal sent by the first base station and the signal strength information of the signal received by the reference node are obtained through the server, so that the RSS fingerprint can be conveniently used for associating the signal strength information of the signal received by the reference node with the position coordinate of the corresponding reference node.
In step S204, a set of annual ring distances of the reference nodes with respect to the first base station is calculated from the signal information, the annual ring distances being the absolute values of the differences between any two of the reference nodes with respect to the first base station RSS values.
In the embodiment of the present invention, the reference node is a known node, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, but is not limited thereto; the ring-of-year distance is an absolute value of a difference between any two reference nodes and an RSS value of the first base station, specifically, a signal propagation process of the first base station takes the first base station as a center and propagates the reference nodes in a ring shape to the periphery, an absolute value of a difference between RSS values received by any two reference nodes at two different positions is a ring-of-year distance between any two reference nodes, and the ring is formed by taking a position coordinate of the first base station as a center of a circle and taking the corresponding reference node as a point on the ring; the calculation of the reference node relative to the set of annual ring distances of the first base station is realized through a server, the server can be an independent physical server or terminal, can also be a server cluster formed by a plurality of physical servers, and can be a cloud server for providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage and a CDN.
As an embodiment of the present invention, the calculation is performed by inputting all RSS fingerprints, that is, the signal information obtained in the foregoing, and calculating a set of annual ring distances of the reference nodes with respect to the first base station according to the signal information, where the annual ring distances are absolute values of differences between any two reference nodes with respect to the RSS values of the first base station.
As another embodiment of the present invention, the fingerprint of the reference node position is defined as follows: fi=(xi,yi,ri1,ri2…rim) (i ═ 1,2, … n), where F isi(ii) a location fingerprint representing the ith said reference node, (x)i,yi) Coordinates representing the ith said reference node, rimAn RSS value representing the location of the mth first base station at the ith reference node, where the set of annual ring distances is defined as follows:
Figure BDA0002315548620000091
according to the embodiment of the invention, the annual ring distances of the reference nodes relative to the first base station are calculated, so that the annual ring distances of all the reference nodes relative to the first base station are collected to form a set, all the first base stations can be deleted through the set of the annual ring distances of the reference nodes relative to the first base station, calculation is not required to be carried out on the basis of all the first base stations when RSS distance calculation is carried out subsequently, and the problems of large work amount of RSS distance calculation caused by the increase of the number of the first base stations, low calculation efficiency, large positioning delay and the like are avoided.
In step S206, the first base station is evaluated according to the set of annual ring distances and a preset rule, and when the set of annual ring distances satisfies the preset rule, the first base station is determined as a calculation base station, where the calculation base station is used to calculate the signal distance, and there are at least a plurality of calculation base stations.
In the embodiment of the present invention, the computing base station is a plurality of the first base stations in all the first base stations, there are at least a plurality of the computing base stations, and the computing base station may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, but is not limited thereto, and may be used to transmit a wireless signal; the evaluation is carried out through a server, the server can be an independent physical server or a terminal, can also be a server cluster formed by a plurality of physical servers, and can be a cloud server for providing basic cloud computing services such as a cloud server, a cloud database, cloud storage, a CDN (content delivery network) and the like; the preset rule may be a threshold formed according to elements in the set of annual ring distances, for example, the threshold may be an average of all elements in the set of annual ring distances, a standard deviation of all elements in the set of annual ring distances, or a sum of a maximum value and a minimum value of all elements in the set of annual ring distances, and the average may be an arithmetic average, a geometric average, a square average, a harmonic average, a weighted average, or the like.
As an embodiment of the present invention, the first base station is evaluated according to a preset rule according to the set of ring distances, where the preset rule is a standard deviation of all elements in the set of ring distances, a difference between an element corresponding to a maximum value in the set of ring distances and a mean value of all elements in the set of ring distances is calculated, and when the difference is smaller than an integer multiple of the standard deviation of all elements in the set of ring distances, for example, may be an integer multiple such as one, two, three, four, or the like, the corresponding first base station may be determined as a calculation base station, and the calculation base station is used for calculating the signal distance, and the number of the calculation base stations is at least multiple.
As still another embodiment of the present invention, the set of annual ring distances is defined as follows:
Figure BDA0002315548620000101
firstly, sorting the annual ring distances in a descending order, and recording the sorted result as
Figure BDA0002315548620000102
Then, the mean and standard deviation of the set of annual ring distances are calculated, the mean being
Figure BDA0002315548620000103
The standard deviation is
Figure BDA0002315548620000104
And then, judging the first base station according to a preset rule, wherein the preset rule is that the abnormal first base station is eliminated by using a method of 3 times of standard deviation. Specifically, the judgment is carried out according to the following steps: assuming that the initial value s1 is 0, calculating
Figure BDA0002315548620000105
Computing
Figure BDA0002315548620000111
If it is not
Figure BDA0002315548620000112
Deleting the corresponding first base station, then making s1 equal to s1+1, and repeating the steps until the corresponding first base station is deleted
Figure BDA0002315548620000113
Determining the corresponding first base station as the computing base station.
As another embodiment of the present invention, a sorting set is generated by sorting all elements in the set of annual ring distances in descending order, calculating a mean value and a standard deviation of all annual ring distances in the sorting set, and calculating a difference between a leading element and the mean value of the sorting set, that is, a difference between a largest element and the mean value of the sorting set, when the difference exceeds 3 times of the standard deviation of the sorting set, a first base station generating the annual ring distance is considered as an abnormal first base station, and is eliminated; and recalculating the mean value and the standard deviation of the remaining annual ring distances and the difference value between the largest element and the mean value, eliminating the largest element according to the same method until the difference value between the largest element and the mean value is less than 3 times of the standard deviation, and selecting the first base station generating the first t annual ring distances for the remaining annual ring distances to participate in RSS distance calculation, wherein the first base stations are calculation base stations. When all the first base stations are not abnormal, the larger the annual ring distances generated at two different positions, the stronger the representation capability of the annual ring distances generated at the two positions of the first base station on the physical distance, therefore, the maximum t values are selected for the first base station without abnormality, so that the elimination of the first base station with weak representation capability of the annual ring distances on the physical distance is realized, the method can be used for ensuring the strong correlation and high consistency of the physical distance and the RSS distance on the basis of reducing the calculation time and the positioning time delay, and can be used in all related positioning technologies which need the RSS distance to perform indoor positioning.
According to the embodiment of the invention, the first base station is judged according to the set of annual ring distances and a preset rule to determine whether the first base station is a calculation base station, so that the calculation base stations are screened from all the first base stations, and the RSS distances are calculated through the corresponding number of calculation base stations.
In step S208, the signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes is obtained, so as to calculate the euclidean distance of the RSS vector between any two of the reference nodes, and the euclidean distance is output to the database, where the euclidean distance is used to represent the difference of the wireless signal strength vectors between any two of the reference nodes.
In the embodiment of the present invention, the reference node refers to that, in a target environment, the positions of some specific wireless routers are manually calibrated, coordinates of the positions are known, the positions of the wireless routers are the reference nodes, the euclidean distance refers to a real distance between two points in an m-dimensional space or a natural length of a vector, and is an actual distance between the two points in a two-dimensional space and a three-dimensional space, in this embodiment, the RSS distance is an euclidean distance between RSS value vectors from all computing base stations in RSS fingerprints at two different positions in the target environment, the database may be a database in a server cluster formed by a plurality of physical servers, and may be a database in a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN, and the database is stored together in a certain manner, The data set can be shared by a plurality of users, has the redundancy as small as possible, and is independent from the application program, and the users can add, inquire, update, delete and the like to the data in the file.
As an embodiment of the present invention, after obtaining a plurality of the computing base stations through evaluation, the server obtains signal strength information of the signals transmitted by the computing base stations and received by any two of the reference nodes, calculates a euclidean distance of a signal vector between any two of the reference nodes, and outputs the euclidean distance to the database, where the euclidean distance is used to represent a difference in wireless signal strength vectors between any two of the reference nodes.
According to the embodiment of the invention, a plurality of calculation base stations are selected to calculate the RSS distance, the Euclidean distance of a signal vector between any two reference nodes is calculated, the Euclidean distance is output to a database, and an indoor positioning RSS distance map is formed.
The embodiment of the invention forms the RSS fingerprint by acquiring the signal information, calculates all RSS values of all the reference nodes in the RSS fingerprint to obtain a set of annual ring distances of the reference nodes relative to the first base station, judges the first base station according to the set of annual ring distances and a preset rule to determine the calculation base station, so that the first base station generating different annual ring distances acquires the power participating in calculating the RSS distance in a post competition mode, the RSS difference generated between any two nodes in the reference nodes by the calculation base station participating in calculating the RSS distance can well represent the physical distance between the two nodes, and thus, when the optimized and small number of first base stations are used for calculating the RSS distance, the strong correlation and high consistency requirements of the RSS distance and the physical distance can be still achieved, the method provides rapid and high-quality RSS distance for various indoor positioning methods based on RSS distance, does not need to calculate signal distance of all indoor wireless routers serving as first base stations, has small workload and high positioning precision, and solves the technical problems of large workload and easy reduction of positioning precision of the conventional method for calculating the signal distance by wireless signal strength.
In the method for calculating a signal distance according to an embodiment of the present invention, the calculating a set of annual ring distances of the reference node with respect to the first base station according to the signal information includes:
collecting signal strength information of all the signals transmitted by the first base station and received by the reference node to associate coordinate information of the reference node to form an association set;
forming a two-dimensional matrix according to all the association sets, wherein the two-dimensional matrix at least comprises coordinate information of the reference node and signal strength information of the signal transmitted by the first base station and received by the reference node;
calculating the absolute value of the difference between any two reference nodes relative to the RSS value of the first base station according to the two-dimensional matrix;
collecting absolute values of distance differences of all of the arbitrary two of the reference nodes with respect to the first base station to form a set of annual ring distances of the reference nodes with respect to the first base station.
In the embodiment of the present invention, the first base station is a device for transmitting a wireless signal, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a handheld computer, etc., but is not limited thereto, and may be used to transmit a wireless signal; the reference node may be a computer device such as a desktop computer, a notebook computer, or the like, or may also be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, or the like, but is not limited thereto, and may be used to receive a wireless signal; the calculation of the annual ring distance set is realized through a server, the server can be an independent physical server or a terminal, can also be a server cluster formed by a plurality of physical servers, and can be a cloud server for providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage and a CDN.
As an embodiment of the present invention, RSS values of the reference nodes from all the first base stations are collected, the position coordinates of the reference nodes are associated to form fingerprints of the reference nodes, the fingerprints of all the reference nodes are collected to form a two-dimensional matrix, and the two-dimensional matrix is a fingerprint map for indoor positioning.
As still another embodiment of the present invention, the reference node collects RSS data from the first base station, associates the position coordinates of the reference node, and defines a fingerprint of the position of the reference node as follows Fi=(xi,yi,ri1,ri2…rim) (i ═ 1,2, … n), where F isi(ii) a location fingerprint representing the ith said reference node, (x)i,yi) Coordinates representing the ith said reference node, rimAn RSS value representing the location of the mth first base station at the ith reference node. Thus, for an environment where there are m first base stations, n reference nodes, all fingerprint data form a two-dimensional matrix F ═ (F ═ F)1,F2,…Fi…Fn)TDefining a distance matrix D of said reference nodes based on said fingerprint dataj=(dii′,dr ii′) Wherein
Figure BDA0002315548620000141
i < i', where,
Figure BDA0002315548620000142
dii′representing a physical distance between a location of an ith said reference node and a location of an ith' said reference node, said physical distance being an actual distance between two different locations in the target environment, wherein,
Figure BDA0002315548620000151
collecting absolute values of distance differences of any two reference nodes relative to the first base station to form a set of annual ring distances of the reference nodes relative to the first base station, wherein the set of annual ring distances is
Figure BDA0002315548620000152
According to the embodiment of the invention, the annual ring distances of the reference nodes relative to the first base station are calculated, so that the annual ring distances of all the reference nodes relative to the first base station are collected to form a set, all the first base stations can be deleted through the set of the annual ring distances of the reference nodes relative to the first base station, calculation is not required to be carried out on the basis of all the first base stations when RSS distance calculation is carried out subsequently, and the problems of large work amount of RSS distance calculation caused by the increase of the number of the first base stations, low calculation efficiency, large positioning delay and the like are avoided.
In the method for calculating a signal distance according to the embodiment of the present invention, the evaluating the first base station according to the set of annual ring distances and according to a preset rule includes:
sorting the elements in the set of annual ring distances by numerical size to generate a sorted set;
calculating a difference value between a leading element in the sorting set and a mean value of the sorting set and a standard deviation of the sorting set to determine whether the first base station is the calculating base station.
In the embodiment of the present invention, the mean value may be an arithmetic mean value, a geometric mean value, a square mean value, a harmonic mean value, a weighted mean value, and the like, the calculation of the difference between the first element in the sorting set and the mean value of the sorting set and the standard deviation of the sorting set are both implemented by a server, and the server may be an independent physical server or a terminal, may also be a server cluster formed by a plurality of physical servers, and may be a cloud server that provides basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN.
As an embodiment of the present invention, the judging is to eliminate the abnormal first base station by using 3 times of standard deviation, that is, to sort the elements in the annual ring distance set according to the numerical values to generate a sorted set, and calculate whether the difference between a leading element and a mean value exceeds 3 times of standard deviation for the sorted annual ring distance set, and if so, eliminate the first base station generating the leading element, that is, eliminate the first base station corresponding to the maximum annual ring distance value, and the leading element does not participate in calculating the RSS distance; then, repeatedly calculating the mean value and the standard deviation of the rest sorting set, namely the mean value and the standard deviation corresponding to the sorting set except the first element, until the difference between the first element and the mean value in the sorting set does not exceed 3 times of the standard deviation, and finally selecting the first t calculating base stations to calculate the RSS distance.
According to the embodiment of the invention, the first base station is judged according to the preset rule to determine whether the first base station is the calculation base station or not, so that the calculation base stations are screened from all the first base stations, the RSS distance calculation is carried out through the corresponding number of calculation base stations, the requirements of strong correlation and high consistency between the RSS distance and the physical distance can be still met when only the optimized and small number of calculation base stations are used for carrying out the RSS distance calculation, and the RSS distance calculation method and the RSS distance calculation device can be used as a position selection guide when a wireless router is deployed specially aiming at indoor positioning.
In the method for calculating a signal distance according to the embodiment of the present invention, the preset rule is that when a difference between an element with a largest value in the set of annual ring distances and a first calculated value is smaller than a second calculated value, the first base station is determined as a calculation base station, where the first calculated value is an average value calculated according to all elements in the set of annual ring distances, and the second calculated value is an integer multiple of a standard deviation calculated according to all elements in the set of annual ring distances.
In the embodiment of the present invention, the first calculation value is an average value calculated according to all elements in the set of annual ring distances, and the second calculation value is an integer multiple of a standard deviation calculated according to all elements in the set of annual ring distances, for example, the first calculation value may be one-time standard deviation, two-time standard deviation, three-time standard deviation, four-time standard deviation, and the like, and is not limited in particular, and may be designed according to actual requirements, and the average value may be an arithmetic average value, a geometric average value, a square average value, a harmonic average value, a weighted average value, and the like.
As an embodiment of the invention, when calculating the mean and standard deviation of the set of annual ring distances, the mean is
Figure BDA0002315548620000171
The standard deviation is
Figure BDA0002315548620000172
And then evaluating the first base station according to a preset rule, wherein the preset rule is that when the difference between the element with the largest value in the set of the annual ring distances and the average value calculated by all elements in the set of the annual ring distances is smaller than a second calculated value, the first base station is determined as a calculation base station, and the second calculated value is an integral multiple value of the standard deviation calculated according to all elements in the set of the annual ring distances.
In the embodiment of the present invention, the first base station is evaluated according to a preset rule to determine whether the first base station is a computing base station, so as to screen the computing base stations from all the first base stations, where the preset rule is that when a difference between an element with a largest value in the set of annual ring distances and a first computed value is smaller than a second computed value, the first base station is determined to be the computing base station, and when RSS distances are computed by using only an optimized and small number of computing base stations, strong correlation and high consistency requirements between RSS distances and physical distances can still be met.
In the method for calculating the signal distance provided by the embodiment of the invention, the annual ring distance is calculated according to a formula
Figure BDA0002315548620000173
Calculation of where rimRepresents the RSS value, r, from the mth first base station received by the ith reference nodei′mRepresenting the RSS value received by the ith' reference node from the mth first base station.
In the embodiment of the present invention, the first base station is a device for transmitting a wireless signal, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a handheld computer, etc., but is not limited thereto, and may be used to transmit a wireless signal; the reference node may be a computer device such as a desktop computer, a notebook computer, or the like, or may be an intelligent terminal that is convenient to carry, such as a tablet computer, a smart phone, a handheld computer, or the like, but is not limited thereto, and may be used to receive a wireless signal, where the distance is an actual distance, that is, a linear distance, and the calculation of the annual ring distance is implemented by a server, and the server may be an independent physical server or terminal, may also be a server cluster formed by a plurality of physical servers, and may be a cloud server that provides basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN.
The embodiment of the invention collects the annual ring distances of all the reference nodes relative to the first base station to form a set by calculating the annual ring distances of the reference nodes relative to the first base station, facilitates the subsequent deletion of all the first base stations, provides a strategy of the first base station for competitive selection on duty aiming at the condition that RSS distances are needed to be used for indoor positioning, and selects a small number of first base stations for RSS distance calculation, so that the strong correlation and high consistency between RSS distances and physical distances are ensured on the basis of efficiency improvement, and the beneficial technical effect of the step is written.
In the method for calculating a signal distance provided in the embodiment of the present invention, the euclidean distance of an RSS vector between any two nodes in the reference nodes is calculated according to a formula
Figure BDA0002315548620000181
Calculating, wherein t is the number of the calculating base stations,
Figure BDA0002315548620000182
an absolute value representing a difference between RSS values of any two of the reference nodes with respect to the k-th calculated base station, and an initial value of s1 is 0.
In the embodiment of the present invention, the computing base station is a device for transmitting wireless signals, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, but is not limited thereto, and may be used for transmitting wireless signals; the reference node may be a computer device such as a desktop computer, a notebook computer, or the like, or may also be an intelligent terminal that is convenient to carry, such as a tablet computer, a smart phone, a palm computer, or the like, but is not limited thereto, and may be used to receive a wireless signal noun.
As an embodiment of the invention, the annual ring distance is according to the formula
Figure BDA0002315548620000191
Calculation of where rimRepresents the RSS value, r, from the mth first base station received by the ith reference nodei′mRepresenting the RSS value received by the ith' th reference node from the mth first base stationIf m-s1 is not less than t, t calculation base stations are selected for RSS distance calculation, and the Euclidean distance of an RSS vector between any two reference nodes is calculated according to the Euclidean distance of the RSS vector between any two reference nodes
Figure BDA0002315548620000192
Calculating, otherwise according to
Figure BDA0002315548620000193
And (4) calculating.
According to the embodiment of the invention, a plurality of calculation base stations are selected to calculate the RSS distance, the Euclidean distance of a signal vector between any two reference nodes is calculated, the Euclidean distance is output to a database, and an indoor positioning RSS distance map is formed.
In the method for calculating a signal distance provided in the embodiment of the present invention, the method further includes determining accuracy of a euclidean distance of the RSS vector, where the determining accuracy of the euclidean distance of the RSS vector includes:
calculating the physical distance between any two nodes in the reference nodes;
and calculating the difference value of the physical distance between any two reference nodes and the Euclidean distance of the corresponding RSS vector to determine the accuracy of the Euclidean distance of the RSS vector.
In the embodiment of the present invention, the euclidean distance refers to a real distance between two points in an m-dimensional space or a natural length of a vector, and is an actual distance between the two points in a two-dimensional space and a three-dimensional space.
As the inventionIn one embodiment, the reference node collects RSS data from the first base station, correlates the location coordinates of the reference node, and defines a fingerprint of the location of the reference node as follows Fi=(xi,yi,ri1,ri2…rim) (i ═ 1,2, … n), where F isi(ii) a location fingerprint representing the ith said reference node, (x)i,yi) Coordinates representing the ith said reference node, rimAn RSS value representing the location of the mth first base station at the ith reference node. Thus, for an environment where there are m first base stations, n reference nodes, all fingerprint data form a two-dimensional matrix F ═ (F ═ F)1,F2,…Fi…Fn)TDefining a distance matrix D of said reference nodes based on said fingerprint dataj=(dii′,dr ii′) Wherein
Figure BDA0002315548620000201
i < i', where,
Figure BDA0002315548620000202
dii′representing a physical distance between a location of an ith said reference node and a location of an ith' said reference node, said physical distance being an actual distance between two different locations in the target environment, wherein,
Figure BDA0002315548620000203
the corresponding Euclidean distance is that an initial value s1 is equal to 0, if m-s1 is larger than or equal to t, t calculation base stations are selected for RSS distance calculation, and the Euclidean distance of an RSS vector between any two reference nodes is calculated according to the Euclidean distance
Figure BDA0002315548620000204
Calculating, otherwise according to
Figure BDA0002315548620000205
Calculating and then calculating the object between any two nodes in the reference nodesDifference of physical distance and corresponding Euclidean distance of the RSS vector to determine the accuracy of the Euclidean distance of the RSS vector, namely, dii′And
Figure BDA0002315548620000206
the difference value is judged, the smaller the difference value is, the higher the accuracy is, and thus the requirements of strong correlation and high consistency between the RSS distance and the physical distance are met.
According to the embodiment of the invention, the accuracy of the Euclidean distance of the RSS vector is determined by calculating the difference value between the physical distance between any two nodes in the reference nodes and the Euclidean distance of the corresponding RSS vector, and the requirements of strong correlation and high consistency between the RSS distance and the physical distance can be still met when only the optimized and small number of first base stations are used for calculating the RSS distance.
In one embodiment, as shown in fig. 4-6, the effect of the above method of calculating signal distance can be further illustrated by the following embodiments: when deploying the first base stations in an indoor environment of 20 meters × 20 meters, the first base stations may be deployed at 57 points on the boundary, and when deploying 2 to 10 first base stations arbitrarily, in order to ensure the positioning accuracy in an indoor complex environment, at least 2 first base stations are selected to perform RSS value calculation, 500 different samples are randomly generated for each number of first base stations, and the correlation and the maximum and minimum of the consistency between the calculated RSS distance and the physical distance are shown in fig. 4, where a straight line represents the correlation between the RSS distance and the physical distance, a dotted line represents the consistency between the RSS distance and the physical distance, a circle represents a curve corresponding to the maximum of the correlation and the consistency, and a triangle represents a curve corresponding to the minimum of the correlation and the consistency, and it can be seen that when the first base stations are properly located, even if only 2 first base stations can achieve strong correlation and high consistency, however, if the first base station is not deployed properly, even if the number of deployed first base stations reaches as many as 10, the consistency and correlation are still poor, i.e. both are lower than 0.8.
In the embodiment of the present invention, by using the method for calculating a signal distance of the embodiment of the present invention, that is, the RSS distance calculation method based on the first base station competing for the shift to the shift, 15 first base stations existing in the environment are set, and when the number of the selected calculation base stations is 2, the correlation and consistency between the RSS distance calculated under 500 times of sampling and the physical distance are greatly improved, as shown in fig. 5-6, in fig. 5, the upper curve is the correlation between the RSS distance and the physical distance obtained by using the method for calculating a signal distance of the embodiment of the present invention, and the lower curve is the correlation between the RSS distance and the physical distance obtained when the RSS distance is calculated by randomly using 2 first base stations, wherein when the RSS distance is calculated by randomly using 2 first base stations, the ratio of the RSS distance to the physical distance is less than 10%, the method for calculating the signal distance selects the calculating base station, and when only 2 technical base stations are selected for calculating the RSS distance, the strong correlation among 500 sampled data has 99.8 percent; in fig. 6, the upper curve is the consistency between the RSS distance and the physical distance obtained by using the method for calculating the signal distance according to the embodiment of the present invention, and the lower curve is the consistency between the RSS distance and the physical distance obtained by randomly using 2 first base stations to calculate the RSS distance, where when 2 first base stations are randomly used to calculate the RSS distance, the ratio of the RSS distance to the physical distance is less than 10%, whereas the calculation base station is selected based on the method for calculating the signal distance according to the embodiment of the present invention, and when only 2 technical base stations are selected to calculate the RSS distance, the high consistency among 500 sampled data is 99.8%, that is, the strong correlation and the high consistency are achieved.
In the embodiment of the present invention, the RSS distance is the basis of various indoor positioning algorithms, and if the RSS distance with high quality can be provided quickly and efficiently, the efficiency and the accuracy of the related positioning algorithm are necessarily improved. The RSS distance calculation method based on the first base station competitive selection on duty greatly reduces the number of the first base stations used for calculating the RSS distance, and achieves strong correlation and high consistency with the physical distance. In order to ensure that the method is used in a complex indoor environment, at least 3 first base stations can be selected for RSS distance calculation in the actual positioning process.
As an embodiment of the invention, when 2 first base stations are randomly used for calculating the RSS distance, the proportion of the RSS distance to the physical distance is less than 10% in 500 sampling, but the method for calculating the signal distance selects the calculating base station based on the embodiment of the invention, when only 2 calculating base stations are selected for calculating the RSS distance, the strong correlation and the high consistency are both 99.8% in 500 sampled groups of data, in order to more stably provide the RSS distance for the indoor positioning technology, when 3 calculating base stations are selected for calculating the RSS distance, the correlation and the consistency of the calculated RSS distance and the physical distance are greatly improved. Under the condition of randomly using 3 first base stations, in 500 times of sampling, the proportion of strong correlation between the RSS distance and the physical distance is only 20.8%, and the proportion of consistency is only about 14.4%; when 3 calculation base stations are selected for calculating the RSS distance, the proportion of strong correlation and high consistency of 500 sampling results reaches 100%.
As shown in fig. 3, in an embodiment, an apparatus for calculating a signal distance is provided, and the apparatus for calculating a signal distance may be integrated in the server 120, and specifically may include: an acquisition module 310, a first calculation module 320, a judgment module 330, and a second calculation module 340.
An obtaining module 310, configured to obtain signal information, where the signal information at least includes coordinate information of a reference node used to receive the signal sent by a first base station and signal strength information of the signal received by the reference node, where there are at least a plurality of reference nodes and the first base station.
A first calculating module 320, configured to calculate, according to the signal information, a set of annual ring distances of the reference nodes relative to the first base station, where the annual ring distances are absolute values of differences between any two of the reference nodes relative to the first base station RSS values.
A judging module 330, configured to judge the first base station according to the set of annual ring distances and according to a preset rule, and when the set of annual ring distances meets the preset rule, determine that the first base station is a calculation base station, where the calculation base station is used to calculate the signal distance, and there are at least a plurality of calculation base stations.
A second calculating module 340, configured to obtain the signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes, to calculate a euclidean distance of an RSS vector between any two of the reference nodes, and output the euclidean distance to a database, where the euclidean distance is used to represent a difference in wireless signal strength vectors between any two of the reference nodes.
In the embodiment of the present invention, the means for calculating the signal distance may be a data circuit terminating device, such as a modem, a hub, a bridge or a switch; or a data terminal device, such as a digital mobile phone, a printer or a host, wherein the host can be a router, a workstation, a server or a wireless sensor; the system may also be an intelligent terminal, such as a computer device like a notebook computer, or may also be an intelligent terminal that is convenient to carry, such as a tablet computer, a palm computer, intelligent glasses, an intelligent watch, an intelligent bracelet, an intelligent sound box, etc., but is not limited thereto, and may be used for data conversion, management, processing and transmission, and the acquisition module 310, the first calculation module 320, the judgment module 330 and the second calculation module 340 all store an operating system for processing various basic system services and programs for executing hardware-related tasks; application software is also stored for implementing the steps of the method for calculating the signal distance in the embodiment of the present invention.
The apparatus for calculating a signal distance may perform the steps of the method for calculating a signal distance provided in any of the above embodiments, wherein an embodiment of the present invention provides a method for calculating a signal distance, the method comprising the steps of, as shown in fig. 2:
in step S202, signal information is obtained, where the signal information at least includes coordinate information of a reference node used for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node, where there are at least a plurality of reference nodes and the first base station.
In the embodiment of the present invention, the first base station is a device for transmitting a wireless signal, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a handheld computer, etc., but is not limited thereto, and may be used to transmit a wireless signal; the reference node may be a computer device such as a desktop computer, a notebook computer, or the like, or may also be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, or the like, but is not limited thereto, and may be used to receive a wireless signal; the signal information acquisition can be performed through a server, the server can be an independent physical server or a terminal, or a server cluster formed by a plurality of physical servers, and can be a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage and a CDN.
As an embodiment of the present invention, the number of the terminals 110 is multiple, the server 120 communicates with the multiple terminals 110 through a wireless network, the first base station and the reference node both communicate with the server 120 through the wireless network, at least two of the first base station and the reference node are provided, the server obtains coordinate information of the reference node for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node, and wirelessly communicates with the mobile device through the server, and the mobile device may sample a wireless signal vector from the first base station nearby, and associate position coordinates of the reference node to form a matrix, which is also referred to as an RSS fingerprint.
As another embodiment of the present invention, the number of the terminals 110 may be multiple, and the specific number is not limited, the server 120 communicates with multiple terminals 110 through a wireless network, the first base station and the reference node also belong to the terminals 110, the terminals 110 further include indoor computer devices such as desktop computers and notebook computers, and devices such as tablet computers, smart phones and handheld computers that can be connected to the wireless local area network, coordinate information of the reference node in the terminals 110 for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node can be obtained through the server, wireless communication is performed with all the terminals 110 through the server, the terminal 110 is used to sample a wireless signal vector from the first base station nearby, and the position coordinates of the reference node are associated to form a matrix, also known as RSS fingerprints.
According to the embodiment of the invention, the coordinate information of the reference node for receiving the signal sent by the first base station and the signal strength information of the signal received by the reference node are obtained through the server, so that the RSS fingerprint can be conveniently used for associating the signal strength information of the signal received by the reference node with the position coordinate of the corresponding reference node.
In step S204, a set of annual ring distances of the reference nodes with respect to the first base station is calculated from the signal information, the annual ring distances being the absolute values of the differences between any two of the reference nodes with respect to the first base station RSS values.
In the embodiment of the present invention, the reference node is a known node, and may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, but is not limited thereto; the ring-of-year distance is an absolute value of a difference between any two reference nodes and an RSS value of the first base station, specifically, a signal propagation process of the first base station takes the first base station as a center and propagates the reference nodes in a ring shape to the periphery, an absolute value of a difference between RSS values received by any two reference nodes at two different positions is a ring-of-year distance between any two reference nodes, and the ring is formed by taking a position coordinate of the first base station as a center of a circle and taking the corresponding reference node as a point on the ring; the calculation of the reference node relative to the set of annual ring distances of the first base station is realized through a server, the server can be an independent physical server or terminal, can also be a server cluster formed by a plurality of physical servers, and can be a cloud server for providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage and a CDN.
As an embodiment of the present invention, the calculation is performed by inputting all RSS fingerprints, that is, the signal information obtained in the foregoing, and calculating a set of annual ring distances of the reference nodes with respect to the first base station according to the signal information, where the annual ring distances are absolute values of differences between any two reference nodes with respect to the RSS values of the first base station.
As another embodiment of the present invention, the fingerprint of the reference node position is defined as follows: fi=(xi,yi,ri1,ri2…rim) (i ═ 1,2, … n), where F isi(ii) a location fingerprint representing the ith said reference node, (x)i,yi) Coordinates representing the ith said reference node, rimAn RSS value representing the location of the mth first base station at the ith reference node, where the set of annual ring distances is defined as follows:
Figure BDA0002315548620000261
according to the embodiment of the invention, the annual ring distances of the reference nodes relative to the first base station are calculated, so that the annual ring distances of all the reference nodes relative to the first base station are collected to form a set, all the first base stations can be deleted through the set of the annual ring distances of the reference nodes relative to the first base station, calculation is not required to be carried out on the basis of all the first base stations when RSS distance calculation is carried out subsequently, and the problems of large work amount of RSS distance calculation caused by the increase of the number of the first base stations, low calculation efficiency, large positioning delay and the like are avoided.
In step S206, the first base station is evaluated according to the set of annual ring distances and a preset rule, and when the set of annual ring distances satisfies the preset rule, the first base station is determined as a calculation base station, where the calculation base station is used to calculate the signal distance, and there are at least a plurality of calculation base stations.
In the embodiment of the present invention, the computing base station is a plurality of the first base stations in all the first base stations, there are at least a plurality of the computing base stations, and the computing base station may be a wireless router, or a computer device such as a desktop computer and a notebook computer, or may be a portable intelligent terminal such as a tablet computer, a smart phone, a palm computer, but is not limited thereto, and may be used to transmit a wireless signal; the evaluation is carried out through a server, the server can be an independent physical server or a terminal, can also be a server cluster formed by a plurality of physical servers, and can be a cloud server for providing basic cloud computing services such as a cloud server, a cloud database, cloud storage, a CDN (content delivery network) and the like; the preset rule may be a threshold formed according to elements in the set of annual ring distances, for example, the threshold may be an average of all elements in the set of annual ring distances, a standard deviation of all elements in the set of annual ring distances, or a sum of a maximum value and a minimum value of all elements in the set of annual ring distances, and the average may be an arithmetic average, a geometric average, a square average, a harmonic average, a weighted average, or the like.
As an embodiment of the present invention, the first base station is evaluated according to a preset rule according to the set of ring distances, where the preset rule is a standard deviation of all elements in the set of ring distances, a difference between an element corresponding to a maximum value in the set of ring distances and a mean value of all elements in the set of ring distances is calculated, and when the difference is smaller than an integer multiple of the standard deviation of all elements in the set of ring distances, for example, may be an integer multiple such as one, two, three, four, or the like, the corresponding first base station may be determined as a calculation base station, and the calculation base station is used for calculating the signal distance, and the number of the calculation base stations is at least multiple.
As still another embodiment of the present invention, the set of annual ring distances is defined as follows:
Figure BDA0002315548620000271
firstly, sorting the annual ring distances in a descending order, and recording the sorted result as
Figure BDA0002315548620000272
Then, the mean and standard deviation of the set of annual ring distances are calculated, the mean being
Figure BDA0002315548620000273
The standard deviation is
Figure BDA0002315548620000281
And then, judging the first base station according to a preset rule, wherein the preset rule is that the abnormal first base station is eliminated by using a method of 3 times of standard deviation. Specifically, the judgment is carried out according to the following steps: assuming that the initial value s1 is 0, calculating
Figure BDA0002315548620000282
Computing
Figure BDA0002315548620000283
If it is not
Figure BDA0002315548620000284
Deleting the corresponding first base station, then making s1 equal to s1+1, and repeating the steps until the corresponding first base station is deleted
Figure BDA0002315548620000285
Determining the corresponding first base station as the computing base station.
As another embodiment of the present invention, a sorting set is generated by sorting all elements in the set of annual ring distances in descending order, calculating a mean value and a standard deviation of all annual ring distances in the sorting set, and calculating a difference between a leading element and the mean value of the sorting set, that is, a difference between a largest element and the mean value of the sorting set, when the difference exceeds 3 times of the standard deviation of the sorting set, a first base station generating the annual ring distance is considered as an abnormal first base station, and is eliminated; and recalculating the mean value and the standard deviation of the remaining annual ring distances and the difference value between the largest element and the mean value, eliminating the largest element according to the same method until the difference value between the largest element and the mean value is less than 3 times of the standard deviation, and selecting the first base station generating the first t annual ring distances for the remaining annual ring distances to participate in RSS distance calculation, wherein the first base stations are calculation base stations. When all the first base stations are not abnormal, the larger the annual ring distances generated at two different positions, the stronger the representation capability of the annual ring distances generated at the two positions of the first base station on the physical distance, therefore, the maximum t values are selected for the first base station without abnormality, so that the elimination of the first base station with weak representation capability of the annual ring distances on the physical distance is realized, the method can be used for ensuring the strong correlation and high consistency of the physical distance and the RSS distance on the basis of reducing the calculation time and the positioning time delay, and can be used in all related positioning technologies which need the RSS distance to perform indoor positioning.
According to the embodiment of the invention, the first base station is judged according to the set of annual ring distances and a preset rule to determine whether the first base station is a calculation base station, so that the calculation base stations are screened from all the first base stations, and the RSS distances are calculated through the corresponding number of calculation base stations.
In step S208, the signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes is obtained, so as to calculate the euclidean distance of the RSS vector between any two of the reference nodes, and the euclidean distance is output to the database, where the euclidean distance is used to represent the difference of the wireless signal strength vectors between any two of the reference nodes.
In the embodiment of the present invention, the reference node refers to that, in a target environment, the positions of some specific wireless routers are manually calibrated, coordinates of the positions are known, the positions of the wireless routers are the reference nodes, the euclidean distance refers to a real distance between two points in an m-dimensional space or a natural length of a vector, and is an actual distance between the two points in a two-dimensional space and a three-dimensional space, in this embodiment, the RSS distance is an euclidean distance between RSS value vectors from all computing base stations in RSS fingerprints at two different positions in the target environment, the database may be a database in a server cluster formed by a plurality of physical servers, and may be a database in a cloud server providing basic cloud computing services such as a cloud server, a cloud database, a cloud storage, and a CDN, and the database is stored together in a certain manner, The data set can be shared by a plurality of users, has the redundancy as small as possible, and is independent from the application program, and the users can add, inquire, update, delete and the like to the data in the file.
As an embodiment of the present invention, after obtaining a plurality of the computing base stations through evaluation, the server obtains signal strength information of the signals transmitted by the computing base stations and received by any two of the reference nodes, calculates a euclidean distance of a signal vector between any two of the reference nodes, and outputs the euclidean distance to the database, where the euclidean distance is used to represent a difference in wireless signal strength vectors between any two of the reference nodes.
According to the embodiment of the invention, a plurality of calculation base stations are selected to calculate the RSS distance, the Euclidean distance of a signal vector between any two reference nodes is calculated, the Euclidean distance is output to a database, and an indoor positioning RSS distance map is formed.
The embodiment of the invention forms the RSS fingerprint by acquiring the signal information, calculates all RSS values of all the reference nodes in the RSS fingerprint to obtain a set of annual ring distances of the reference nodes relative to the first base station, judges the first base station according to the set of annual ring distances and a preset rule to determine the calculation base station, so that the first base station generating different annual ring distances acquires the power participating in calculating the RSS distance in a post competition mode, the RSS difference generated between any two nodes in the reference nodes by the calculation base station participating in calculating the RSS distance can well represent the physical distance between the two nodes, and thus, when the optimized and small number of first base stations are used for calculating the RSS distance, the strong correlation and high consistency requirements of the RSS distance and the physical distance can be still achieved, the method provides rapid and high-quality RSS distance for various indoor positioning methods based on RSS distance, does not need to calculate signal distance of all indoor wireless routers serving as first base stations, has small workload and high positioning precision, and solves the technical problems of large workload and easy reduction of positioning precision of the conventional method for calculating the signal distance by wireless signal strength.
In one embodiment, a computer device is proposed, which comprises a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the method of calculating a signal distance in an embodiment of the invention.
FIG. 7 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the server 120 in fig. 1. As shown in fig. 7, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory of the computer device stores an operating system and may further store a computer program, which, when executed by the processor, causes the processor to carry out the method of calculating a signal distance. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In embodiments of the present invention, the memory may be a high speed random access memory such as DRAM, SRAM, DDR, RAM, or other random access solid state memory device, or a non-volatile memory such as one or more hard disk storage devices, optical disk storage devices, memory devices, or the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the apparatus for calculating a signal distance provided herein may be implemented in the form of a computer program, which is executable on a computer device as shown in fig. 7. The memory of the computer device may store various program modules constituting the apparatus for calculating a signal distance, such as the acquisition module 310, the first calculation module 320, the judgment module 330, and the second calculation module 340 shown in fig. 3. The computer program constituted by the respective program modules causes the processor to execute the steps in the method of calculating a signal distance of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 7 may execute step S202 through the obtaining module 310 in the apparatus for calculating a signal distance shown in fig. 3, to obtain signal information, where the signal information at least includes coordinate information of a reference node used for receiving the signal sent by the first base station and signal strength information of the signal received by the reference node, where there are at least a plurality of the first base station and the reference node. The computer device may perform step S204 through the first calculation module 320, and calculate a set of annual ring distances of the reference nodes relative to the first base station according to the signal information, wherein the annual ring distances are absolute values of differences between any two reference nodes relative to the first base station RSS values. The computer device may execute step S206 through the evaluation module 330, evaluate the first base station according to the set of annual ring distances and a preset rule, and determine that the first base station is a calculation base station when the set of annual ring distances meets the preset rule, where the calculation base station is used to calculate the signal distance, and there are at least a plurality of calculation base stations. The computer device may execute step S208 through the second calculation module 340, to obtain the signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes, to calculate the euclidean distance of the RSS vector between any two of the reference nodes, and output the euclidean distance to the database, where the euclidean distance is used to represent the difference in wireless signal strength vector between any two of the reference nodes.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the processor is caused to execute the steps of the method for calculating a signal distance.
In the several embodiments provided by the present invention, it should be understood that the described embodiments are merely illustrative, for example, the division of the modules is only one logical function division, and there may be other division manners in actual implementation, for example, a plurality of modules may be combined or may be integrated together, or some modules may be omitted, and some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in various embodiments may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method of calculating a signal distance, the method comprising:
acquiring signal information, wherein the signal information at least comprises coordinate information of a reference node used for receiving the signal sent by a first base station and signal strength information of the signal received by the reference node, and at least a plurality of first base stations and the reference nodes are provided;
calculating from the signal information a set of annual ring distances of the reference nodes relative to the first base station, the annual ring distances being the absolute value of the difference between any two of the reference nodes relative to the first base station RSS value;
judging the first base station according to the set of the annual ring distances and a preset rule, and determining the first base station as a calculation base station when the set of the annual ring distances meets the preset rule, wherein the calculation base station is used for calculating the signal distances and at least a plurality of calculation base stations are provided;
and acquiring the signal strength information of the signals transmitted by the computing base station and received by any two of the reference nodes, so as to compute the Euclidean distance of the RSS vector between any two of the reference nodes, and outputting the Euclidean distance to a database, wherein the Euclidean distance is used for representing the difference of the wireless signal strength vectors between any two of the reference nodes.
2. The method of claim 1, wherein said calculating a set of annual ring distances of the reference node relative to the first base station from the signal information comprises:
collecting signal strength information of all the signals transmitted by the first base station and received by the reference node to associate coordinate information of the reference node to form an association set;
forming a two-dimensional matrix according to all the association sets, wherein the two-dimensional matrix at least comprises coordinate information of the reference node and signal strength information of the signal transmitted by the first base station and received by the reference node;
calculating the absolute value of the difference between any two reference nodes relative to the RSS value of the first base station according to the two-dimensional matrix;
collecting absolute values of distance differences of all of the arbitrary two of the reference nodes with respect to the first base station to form a set of annual ring distances of the reference nodes with respect to the first base station.
3. The method of claim 1, wherein the evaluating the first base station according to the set of annual ring distances according to a preset rule comprises:
sorting the elements in the set of annual ring distances by numerical size to generate a sorted set;
calculating a difference value between a leading element in the sorting set and a mean value of the sorting set and a standard deviation of the sorting set to determine whether the first base station is the calculating base station.
4. The method of claim 1, wherein the predetermined rule is to determine the first base station as a computing base station when the difference between the largest element in the set of annual ring distances and a first computed value is smaller than a second computed value, wherein the first computed value is an average value computed from all elements in the set of annual ring distances, and the second computed value is an integer multiple of a standard deviation computed from all elements in the set of annual ring distances.
5. The method of claim 1, wherein the annual ring distance is formulated as
Figure FDA0002315548610000021
Calculation of where rimRepresents the RSS value, r, from the mth first base station received by the ith reference nodei′mRepresenting the RSS value received by the ith' reference node from the mth first base station.
6. The method of claim 1, wherein the euclidean distance of the RSS vector between any two of the reference nodes is in accordance with a formula
Figure FDA0002315548610000022
Calculating, wherein t is the number of the calculating base stations,
Figure FDA0002315548610000023
an absolute value representing a difference between RSS values of any two of the reference nodes with respect to the k-th calculated base station, and an initial value of s1 is 0.
7. The method of claim 1, further comprising determining an accuracy of a euclidean distance of the RSS vector, the determining the accuracy of the euclidean distance of the RSS vector comprising:
calculating the physical distance between any two nodes in the reference nodes;
and calculating the difference value of the physical distance between any two reference nodes and the Euclidean distance of the corresponding RSS vector to determine the accuracy of the Euclidean distance of the RSS vector.
8. An apparatus for calculating a signal distance, the apparatus comprising:
an obtaining module, configured to obtain signal information, where the signal information at least includes coordinate information of a reference node used to receive the signal sent by a first base station and signal strength information of the signal received by the reference node, where at least a plurality of the first base stations and the plurality of the reference nodes are provided;
a first calculation module configured to calculate, according to the signal information, a set of annual ring distances of the reference nodes with respect to the first base station, where the annual ring distances are absolute values of differences between any two of the reference nodes with respect to the first base station RSS values;
the judging module is used for judging the first base station according to the set of annual ring distances and a preset rule, and when the set of annual ring distances meets the preset rule, the first base station is determined to be a calculation base station which is used for calculating the signal distances, and at least a plurality of calculation base stations are provided;
and a second calculating module, configured to obtain signal strength information of the signal transmitted by the computing base station and received by any two of the reference nodes, to calculate a euclidean distance of an RSS vector between any two of the reference nodes, and output the euclidean distance to a database, where the euclidean distance is used to represent a difference in wireless signal strength vectors between any two of the reference nodes.
9. A computer arrangement comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of calculating a signal distance of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, causes the processor to carry out the steps of the method of calculating a signal distance as claimed in any one of claims 1 to 7.
CN201911288908.6A 2019-12-12 2019-12-12 Method and device for calculating signal distance, computer equipment and storage medium Expired - Fee Related CN110958565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911288908.6A CN110958565B (en) 2019-12-12 2019-12-12 Method and device for calculating signal distance, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911288908.6A CN110958565B (en) 2019-12-12 2019-12-12 Method and device for calculating signal distance, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110958565A true CN110958565A (en) 2020-04-03
CN110958565B CN110958565B (en) 2021-01-01

Family

ID=69981617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911288908.6A Expired - Fee Related CN110958565B (en) 2019-12-12 2019-12-12 Method and device for calculating signal distance, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110958565B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112327247A (en) * 2020-09-29 2021-02-05 深圳市虹鹏能源科技有限责任公司 Positioning device and positioning system of flat-plate transport vehicle
CN113613168A (en) * 2021-08-10 2021-11-05 清研讯科(北京)科技有限公司 Positioning method, positioning device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104869636A (en) * 2015-05-12 2015-08-26 四川师范大学 Indoor positioning method based on distance measurement information fusion
CN107509171A (en) * 2017-09-01 2017-12-22 广州杰赛科技股份有限公司 Indoor orientation method and device
CN109688542A (en) * 2019-01-25 2019-04-26 佛山市顺德区中山大学研究院 A kind of adaptive indoor orientation method based on WiFi and mobile communication base station

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104869636A (en) * 2015-05-12 2015-08-26 四川师范大学 Indoor positioning method based on distance measurement information fusion
CN107509171A (en) * 2017-09-01 2017-12-22 广州杰赛科技股份有限公司 Indoor orientation method and device
CN109688542A (en) * 2019-01-25 2019-04-26 佛山市顺德区中山大学研究院 A kind of adaptive indoor orientation method based on WiFi and mobile communication base station

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周非: "基于主成分分析和卡方距离的信号强度差指纹定位算法", 《计算机应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112327247A (en) * 2020-09-29 2021-02-05 深圳市虹鹏能源科技有限责任公司 Positioning device and positioning system of flat-plate transport vehicle
CN112327247B (en) * 2020-09-29 2024-05-28 深圳市虹鹏能源科技有限责任公司 Positioning device and positioning system of flat-plate transport vehicle
CN113613168A (en) * 2021-08-10 2021-11-05 清研讯科(北京)科技有限公司 Positioning method, positioning device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN110958565B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN108628904B (en) Path coding method, similar path searching method, similar path coding device, similar path searching device and electronic equipment
CN108280115B (en) Method and device for identifying user relationship
WO2020215783A1 (en) Locating method and apparatus, and storage medium
CN112218330B (en) Positioning method and communication device
WO2015154438A1 (en) Positioning method and device
WO2020207096A1 (en) Method for performing positioning in 5g scenarios, positioning platform and user terminal
CN112801301B (en) Asynchronous computing method, device, apparatus, storage medium, and program product
CN110351654A (en) A kind of localization method, device, storage medium and electronic equipment
JP6696859B2 (en) Quality estimation device and quality estimation method
CN110490295B (en) Data processing method and processing device
CN111090877B (en) Data generation and acquisition methods, corresponding devices and storage medium
CN110784837B (en) Indoor positioning method, device, medium and electronic equipment
CN110958565B (en) Method and device for calculating signal distance, computer equipment and storage medium
CN109756970B (en) Proximity relation wireless signal positioning method, device, equipment and storage medium
Loh et al. Intelligent base station placement in urban areas with machine learning
CN113055901B (en) Terminal positioning method and device
CN109242782A (en) Noise processing method and processing device
CN114125813B (en) Signal coverage range determining method based on mobile phone signaling and related device
CN112235723B (en) Positioning method, positioning device, electronic equipment and computer readable storage medium
CN111065045B (en) Matching positioning method and device, electronic equipment and computer readable medium
CN113395762A (en) Position correction method and device in ultra-wideband positioning network
CN116567806A (en) Positioning method and communication equipment based on artificial intelligence AI model
Yu et al. An indoor localization of WiFi based on branch-bound algorithm
CN112288867A (en) Smart building three-dimensional model rendering method and smart building system
CN110636525A (en) Credibility perception-based data transmission control method suitable for 5G network

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210101

Termination date: 20211212

CF01 Termination of patent right due to non-payment of annual fee