Measure the methods, devices and systems of distance
Technical field
The present invention relates to electronic technology, particularly relate to a kind of methods, devices and systems measuring distance.
Background technology
Along with the development of vehicle technology, unmanned it is developed rapidly.Carrying out nobody
In driving procedure, need the distance between vehicle is measured, thus the distance between vehicle
Time too small, perform corresponding anticollision flow process.
In vehicle travel process, vehicle odometry can use following several method: laser ranging, super
Sound ranging, radar range finding and infrared distance measuring etc..But this several ways is required to add on vehicle
Fill corresponding equipment, such as: laser range finder, radar or infrared equipment etc., thus cause surveying
Span from relatively costly.
Summary of the invention
The present invention provides a kind of methods, devices and systems measuring distance, is used for solving prior art
The relatively costly technical problem of middle measurement distance.
For reaching above-mentioned purpose, embodiments of the invention adopt the following technical scheme that
First aspect, it is provided that a kind of method measuring distance, including:
The management frame that application layer is sent, it may be judged whether for the ranging data for measuring distance
Frame;
If described management frame is described ranging data frame, then pass through data switch by described in physical layer
Ranging data frame sends to air interface;
The ranging data for described ranging data frame is responded is received by described air interface
Acknowledgement frame;
The described ranging data frame that calculating application layer sends, and received by described air interface
Time interval between described ranging data acknowledgement frame;
According to described time interval, calculate and obtain range measurements.
Second aspect, it is provided that a kind of device measuring distance, including:
Judge module, for the management frame sent for application layer, it may be judged whether for being used for measuring
The ranging data frame of distance;
First sending module, if being described ranging data frame for described management frame, then in physical layer
By data switch, described ranging data frame is sent to air interface;
Receiver module, for receiving for carrying out described ranging data frame by described air interface
The ranging data acknowledgement frame of response;
Time Calculation module, for calculating the described ranging data frame that application layer sends, and passes through
Time interval between the described ranging data acknowledgement frame that described air interface receives;
Distance calculation module, for according to described time interval, calculates and obtains range measurements.
The third aspect, it is provided that a kind of method measuring distance, including:
Ranging data frame is received by air interface;
The management frame that application layer is sent, it may be judged whether for for described ranging data frame is entered
The ranging data acknowledgement frame of row response;
If judging, described management frame is described ranging data acknowledgement frame, then pass through in described physical layer
Described ranging data acknowledgement frame is sent to described air interface by data switch.
Fourth aspect, it is provided that a kind of device measuring distance, including:
Data frame receipt module, for receiving ranging data frame by air interface;
Frame judge module, for the management frame that sent for application layer, it may be judged whether for
In the ranging data acknowledgement frame that described ranging data frame is responded;
Frame the first sending module, if for judging that described management frame is that described ranging data is true
Recognize frame, then by data switch, described ranging data acknowledgement frame is sent to described in described physical layer
Air interface.
5th aspect, it is provided that a kind of system measuring distance, including the survey as described in second aspect
Span from device, and the device of the measurement distance as described in fourth aspect.
The methods, devices and systems of the measurement distance that the embodiment of the present invention provides, by for application
The management frame that layer is sent, it may be judged whether for being used for measuring the ranging data frame of distance, if then existing
Ranging data frame is sent to air interface by physical layer by data switch, and then is connect in the air by this
Mouth receives the ranging data acknowledgement frame for responding ranging data frame, calculates application layer and sends
Ranging data frame, and receive ranging data acknowledgement frame between time interval, during according to this
Between be spaced, calculate obtain range measurements.It is ranging data frame or range finding number owing to working as management frame
During according to acknowledgement frame, directly it is transmitted by data switch, it is to avoid management frame is joined message
In queue, thus save the process of competition in message queue so that application layer sends range finding number
According to frame, and the time interval received between ranging data acknowledgement frame can accurately reflect range measurement
Result.Only need communicator provisioned in vehicle both can realize simultaneously as send management frame,
Without optional equipment for measuring the device of distance, therefore solve and prior art is measured distance
Relatively costly technical problem.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the present invention
Technological means, and can be practiced according to the content of description, and the present invention's be upper in order to allow
State and can become apparent with other objects, features and advantages, below especially exemplified by the concrete reality of the present invention
Execute mode.
Accompanying drawing explanation
By reading the detailed description of hereafter preferred implementation, various other advantage and benefit
Place will be clear from understanding for those of ordinary skill in the art.Accompanying drawing is only used for illustrating preferably
The purpose of embodiment, and it is not considered as limitation of the present invention.And at whole accompanying drawing
In, it is denoted by the same reference numerals identical parts.In the accompanying drawings:
The schematic flow sheet of a kind of method measuring distance that Fig. 1 provides for the embodiment of the present invention one;
Fig. 2 is the schematic diagram of the method measuring distance;
The structural representation of a kind of device 30 measuring distance that Fig. 3 provides for the embodiment of the present invention two;
The structural representation of the another kind of device 30 measuring distance that Fig. 4 provides for the embodiment of the present invention two
Figure;
The schematic flow sheet of a kind of method measuring distance that Fig. 5 provides for the embodiment of the present invention three;
The structural representation of a kind of device 60 measuring distance that Fig. 6 provides for the embodiment of the present invention four;
The structural representation of the another kind of device 60 measuring distance that Fig. 7 provides for the embodiment of the present invention four
Figure;
The structural representation of a kind of system measuring distance that Fig. 8 provides for the embodiment of the present invention five;
A kind of application scenarios schematic diagram that Fig. 9 provides for the embodiment of the present invention five.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although it is attached
Figure shows the exemplary embodiment of the disclosure, it being understood, however, that can be with various shapes
Formula realizes the disclosure and should not limited by embodiments set forth here.On the contrary, it is provided that these
Embodiment is able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
Below in conjunction with the accompanying drawings the method for distance, device measured in embodiment of the present invention offer and be
System is described in detail.
Embodiment one
The schematic flow sheet of a kind of method measuring distance that Fig. 1 provides for the embodiment of the present invention one,
In a kind of possible application scenarios, the method in the present embodiment can be performed by the first vehicle, should
First vehicle performs the method in the present embodiment can record the distance between the second vehicle, such as Fig. 1
Shown in, including:
Step 101, the management frame that application layer is sent, it may be judged whether for for measuring distance
Ranging data frame.
Concrete, when the first vehicle needs to measure the distance between the second vehicle, application layer is raw
The management frame that Cheng Yixiang the second vehicle sends, this management frame is the ranging data carrying range finding mark
Frame.Wherein, this ranging data frame is based on 802.11p agreement.
It should be noted that IEEE 802.11p agreement, also known as the wireless access under vehicle environmental
(Wireless Access in the Vehicular Environment, WAVE) be one by IEEE
The communication protocol that 802.11 standards expand, is mainly used in vehicle electronics radio communication, has control letter
Road (Control Channel, CCH) and synchronizing channel (synchronization channel, SCH)
Two different channels.CCH can be used to transmit WAVE short message (WAVEShortMessage,
WSM), SCH can be used to transmit WSM and network interconnection agreement (Internet Protocol, IP)
Data.
If step 102 management frame is ranging data frame, then will range finding by data switch in physical layer
Frame sends to air interface.
Concrete, this data switch is 802.11p data switch, at least has 802.11p media and visits
Ask control (Media Access Control, MAC) passage and range finding passage.If judging this pipe
Reason frame is ranging data frame, then pass through the range finding passage of data switch by ranging data frame in physical layer
Send to air interface.This air interface be pre-configured with based on 802.11p agreement for the first car
And second vehicle between communicate.
Step 103, received for ranging data that ranging data frame is responded by air interface
Acknowledgement frame.
Concrete, the first vehicle by air interface after the second vehicle sends ranging data frame,
After the physical layer of the second vehicle receives ranging data frame by this air interface, by the second vehicle
Application layer generate management frame based on 802.11p agreement, this management frame be carry range finding mark
Ranging data acknowledgement frame, if the physical layer at the second vehicle judges that this management frame is for for range finding
Frame carries out the ranging data acknowledgement frame responded, then by data switch by ranging data acknowledgement frame
Send to air interface.Thus the physical layer of the first vehicle is received for range finding by air interface
Frame carries out the ranging data acknowledgement frame responded, and then the application layer of the first vehicle passes through physical layer
Get this ranging data acknowledgement frame.
The ranging data frame that step 104, calculating application layer send, and received by air interface
Time interval between ranging data acknowledgement frame.
Concrete, the first vehicle sends the time point of ranging data frame, and application according to application layer
Layer gets the time point of ranging data acknowledgement frame by physical layer, calculates between the two time point
Time interval.
Step 105, according to time interval, calculate and obtain range measurements.
Concrete, time interval t substitution formula s=t × C/2 is calculated, it is thus achieved that range measurement
Result s, wherein, C is the light velocity.
Further, after step 101, if also including, managing frame is not ranging data frame, then depend on
Secondary via message queue and data switch, described management frame is sent to air interface.
Concrete, management frame is increased in the message queue that priority is the highest, when described preferentially
In the message queue that level is the highest, during poll to management frame, by described data switch, management frame is sent out
Deliver to air interface.
In order to understand explanation the present embodiment, the present embodiment additionally provides the principle of the method measuring distance
Figure, Fig. 2 is the schematic diagram of method measuring distance, as in figure 2 it is shown, management frame judging unit with
The AC=4 that priority is the highest, i.e. access level (Access Category) are that 4 message queues are connected,
The most also it is connected with 802.11p data switch, thus when management frame judging unit determines that management frame is for surveying
Directly sent to air interface by 802.11p data switch when Frame, and determine management frame not
For during ranging data frame the most successively via AC=4 message queue and 802.11p data switch by number of finding range
Send to air interface according to frame.Wherein, AC=4 message queue has corresponding configuration parameter, should
Configuration parameter includes: Arbitration Inter Frame Space (arbitration inter-frame space, AIFS), competing
Strive window (contention window, CW) and send opportunity limit (transmissionopportunity,
TXOP)。
In fig. 2, AC represents the priority of each channel, AC value from 1 to 4, wherein 4
Priority the highest.For each priority, the data of equal priority can inbound message team
Row are queued up, and message queue follows the principle of first in first out.All of message queue carry out internal competing
After striving, participate in Channel assignment and Media Competition.Due to when manage frame be ranging data frame time, directly
Connected 802.11p data switch to be transmitted, it is to avoid join in message queue by management frame,
Thus saving the process of competition in message queue so that application layer sends ranging data frame, with
And the time interval received between ranging data acknowledgement frame can accurately reflect range measurements.
In the present embodiment, by the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame, if then physical layer by data switch by ranging data frame send
To air interface, and then receive the survey for ranging data frame is responded by this air interface
Away from data validation frame, calculate the ranging data frame that application layer sends, and the ranging data received is true
Recognize the time interval between frame, according to this time interval, calculate and obtain range measurements.Due to
When managing frame and being ranging data frame, directly it is transmitted by data switch, it is to avoid general manages
Frame joins in message queue, thus saves the process of competition in message queue so that application
The time interval that layer sends between ranging data frame, and reception ranging data acknowledgement frame can be accurate
Reflection range measurements.Simultaneously as send management frame only need communication provisioned in vehicle
Device both can realize, it is not necessary to optional equipment, for measuring the device of distance, therefore solves existing skill
Art is measured the relatively costly technical problem of distance.
Embodiment two
The structural representation of a kind of device 30 measuring distance that Fig. 3 provides for the embodiment of the present invention two,
In a kind of possible application scenarios, the device 30 of the measurement distance that the present embodiment is provided can be pacified
It is loaded in the first vehicle, for measuring the distance between the first vehicle and the second vehicle, such as Fig. 3 institute
Showing, the device 30 measuring distance includes: judge module the 31, first sending module 32, reception mould
Block 33, Time Calculation module 34 and distance calculation module 35.
Judge module 31, for the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame.
First sending module 32, if being described ranging data frame for described management frame, then at physics
Described ranging data frame is sent to air interface by layer by data switch.
Wherein, data switch includes MAC passage and the range finding passage of 802.11p.
Concrete, the first sending module 32 is specifically in the physical layer survey by described data switch
Away from passage, described ranging data frame is sent to air interface.
Receiver module 33, for receiving for entering described ranging data frame by described air interface
The ranging data acknowledgement frame of row response.
Time Calculation module 34, for calculating the described ranging data frame that application layer sends, Yi Jitong
Cross the time interval between the described ranging data acknowledgement frame that described air interface receives.
Distance calculation module 35, for according to described time interval, calculates and obtains range measurements.
Concrete, distance calculation module 35 is specifically for substituting into formula s=t by described time interval t
× C/2 calculates, it is thus achieved that range measurements s, and wherein, C is the light velocity.
The present embodiment additionally provides the another kind of device measuring distance, and Fig. 4 is the embodiment of the present invention two
The structural representation of the another kind of device 30 measuring distance provided, as shown in Figure 4, in Fig. 3 institute
Farther include on the basis of the device 30 of the measurement distance provided: the second sending module 36.
Second sending module 36, if not being described ranging data frame for described management frame, the most successively
Via message queue and data switch, described management frame is sent to air interface.
Concrete, the second sending module 36 is the highest specifically for described management frame is increased to priority
Message queue in;When in the message queue the highest in described priority, poll to described management frame
Time, by described data switch, described management frame is sent to air interface.
In the present embodiment, by the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame, if then physical layer by data switch by ranging data frame send
To air interface, and then receive the survey for ranging data frame is responded by this air interface
Away from data validation frame, calculate the ranging data frame that application layer sends, and the ranging data received is true
Recognize the time interval between frame, according to this time interval, calculate and obtain range measurements.Due to
When managing frame and being ranging data frame, directly it is transmitted by data switch, it is to avoid general manages
Frame joins in message queue, thus saves the process of competition in message queue so that application
The time interval that layer sends between ranging data frame, and reception ranging data acknowledgement frame can be accurate
Reflection range measurements.Simultaneously as send management frame only need communication provisioned in vehicle
Device both can realize, it is not necessary to optional equipment, for measuring the device of distance, therefore solves existing skill
Art is measured the relatively costly technical problem of distance.
Embodiment three
The schematic flow sheet of a kind of method measuring distance that Fig. 5 provides for the embodiment of the present invention three,
In a kind of possible application scenarios, the first vehicle can perform measurement that embodiment one provided away from
From method, the method in the present embodiment can by second vehicle perform, this second vehicle performs basis
Method in embodiment so that the first vehicle records the distance between the second vehicle and the first vehicle,
As it is shown in figure 5, include:
Step 501, by air interface receive ranging data frame.
Concrete, this air interface be pre-configured with based on 802.11p agreement for the first vehicle and
Communicate between second vehicle.
Step 502, the management frame that application layer is sent, it may be judged whether for for described range finding
Frame carries out the ranging data acknowledgement frame responded.
If step 503 judges that described management frame is described ranging data acknowledgement frame, then at described thing
Described ranging data acknowledgement frame is sent to described air interface by reason layer by data switch.
Wherein, data switch can be 802.11p data switch, at least has the MAC of 802.11p
Passage and range finding passage.
Concrete, in physical layer by the range finding passage of described data switch by true for described ranging data
Recognize frame to send to described air interface.
Further, after step 502, also include:
If physical layer judges that described management frame is not described ranging data acknowledgement frame, the most successively via
Described management frame is sent to air interface by message queue and data switch.
Concrete, described management frame is increased in the message queue that priority is the highest;When described
In the message queue that priority is the highest, during poll to described management frame, will by described data switch
Described management frame sends to air interface.
In the present embodiment, by the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame, if then physical layer by data switch by ranging data frame send
To air interface, and then receive the survey for ranging data frame is responded by this air interface
Away from data validation frame, calculate the ranging data frame that application layer sends, and the ranging data received is true
Recognize the time interval between frame, according to this time interval, calculate and obtain range measurements.Due to
When managing frame and being ranging data acknowledgement frame, directly it is transmitted by data switch, it is to avoid general
Management frame joins in message queue, thus saves the process of competition in message queue so that
The time interval that application layer sends between ranging data frame, and reception ranging data acknowledgement frame can
Accurately reflect range measurements.Only need in vehicle provisioned simultaneously as send management frame
Communicator both can realize, it is not necessary to optional equipment, for measuring the device of distance, therefore solves existing
There is in technology the relatively costly technical problem measuring distance.
Embodiment four
The structural representation of a kind of device 60 measuring distance that Fig. 6 provides for the embodiment of the present invention four,
In a kind of possible application scenarios, the device 30 of the measurement distance that embodiment two is provided can be pacified
Being loaded in the first vehicle, the device 60 of the measurement distance that the present embodiment is provided can be installed on second
In vehicle so that the measurement distance in the first vehicle device 30 measure obtain the first vehicle and
Distance between second vehicle, as shown in Figure 6, the device of the measurement distance that the present embodiment is provided
60 include: data frame receipt module 61, Frame judge module 62 and Frame first send mould
Block 63.
Data frame receipt module 61, for receiving ranging data frame by air interface.
Concrete, this air interface be pre-configured with based on 802.11p agreement for the first vehicle and
Communicate between second vehicle.
Frame judge module 62, for the management frame sent for application layer, it may be judged whether for
For the ranging data acknowledgement frame that described ranging data frame is responded.
Frame the first sending module 63, if for judging that described management frame is described ranging data
Acknowledgement frame, then sent described ranging data acknowledgement frame to institute by data switch in described physical layer
State air interface.
Wherein, data switch includes MAC passage and the range finding passage of 802.11p.
Concrete, Frame the first sending module 63, specifically in physical layer by described data
Described ranging data acknowledgement frame is sent to described air interface by the range finding passage of switch.
The present embodiment additionally provides the another kind of device measuring distance, and Fig. 7 is the embodiment of the present invention four
The structural representation of the another kind of device 60 measuring distance provided, as it is shown in fig. 7, in Fig. 6 institute
Farther include on the basis of the device 60 of the measurement distance provided: Frame the second sending module 64.
For physical layer, Frame the second sending module 64, if judging that described management frame is not described
Ranging data acknowledgement frame, sends described management frame extremely via message queue and data switch the most successively
Air interface.
Concrete, Frame the second sending module 64, specifically for increasing to excellent by described management frame
In the message queue that first level is the highest;When, in the message queue the highest in described priority, poll is to institute
When stating management frame, by described data switch, described management frame is sent to air interface.
In the present embodiment, by the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame, if then physical layer by data switch by ranging data frame send
To air interface, and then receive the survey for ranging data frame is responded by this air interface
Away from data validation frame, calculate the ranging data frame that application layer sends, and the ranging data received is true
Recognize the time interval between frame, according to this time interval, calculate and obtain range measurements.Due to
When managing frame and being ranging data acknowledgement frame, directly it is transmitted by data switch, it is to avoid general
Management frame joins in message queue, thus saves the process of competition in message queue so that
The time interval that application layer sends between ranging data frame, and reception ranging data acknowledgement frame can
Accurately reflect range measurements.Only need in vehicle provisioned simultaneously as send management frame
Communicator both can realize, it is not necessary to optional equipment, for measuring the device of distance, therefore solves existing
There is in technology the relatively costly technical problem measuring distance.
Embodiment five
The structural representation of a kind of system measuring distance that Fig. 8 provides for the embodiment of the present invention five,
As shown in Figure 8, including: measure the device 30 of distance and measure the device 60 of distance.
Each functional module of the device 30 measuring distance and the device 60 measuring distance sees embodiment
Two and the associated description of embodiment four, this is repeated no more by the present embodiment.
In a kind of possible application scenarios, two measure the device of distance, i.e. measure the device of distance
30 and measure distance device 60, be installed in two different vehicle, Fig. 9 is the embodiment of the present invention five
A kind of application scenarios schematic diagram provided, as it is shown in figure 9, the device 30 measuring distance is installed on the
One vehicle 81, the device 60 measuring distance is installed on the second vehicle 82.
Measure the system of distance, for measuring the distance between the first vehicle 81 and the second vehicle 82.
Wherein, the first vehicle 81 is provided with the device 30 of the measurement distance that embodiment two is provided.The
It is connected with each other by air interface between one vehicle 81 and the second vehicle 82.This air interface based on
802.11p agreement.
First vehicle 81, for the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame;If described management frame is described ranging data frame, then lead in physical layer
Cross data switch to send described ranging data frame to air interface;Received by described air interface
For the ranging data acknowledgement frame that described ranging data frame is responded;Calculate what application layer sent
Time interval between ranging data frame, and the ranging data acknowledgement frame received by air interface;
According to described time interval, calculate and obtain range measurements.
Second vehicle 82, for receiving ranging data frame by air interface;Application layer is sent out
The management frame sent, it may be judged whether true for the ranging data for described ranging data frame is responded
Recognize frame;If judging, described management frame is described ranging data acknowledgement frame, then lead in described physical layer
Cross data switch to send described ranging data acknowledgement frame to described air interface.
In the present embodiment, by the management frame sent for application layer, it may be judged whether for being used for surveying
Span from ranging data frame, if then physical layer by data switch by ranging data frame send
To air interface, and then receive the survey for ranging data frame is responded by this air interface
Away from data validation frame, calculate application layer and send ranging data frame, and receive ranging data acknowledgement frame
Between time interval, according to this time interval, calculate and obtain range measurements.Due to when pipe
When reason frame is ranging data frame and ranging data acknowledgement frame, directly it is transmitted by data switch,
Avoid and management frame is joined in message queue, thus save the mistake of competition in message queue
Journey so that application layer sends ranging data frame, and receives the time between ranging data acknowledgement frame
Interval can accurately reflect range measurements.Only need in vehicle simultaneously as send management frame
Provisioned communicator both can realize, it is not necessary to optional equipment is for measuring the device of distance, therefore
Solve the relatively costly technical problem measuring distance in prior art.
One of ordinary skill in the art will appreciate that: realize the whole of above-mentioned each method embodiment
Or part steps can be completed by the hardware that programmed instruction is relevant.Aforesaid program is permissible
It is stored in a computer read/write memory medium.This program upon execution, performs to include
State the step of each method embodiment;And aforesaid storage medium includes: ROM, RAM, magnetic
The various medium that can store program code such as dish or CD.
It is last it is noted that various embodiments above is only in order to illustrate technical scheme,
It is not intended to limit;Although the present invention being described in detail with reference to foregoing embodiments,
It will be understood by those within the art that: foregoing embodiments still can be remembered by it
The technical scheme carried is modified, or carries out the most some or all of technical characteristic
With replacing;And these amendments or replacement, do not make the essence of appropriate technical solution depart from this
Invent the scope of each embodiment technical scheme.