The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide a kind of pickup code generating method, storage to set
Standby and electronic equipment, it is intended to solve the problems, such as that existing pickup code is simple, easily causes to take wrong express delivery because inputting pickup code mistake.
Technical scheme is as follows:
A kind of pickup code generating method, wherein, including step:
Random generation data bit, and judge whether current data position repeats with the data bit cached, delay if not repeating
Deposit current data position;
Conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtains school
Test position;
Current data position is subjected to synthesis processing with corresponding check bit and forms pickup code.
Preferably, described the step of carrying out conversion process to current data position, specifically includes:
Each by current data position is multiplied with a numeral respectively, is then changed the results added after multiplication
Interposition after processing.
Preferably, the step of coding progress fusion treatment with launching the express delivery cabinet of express delivery forms check bit is specifically wrapped
Include:
Interposition after conversion process is added with the coding for the express delivery cabinet for launching express delivery;
Result after will add up obtains check bit with 100 modulus.
Preferably, the digit of the data bit is 6, and the digit of the check bit is 2.
Preferably, each by current data position is multiplied with 2,3,4,5,4,3 respectively, then by the result after multiplication
Addition obtains the interposition after conversion process.
Preferably, express delivery cabinet is encoded to 00~49.
Preferably, the check bit is located at behind the data bit.
Preferably, the data bit of caching is deleted after preserving the scheduled time.
A kind of storage device, wherein being stored with a plurality of instruction, the instruction is suitable to be loaded and performed by processor:
Random generation data bit, and judge whether current data position repeats with the data bit cached, delay if not repeating
Deposit current data position;
Conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtains school
Test position;
Current data position is subjected to synthesis processing with corresponding check bit and forms pickup code.
A kind of electronic equipment, it includes:
Processor, be adapted for carrying out each instruction, and storage device, suitable for storing a plurality of instruction, the instruction be suitable to by
Reason device is loaded and performed:
Random generation data bit, and judge whether current data position repeats with the data bit cached, delay if not repeating
Deposit current data position;
Conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtains school
Test position;
Current data position is subjected to synthesis processing with corresponding check bit and forms pickup code.
Beneficial effect:The pickup code obtained by the inventive method, there is the characteristics of safety, not error-prone, due to verification
The presence of code, the difference of more than 2 between pickup code and pickup code at least be present, even if user is in situation about accidentally inputing by mistake
Under, be also not in that the situation for taking wrong express delivery occurs.
Embodiment
The present invention provides a kind of pickup code generating method, storage device and electronic equipment, to make the purpose of the present invention, technology
Scheme and effect are clearer, clear and definite, and the present invention is described in more detail below.It is it should be appreciated that described herein specific
Embodiment only to explain the present invention, is not intended to limit the present invention.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of pickup code generating method preferred embodiment of the present invention, as illustrated, its
Including step:
S1, data bit is generated at random, and judge whether current data position repeats with the data bit cached, if not repeating
Cache current data position;
S2, conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtained
To check bit;
S3, current data position and corresponding check bit are carried out synthesizing processing form pickup code.
The present invention carries out fusion treatment by the way that data bit is carried out into conversion process, with the coding of express delivery cabinet, generates check bit,
Then data bit is synthesized to processing with check bit generate final pickup code, due to containing check bit in pickup code, so i.e.
User is being inputed pickup code by mistake, be also not in the situation for taking wrong express delivery, i.e., the serious forgiveness between pickup code greatly promotes, and
Because pickup code contains the information of express delivery cabinet coding, so even in (the non-express delivery for launching user's express delivery of non-targeted express delivery cabinet
Cabinet) input pickup code, corresponding express delivery cabinet will not be also opened, so as to avoid taking the situation of wrong express delivery from occurring.
Preferably, described the step of carrying out conversion process to current data position, specifically includes:
Each by current data position is multiplied with a numeral respectively, is then changed the results added after multiplication
Interposition after processing.
In this step, first to current data position each respectively with one numeral is multiplied, each of which position multiplication number
Word can be with identical either entirely different or identical or partly different for part.Such as assume that current data position is
12345, then each numeral being multiplied is 2, and such case belongs to identical situation;If each numeral being multiplied
Respectively 2,6,7,4,3, then such case belongs to entirely different situation;If each numeral being multiplied is respectively 2,6,
2nd, 4,2, then such case belongs to part identical situation, while falls within the different situation in part.
Then by the results added after multiplication, such as current data position is 12345, and each numeral being multiplied is respectively
2nd, 6,7,4,3, then in current data position first be multiplied after result be 1 × 2=2, the result after second multiplication
For 2 × 6=12, the 3rd be multiplied after result be 3 × 7=21, the result after the 4th multiplication is 4 × 4=16, the 5th
Result after position is multiplied is 5 × 3=15, is obtained after the above results are added:2+12+21+16+15=66.Most at last
66 arrived are as the interposition after conversion process.The effect of the interposition is exactly to carry out fusion treatment with follow-up coding
So as to obtain check bit.
Preferably, the step of coding progress fusion treatment with launching the express delivery cabinet of express delivery forms check bit is specifically wrapped
Include:
Interposition after conversion process is added with the coding for the express delivery cabinet for launching express delivery;
Result after will add up obtains check bit with 100 modulus.
Check bit is the key component of pickup code, and the generation of check bit and the coding of data bit and express delivery cabinet have determination
Relation.
In this step, first the interposition that abovementioned steps obtain is added with the coding for the express delivery cabinet for launching express delivery.Wherein throw
The express delivery cabinet for putting express delivery is exactly target express delivery cabinet, i.e. storage has the express delivery cabinet of user's express delivery, is needed from mesh during future customer pickup
Mark express delivery cabinet and carry out pickup.
It is 66 wherein to assume interposition, launches express delivery cabinet and is encoded to 23, then the result after the two addition is:66+
23=89.
Then result and 100 modulus after will add up, modulus is exactly to seek integer quotient (being taken the remainder after being divided by), such as c
=a%b, c are exactly a and b modulus, such as by 89 and 100 modulus, then the result after modulus is 89%100=89, if it is added
Result afterwards is 143, then the result after modulus is 143%100=43, if the result after being added is 1234, then
Result after modulus is 1234%100=34.Because with 100 modulus in the present invention, the check bit finally given must be
Double figures, example as the aforementioned 89,43 or 34.
Preferably, the digit of the data bit is 6, and the digit of the check bit is 2.
Such as the data bit is specially 123456, the check bit is 89,43 or 34.Preferably, for data bit
For the situation of 6, then each by current data position is multiplied with 2,3,4,5,4,3 respectively, then by the knot after multiplication
Fruit is added to obtain the interposition after conversion process.
In the step S3, it is also necessary to carry out synthesis processing to the data bit and check bit.
In view of the coming years, express delivery quantity will continue that the trend increased is presented, so the present invention taking using 8 bit digitals
Part code.Wherein this 8 pickup codes, it is data bit to have 6 bit digitals, and it is check bit to have 2 bit digitals.That is, at the synthesis
Reason is preferably directly to merge, such as the data bit is 123456, and the check bit is 89, then the pickup code is
89123456, either 12345689 or 12389456, or 12834596.
That is, in the present invention, check bit can be placed on before data bit, be middle or below, can also
It is to take check bit apart, is then inserted respectively into the diverse location of data bit, such as is respectively inserted into data bit foremost and most
Below, two different centre positions of data bit etc. are respectively inserted into or.
But it is currently preferred, it is that check bit is placed on behind data bit, such as the data bit is 123456, institute
Check bit is stated as 89, then final pickup code is preferably 12345689, and this mode can facilitate to be managed to pickup code
And identification.
Preferably, express delivery cabinet is encoded to 00~49.In present invention, it is desirable to all express delivery cabinets are encoded in advance, example
Such as encoded by region, in some region, express delivery cabinet is encoded to 00~49, and either 00~99 or 00~199, but
Preferably, express delivery cabinet is encoded to 00~49, so maintains easily management and maintenance of the personnel to express delivery cabinet.Specific manifestation
For, within the scope of one, such as a cell or school etc., express delivery cabinet is encoded since 00, due to the installation of express delivery cabinet
Will not be too many, set this region and be up to 50 express delivery cabinets, then the scope of coding is exactly 00-49, so as to obtain this 50
Express delivery cabinet encodes.
Preferably, the data bit of caching is deleted after preserving the scheduled time.Such as after data bit is cached, preserve 7 days,
The data bit is automatically deleted after 7 days.Because random number is limited, so need to discharging random number, it is general next
Say that user can take express delivery away in 7 days, so the present invention is automatically deleted the data bit after 7 days, subsequently to give birth to
Cheng Xin data bit.Further, since the data bit of pickup code is generated at random by the storage device in express delivery cabinet, in generation one
, it is necessary to judge that the data bit whether there is in buffer area (whether being repeated with the data bit cached), such as during random data bits
Fruit is present, then needs to return again generation data bit at random.
In the present invention, it is assumed that pickup code is ddddddcc, false if pickup code has an input error during user's pickup
If this position is in data bit, then due to the algorithmic rule of check bit, the school calculated of wrong data bit of user's input
Position is tested, it is inevitable inconsistent with the check bit cc of the pickup code of user, so the pickup code mistake of user's input, can not take out fast
Part.Assuming that wrong that of user's input be in check bit, due to the algorithmic rule of check bit, user's input it is wrong
Check bit does not meet check bit create-rule, and user's input is wrong pickup code, can not take out express mail.
Assuming that user's pickup code on cabinet-type air conditioner A is ddddddcc, user has been gone to above cabinet-type air conditioner B, inputs pickup code
Ddddddcc, due to there is the presence of the coding of express delivery cabinet in check bit create-rule.In above 6 data bit identical situations
Under, two bit check positions necessarily differ behind different express delivery cabinet generations.Therefore user inputs taking for cabinet-type air conditioner A on cabinet-type air conditioner B
Part code is necessarily invalid, can not take out express delivery.
Referring to Fig. 2, it is a kind of flow chart of pickup code generating method specific embodiment of the present invention, as illustrated, its
Including step:
T1, express delivery is launched, express delivery is placed among express delivery cabinet by staff;
T2, data bit are generated at random, and data bit is generated at random by the processor among express delivery cabinet;
T3, judging whether in buffer area, the data bit for judging to generate in T2 steps whether there is among buffer area,
If it does not, carrying out next step operation, if it is present returning to T2, data bit is regenerated;
T4, buffer area is stored in, the random data bits of generation are retained among buffer area, retention periods are 7 days;
T5, interposition, the data bit generated at random is referred to as interposition by the data changed and be added to obtain;
T6, express delivery cabinet coding is obtained, express delivery cabinet is encoded, the scope of coding is 00~49;
Result and 100 modulus after T7, addition, the interposition obtained in T5 steps and the express delivery cabinet in T6 steps are encoded into phase
Add, then by obtained result and 100 modulus;
T8, check bit, step T7 data are as the check code in pickup code;
T9, pickup code, the data bit of step T4 cachings merge to obtain final pickup code with step T8 check bit.
The present invention also provides a kind of storage device, wherein being stored with a plurality of instruction, the instruction is suitable to be loaded by processor
And perform:
Random generation data bit, and judge whether current data position repeats with the data bit cached, delay if not repeating
Deposit current data position;
Conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtains school
Test position;
Current data position is subjected to synthesis processing with corresponding check bit and forms pickup code.
The present invention also provides a kind of electronic equipment, and it includes:
Processor, each instruction is adapted for carrying out, and
Storage device, suitable for storing a plurality of instruction, the instruction is suitable to be loaded and performed by processor:
Random generation data bit, and judge whether current data position repeats with the data bit cached, delay if not repeating
Deposit current data position;
Conversion process is carried out to current data position, and the coding of the express delivery cabinet with launching express delivery carries out fusion treatment and obtains school
Test position;
Current data position is subjected to synthesis processing with corresponding check bit and forms pickup code.
In summary, the pickup code obtained by the inventive method, there is the characteristics of safety, not error-prone, due to verification
The presence of code, the difference of more than 2 between pickup code and pickup code at least be present, even if user is in situation about accidentally inputing by mistake
Under, be also not in that the situation for taking wrong express delivery occurs.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention
Protect scope.