The content of the invention
In order to solve the above-mentioned technical problem, it is an object of the invention to provide a kind of shared bicycle electronic lock solution of energy saving
Locking method and system, for selecting suitable unlocking manner according to actual conditions, to reach the purpose for saving electricity.
The technical solution adopted in the present invention is:A kind of shared bicycle electronic lock unlocking method, including:
Background server receives the unlocking request that user equipment is sent, and the unlocking request is used to ask unblock target to be shared
The electronic lock of bicycle;
After the background server confirms that the unlocking request is effective, perform first and judge operation:Whether judge electronic lock
Bluetooth connection is established with the user equipment;
If the first result for judging to operate is yes, the background server sends unlock instruction to the user equipment,
The user equipment forwards the unlock instruction to the electronic lock so that the electronic lock unblock;
If the first result for judging to operate is no, performs second and judge operation:Judge the mobile communication module of electronic lock
Whether open;
If the second result for judging to operate is yes, the background server sends unlock instruction to the electronic lock, makes
Obtain the electronic lock unblock;
If the second result for judging to operate is no, the background server sends unlocking pin to the user equipment,
So that user is with electronic lock described in the unlocking pin manual unlocking.
Further, after the user is with electronic lock described in the unlocking pin manual unlocking, in addition to:
The unlocking pin in password queue is labeled as having failed by electronic lock, wherein, the solution in the password queue
Lock cipher is issued and is stored in local in advance by the background server.
Further, described unlocking method also includes:
When failed unlocking pin quantity reaches preset value in the password queue, the background server is to described
Electronic lock issues the new unlocking pin of equivalent, for updating failed unlocking pin in the password queue.
Further, the mobile communication module of the electronic lock is normally opened when electricity is in the range of first, at electricity
Periodically alternately opened and closed when in the range of second, the positive closing when electricity is in the range of the 3rd.
Further, the bluetooth module of the electronic lock is worked in peak period with the first broadcasting frequency, in non-peak
Section is worked with the second broadcasting frequency.
Another technical scheme of the present invention is:A kind of shared bicycle electronics unlocking system, including:
User equipment, for entering row data communication with electronic lock and background server, unlocked with being sent to background server
Request, the unlock instruction for receiving background server transmission, unlocking pin simultaneously forward received unlock instruction, institute to electronic lock
The electronic lock that unlocking request is used to ask unblock target to share bicycle to background server is stated, the unlock instruction is used to make electronics
Lock unblock, the unlocking pin are used for user's manual unlocking electronic lock;
Background server, for entering row data communication with electronic lock and user equipment, receive the unblock that user equipment is sent
Ask and after confirming that the unlocking request is effective, perform first and judge operation:Judge electronic lock whether with the user equipment
Establish bluetooth connection;If the first result for judging to operate is yes, the background server sends to the user equipment and unlocked
Instruction;If the first result for judging to operate is no, performs second and judge operation:Judge electronic lock mobile communication module whether
Open;If the second result for judging to operate is yes, the background server sends unlock instruction to the electronic lock;If second
The result for judging operation is no, then the background server sends unlocking pin to the user equipment;
Electronic lock, the electronic lock include processing module, bluetooth module and mobile communication module;
Processing module, for according to unlock instruction or unlocking pin control electronic lock unblock, the bluetooth module, movement to be logical
Letter module is connected with processing module;
Bluetooth module, for establish bluetooth connection with user equipment with receive user equipment forwarding unlock instruction;
Mobile communication module, referred to for realizing data transfer with background server with receiving the unblock of background server transmission
Order.
Further, the electronic lock also includes unlocking pin mark module, for marking user in password queue manual
For unlocking pin used in unblock electronic lock to have failed, the unlocking pin in the password queue is advance by the background server
Issue and be stored in local, the unlocking pin mark module is connected with processing module.
Further, the electronic lock also includes unlocking pin quantity detection module, for detecting in the password queue
The quantity of failed unlocking pin, the unlocking pin quantity detection module are connected with processing module;
When failed unlocking pin quantity reaches preset value in the password queue, the background server is to described
Electronic lock issues the new unlocking pin of equivalent, for updating failed unlocking pin in the password queue.
Further, the electronic lock also includes:
Electricity acquisition module, for obtaining the information about power of electronic lock;The output end of the electricity acquisition module and processing
The input connection of module;
The mobile communication module is normally opened when electricity is in the range of first, the cycle when electricity is in the range of second
Property alternately open and close, electricity be in the 3rd in the range of when positive closing.
Further, the bluetooth module is worked in peak period with the first broadcasting frequency, in off-peak period with second
Broadcasting frequency works.
The beneficial effects of the invention are as follows:
Background server prioritizing selection issues unlock instruction to user equipment in the present invention, and user equipment recycles bluetooth company
Switch through hair unlock instruction to electronic lock and realize unblock;When electronic lock and user equipment are without bluetooth connection, background server passes through
The mobile communication module of electronic lock issues unlock instruction to electronic lock;When the mobile communication module of electronic lock is not opened, backstage
Server issues unlocking pin and realizes manual unlocking according to unlocking pin to user equipment, user.The present invention is according to actual conditions
Suitable unlocking manner is selected, to reach the purpose for saving electricity;Specifically, the use of the mobile communication module of electronic lock is reduced
Time, bluetooth module preferably low in energy consumption are communicated, so reduce electronic lock power consumption, extend electronic lock it is standby when
Between, electronic lock has two kinds of communication modules of bluetooth module and mobile communication module concurrently, both ensure that electronic lock and background server
Communication, its continuation of the journey demand is taken into account again, improve Consumer's Experience.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase
Mutually combination.
A kind of shared bicycle electronics unlocking system, with reference to figure 3, Fig. 3 is a kind of shared bicycle electronic lock solution in the present invention
One specific embodiment structured flowchart of lock system;System for unlocking includes user equipment 301, electronic lock 302 and background server
303;Electronic lock 302 includes processing module 3021, bluetooth module 3022 and mobile communication module 3023;Bluetooth module 3022, move
Dynamic communication module 3023 is connected with processing module 3021;Bluetooth module 3022 is connected with user equipment 301;User equipment 301,
Mobile communication module 3023 is connected with background server 303 respectively.
User equipment 301 includes bluetooth module and mobile communication module, and electronic lock 302 passes through bluetooth module 3022 and user
Equipment 301 realizes communication, and user equipment 301 is realized with background server 303 by mobile communication module 3023 and communicated;Specifically
Ground, user equipment 301 can be mobile phone, tablet personal computer PAD or notebook computer.User equipment 301 is used for background server
303 transmission unlocking requests, the unlock instruction for receiving the transmission of background server 303, unlocking pin are simultaneously received to electronic lock forwarding
The unlock instruction arrived, unlocking request are used for the electronic lock for asking unblock target to share bicycle to background server 303, unlock instruction
For unlocking electronic lock 302, unlocking pin is used for user's manual unlocking electronic lock 302.
Background server 303, for entering row data communication, background server 303 with electronic lock 302 and user equipment 301
For after receiving the unlocking request of the transmission of user equipment 301 and confirming that unlocking request is effective, performing first and judging operation:
Judge whether electronic lock 302 with user equipment 301 establishes bluetooth connection;If the first result for judging to operate is yes, backstage takes
Business device 303 sends unlock instruction to user equipment 301;If the first result for judging to operate is no, performs second and judge operation:
Judge whether the mobile communication module 3023 of electronic lock 302 is opened;If the second result for judging to operate is yes, background server
303 send unlock instruction to electronic lock 302;If second judges that the result of operation is no, background server 303 is to user equipment
301 send unlocking pin.
Processing module 3021, for being unlocked according to unlock instruction or unlocking pin control electronic lock 302, usually, processing
Module 3021 is the module with data-handling capacity, its peripheral circuit can be configured using single-chip microcomputer to realize.Bluetooth module
3022, for establish bluetooth connection with user equipment 301 with receive user equipment 301 forwarding unlock instruction, bluetooth module
3022 be the communication chip based on Bluetooth Communication Technology;Bluetooth module 3022 is worked in peak period with the first broadcasting frequency,
Off-peak period is worked with the second broadcasting frequency.Mobile communication module 3023, for realizing data transfer with background server 303
To receive the unlock instruction of the transmission of background server 303;, mobile communication module 3023 is to realize communication using mobile communications network
Module.
Further, electronic lock, the mobile communication module of user equipment are global system for mobile communications (Global
System for Mobile Communication), it is exactly well-known GSM, is the most commonly used mobile electricity of current application
Words standard;Mobile communication module can be divided into 2G modules, 3G module, 4G modules, 5G modules according to standard difference;Preferably, originally
Invention is from 2G modules as mobile communication module.
Further, power module 3024, unlocking pin mark module 3025, solution are also included with reference to figure 3, electronic lock 302
Lock cipher quantity detection module 3026 and electricity acquisition module 3027;Unlocking pin mark module 3025 is used to mark password queue
Unlocking pin used in middle user's manual unlocking electronic lock 302 is has failed, and the unlocking pin in password queue is by background service
Device 303 issues in advance and is stored in local;Unlocking pin quantity detection module 3026 is failed in password queue for detecting
The quantity of unlocking pin, when failed unlocking pin quantity reaches preset value in password queue, background server 303 is to electricity
Son lock 302 issues the new unlocking pin of equivalent, for failed unlocking pin in more new password queue;Electricity acquisition module 3027
For obtaining the information about power of electronic lock 302, mobile communication module 3023 is normally opened when electricity is in the range of first, in electricity
Periodically alternately opened and closed when in the range of second, the positive closing when electricity is in the range of the 3rd;Unlocking pin
Mark module 3025 is connected with processing module 3021;Unlocking pin quantity detection module 3026 is connected with processing module 3021;Electricity
Source module 3024 is used to provide working power, output end and the electricity acquisition module 3027 of power module 302 for electronic lock 302
Input is connected, and the output end of electricity acquisition module 3027 is connected with the input of processing module 3021.
Based on above-mentioned system for unlocking, the present invention also provides a kind of shared bicycle electronic lock unlocking method, and with reference to figure 4, Fig. 4 is
An a kind of specific embodiment method flow diagram of shared bicycle electronic lock unlocking method in the present invention;Including:
4011:When user wants to share bicycle using target, bicycle is shared close to target, uses user equipment such as mobile phone
Quick Response Code on the shared bicycle of scanning obtains bicycle information, and the information comprises at least the identity ID of shared bicycle;By using
Family equipment sends unlocking request to background server;
4012:Background server receives the unlocking request that user equipment is sent, and unlocking request is used to ask unblock target to be total to
The electronic lock of bicycle is enjoyed, wherein, unlocking request comprises at least the identity ID and user account that target shares bicycle;
4021:Background server carries out authentication to user and confirms whether unlocking request is effective, such as inquires about the conjunction of user account
Whether method, account have enough remaining sums or cash pledge, account have it is without exception, check target share bicycle whether scheduled, vehicle
There is (be such as in and report state to be repaired for repairment) without exception, here to judging whether that effective a variety of situations are not specifically limited;If
Unlocking request is invalid, then does not make any action, it is preferable that background server sends feedback message to user equipment and is used to prompt to use
The family target, which shares bicycle, can not currently use, and wait and enter unlocking request next time;
4022:Background server to user carry out authentication confirm unlocking request it is effective after, perform first judge operation:Judge
Whether electronic lock with user equipment establishes bluetooth connection;
4031:If the first result for judging to operate is yes, background server sends unlock instruction to user equipment;
4032:User equipment forwards unlock instruction using bluetooth to electronic lock so that electronic lock unlocks;Electronic lock unlocked
Cheng Wei:Judge whether unlock instruction is effective, if effectively, the unlocked state of driving electronic lock releases the locking to sharing bicycle,
Do not repeated here for the theory of mechanics of unblock;
404:If the first result for judging to operate is no, performs second and judge operation:Judge the mobile communication of electronic lock
Whether module opens;
4051:If the second result for judging to operate is yes, background server sends unlock instruction to electronic lock so that electricity
Son lock unblock, electronic lock receive unlock instruction by mobile communication module, and releasing process repeats no more;
4052:If the second result for judging to operate is no, background server sends unlocking pin to user equipment so that
User is provided with keypad at electronic lock shell user oriented, grasped manually for user with unlocking pin manual unlocking electronic lock
Make input password, the process unlocked using unlocking pin is:Judge whether unlocking pin is effective, if effectively, driving solution locked mode
Block releases the locking to sharing bicycle, is not repeated here for the theory of mechanics of unblock.
Background server prioritizing selection issues unlock instruction to user equipment in the present invention, and user equipment recycles bluetooth company
Switch through hair unlock instruction to electronic lock and realize unblock;When electronic lock and user equipment are without bluetooth connection, background server passes through
The mobile communication module of electronic lock issues unlock instruction to electronic lock;When the mobile communication module of electronic lock is not opened, backstage
Server issues unlocking pin and realizes manual unlocking according to unlocking pin to user equipment, user.The present invention is according to actual conditions
Suitable unlocking manner is selected, to reach the purpose for saving electricity;Specifically, the use of the mobile communication module of electronic lock is reduced
Time, bluetooth module preferably low in energy consumption are communicated, so reduce electronic lock power consumption, extend electronic lock it is standby when
Between, electronic lock has two kinds of communication modules of bluetooth module and mobile communication module concurrently, both ensure that electronic lock and background server
Communication, its continuation of the journey demand is taken into account again, improve Consumer's Experience.
Preferably, with reference to figure 3, the electricity acquisition module 3027 of electronic lock 302 detects the electricity of power module 3024, electricity
Acquisition module 3027 transmits the information about power detected to processing module 3021, when processing module 3021 judges that electricity is in the
During one scope, electronic lock controls its mobile communication module 3023 normally opened, the first scope preferably 80%~100%, now electronic lock
Electricity it is sufficient, mobile communication module 3023 is kept it turned on, using the teaching of the invention it is possible to provide the Consumer's Experience of quick release.Work as processing module
3021 when judging that electricity is in the second scope, mobile communication module 3023 is periodically alternately opened and closed, according to default week
Phase opens work, such as opens mobile communication module 3023 every 2 hours, is closed after opening 20 minutes, predetermined period can root
According to needing to be adjusted, it is not especially limited here;Second scope preferably 30%~80%;Now the movement of electronic lock 302 is led to
Letter module 3023 periodically opens and closes, and avoids mobile communication module 3023 from being constantly in working condition, reduces mobile communication
The working time of module 3023, the energy consumption of electronic lock 302 is reduced, extend the operable time of electronic lock 302.Finally, processing is worked as
When module 3021 judges that electricity is in three scopes, the mobile communication module 3023 of positive closing electronic lock 302, the 3rd scope is excellent
Select 0%~30%;Now, the mobile communication module 3023 for starting electronic lock 302 is not allowed, to reach the purpose of energy saving.
Preferably, electronic lock is according to the broadcasting frequency of period different adjustment bluetooth module, in the present embodiment, the period point
For peak period and off-peak period, for example, peak period is peak period on and off duty, 7 points to 9 points of the morning and the 17 of afternoon
O'clock to 20 points for user use peak periods.The bluetooth module of electronic lock is worked in peak period with the first broadcasting frequency, and first
The preferred 5Hz of broadcasting frequency;Worked in off-peak period with the second broadcasting frequency, the preferred 1Hz of the second broadcasting frequency.Therefore, in height
The peak period suitably tunes up the broadcasting frequency of bluetooth module, reduces the time needed for Bluetooth communication, reduces user indirectly and utilizes user
The time required during bicycle is shared in equipment unblock, improves Consumer's Experience;On the contrary, in off-peak period, appropriate reduction bluetooth mould
The broadcasting frequency of block, broadcasting frequency of the bluetooth module in off-peak period are less than the broadcasting frequency of peak period;It can reduce indirectly
The power consumption of electronic lock, to extend the up time of electronic lock.
Further, in actual use, with reference to figure 5, Fig. 5 is in the present invention in a kind of shared bicycle electronic lock unlocking method
A specific embodiment method flow diagram of new unlocking pin is issued, background server issues the process of new unlocking pin to electronic lock
For:
501:Background server disposably issues when multiple unlocking pins are used for manual unlocking to electronic lock and verifies that user is defeated
The unlocking pin entered.
In the present embodiment, the quantity of unlocking pin may be configured as 50, and this quantity can be adjusted as needed.One
Secondary property issues multiple unlocking pins to reduce background server because of the communication time caused by unlocking pin transmission demand with electronic lock
Number, the communication power consumption of electronic lock is further reduced, extend the up time of electronic lock.In fact, background server is to electronics
The approach that lock issues new unlocking pin includes two kinds:The first, user during shared bicycle is used, electronic lock by using
Family equipment is issued when entering row data communication with background server, and user equipment is utilized to electronic lock with reference to above-mentioned background server
The releasing process of unlock instruction is issued, background server, can be simultaneously to the electronic lock when issuing unlock instruction to electronic lock
Issue multiple unlocking pins;I.e. background server sends unlock instruction and multiple unlocking pins to user equipment, user equipment
Sent by bluetooth to electronic lock, the received unlock instruction of electronic lock storage and multiple unlocking pins.Second, electronic lock
Mobile communication module open and issue when being communicated with background server, pass through electronic lock with reference to above-mentioned background server
Mobile communication module issues the process of unlock instruction, and background server issues unlock instruction and multiple unlocking pins to electronic lock
Mobile communication module.Electronic lock stores the unlocking pin received by it and forms password queue.The password queue is successively
What arrangement used, background server maintains corresponding password queue, and when background server and electronic lock can communicate, where is verification
A little passwords used on shared bicycle, and background server carries out corresponding mark, and such background server would not weigh
Issuing failed password again, (background server can not be failure directly by the pin marker issued, because user may be not
Using the password, the inconsistent of password queue between the two so will result in).
502:User relies on the unlocking pin manual unlocking electronic lock that user equipment receives.
503:When user successfully unlocks by the unlocking pin that user equipment receives, electronic lock is by password queue
Unlocking pin is labeled as having failed.
504:Judge whether failed unlocking pin quantity reaches preset value in password queue.
505:When failed unlocking pin quantity reaches preset value in password queue, background server is under electronic lock
The new unlocking pin of equivalent is sent out, for failed unlocking pin in more new password queue.Specific embodiment has two kinds:First
Kind, the unlocking pin quantity detection module of electronic lock can detect the quantity of failed unlocking pin;And judge failed solution
Whether the quantity of lock cipher is less than preset value, is asked if it is, electronic lock actively issues unlocking pin to background server transmission
Ask, background server issues the new unlocking pin equal with the quantity of failed unlocking pin to electronic lock, issue process with
It is above-mentioned issue multiple unlocking pins process it is identical;Otherwise, electronic lock does not perform any operation;In the present embodiment, preset value is
20, preset value can be also adjusted as needed.Second, after user manually unlocks successfully unlocking, share the row of bicycle
After journey terminates, electronic lock will report the information of this stroke, wherein, information includes unlocking pin used in this stroke, and
Background server is stored with the unlocking pin sequence identical unlocking pin sequence with electronic lock, and background server is connect by matching
The unlocking pin and the unlocking pin sequence of corresponding electronic lock used in travel information received, judges the unblock of the electronic lock
Which unlocking pin has been used in keying sequence, and counts the quantity for the unlocking pin having been used, and judges what is had been used
Whether the quantity of unlocking pin reaches preset value, and judged result is yes, then background server is issued and had been used to electronic lock
Unlocking pin the new unlocking pin of quantity identical, it is identical with the above-mentioned process for issuing multiple unlocking pins to issue process;Sentence
Disconnected result is no, then does not do any action.
Above is the preferable implementation to the present invention is illustrated, but the invention is not limited to the implementation
Example, those skilled in the art can also make a variety of equivalent variations on the premise of without prejudice to spirit of the invention or replace
Change, these equivalent deformations or replacement are all contained in the application claim limited range.