A kind of jamproof geomagnetic parking stall detector program wireless downloading update method
Technical field
The present invention relates to a kind of jamproof geomagnetic parking stall detector program wireless downloading update methods, serve primarily in ground
The update of magnetic parking space detector program, belongs to geomagnetic parking stall detection technique field.
Background technology
Currently, the scale of urban parking area is increasing, parking lot establish parking lot server and geomagnetism detecting device it
Between communication network.Geomagnetism detecting device generally can non-maintaining work 3-5 years as long as using low energy consumption operation mode.It is detecting
In the life cycle of device, generally requires and update is downloaded to detector program.It has invented herein and a kind of having utilized server and
The communication network of construction to object detector into the newer method of line program wireless downloading, it is not necessary that the detector is torn open from parking stall
Under, improve update efficiency.Meanwhile the program down loading updating of object detector can when non-targeted detector is worked normally into
Row ensures to carry out, by batch program update, reducing update cost to geomagnetism detecting device in the case of the normal operation of parking lot.
Actual conditions are that the communication of server and detector generally uses same frequency range, if program wireless downloading updates
Also it uses the frequency range, the I class messages that will produce non-targeted detector to be received by object detector, update is caused to fail.Especially
It is extensive in the newer program file character distribution of download, is easy to obscure with the I class messages of non-targeted detector, unsuitable area
Point.If wireless downloading update uses other frequency ranges, all devices in the communication link of parking lot to be required to change frequency range
Setting, non-targeted detector can not upload I class messages, parking lot caused to will be unable to normal operation.Therefore one kind has been invented herein
New program wireless downloading updates agreement, under the premise of not being modified to the working frequency of detector, excludes I class messages,
Screening obtains II class messages.
Invention content
Purpose:In order to overcome the deficiencies in the prior art, the present invention to provide a kind of jamproof geomagnetic parking stall detection
Device program wireless downloading update method avoids normal work during newer into line program wireless downloading to object detector
The non-targeted detector made generates interference when carrying out the publication of I class messages using same frequency range, to current renewal process.It is known
The program file character range that server is sent is extensive, should not be distinguished with I classes message, needs to ensure journey using certain agreement grammer
The intersection of character distributed area and I class message character distributed areas is sky in preface part.In order to improve program down loading updating process
Efficiency, communication of the present invention between server and object detector, has all carried out private mark processing and anti-private mark is parsed
Journey improves the accuracy rate and efficiency of II class message filters.
Technical solution:In order to solve the above technical problems, the technical solution adopted by the present invention is:
A kind of jamproof geomagnetic parking stall detector program wireless downloading update method, it is characterised in that:Server and mesh
It marks the update of detector program wireless downloading and uses synchronous communication mode, include the following steps:
Step 1. server generates and downloads bind command message, carries out private mark processing and continuous several times are sent;
Step 2. object detector is received, is screened, anti-private mark is resolved to after downloading bind command message and being verified, with
Server establishes communication connection, generates the message that waits for downloads, carries out private mark processing and continuous several times are sent;
Step 3. server receives, screening, the parsing of anti-private mark obtain wait for downloads message and after being verified by a fixed number
The program file data generator file download data message of amount, and sent after carrying out private mark processing;
Step 4. object detector screens the message received within the stand-by period, isolates non-targeted detector
I class messages, obtain by private mark processing program file downloading data message;Object detector passes through private mark to what is received
The program file downloading data message of processing carries out anti-private mark parsing;Object detector verifies the message after parsing, tests
Card, which is successfully generated, receives downloading data success message, otherwise generates and receives downloading data failure message, is sent out after carrying out private mark processing
It send;
Step 5. server screens the message received in waiting response time, the parsing of anti-private mark obtains target
The reception downloading data response message that detector is sent;If it is downloading data success message is received, selection is executed to be examined to target
It surveys device to generate lower a data message and carry out private mark processing and send, otherwise retransmits a message;If program file is sent out
Send and finish, and receive object detector transmission reception downloading data success message, generate program update command message, into
It is sent after the processing of row private mark;
Step 6. object detector is received, is screened, anti-private mark is resolved to server message and is verified;If it is program
File download data message executes step 4;Command message is updated if it is program, uses all program file numbers downloaded
According to update existing program, generation is updated successfully message after the completion of upgrading, private mark is handled and continuous several times are sent, automatically into work
Parameter configuration mode.
Preferably, the jamproof geomagnetic parking stall detector program wireless downloading update method, feature
It is:In step 1 to step 6, server and object detector are during program wireless downloading is newer, the message that receives
Including I classes message and II class messages, the character in all 128 to 255 ranges of I class messages is set in advance;
In order to ensure the quick screening of II class messages, while I classes message being avoided to generate interference to program file downloading data,
II class messages are generated first, in accordance with the message format of setting, is handled later by private mark and II class message characters is completely converted into 0
Into 127 ranges.
Preferably, the jamproof geomagnetic parking stall detector program wireless downloading update method, feature
It is, in step 1 to step 6, server in the message received, is sieved according to character range first with object detector
Choosing obtains II class messages, then carries out anti-private mark parsing reduction to the II class messages of acquisition and verify;Anti- private mark parses conduct
The inverse operation of private mark processing, converts II class message of the character range in 0 to 127 ranges to original message, to realize target
Detector program is wirelessly more newly downloaded.
Advantageous effect:Jamproof geomagnetic parking stall detector program wireless downloading update method provided by the invention utilizes
The existing parking lot server in parking lot(Hereinafter referred to as " server ")Cordless communication network between parking space detector is established
Server and the newer detector of needs(Hereinafter referred to as " object detector ")Between write to each other, between the two be used for program
The newer message of wireless downloading is uniformly denoted as II class messages;II classes message between server and object detector passes through private mark
Processing and the parsing of anti-private mark;It is handled by private mark, makes II classes message and without newer detector(It is hereinafter referred to as " non-targeted
Detector ")The parking space information message of upload(Hereinafter referred to as " I classes message ")Character range is not intersected, and object detector is avoided
II classes message and non-targeted detector I class messages obscure and lead to download update failure.The update of program wireless downloading can be improved
Anti-interference ability and reduce the more newly downloaded cost of parking field detector program.
It has the following advantages:(1) utilizes the wireless communication between the existing server in parking lot and geomagnetic parking stall detector
Network carries out wireless downloading update to geomagnetism detecting device and has been saved under detector program without removing detector from parking stall
Carry newer human cost;(2) ensure large parking lot uninterruptedly run in the case of, realize detector by batch update,
Without being interfered by other normal work detectors, the newer effect of detector program is improved while reducing upgrade cost
Rate;(3) parking lot that the detector program of mono- version of can not possibly be different suitable for all environmental conditions;With social economy
Continuous development, new model continues to bring out, and the detector program of legacy version may not be suitable for the new situation occurred.This hair
The bright wireless downloading update that parking field detector program may be implemented, the parking of new situation and varying environment condition for appearance
Field update detector program, is convenient for the marketing application of geomagnetic parking stall detector.
Description of the drawings
Fig. 1 is that parking field detector program wireless downloading updates system construction drawing;
Fig. 2 is program wireless downloading renewal process schematic diagram;
Fig. 3 is that server carries out private mark Processing Algorithm schematic diagram to former message;
Fig. 4 is that object detector carries out anti-private mark analytical algorithm schematic diagram to the message that private mark is handled.
Specific implementation mode
The present invention is further described with reference to specific embodiment.
As shown in Figure 1 to Figure 2, a kind of jamproof geomagnetic parking stall detector program wireless downloading update method, including such as
Lower step:As shown in Figure 2, wherein I represents I class messages to communication process principle therein, and II represents II class messages:
Step 1. server generates and downloads bind command message, carries out private mark processing and continuous several times are sent;
Step 2. object detector is received, is screened, anti-private mark is resolved to after downloading bind command message and being verified, with
Server establishes communication connection, generates the message that waits for downloads, carries out private mark processing and continuous several times are sent;
Step 3. server receives, screening, the parsing of anti-private mark obtain wait for downloads message and after being verified by a fixed number
The program file data generator file download data message of amount, and sent after carrying out private mark processing;
Step 4. object detector screens the message received within the stand-by period, isolates non-targeted detector
I class messages, obtain by private mark processing program file downloading data message.Object detector passes through private mark to what is received
The program file downloading data message of processing carries out anti-private mark parsing.Object detector verifies the message after parsing, tests
Card, which is successfully generated, receives downloading data success message, otherwise generates and receives downloading data failure message, is sent out after carrying out private mark processing
It send;
Step 5. server screens the message received in waiting response time, the parsing of anti-private mark obtains target
The reception downloading data response message that detector is sent.If it is downloading data success message is received, selection is executed to be examined to target
It surveys device to generate lower a data message and carry out private mark processing and send, otherwise retransmits a message.If program file is sent out
Send and finish, and receive object detector transmission reception downloading data success message, generate program update command message, into
It is sent after the processing of row private mark;
Step 6. object detector is received, is screened, anti-private mark is resolved to server message and is verified.If it is journey
Preface part downloading data message executes step 4.Command message is updated if it is program, uses all program files downloaded
Data update existing program, generation is updated successfully message after the completion of upgrading, simultaneously continuous several times are sent for private mark processing, automatically into work
Make parameter configuration mode.
In the step 1 to step 6, it is involved in the problems, such as that the processing of message private mark is parsed with anti-private mark, here by will be according to
The II class messages that the message format of setting generates(Hereinafter referred to as " former message ")Character is split, every time 6 compositions one of extraction
Character in former message is split the II classes for the character expression that combination producing is entirely located in 0 to 127 ranges by a new byte
Message(Hereinafter referred to as " private mark message ").In the I classes message content of design all in the case of 127 or more, you can difference two
Person.
In the step 1 and step 6, the algorithm description of private mark processing is as follows:
Using by every 6 segmentations of former message character once, the private mark message length of generation on the one hand can be limited, is improved more
New speed;On the other hand, algorithm design is simple and practicable.When being split to former message, 6 two are extracted every time in former message
System position forms low 6 of a new byte.Later in high 2 additions 0 of new byte, 8 characters, processing procedure are formed
As shown in Figure 3.
Character in private mark message can be divided into 4 classes, as shown in Figure 3.Private mark report is indicated used here as dealbuf [i]
I-th of character data in text, buf [k] indicates k-th of character data in former message, corresponding, wherein k=3*i/4 or
3*i/4+1.The characteristic of division and calculation formula of 4 class characters so in private mark message are shown in following analysis:
The classification characteristics of 1st class character be i%4==0, calculation formula sees below formula:
dealbuf[i]=(buf[3*i/4]&0xFC)>>2 (1)
The classification characteristics of 2nd class character be i%4==1, calculation formula sees below formula:
dealbuf[i]=((buf[3*i/4]&0x03)<<4)|((buf[3*i/4+1]&0xF0)>>4) (2)
The classification characteristics of 3rd class character be i%4==2, calculation formula sees below formula:
dealbuf[i]=((buf[3*i/4]&0x0F)<<2)|((buf[3*i/4+1]&0xC0)>>6) (3)
The classification characteristics of 4th class character be i%4==3, calculation formula sees below formula:
dealbuf[i]=(buf[3*i/4]&0x3F) (4)
In the step 3 to step 6, need to carry out anti-private mark dissection process to the private mark message of screening, to obtain former report
Text.When anti-private mark parsing, take out private mark message character data low six, composition data bit string is cut from data bits successively
Take 8 compositions, one character, specific execution algorithm as follows:
Parsing reduction is carried out to private mark message, obtained former message character can be divided into 3 classes, and segmentation combination process is shown in figure
Shown in 4.Convertbuf [i] indicates that i-th of character data in detector original message, dealbuf [k] indicate in private mark message
K-th of character data, corresponding, wherein k=4*i/3 or 4*i/3+1.Former message character data can be divided into 3 classes, classification
Feature is shown in following analysis with calculation formula:
The classification characteristics of 1st class character be i%3==0, calculation formula sees below formula:
convertbuf[i]=
((dealbuf[4*i/3]&0x3F)<<2)|((dealbuf[4*i/3+1]&0x30)>>4) (5)
The classification characteristics of 2nd class character be i%3==1, calculation formula sees below formula:
convertbuf[i]=
((dealbuf[4*i/3]&0x0F)<<4)|((dealbuf[4*i/3+1]&0x3C)>>2) (6)
The classification characteristics of 3rd class character be i%3==2, calculation formula sees below formula:
convertbuf[i]=
((dealbuf[4*i/3]&0x03)<<6)|(dealbuf[4*i/3+1]&0x3F) (7)
The above is only a preferred embodiment of the present invention, it should be pointed out that:For the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.