CN105224414B - For the method for calibration and device of the code for realizing business task - Google Patents
For the method for calibration and device of the code for realizing business task Download PDFInfo
- Publication number
- CN105224414B CN105224414B CN201510624931.3A CN201510624931A CN105224414B CN 105224414 B CN105224414 B CN 105224414B CN 201510624931 A CN201510624931 A CN 201510624931A CN 105224414 B CN105224414 B CN 105224414B
- Authority
- CN
- China
- Prior art keywords
- code
- verified
- character
- check
- check code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 238000012795 verification Methods 0.000 claims abstract description 101
- 230000000052 comparative effect Effects 0.000 claims abstract description 29
- 230000000694 effects Effects 0.000 claims description 138
- 230000015572 biosynthetic process Effects 0.000 claims description 55
- 230000009466 transformation Effects 0.000 claims description 23
- 238000003780 insertion Methods 0.000 claims description 17
- 230000037431 insertion Effects 0.000 claims description 17
- 238000000605 extraction Methods 0.000 claims description 12
- 125000004122 cyclic group Chemical group 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000006870 function Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000007257 malfunction Effects 0.000 description 3
- 239000000203 mixture Substances 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 241000209094 Oryza Species 0.000 description 2
- 235000007164 Oryza sativa Nutrition 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 235000009566 rice Nutrition 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000001035 drying Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a kind of method of calibration and device for being used to realize the code of business task.This method includes:Obtain code to be verified;Obtain and parse the create-rule of the code to be verified, the check code for self checking is intercepted from the code to be verified, using remaining code as code to be calculated;Obtain and parse the create-rule of the check code for self checking, generate the character to be verified of the code to be calculated;Compare the check code for self checking and the character to be verified, determine whether the code to be verified passes through verification according to comparative result.The embodiment of the present invention is during verification, the character to be verified of in-time generatin code to be calculated, and then the character to be verified of the check code and code to be calculated that are used for self checking in code to be verified is compared to determine whether code to be verified passes through verification.
Description
Technical field
The present invention relates to technical field of data processing, particularly a kind of method of calibration for being used to realize the code of business task and
Device.
Background technology
In the Internet, applications, there are many scenes to need to use " code ", for example new product is reached the standard grade, envelope is surveyed to use and " invited
Code " realizes invitation registration;" gift code " is used to be issued to active player in game, for exchanging stage property in game;Network is purchased
" preferential code " deduction and exemption purchase expenses is used in thing, is taken to user preferential, etc..
In the prior art, " code " can be generated by randomized or certain rule.When being generated by randomized, with
Machine generation character string i.e. be used as " code ", code it is large numbers of in the case of repetition occurs, caused by this mode code need
There is the step of code that removal repeatedly generates, or whether detection code repeats immediately after generated code.When code is more, what is repeated is general
Rate is bigger, and the efficiency of generated code is lower.In addition, the code that either randomized or certain rule generate, is needs code
Itself go to index, search corresponding business, when check code, retrieval amount can take very big internal memory with regard to big, verification
Efficiency is very slow.Thus, it would be highly desirable to the scheme to solve the above problems is provided.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on
State the method for calibration and device that are used to realize the code of business task of problem.
According to an aspect of of the present present invention, there is provided a kind of method of calibration for being used to realize the code of business task, including:
Obtain code to be verified;
Obtain and parse the create-rule of the code to be verified, intercepted from the code to be verified for self checking
Check code, using remaining code as code to be calculated;
Obtain and parse the create-rule of the check code for self checking, generate the word to be verified of the code to be calculated
Symbol;
Compare the check code for self checking and the character to be verified, determined according to comparative result described to be verified
Code whether pass through verification.
Alternatively, the code to be verified based on effect code, obscure code and generated for the check code of self checking, institute
Check code for self checking is stated using the effect code and described obscure code and generates.
Alternatively, the effect code is the character in the first substring being converted into by the task identification of business, described
Obscure the character string that code is the first designated length randomly selected from the second substring, first substring from for
Generate and extracted in the character string of the code to be verified, second substring is extracted first son from the character string
Remainder extraction after character string.
Alternatively, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the finger of intermediate code that code character closes to obtain
Positioning is put, wherein, the check code for self checking is the second designated length.
Alternatively, the create-rule of the code to be verified is parsed, is intercepted from the code to be verified for self checking
Check code, including:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as institute
State the check code for self checking.
Alternatively, the specified location includes the initial position or end position of the intermediate code.
Alternatively, when the specified location is the initial position of the intermediate code, according to the specified location, from described
The character of second designated length is intercepted in code to be verified, including:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
Alternatively, when the specified location is the end position of the intermediate code, according to the specified location, from described
The character of second designated length is intercepted in code to be verified, including:
From the end position of the code to be verified, backward intercepts the character of second designated length.
Alternatively, the create-rule of the check code for self checking includes:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as described for self checking
Check code.
Alternatively, the create-rule of the parsing check code for self checking, generates the to be verified of the code to be calculated
Character, including:
The create-rule of the parsing check code for self checking, it is determined that calculating the rule of the check code of the intermediate code
And the rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated.
Alternatively, the character string is M+N positions, and calculating the rule of the check code of the intermediate code includes:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, as institute
State the check code of intermediate code.
Alternatively, according to the rule for the check code for calculating the intermediate code, the check code of the code to be calculated is calculated, is wrapped
Include:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as
The check code of the code to be calculated.
Alternatively, the check code for self checking of second designated length is taken from the check code of the intermediate code
Rule includes:From the initial position of the check code of the intermediate code, the second designated length position is sequentially taken, is used for certainly as described
The check code of verification;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated, including:From described to be calculated
The initial position of the check code of code rises, and order intercepts the second designated length position, as the character to be verified.
Alternatively, the check code for self checking of second designated length is taken from the check code of the intermediate code
Rule includes:From the end position of the check code of the intermediate code, backward takes the second designated length position, is used for certainly as described
The check code of verification;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated, including:From described to be calculated
The end position of the check code of code rises, and backward intercepts the second designated length position, as the character to be verified.
Alternatively, whether the code to be verified is determined by verification according to comparative result, including:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to treat school
The code tested passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to treat
The code of verification is not validated.
Alternatively, the character in the character string is different two-by-two, it is determined that the code to be verified by verification after, also
Including:
The character being present in second substring is deleted from the code to be calculated, obtains the code to be verified
In effect code;
Obtain and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into described appoint
Business mark.
Alternatively, first substring is M positions, and the transformation rule of the effect code includes:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
Alternatively, the transformation rule of the effect code is parsed, the effect code in the code to be verified is converted into described
Task identification, including:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into institute from M system numbers
State task identification.
Alternatively, the transformation rule of the effect code is parsed, the effect code of the code to be verified is converted into described appoint
After business mark, in addition to:
Corresponding business task is searched according to the task identification, and carries out business logical operation.
According to another aspect of the present invention, a kind of calibration equipment for being used to realize the code of business task is additionally provided, including:
Code securing component to be verified, suitable for obtaining code to be verified;
Self-checking code determines component, suitable for obtaining and parsing the create-rule of the code to be verified, from described to be verified
Code in intercept check code for self checking;
Code to be calculated determines component, after the check code for self checking is intercepted from the code to be verified,
Using remaining code as code to be calculated;
Character formation component to be verified, it is raw suitable for obtaining and parsing the create-rule of the check code for self checking
Into the character to be verified of the code to be calculated;
Component is verified, suitable for the relatively check code for self checking and the character to be verified, according to comparative result
Determine whether the code to be verified passes through verification.
Alternatively, the code to be verified based on effect code, obscure code and generated for the check code of self checking, institute
Check code for self checking is stated using the effect code and described obscure code and generates.
Alternatively, the effect code is the character in the first substring being converted into by the task identification of business, described
Obscure the character string that code is the first designated length randomly selected from the second substring, first substring from for
Generate and extracted in the character string of the code to be verified, second substring is extracted first son from the character string
Remainder extraction after character string.
Alternatively, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the finger of intermediate code that code character closes to obtain
Positioning is put, wherein, the check code for self checking is the second designated length.
Alternatively, the self-checking code determines that component is further adapted for:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as institute
State the check code for self checking.
Alternatively, the specified location includes the initial position or end position of the intermediate code.
Alternatively, when the specified location is the initial position of the intermediate code, the self-checking code determines component also
It is suitable to:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
Alternatively, when the specified location is the end position of the intermediate code, the self-checking code determines component also
It is suitable to:
From the end position of the code to be verified, backward intercepts the character of second designated length.
Alternatively, the create-rule of the check code for self checking includes:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as described for self checking
Check code.
Alternatively, the character formation component to be verified is further adapted for:
The create-rule of the parsing check code for self checking, it is determined that calculating the rule of the check code of the intermediate code
And the rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated.
Alternatively, the character string is M+N positions, and calculating the rule of the check code of the intermediate code includes:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, as institute
State the check code of intermediate code.
Alternatively, the character formation component to be verified is further adapted for:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as
The check code of the code to be calculated.
Alternatively, the check code for self checking of second designated length is taken from the check code of the intermediate code
Rule includes:From the initial position of the check code of the intermediate code, the second designated length position is sequentially taken, is used for certainly as described
The check code of verification;
The character formation component to be verified is further adapted for:From the initial position of the check code of the code to be calculated, order
The second designated length position is intercepted, as the character to be verified.
Alternatively, the check code for self checking of second designated length is taken from the check code of the intermediate code
Rule includes:From the end position of the check code of the intermediate code, backward takes the second designated length position, is used for certainly as described
The check code of verification;
The character formation component to be verified is further adapted for:From the end position of the check code of the code to be calculated, backward
The second designated length position is intercepted, as the character to be verified.
Alternatively, the verification component is further adapted for:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to treat school
The code tested passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to treat
The code of verification is not validated.
Alternatively, the character in the character string is different two-by-two, in addition to:
Task identification determines component, suitable for it is described verification component it is determined that the code to be verified by verification after, from
The character being present in second substring is deleted in the code to be calculated, obtains the effect in the code to be verified
Code;Obtain and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into the task mark
Know.
Alternatively, first substring is M positions, and the transformation rule of the effect code includes:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
Alternatively, the task identification determines that component is further adapted for:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into institute from M system numbers
State task identification.
Alternatively, described device also includes:
Business task processing component, determine to act on the transformation rule of code described in analyzing component suitable for the task identification, will
The effect code of the code to be verified is converted into after the task identification, is searched corresponding business according to the task identification and is appointed
Business, and carry out business logical operation.
In embodiments of the present invention, obtain and parse the create-rule of code to be verified, intercepted from code to be verified
For the check code of self checking, and using remaining code as code to be calculated.Then, obtain and parse the check code for self checking
Create-rule, generate the character to be verified of code to be calculated.Afterwards, the check code for self checking and character to be verified are compared,
Determine whether code to be verified passes through verification according to comparative result.The embodiment of the present invention during verification, treat by in-time generatin
Calculate the character to be verified of code, and then to be verified character of the check code with code to be calculated that self checking will be used in code to be verified
It is compared to determine whether code to be verified passes through verification.It is if to be calculated in code to be verified during transmission
Code error, such as character are lost or are tampered, then the character to be verified generated according to code to be calculated in code to be verified with using
Must be in the check code of self checking it is different, can not be by verification, thus can determine to transmit by check results
During code to be verified whether malfunction.
Further, the code to be verified of the embodiment of the present invention further comprises in addition to including effect code and obscure code and use
In the check code of self checking, so as to serve the effect that anti-tamper, anti-violence cracks, the security of code is greatly improved.
In addition, the embodiment of the present invention can parse after code to be verified is by verification from the code by verification
Code is acted on, because effect code is to convert what is obtained by the task identification of business, corresponding business can be calculated by acting on code
Task identification, so as to inquire corresponding business task according to the task identification of business, and then carry out business logical operation.
Because the length of the code by verification is more than the length of the task identification of business, the embodiment of the present invention directly passes through the task of business
Mark inquires about corresponding business task, and index search phase is done compared to the code book body by verification is needed to use in the prior art
The business answered, inquiry business it is more efficient.Also, letter is generally comprised in the code for passing through verification, letter takes byte and compares number
Word is more, and the task identification of business is usually to be made up of numeral, thus the task identification occupancy byte of business is fewer than the code of generation,
Therefore the embodiment of the present invention is indexed using the task identification of business, compared in the prior art using the code book body by verifying
Index, the occupancy of internal memory can be reduced, save system resource.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the embodiment of the present invention.
According to the accompanying drawings will be brighter to the detailed description of the specific embodiment of the invention, those skilled in the art
Above-mentioned and other purposes, the advantages and features of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the flow according to an embodiment of the invention for being used to realize the generation method of the code of business task
Figure;
Fig. 2 shows the flow chart of the generation method of the check code according to an embodiment of the invention for self checking;
Fig. 3 shows the flow according to an embodiment of the invention for being used to realize the method for calibration of the code of business task
Figure;
Fig. 4 shows the flow of the generation method of the character to be verified of code to be calculated according to an embodiment of the invention
Figure;
Fig. 5 shows that the structure according to an embodiment of the invention for realizing the generating means of the code of business task is shown
It is intended to;
Fig. 6 shows that the structure according to an embodiment of the invention for realizing the calibration equipment of the code of business task is shown
It is intended to;And
Fig. 7 shows the structure in accordance with another embodiment of the present invention for being used to realize the calibration equipment of the code of business task
Schematic diagram.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
It is provided in an embodiment of the present invention a kind of for before realizing the method for calibration of code of business task, being situated between first introducing
The generating process of the code of the business that continues task, during the code of generation business task, might as well the code of the business task be referred to as to treat
Generated code.Here business task can be as mentioned above, and involved business is appointed in many scenes of the Internet, applications
Business, such as invite task, exchange game item, deduction and exemption purchase expenses, the embodiment of the present invention is not any limitation as to this.
Fig. 1 shows the flow according to an embodiment of the invention for being used to realize the generation method of the code of business task
Figure.This method can be applied in terminal, server or other equipment, for generating the code of business task.As shown in figure 1,
This method comprises at least following steps S102 to step S108.
Step S102, the character string for generating code to be generated is obtained, the first substring is extracted from the character string, and
The second substring is extracted from remainder.
Step S104, the task identification of business is obtained, task identification is converted into the character in the first substring, as
Effect code in code to be generated.
Step S106, the character string of the first designated length is randomly selected from the second substring as in code to be generated
Obscure code, and using acting on code and obscuring code, generate the check code for being used for self checking in code to be generated.
Step S108, based on effect code, obscure code and check code for self checking, generate code to be generated.
What is referred in above step S102 is used to generate the character string of code to be generated, can have identical word in the character string
Character in symbol or the character string is different two-by-two.When there is identical character in character string, extracted from the character string
Identical character is there may be in one substring and the second substring.For example, obtain the character for generating code to be generated
Go here and there as " abcdefgh123456789ab ", it is " abcdefgh12 " that the first substring is extracted from the character string, the second sub- word
Symbol string is " 3456789ab ", identical character " ab " be present in the first substring and the second substring here.In order to protect
Card subsequently the code of generation is parsed exactly, in step S108 based on act on code, obscure code and for self checking
When check code generates code to be generated, it is possible to specify this three's's (that is, act on code, obscure code and the check code for self checking)
Sorting position, for example, sorting position, which is followed successively by, obscures code, effect code and the check code for self checking;Or sorting position
It is followed successively by effect code, obscures code and the check code for self checking;Or sorting position is followed successively by the verification for self checking
Code, act on code and obscure code.When subsequently being parsed to the code of generation, parsing school is carried out according to the sorting position specified
Test, so as to be parsed exactly to the code of generation.
When the character in character string is different two-by-two, the first substring extracted from the character string and the second sub- character
Identical character is not present in string, and identical word is also not present in the first substring and the second substring between each other
Symbol, then effect code based on the generation of the first substring and obscure code also in the absence of identical based on the generation of the second substring
Character, thus for removing any character after the check code for self checking in the code of generation, can distinguish exactly is
Effect code obscures code.Therefore, in step S108 based on effect code, obscure code and for self checking check code generation treat
During generated code, it is not necessary to specify effect code and obscure the sorting position of code, such as obscure code to upset radom insertion effect code
In, it still can ensure subsequently to parse the code of generation exactly.Also, the mode of this generated code can further serve as
The effect cracked to anti-tamper, anti-violence, greatly improve the security of the code of generation.It should be noted that in practical operation
In can also specify effect code and obscure the sorting position of code, the embodiment of the present invention is not any limitation as to this.
The task identification based on business generates the effect code in code to be generated in step S104, the embodiments of the invention provide
A kind of optional scheme, in this scenario, the first substring are M positions, out of order first substring, obtain the word of M system numbers
List is accorded with, and then based on the character lists of M system numbers, the M system numbers of calculating task mark.Further, it is possible to determine task mark
The current system number known, and then based on the character lists of M system numbers, task identification is converted into M system numbers from current system number.
For example, the task identification of business is adding certainly in tables of data, it is from increasing, step-length such as since decimal number " 0 "
1, it is positive integer to add certainly as 0,1,2,3 ... n, n.For generating the character string of code to be generated as M+N positions
" s25a9rwc78pzdgt6jbu4eh3fnqyxmkv ", the first substring are M (M=26) position
" s259rwc78pzdgt6jbue3fnqymk ", the second substring are " a4hxv " of N (N=5) position.Out of order first sub- character
String, the character lists for obtaining M system numbers are " ws5gr2pumk7q3c6tfdj9bzney8 ", add the M of middle decimal number " 0 " certainly
System number is that " w " is used as the effect code in code to be generated, and the M systems number of decimal number " 1 " is " s " as the work in code to be generated
With code, by that analogy.It is only illustrative it should be noted that enumerate herein, the embodiment of the present invention is not any limitation as to this.
In step s 106 using acting on code and obscuring code, the check code for being used for self checking in code to be generated, this hair are generated
Bright embodiment provides a kind of optional scheme.Fig. 2 shows the verification according to an embodiment of the invention for self checking
The flow chart of the generation method of code.As shown in Fig. 2 this method comprises at least following steps S202 to step S206.
Step S202, code will be obscured and upset in radom insertion effect code, generate intermediate code.
In this step, by taking above example as an example, first is randomly selected from the second substring " a4hxv " and specifies length
The character string " ahx4 " of degree (being assumed to be 4) obscures code as in code to be generated, will obscure code " ahx4 " and upsets radom insertion work
With in code " w ", generation intermediate code is " a4hxw ".Further, it can also will obscure code and upset any more of radom insertion effect code
Individual position generates intermediate code, for example, any number of positions that code " ahx4 " upsets radom insertion effect code " w " will be obscured, generation
Intermediate code is " a4whx ".It is only illustrative it should be noted that enumerate herein, the embodiment of the present invention is not any limitation as to this.
Step S204, calculate the check code of intermediate code.
In this step, the embodiments of the invention provide a kind of optional scheme, i.e. character string is M+N positions, can be with out of order
The character string, the character lists of M+N system numbers are obtained, and calculate the CRC of intermediate code (Cyclic Redundancy Check, are followed
Ring check code) value.Subsequently, based on the character lists of M+N system numbers, the crc value of intermediate code is converted into M+N system numbers, as
The check code of intermediate code.
By taking above example as an example, the intermediate code of generation is " a4whx ", calculate the CRC32 values of the intermediate code for-
10822859820 (decimal numbers being converted to by binary number).When calculating the crc value of code, there can be different CRC to calculate
Method, such as CRC8, CRC12, CRC16, CRC32, each CRC algorithm represent different generator polynomials.In this example schematically
The CRC32 values of intermediate code are calculated, the embodiment of the present invention is not any limitation as to this.Subsequently, based on the character lists of M+N system numbers,
The CRC32 values " -10822859820 " of intermediate code are converted into M+N systems number " aksdf8dk ", the check code as intermediate code.
Step S206, the check code of the second designated length is taken from the check code for the intermediate code being calculated, as to be generated
It is used for the check code of self checking into code.
In this step, second can be sequentially taken to specify from the initial position of the check code for the intermediate code being calculated
Length position, as the check code for being used for self checking in code to be generated;Or the end of the check code from the intermediate code being calculated
Position is risen, and backward takes the second designated length position, as the check code for being used for self checking in code to be generated.
In the check code " aksdf8dk " for the intermediate code being calculated, from initial position, second is sequentially taken to specify length
Spend (being assumed to be 3) position " aks ", as the check code for being used for self checking in code to be generated.Or from end position, backward takes
Second designated length (being assumed to be 3) position " 8dk ", as the check code for being used for self checking in code to be generated.It should be noted that this
Place, which is enumerated, to be only illustrative, and the embodiment of the present invention is not any limitation as to this.
Further, the first designated length referred in step S106 can be realized by following steps, i.e. determine to be generated
Into the length of the effect code in the length of code and code to be generated, and then the length of code to be generated is subtracted into the work in code to be generated
With the length of code with the second designated length (that is, the length that the check code of self checking is used in code to be generated) sum, obtained length
Angle value is defined as the first designated length (that is, the length for obscuring code in code to be generated).In practical operation, the length of code to be generated
It is used for self checking in degree, the length of effect code in code to be generated, the length for obscuring code in code to be generated and code to be generated
Check code length, determine any three in this four length, you can obtain the 4th length.
In step S106 using acting on code and obscuring code, generate in code to be generated and be used for after the check code of self checking, step
In rapid S108 based on effect code, obscure code and check code for self checking, generate code to be generated, the embodiment of the present invention provides
A kind of optional scheme, in the optional scheme, upset in radom insertion effect code due to obscuring code and generate intermediate code,
Check code for self checking can be thus attached to the end of intermediate code, generate code to be generated;Or it will can also be used for
The check code of self checking is attached to the front end of intermediate code, generates code to be generated.
For example, the intermediate code generated in above step S202 is " a4whx ", from the check code of intermediate code in step S206
The check code for self checking of interception is " aks " or " 8dk " in " aksdf8dk ".
For the check code " aks " for self checking, " aks " can be attached to intermediate code " a4whx " end, generated
Code to be generated is " a4whxaks ";Or " aks " is attached to intermediate code " a4whx " front end, generating code to be generated is
“aksa4whx”。
For the check code " 8dk " for self checking, " 8dk " can be attached to intermediate code " a4whx " end, generated
Code to be generated is " a4whx8dk ";Or " 8dk " is attached to intermediate code " a4whx " front end, generating code to be generated is
“8dka4whx”。
Example above is listed from when to add middle decimal number be " 0 ", according to the code of the business task of such scheme generation
Situation, for other decimal numbers in adding certainly, similar for the situation of " 0 " with decimal number, here is omitted.
It is (that is, to be generated according to the code of methods mentioned above generation business task in terminal, server or other equipment
Code) after, when receiving the request of code of issuing service task or instruction, the code of the business task of generation can be handed down to
Multiple destination clients.So as to which, multiple destination clients are using the code of the business task received, to terminal, server or
Corresponding business task is searched in the Service Database specified in other equipment, is realized by terminal, server or other equipment
Business logical operation.
The code for how verifying business task is explained below and inquires about corresponding business times using the code of business task
Business, and then realize business logical operation.
Fig. 3 shows the flow according to an embodiment of the invention for being used to realize the method for calibration of the code of business task
Figure.As shown in figure 3, this method comprises at least following steps S302 to step S308.
Step S302, obtain code to be verified.
Step S304, obtain and parse the create-rule of code to be verified, intercepted from code to be verified for self checking
Check code, using remaining code as code to be calculated.
Step S306, obtain and parse the create-rule of the check code for self checking, generate the to be verified of code to be calculated
Character.
Step S308, compare the check code for self checking and character to be verified, determined according to comparative result to be verified
Whether code passes through verification.
In embodiments of the present invention, obtain and parse the create-rule of code to be verified, intercepted from code to be verified
For the check code of self checking, and using remaining code as code to be calculated.Then, obtain and parse the check code for self checking
Create-rule, generate the character to be verified of code to be calculated.Afterwards, the check code for self checking and character to be verified are compared,
Determine whether code to be verified passes through verification according to comparative result.The embodiment of the present invention during verification, treat by in-time generatin
Calculate the character to be verified of code, and then to be verified character of the check code with code to be calculated that self checking will be used in code to be verified
It is compared to determine whether code to be verified passes through verification.It is if to be calculated in code to be verified during transmission
Code error, such as character are lost or are tampered, then the character to be verified generated according to code to be calculated in code to be verified with using
Must be in the check code of self checking it is different, can not be by verification, thus can determine to transmit by check results
During code to be verified whether malfunction.
The code to be verified that above step S302 is obtained, it is based on effect code, obscures code and verification for self checking
Code and generate, wherein, the check code for self checking is generated with obscuring code using acting on code.It follows that the present invention is real
The code to be verified of example is applied in addition to including effect code, further comprises and obscure code and the check code for self checking, so as to rise
The effect cracked to anti-tamper, anti-violence, greatly improve the security of code.
Also, effect code is character in the first substring being converted into by the task identification of business, obscure code be from
The character string for the first designated length randomly selected in second substring, the first substring is from for generating code to be verified
Character string in extract, the second substring from character string be extracted the first substring after remainder extraction.This hair
Character in the first substring that bright embodiment is converted to the task identification of business, as the effect code in code to be generated,
So as in the case of the task identification of business is unduplicated, ensure that the code of generation does not repeat, solve and work as life in the prior art
Into code it is more when the probability that repeats it is bigger, and then also need to carry out deduplication operation after generated code, cause the efficiency of generated code compared with
The problem of low.
For example, in terminal, server or other equipment generated code " a4whx8dk " (code is used to realize business task)
Afterwards, the code is handed down to one or more destination clients.Destination client carries out code using the code of the business task received
Verification and business lookup, in practical operation, destination client code to be verified can be submitted to terminal, server or
Person's other equipment, and then carry out the verification of code and the lookup of business.Terminal, server or other equipment obtain to be verified
Code is " a4whx8dk ", and the task identification of business is adding certainly in tables of data, from increasing, step-length such as since decimal number " 0 "
For 1, it is positive integer to add certainly as 0,1,2,3 ... n, n.For generating the character string of code to be verified as M+N positions
" s25a9rwc78pzdgt6jbu4eh3fnqyxmkv ", the first substring are M (M=26) position
" s259rwc78pzdgt6jbue3fnqymk ", the second substring are " a4hxv " of N (N=5) position.It should be noted that this
Place, which is enumerated, to be only illustrative, and the embodiment of the present invention is not any limitation as to this.
In above step S304, the create-rule of code to be verified includes the check code for self checking being attached to effect
Code and obscure the specified location of intermediate code that code character closes to obtain, wherein, the check code for self checking is the second designated length.This
When, the create-rule of code to be verified is parsed, determines the second designated length and specified location, and then according to specified location, from treating
The character of the second designated length is intercepted in the code of verification, as the check code for self checking.Here, specified location can include
Initial position, end position or the other positions of intermediate code.
, can be from the initial position of code to be verified when specified location is the initial position of intermediate code, order intercepts
The character of second designated length.
, can be from the end position of code to be verified when specified location is the end position of intermediate code, backward interception
The character of second designated length.
In above example, the code to be verified of acquisition is " a4whx8dk ", second for the check code of self checking
Designated length is 3, and specified location is the end position of intermediate code.Now, from the end position of code " a4whx8dk " to be verified
Rise, backward intercepts the character " 8dk " of the second designated length " 3 ", as the check code for self checking.Now, remaining code is
" a4whx " is used as code to be calculated.
The create-rule of the check code for self checking is parsed in step S306, generates the word to be verified of code to be calculated
Symbol, the embodiments of the invention provide a kind of optional scheme, in this scenario, the create-rule bag for the check code of self checking
Code will be obscured by, which including, upsets in radom insertion effect code, generates intermediate code, and then calculates the check code of intermediate code, then from intermediate code
Check code in take the check code of the second designated length, as the check code for self checking.Fig. 4 is shown according to the present invention one
The flow chart of the generation method of the character to be verified of the code to be calculated of individual embodiment.As shown in figure 4, this method is including at least following
Step S402 to step S406.
Step S402, the create-rule of the check code for self checking is parsed, it is determined that calculating the rule of the check code of intermediate code
Then and from the check code of intermediate code take the rule of the check code for self checking of the second designated length.
Step S404, according to the rule for the check code for calculating intermediate code, calculate the check code of code to be calculated.
In this step, the rule of the check code for the calculating intermediate code that step S402 is determined includes out of order character string, obtains M
The character lists of+N system numbers, and then calculate the crc value of intermediate code, the character lists then based on M+N system numbers, by intermediate code
Crc value be converted to M+N system numbers, the check code as intermediate code.Now, the crc value of code to be calculated is calculated, and then is based on M+
The character lists of N system numbers, the crc value of code to be calculated is converted into M+N system numbers, the check code as code to be calculated.
In example above, code to be calculated be " a4whx ", the CRC32 values of the code " a4whx " to be calculated be "-
10822859820 ", it is " aksdf8dk " that the CRC32 values of code to be calculated are converted into M+N systems number, the school as code to be calculated
Test code.
Step S406, according to the rule for the check code for self checking that the second designated length is taken from the check code of intermediate code
Then, the character to be verified of the second designated length is intercepted from the check code of code to be calculated.
In this step, when take the second designated length in the check code from intermediate code that step S402 is determined is used for self-correcting
The rule for the check code tested include from the initial position of the check code of intermediate code, sequentially take the second designated length position, as with
In the check code of self checking.At this point it is possible to from the initial position of the check code of code to be calculated, order intercepts the second designated length
Position, as character to be verified.
When the check code for self checking that the second designated length is taken in the check code from intermediate code that step S402 is determined
Rule include from the end position of the check code of intermediate code, backward takes the second designated length position, as self checking
Check code.At this point it is possible to from the end position of the check code of code to be calculated, backward intercepts the second designated length position, as treating
Check character.
In example above, the rule of the check code for self checking of the second designated length are taken from the check code of intermediate code
Then include from the end position of the check code of intermediate code, backward takes the second designated length position, as the verification for self checking
Code.At this point it is possible to from the end position of the check code " aksdf8dk " of code to be calculated, backward intercepts the second designated length " 3 "
Position " 8dk ", as character to be verified.
In above step S308, if comparative result is identical with character to be verified for the check code for self checking, really
Fixed code to be verified passes through verification;Conversely, if comparative result is to be differed for the check code of self checking with character to be verified,
Determine that code to be verified is not validated.In the above example, the check code " 8dk " for self checking and character to be verified
" 8dk " is identical, it is determined that code to be verified passes through verification.
Further, after step S308 determines code to be verified by verification, can be extracted from the code of business task
The task identification of business, and then corresponding business task is searched according to task identification, and carry out business logical operation.I.e., it is possible to
The character being present in the second substring is deleted from code to be calculated, obtains the effect code in code to be verified, and then obtain
And the transformation rule of analytic function code, the effect code in code to be verified is converted into task identification, and then according to task identification
Corresponding business task is searched, and carries out business logical operation.
In this step, acting on the transformation rule of code includes out of order first substring, obtains the character row of M system numbers
Table, and then based on the character lists of M system numbers, the M system numbers of calculating task mark.At this point it is possible to the character according to M system numbers
List, the effect code in code to be verified is converted into task identification from M system numbers.
In example above, code to be calculated is " a4whx ", and the second substring is " a4hxv " of N (N=5) position, from treating
The character (that is, obscuring code) deleted and be present in the second substring in code is calculated, the effect code obtained in code to be verified is
“w”.Subsequently, based on the character lists of M system numbers, the effect code " w " in code to be verified is converted into task mark from M system numbers
Know " 0 ".Afterwards, corresponding business task is searched according to task identification " 0 ", and carries out business logical operation.For example, task identification
Business task corresponding to " 0 " is " exchange game item ", then carries out exchanging the business logical operation of game item.
The embodiment of the present invention directly inquires about corresponding business task by the task identification of business, compared in the prior art
Need to use the code book body of generation to do the corresponding business of index search, inquiry business it is more efficient.Also, in the code of generation
Letter is generally comprised, letter occupancy byte is more than numeral, and the task identification of business is usually to be made up of numeral, thus business
Task identification occupancy byte is fewer than the code of generation, therefore the embodiment of the present invention is indexed using the task identification of business, compared to
Indexed in the prior art using the code book body of generation, the occupancy of internal memory can be reduced, save system resource.
The generation method for being used to realize the code of business task provided based on each embodiment above, based on same invention structure
Think, the embodiment of the present invention additionally provides a kind of generating means for being used to realize the code of business task, and the device can be applied at end
In end, server or other equipment, for generating the code of business task.Here business task can be as mentioned above,
The involved business task in many scenes of the Internet, applications, such as invite task, exchange game item, deduction and exemption shopping expense
With, exchange gift etc., the embodiment of the present invention is not any limitation as to this.
Fig. 5 shows that the structure according to an embodiment of the invention for realizing the generating means of the code of business task is shown
It is intended to.As shown in figure 5, the device 500 can at least include substring extraction assembly 510, effect code formation component 520, mix
Confuse yard formation component 530, self-checking code formation component 540 and code formation component 550 to be generated.
Now introduce each composition or device that are used to realize the generating means 500 of the code of business task of the embodiment of the present invention
Annexation between function and each several part:
Substring extraction assembly 510, it is used to generate the character string of code to be generated suitable for obtaining, the is extracted from character string
One substring, and extract the second substring from remainder;
Code formation component 520 is acted on, is coupled with substring extraction assembly 510, suitable for obtaining the task identification of business,
Task identification is converted into the character in the first substring, as the effect code in code to be generated;
Obscure yard formation component 530, be coupled with effect code formation component 520, suitable for random from the second substring
The character string for extracting the first designated length obscures code as in code to be generated;
Self-checking code formation component 540, it is coupled with obscuring yard formation component 530, suitable for code and obscuring code using acting on,
Generate the check code for being used for self checking in code to be generated;
Code formation component 550 to be generated, is coupled with self-checking code formation component 540, suitable for based on effect code, obscure code
And the check code for self checking, generate code to be generated.
In an embodiment of the present invention, the character string for being used to generate code to be generated that substring extraction assembly 510 obtains,
There can be the character in identical character or the character string different two-by-two in the character string.When there is identical character in character string
When, identical character is there may be in the first substring and the second substring that are extracted from the character string.For example, obtain
Character string for generating code to be generated is " abcdefgh123456789ab ", and the first substring is extracted from the character string
For " abcdefgh12 ", the second substring is " 3456789ab ", is deposited in the first substring and the second substring here
At identical character " ab ".In order to ensure that subsequently the code of generation is parsed exactly, code formation component 550 to be generated is based on
When acting on code, obscure code and generating code to be generated for the check code of self checking, it is possible to specify this three (that is, acts on code, mixed
Confuse code and the check code for self checking) sorting position, for example, sorting position, which is followed successively by, obscures code, effect code and use
In the check code of self checking;Or sorting position is followed successively by effect code, obscures code and the check code for self checking;Or
Sorting position is followed successively by the check code for self checking, acts on code and obscures code.When subsequently being parsed to the code of generation,
Parsing verification is carried out according to the sorting position specified, so as to be parsed exactly to the code of generation.
When the character in character string is different two-by-two, the first substring extracted from the character string and the second sub- character
Identical character is not present in string, and identical word is also not present in the first substring and the second substring between each other
Symbol, then effect code based on the generation of the first substring and obscure code also in the absence of identical based on the generation of the second substring
Character, thus for removing any character after the check code for self checking in the code of generation, can distinguish exactly is
Effect code obscures code.Therefore, code formation component 550 to be generated based on effect code, obscure code and verification for self checking
When code generates code to be generated, it is not necessary to specify effect code and obscure the sorting position of code, such as obscure code to upset with the machine transplanting of rice
Enter to act in code, still can ensure subsequently to parse the code of generation exactly.Also, the mode of this generated code can
The effect that anti-tamper, anti-violence cracks is further functioned as, greatly improves the security of the code of generation.It should be noted that
Effect code can also be specified in practical operation and obscures the sorting position of code, the embodiment of the present invention is not any limitation as to this.
In an embodiment of the present invention, code formation component 520 is acted on to be further adapted for:It is out of order when the first substring is M positions
First substring, obtain the character lists of M system numbers;Based on the character lists of M system numbers, the M systems of calculating task mark
Number.
In an embodiment of the present invention, code formation component 520 is acted on to be further adapted for:Determine the current system number of task identification;
And then based on the character lists of M system numbers, task identification is converted into M system numbers from current system number.
For example, the task identification of business is adding certainly in tables of data, it is from increasing, step-length such as since decimal number " 0 "
1, it is positive integer to add certainly as 0,1,2,3 ... n, n.For generating the character string of code to be generated as M+N positions
" s25a9rwc78pzdgt6jbu4eh3fnqyxmkv ", the first substring are M (M=26) position
" s259rwc78pzdgt6jbue3fnqymk ", the second substring are " a4hxv " of N (N=5) position.Out of order first sub- character
String, the character lists for obtaining M system numbers are " ws5gr2pumk7q3c6tfdj9bzney8 ", add the M of middle decimal number " 0 " certainly
System number is that " w " is used as the effect code in code to be generated, and the M systems number of decimal number " 1 " is " s " as the work in code to be generated
With code, by that analogy.It is only illustrative it should be noted that enumerate herein, the embodiment of the present invention is not any limitation as to this.
In an embodiment of the present invention, self-checking code formation component 540 is further adapted for:Code will be obscured and upset radom insertion effect
In code, intermediate code is generated;Calculate the check code of intermediate code;The second designated length is taken from the check code for the intermediate code being calculated
Check code, as in code to be generated be used for self checking check code.
In an embodiment of the present invention, self-checking code formation component 540 is further adapted for:Code will be obscured and upset radom insertion effect
Any number of positions of code, generate intermediate code.
By taking above example as an example, obscure yard formation component 530 and randomly select first from the second substring " a4hxv "
The character string " ahx4 " of designated length (being assumed to be 4) obscures code as in code to be generated.Self-checking code formation component 540 will be mixed
The code " ahx4 " that confuses is upset in radom insertion effect code " w ", and generation intermediate code is " a4hxw ".Further, self-checking code formation component
540 will obscure any number of positions that code " ahx4 " upsets radom insertion effect code " w ", and generation intermediate code is " a4whx ".Need
Illustrate, enumerate being only illustrative herein, the embodiment of the present invention is not any limitation as to this.
In an embodiment of the present invention, self-checking code formation component 540 is further adapted for:When character string is M+N positions, out of order word
Symbol string, obtains the character lists of M+N system numbers;Calculate the crc value of intermediate code;Based on the character lists of M+N system numbers, by centre
The crc value of code is converted to M+N system numbers, the check code as intermediate code.
By taking above example as an example, the intermediate code that self-checking code formation component 540 generates is " a4whx ", and self-checking code is given birth to
The CRC32 values that the intermediate code is calculated into component 540 are -10822859820 (decimal numbers being converted to by binary number).
When calculating the crc value of code, can there are different CRC algorithms, such as CRC8, CRC12, CRC16, CRC32, each CRC algorithm table
Show different generator polynomials.The CRC32 values of intermediate code are schematically calculated in this example, the embodiment of the present invention is not limited this
System.Then, character lists of the self-checking code formation component 540 based on M+N system numbers, by the CRC32 values of intermediate code "-
10822859820 " are converted to M+N systems number " aksdf8dk ", the check code as intermediate code.
In an embodiment of the present invention, self-checking code formation component 540 is further adapted for:From the inspection for the intermediate code being calculated
The initial position of code rises, and sequentially takes the second designated length position, as the check code for being used for self checking in code to be generated;Or from
The end position of the check code for the intermediate code being calculated rises, and backward takes the second designated length position, as being used in code to be generated
The check code of self checking.
In the check code " aksdf8dk " for the intermediate code being calculated, self-checking code formation component 540 is from initial position
Rise, sequentially take the second designated length (being assumed to be 3) position " aks ", as the check code for being used for self checking in code to be generated.Or
Self-checking code formation component 540 is from end position, and backward takes the second designated length (being assumed to be 3) position " 8dk ", as to be generated
It is used for the check code of self checking in code.It is only illustrative it should be noted that enumerate herein, the embodiment of the present invention is not added with to this
With limitation.
In an embodiment of the present invention, obscure yard formation component 530 to be further adapted for:Determine the length of code to be generated and to be generated
Into the length of the effect code in code;The length that the length of code to be generated is subtracted to the effect code in code to be generated specifies length with second
Sum is spent, obtained length value is defined as the first designated length.In practical operation, in the length of code to be generated, code to be generated
The length of effect code, be used in the length for obscuring code in code to be generated and code to be generated self checking check code length
Spend, determine any three in this four length, you can obtain the 4th length.
In an embodiment of the present invention, code formation component 550 to be generated is further adapted for:Check code for self checking is added
At the end of intermediate code, code to be generated is generated;Or the check code for self checking is attached to the front end of intermediate code, generate
Code to be generated.
For example, the intermediate code of the generation of self-checking code formation component 540 above is " a4whx ", and from the inspection of intermediate code
The check code for self checking of interception is " aks " or " 8dk " in code " aksdf8dk ".
For the check code " aks " for self checking, " aks " is attached to intermediate code by code formation component 550 to be generated
The end of " a4whx ", it is " a4whxaks " to generate code to be generated;Or " aks " is attached to intermediate code " a4whx " front end,
It is " aksa4whx " to generate code to be generated.
For the check code " 8dk " for self checking, " 8dk " is attached to intermediate code by code formation component 550 to be generated
The end of " a4whx ", it is " a4whx8dk " to generate code to be generated;Or " 8dk " is attached to intermediate code " a4whx " front end,
It is " 8dka4whx " to generate code to be generated.
Example above is listed from when to add middle decimal number be " 0 ", according to the code of the business task of such scheme generation
Situation, for other decimal numbers in adding certainly, similar for the situation of " 0 " with decimal number, here is omitted.
The method of calibration for being used to realize the code of business task provided based on each embodiment above, based on same invention structure
Think, the embodiment of the present invention additionally provides a kind of calibration equipment for being used to realize the code of business task.Fig. 6 is shown according to the present invention
The structural representation for being used to realize the calibration equipment of the code of business task of one embodiment.As shown in fig. 6, the device 600 to
Code securing component 610 to be verified, self-checking code can be included less and determine that component 620, code to be calculated determine component 630, to be verified
Character formation component 640 and verification component 650.
Now introduce each composition or device that are used to realize the calibration equipment 600 of the code of business task of the embodiment of the present invention
Annexation between function and each several part:
Code securing component 610 to be verified, suitable for obtaining code to be verified;
Self-checking code determines component 620, is coupled with code securing component 610 to be verified, to be verified suitable for obtaining and parsing
Code create-rule, the check code for self checking is intercepted from code to be verified;
Code to be calculated determines component 630, determines that component 620 is coupled with self-checking code, suitable for being cut from code to be verified
Take after the check code of self checking, using remaining code as code to be calculated;
Character formation component 640 to be verified, determine that component 630 is coupled with code to be calculated, be used for suitable for obtaining and parsing
The create-rule of the check code of self checking, generate the character to be verified of code to be calculated;
Component 650 is verified, is coupled with character formation component 640 to be verified, suitable for comparing the check code for self checking
With character to be verified, determine whether code to be verified passes through verification according to comparative result.
In an embodiment of the present invention, the code to be verified that code securing component 610 to be verified obtains, be based on effect code,
Obscure code and generated for the check code of self checking, wherein, the check code for self checking code and is obscured using acting on
Code and generate.It follows that the code to be verified of the embodiment of the present invention except including effect code in addition to, further comprises obscure code and
For the check code of self checking, so as to serve the effect that anti-tamper, anti-violence cracks, the security of code is greatly improved.
Also, effect code is character in the first substring being converted into by the task identification of business, obscure code be from
The character string for the first designated length randomly selected in second substring, the first substring is from for generating code to be verified
Character string in extract, the second substring from character string be extracted the first substring after remainder extraction.This hair
Character in the first substring that bright embodiment is converted to the task identification of business, as the effect code in code to be generated,
So as in the case of the task identification of business is unduplicated, ensure that the code of generation does not repeat, solve and work as life in the prior art
Into code it is more when the probability that repeats it is bigger, and then also need to carry out deduplication operation after generated code, cause the efficiency of generated code compared with
The problem of low.
Still exemplified by above, the code to be verified of acquisition is " a4whx8dk ", and the task identification of business is in tables of data
From adding, from increasing such as since decimal number " 0 ", step-length 1, it is positive integer to add certainly as 0,1,2,3 ... n, n.For generating
The character string of code to be verified is " s25a9rwc78pzdgt6jbu4eh3fnqyxmkv " of M+N positions, and the first substring is M
(M=26) " s259rwc78pzdgt6jbue3fnqymk " of position, the second substring are " a4hxv " of N (N=5) position.Need
Illustrate, enumerate being only illustrative herein, the embodiment of the present invention is not any limitation as to this.
In an embodiment of the present invention, when code to be verified create-rule include by the second designated length, for from
When the check code of verification is attached to effect code and obscures the specified location for the intermediate code that code character closes to obtain, self-checking code determines component
The create-rule of 620 parsing codes to be verified, determines the second designated length and specified location, and then according to specified location, from treating
The character of the second designated length is intercepted in the code of verification, as the check code for self checking.Here, the second designated length is use
In the length of the check code of self checking, specified location can include initial position, end position or the other positions of intermediate code.
When specified location is the initial position of intermediate code, self-checking code determines component 620 from the initial of code to be verified
Position is risen, and order intercepts the character of the second designated length.
When specified location is the end position of intermediate code, self-checking code determines component 620 from the end of code to be verified
Position is risen, and backward intercepts the character of the second designated length.
In above example, the code to be verified that code securing component 610 to be verified obtains is " a4whx8dk ", for certainly
Second designated length of the check code of verification is 3, and specified location is the end position of intermediate code.Now, self-checking code determines group
For part 620 from the end position of code " a4whx8dk " to be verified, backward intercepts the character " 8dk " that the second designated length is " 3 ",
As the check code for self checking.Determine that component 620 intercepts the school for self checking from code to be verified in self-checking code
After testing code, code to be calculated determines that component 630 determines that remaining code is used as code to be calculated for " a4whx ".
In an embodiment of the present invention, the create-rule for the check code of self checking is upset with the machine transplanting of rice including that will obscure code
Enter to act in code, generate intermediate code, and then calculate the check code of intermediate code, then take second to specify from the check code of intermediate code
The check code of length, as the check code for self checking.Now, character formation component 640 to be verified is further adapted for:Parse and be used for
The create-rule of the check code of self checking, it is determined that calculating the rule of the check code of intermediate code and being taken from the check code of intermediate code
The rule of the check code for self checking of second designated length;According to the rule for the check code for calculating intermediate code, calculate and wait to count
Calculate the check code of code;According to the rule for the check code for self checking that the second designated length is taken from the check code of intermediate code,
The character to be verified of the second designated length is intercepted from the check code of code to be calculated.
In an embodiment of the present invention, calculating the rule of the check code of intermediate code includes out of order character string, obtains M+N systems
Several character lists, and then calculate the crc value of intermediate code, the character lists then based on M+N system numbers, by the CRC of intermediate code
Value is converted to M+N system numbers, the check code as intermediate code.Now, character formation component 640 to be verified calculates code to be calculated
Crc value, and then based on the character lists of M+N system numbers, the crc value of code to be calculated is converted into M+N system numbers, as to be calculated
The check code of code.
In example above, code to be calculated is " a4whx ", the CRC32 values of the code " a4whx " to be calculated for "-
10822859820 ", the CRC32 values of code to be calculated are converted to M+N system numbers and are by character formation component 640 to be verified
" aksdf8dk ", the check code as code to be calculated.
In an embodiment of the present invention, the verification for self checking of the second designated length is taken from the check code of intermediate code
The rule of code is included from the initial position of the check code of intermediate code, the second designated length position is sequentially taken, as self checking
Check code.Now, the initial position of check code of the character formation component 640 to be verified from code to be calculated, order interception the
Two designated length positions, as character to be verified.
In an embodiment of the present invention, the verification for self checking of the second designated length is taken from the check code of intermediate code
The rule of code is included from the end position of the check code of intermediate code, and backward takes the second designated length position, as self checking
Check code.Now, the end position of check code of the character formation component 640 to be verified from code to be calculated, backward interception the
Two designated length positions, as character to be verified.
In example above, the rule of the check code for self checking of the second designated length are taken from the check code of intermediate code
Then include from the end position of the check code of intermediate code, backward takes the second designated length position, as the verification for self checking
Code.Now, character formation component 640 to be verified from the end position of the check code " aksdf8dk " of code to be calculated, cut by backward
The character bit that the second designated length is " 3 " is taken, i.e., " 8dk ", as character to be verified.
In an embodiment of the present invention, verification component 650 compares the check code for self checking and character to be verified, if than
Relatively result is identical with character to be verified for the check code for self checking, it is determined that code to be verified passes through verification;If conversely, than
Relatively result differs for the check code for self checking with character to be verified, it is determined that code to be verified is not validated.Upper
State in example, verification component 650 compares identical with character to be verified " 8dk " for the check code " 8dk " of self checking, it is determined that
Code to be verified passes through verification.
In an embodiment of the present invention, as shown in fig. 7, the calibration equipment 600 of Fig. 6 displayings can also include:Task identification
Determine component 660, be coupled with verification component 650, suitable for verification component 650 it is determined that code to be verified by verification after,
The character being present in the second substring is deleted from code to be calculated, obtains the effect code in code to be verified;Obtain and solve
Analysis acts on the transformation rule of code, and the effect code in code to be verified is converted into task identification.
In an embodiment of the present invention, acting on the transformation rule of code includes out of order first substring, obtains M system numbers
Character lists, and then based on the character lists of M system numbers, the M system numbers of calculating task mark.Now, task identification determines group
Effect code in code to be verified is converted to task identification by part 660 according to the character lists of M system numbers from M system numbers.
In example above, code to be calculated is " a4whx ", and the second substring is " a4hxv " of N (N=5) position, from treating
The character (that is, obscuring code) deleted and be present in the second substring in code is calculated, the effect code obtained in code to be verified is
“w”.Subsequently, based on the character lists of M system numbers, the effect code " w " in code to be verified is converted into task mark from M system numbers
Know " 0 ".
In an embodiment of the present invention, as shown in fig. 7, the calibration equipment 600 of Fig. 6 displayings can also include:Business task
Processing component 670, determine that component 660 is coupled with task identification, turning for the analytic function code of component 660 is determined suitable for task identification
Change rule, after the effect code of code to be verified is converted into task identification, corresponding business task searched according to task identification,
And carry out business logical operation.For example, business task corresponding to task identification " 0 " is " exchange game item ", at business task
Reason component 670 exchange the business logical operation of game item.
According to the combination of any one above-mentioned preferred embodiment or multiple preferred embodiments, the embodiment of the present invention can reach
Following beneficial effect:
In embodiments of the present invention, obtain and parse the create-rule of code to be verified, intercepted from code to be verified
For the check code of self checking, and using remaining code as code to be calculated.Then, obtain and parse the check code for self checking
Create-rule, generate the character to be verified of code to be calculated.Afterwards, the check code for self checking and character to be verified are compared,
Determine whether code to be verified passes through verification according to comparative result.The embodiment of the present invention during verification, treat by in-time generatin
Calculate the character to be verified of code, and then to be verified character of the check code with code to be calculated that self checking will be used in code to be verified
It is compared to determine whether code to be verified passes through verification.It is if to be calculated in code to be verified during transmission
Code error, such as character are lost or are tampered, then the character to be verified generated according to code to be calculated in code to be verified with using
Must be in the check code of self checking it is different, can not be by verification, thus can determine to transmit by check results
During code to be verified whether malfunction.
Further, the code to be verified of the embodiment of the present invention further comprises in addition to including effect code and obscure code and use
In the check code of self checking, so as to serve the effect that anti-tamper, anti-violence cracks, the security of code is greatly improved.
In addition, the embodiment of the present invention can parse after code to be verified is by verification from the code by verification
Code is acted on, because effect code is to convert what is obtained by the task identification of business, corresponding business can be calculated by acting on code
Task identification, so as to inquire corresponding business task according to the task identification of business, and then carry out business logical operation.
Because the length of the code by verification is more than the length of the task identification of business, the embodiment of the present invention directly passes through the task of business
Mark inquires about corresponding business task, and index search phase is done compared to the code book body by verification is needed to use in the prior art
The business answered, inquiry business it is more efficient.Also, letter is generally comprised in the code for passing through verification, letter takes byte and compares number
Word is more, and the task identification of business is usually to be made up of numeral, thus the task identification occupancy byte of business is fewer than the code of generation,
Therefore the embodiment of the present invention is indexed using the task identification of business, compared in the prior art using the code book body by verifying
Index, the occupancy of internal memory can be reduced, save system resource.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself
Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any
Mode it can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice
Microprocessor or digital signal processor (DSP) realize the code for being used to realize business task according to embodiments of the present invention
The some or all functions of some or all parts in calibration equipment.The present invention is also implemented as being used to perform here
The some or all equipment or program of device of described method are (for example, computer program and computer program production
Product).Such program for realizing the present invention can store on a computer-readable medium, or can have one or more
The form of signal.Such signal can be downloaded from internet website and obtained, and either be provided or on carrier signal to appoint
What other forms provides.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
So far, although those skilled in the art will appreciate that detailed herein have shown and described multiple showing for the present invention
Example property embodiment, still, still can be direct according to present disclosure without departing from the spirit and scope of the present invention
It is determined that or derive many other variations or modifications for meeting the principle of the invention.Therefore, the scope of the present invention is understood that and recognized
It is set to and covers other all these variations or modifications.
The one side of the embodiment of the present invention, is also disclosed:A1, a kind of method of calibration for being used to realize the code of business task,
Including:
Obtain code to be verified;
Obtain and parse the create-rule of the code to be verified, intercepted from the code to be verified for self checking
Check code, using remaining code as code to be calculated;
Obtain and parse the create-rule of the check code for self checking, generate the word to be verified of the code to be calculated
Symbol;
Compare the check code for self checking and the character to be verified, determined according to comparative result described to be verified
Code whether pass through verification.
A2, the method according to A1, wherein, the code to be verified is based on effect code, obscures code and for self-correcting
The check code tested and generate, the check code for self checking is using the effect code and described obscure code and generates.
A3, the method according to any one of A1-A2, wherein, the effect code is converted into by the task identification of business
The first substring in character, it is described to obscure the word that code is the first designated length randomly selected from the second substring
Symbol string, first substring extract from the character string for generating the code to be verified, second substring
From the character string be extracted first substring after remainder extraction.
A4, the method according to any one of A1-A3, wherein, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the finger of intermediate code that code character closes to obtain
Positioning is put, wherein, the check code for self checking is the second designated length.
A5, the method according to any one of A1-A4, wherein, the create-rule of the code to be verified is parsed, from described
The check code for self checking is intercepted in code to be verified, including:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as institute
State the check code for self checking.
A6, the method according to any one of A1-A5, wherein, the specified location includes the initial bit of the intermediate code
Put or end position.
A7, the method according to any one of A1-A6, wherein, when the initial bit that the specified location is the intermediate code
When putting, according to the specified location, the character of second designated length is intercepted from the code to be verified, including:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
A8, the method according to any one of A1-A7, wherein, when the last bit that the specified location is the intermediate code
When putting, according to the specified location, the character of second designated length is intercepted from the code to be verified, including:
From the end position of the code to be verified, backward intercepts the character of second designated length.
A9, the method according to any one of A1-A8, wherein, the create-rule bag of the check code for self checking
Include:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as described for self checking
Check code.
A10, the method according to any one of A1-A9, wherein, the generation rule of the parsing check code for self checking
Then, the character to be verified of the code to be calculated is generated, including:
The create-rule of the parsing check code for self checking, it is determined that calculating the rule of the check code of the intermediate code
And the rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated.
A11, the method according to any one of A1-A10, wherein, the character string is M+N positions, calculates the intermediate code
The rule of check code include:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, as institute
State the check code of intermediate code.
A12, the method according to any one of A1-A11, wherein, according to the rule for the check code for calculating the intermediate code,
The check code of the code to be calculated is calculated, including:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as
The check code of the code to be calculated.
A13, the method according to any one of A1-A12, wherein,
The rule bag of the check code for self checking of second designated length is taken from the check code of the intermediate code
Include:From the initial position of the check code of the intermediate code, the second designated length position is sequentially taken, as described for self checking
Check code;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated, including:From described to be calculated
The initial position of the check code of code rises, and order intercepts the second designated length position, as the character to be verified.
A14, the method according to any one of A1-A13, wherein,
The rule bag of the check code for self checking of second designated length is taken from the check code of the intermediate code
Include:From the end position of the check code of the intermediate code, backward takes the second designated length position, as described for self checking
Check code;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated, including:From described to be calculated
The end position of the check code of code rises, and backward intercepts the second designated length position, as the character to be verified.
A15, the method according to any one of A1-A14, wherein, determine that the code to be verified is according to comparative result
It is no by verification, including:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to treat school
The code tested passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to treat
The code of verification is not validated.
A16, the method according to any one of A1-A15, wherein, the character in the character string is different two-by-two, it is determined that
After the code to be verified is by verification, in addition to:
The character being present in second substring is deleted from the code to be calculated, obtains the code to be verified
In effect code;
Obtain and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into described appoint
Business mark.
A17, the method according to any one of A1-A16, wherein, first substring is M positions, the effect code
Transformation rule include:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
A18, the method according to any one of A1-A17, wherein, the transformation rule of the effect code is parsed, is treated described
Effect code in the code of verification is converted into the task identification, including:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into institute from M system numbers
State task identification.
A19, the method according to any one of A1-A18, wherein, the transformation rule of the effect code is parsed, is treated described
The effect code of the code of verification is converted into after the task identification, in addition to:
Corresponding business task is searched according to the task identification, and carries out business logical operation.
The another aspect of the embodiment of the present invention, is also disclosed:B20, a kind of verification dress for being used to realize the code of business task
Put, including:
Code securing component to be verified, suitable for obtaining code to be verified;
Self-checking code determines component, suitable for obtaining and parsing the create-rule of the code to be verified, from described to be verified
Code in intercept check code for self checking;
Code to be calculated determines component, after the check code for self checking is intercepted from the code to be verified,
Using remaining code as code to be calculated;
Character formation component to be verified, it is raw suitable for obtaining and parsing the create-rule of the check code for self checking
Into the character to be verified of the code to be calculated;
Component is verified, suitable for the relatively check code for self checking and the character to be verified, according to comparative result
Determine whether the code to be verified passes through verification.
B21, the device according to B20, wherein, the code to be verified is based on effect code, obscures code and for certainly
The check code of verification and generate, the check code for self checking is using the effect code and described obscure code and generates.
B22, the device according to any one of B20-B21, wherein, the effect code is the task identification conversion by business
For the first substring in character, it is described that to obscure code be the first designated length randomly selected from the second substring
Character string, first substring extract from the character string for generating the code to be verified, the second sub- character
Go here and there from the character string be extracted first substring after remainder extraction.
B23, the device according to any one of B20-B22, wherein, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the finger of intermediate code that code character closes to obtain
Positioning is put, wherein, the check code for self checking is the second designated length.
B24, the device according to any one of B20-B23, wherein, the self-checking code determines that component is further adapted for:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as institute
State the check code for self checking.
B25, the device according to any one of B20-B24, wherein, the specified location includes the initial of the intermediate code
Position or end position.
B26, the device according to any one of B20-B25, wherein, when the specified location is the initial of the intermediate code
During position, the self-checking code determines that component is further adapted for:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
B27, the device according to any one of B20-B26, wherein, when the end that the specified location is the intermediate code
During position, the self-checking code determines that component is further adapted for:
From the end position of the code to be verified, backward intercepts the character of second designated length.
B28, the device according to any one of B20-B27, wherein, the create-rule of the check code for self checking
Including:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as described for self checking
Check code.
B29, the device according to any one of B20-B28, wherein, the character formation component to be verified is further adapted for:
The create-rule of the parsing check code for self checking, it is determined that calculating the rule of the check code of the intermediate code
And the rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code
Then, the character to be verified of second designated length is intercepted from the check code of the code to be calculated.
B30, the device according to any one of B20-B29, wherein, the character string is M+N positions, calculates the intermediate code
The rule of check code include:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, as institute
State the check code of intermediate code.
B31, the device according to any one of B20-B30, wherein, the character formation component to be verified is further adapted for:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as
The check code of the code to be calculated.
B32, the device according to any one of B20-B31, wherein,
The rule bag of the check code for self checking of second designated length is taken from the check code of the intermediate code
Include:From the initial position of the check code of the intermediate code, the second designated length position is sequentially taken, as described for self checking
Check code;
The character formation component to be verified is further adapted for:From the initial position of the check code of the code to be calculated, order
The second designated length position is intercepted, as the character to be verified.
B33, the device according to any one of B20-B32, wherein,
The rule bag of the check code for self checking of second designated length is taken from the check code of the intermediate code
Include:From the end position of the check code of the intermediate code, backward takes the second designated length position, as described for self checking
Check code;
The character formation component to be verified is further adapted for:From the end position of the check code of the code to be calculated, backward
The second designated length position is intercepted, as the character to be verified.
B34, the device according to any one of B20-B33, wherein, the verification component is further adapted for:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to treat school
The code tested passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to treat
The code of verification is not validated.
B35, the device according to any one of B20-B34, wherein, the character in the character string is different two-by-two, also wraps
Include:
Task identification determines component, suitable for it is described verification component it is determined that the code to be verified by verification after, from
The character being present in second substring is deleted in the code to be calculated, obtains the effect in the code to be verified
Code;Obtain and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into the task mark
Know.
B36, the device according to any one of B20-B35, wherein, first substring is M positions, the effect code
Transformation rule include:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
B37, the device according to any one of B20-B36, wherein, the task identification determines that component is further adapted for:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into institute from M system numbers
State task identification.
B38, the device according to any one of B20-B37, wherein, in addition to:
Business task processing component, determine to act on the transformation rule of code described in analyzing component suitable for the task identification, will
The effect code of the code to be verified is converted into after the task identification, is searched corresponding business according to the task identification and is appointed
Business, and carry out business logical operation.
Claims (38)
1. a kind of method of calibration for being used to realize the code of business task, including:
Obtain code to be verified;
Obtain and parse the create-rule of the code to be verified, the verification for self checking is intercepted from the code to be verified
Code, using remaining code as code to be calculated;
Obtain and parse the create-rule of the check code for self checking, generate the character to be verified of the code to be calculated;
Compare the check code for self checking and the character to be verified, the code to be verified is determined according to comparative result
Whether verification is passed through.
2. according to the method for claim 1, wherein, the code to be verified is based on effect code, obscures code and for certainly
The check code of verification and generate, the check code for self checking is using the effect code and described obscure code and generates.
3. according to the method for claim 2, wherein, the effect code is the first son being converted into by the task identification of business
Character in character string, it is described to obscure the character string that code is the first designated length randomly selected from the second substring, institute
State the first substring to extract from the character string for generating the code to be verified, second substring is from the word
Symbol string is extracted the remainder extraction after first substring.
4. according to the method for claim 3, wherein, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the specific bit of intermediate code that code character closes to obtain
Put, wherein, the check code for self checking is the second designated length.
5. according to the method for claim 4, wherein, parse the create-rule of the code to be verified, from described to be verified
Code in intercept check code for self checking, including:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as the use
In the check code of self checking.
6. according to the method for claim 4, wherein, the specified location includes initial position or the end of the intermediate code
Position.
7. the method according to claim 11, wherein, when the specified location is the initial position of the intermediate code, root
According to the specified location, the character of second designated length is intercepted from the code to be verified, including:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
8. the method according to claim 11, wherein, when the specified location is the end position of the intermediate code, root
According to the specified location, the character of second designated length is intercepted from the code to be verified, including:
From the end position of the code to be verified, backward intercepts the character of second designated length.
9. according to the method for claim 4, wherein, the create-rule of the check code for self checking includes:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as the verification for self checking
Code.
10. according to the method for claim 9, wherein, the create-rule of the parsing check code for self checking, generate
The character to be verified of the code to be calculated, including:
The create-rule of the parsing check code for self checking, it is determined that calculate the check code of the intermediate code rule and
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code, from
The character to be verified of second designated length is intercepted in the check code of the code to be calculated.
11. according to the method for claim 10, wherein, the character string is M+N positions, calculates the check code of the intermediate code
Rule include:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, in described
Between code check code.
12. according to the method for claim 11, wherein, according to the rule for the check code for calculating the intermediate code, calculate institute
The check code of code to be calculated is stated, including:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as described
The check code of code to be calculated.
13. the method according to claim 11, wherein,
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code to be included:From
The initial position of the check code of the intermediate code rises, and the second designated length position is sequentially taken, as the verification for self checking
Code;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code, from
The character to be verified of second designated length is intercepted in the check code of the code to be calculated, including:From the code to be calculated
The initial position of check code rises, and order intercepts the second designated length position, as the character to be verified.
14. the method according to claim 11, wherein,
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code to be included:From
The end position of the check code of the intermediate code rises, and backward takes the second designated length position, as the verification for self checking
Code;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code, from
The character to be verified of second designated length is intercepted in the check code of the code to be calculated, including:From the code to be calculated
The end position of check code rises, and backward intercepts the second designated length position, as the character to be verified.
15. the method according to any one of claim 1-3,5-14, wherein, determined according to comparative result described to be verified
Code whether by verification, including:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to be verified
Code passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to be verified
Code it is not validated.
16. according to the method for claim 3, wherein, the character in the character string is different two-by-two, it is determined that described treat school
After the code tested is by verification, in addition to:
The character being present in second substring is deleted from the code to be calculated, is obtained in the code to be verified
Act on code;
Obtain and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into the task mark
Know.
17. according to the method for claim 16, wherein, first substring is M positions, the conversion rule of the effect code
Then include:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
18. according to the method for claim 17, wherein, the transformation rule of the effect code is parsed, will be described to be verified
Effect code in code is converted into the task identification, including:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into described appoint from M system numbers
Business mark.
19. according to the method for claim 16, wherein, the transformation rule of the effect code is parsed, will be described to be verified
The effect code of code is converted into after the task identification, in addition to:
Corresponding business task is searched according to the task identification, and carries out business logical operation.
20. a kind of calibration equipment for being used to realize the code of business task, including:
Code securing component to be verified, suitable for obtaining code to be verified;
Self-checking code determines component, suitable for obtaining and parsing the create-rule of the code to be verified, from the code to be verified
The middle check code intercepted for self checking;
Code to be calculated determines component, will be surplus after the check code for self checking is intercepted from the code to be verified
Remaining code is as code to be calculated;
Character formation component to be verified, suitable for obtaining and parsing the create-rule of the check code for self checking, generate institute
State the character to be verified of code to be calculated;
Component is verified, suitable for the relatively check code for self checking and the character to be verified, is determined according to comparative result
Whether the code to be verified passes through verification.
21. device according to claim 20, wherein, the code to be verified is based on effect code, obscures code and be used for
The check code of self checking and generate, the check code for self checking is using the effect code and described obscure code and generates.
22. device according to claim 21, wherein, the effect code is first be converted into by the task identification of business
Character in substring, it is described to obscure the character string that code is the first designated length randomly selected from the second substring,
First substring extracts from the character string for generating the code to be verified, and second substring is from described
Character string is extracted the remainder extraction after first substring.
23. device according to claim 22, wherein, the create-rule of the code to be verified includes:
The check code for self checking is attached to the effect code and obscures the specific bit of intermediate code that code character closes to obtain
Put, wherein, the check code for self checking is the second designated length.
24. device according to claim 23, wherein, the self-checking code determines that component is further adapted for:
The create-rule of the code to be verified is parsed, determines second designated length and the specified location;
According to the specified location, the character of second designated length is intercepted from the code to be verified, as the use
In the check code of self checking.
25. device according to claim 23, wherein, the specified location includes initial position or the end of the intermediate code
Tail position.
26. device according to claim 25, wherein, when the specified location is the initial position of the intermediate code,
The self-checking code determines that component is further adapted for:
From the initial position of the code to be verified, the character of second designated length is sequentially intercepted.
27. device according to claim 25, wherein, when the specified location is the end position of the intermediate code,
The self-checking code determines that component is further adapted for:
From the end position of the code to be verified, backward intercepts the character of second designated length.
28. device according to claim 23, wherein, the create-rule of the check code for self checking includes:
By it is described obscure code upset described in radom insertion act on code in, generate intermediate code;
Calculate the check code of the intermediate code;
The check code of second designated length is taken from the check code of the intermediate code, as the verification for self checking
Code.
29. device according to claim 28, wherein, the character formation component to be verified is further adapted for:
The create-rule of the parsing check code for self checking, it is determined that calculate the check code of the intermediate code rule and
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code;
According to the rule for the check code for calculating the intermediate code, the check code of the calculating code to be calculated;
According to the rule for the check code for self checking that second designated length is taken from the check code of the intermediate code, from
The character to be verified of second designated length is intercepted in the check code of the code to be calculated.
30. device according to claim 29, wherein, the character string is M+N positions, calculates the check code of the intermediate code
Rule include:
The out of order character string, obtains the character lists of M+N system numbers;
Calculate the cyclic check code crc value of the intermediate code;
Based on the character lists of the M+N systems number, the crc value of the intermediate code is converted into M+N system numbers, in described
Between code check code.
31. device according to claim 30, wherein, the character formation component to be verified is further adapted for:
Calculate the crc value of the code to be calculated;
Based on the character lists of the M+N systems number, the crc value of the code to be calculated is converted into M+N system numbers, as described
The check code of code to be calculated.
32. device according to claim 29, wherein,
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code to be included:From
The initial position of the check code of the intermediate code rises, and the second designated length position is sequentially taken, as the verification for self checking
Code;
The character formation component to be verified is further adapted for:From the initial position of the check code of the code to be calculated, order intercepts
Second designated length position, as the character to be verified.
33. device according to claim 29, wherein,
The rule of the check code for self checking of second designated length is taken from the check code of the intermediate code to be included:From
The end position of the check code of the intermediate code rises, and backward takes the second designated length position, as the verification for self checking
Code;
The character formation component to be verified is further adapted for:From the end position of the check code of the code to be calculated, backward interception
Second designated length position, as the character to be verified.
34. according to the device described in any one of claim 20-22,24-33, wherein, the verification component is further adapted for:
If comparative result is identical with the character to be verified for the check code for self checking, it is determined that described to be verified
Code passes through verification;
If comparative result differs for the check code for self checking with the character to be verified, it is determined that described to be verified
Code it is not validated.
35. device according to claim 22, wherein, the character in the character string is different two-by-two, in addition to:
Task identification determines component, suitable for the verification component it is determined that the code to be verified by verification after, from described
The character being present in second substring is deleted in code to be calculated, obtains the effect code in the code to be verified;Obtain
Take and parse the transformation rule of the effect code, the effect code in the code to be verified is converted into the task identification.
36. device according to claim 35, wherein, first substring is M positions, the conversion rule of the effect code
Then include:
Out of order first substring, obtains the character lists of M system numbers;
Based on the character lists of the M systems number, the M system numbers of the task identification are calculated.
37. device according to claim 36, wherein, the task identification determines that component is further adapted for:
According to the character lists of the M systems number, the effect code in the code to be verified is converted into described appoint from M system numbers
Business mark.
38. device according to claim 35, wherein, in addition to:
Business task processing component, determine to act on the transformation rule of code described in analyzing component suitable for the task identification, by described in
The effect code of code to be verified is converted into after the task identification, and corresponding business task is searched according to the task identification,
And carry out business logical operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510624931.3A CN105224414B (en) | 2015-09-25 | 2015-09-25 | For the method for calibration and device of the code for realizing business task |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510624931.3A CN105224414B (en) | 2015-09-25 | 2015-09-25 | For the method for calibration and device of the code for realizing business task |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105224414A CN105224414A (en) | 2016-01-06 |
CN105224414B true CN105224414B (en) | 2018-01-19 |
Family
ID=54993404
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510624931.3A Active CN105224414B (en) | 2015-09-25 | 2015-09-25 | For the method for calibration and device of the code for realizing business task |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105224414B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113010859B (en) * | 2021-02-18 | 2022-09-06 | 浪潮云信息技术股份公司 | Activation code generation method supporting self-checking |
CN113611014B (en) * | 2021-07-08 | 2023-07-21 | 国家电网有限公司技术学院分公司 | Five-prevention lockset management method based on block chain |
CN113593090B (en) * | 2021-07-30 | 2023-07-18 | 国家电网有限公司技术学院分公司 | Block chain-based five-prevention Bluetooth lock system of transformer substation |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7861304B1 (en) * | 2004-05-07 | 2010-12-28 | Symantec Corporation | Pattern matching using embedded functions |
CN101976241A (en) * | 2010-09-26 | 2011-02-16 | 用友软件股份有限公司 | Method and system for generating identification code |
CN102609330A (en) * | 2012-02-06 | 2012-07-25 | 中国农业银行股份有限公司 | Document number generating method and document number generating system |
CN103838753A (en) * | 2012-11-23 | 2014-06-04 | 腾讯科技(北京)有限公司 | Storage and verification method and device for exchange codes |
-
2015
- 2015-09-25 CN CN201510624931.3A patent/CN105224414B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7861304B1 (en) * | 2004-05-07 | 2010-12-28 | Symantec Corporation | Pattern matching using embedded functions |
CN101976241A (en) * | 2010-09-26 | 2011-02-16 | 用友软件股份有限公司 | Method and system for generating identification code |
CN102609330A (en) * | 2012-02-06 | 2012-07-25 | 中国农业银行股份有限公司 | Document number generating method and document number generating system |
CN103838753A (en) * | 2012-11-23 | 2014-06-04 | 腾讯科技(北京)有限公司 | Storage and verification method and device for exchange codes |
Also Published As
Publication number | Publication date |
---|---|
CN105224414A (en) | 2016-01-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10796244B2 (en) | Method and apparatus for labeling training samples | |
CN103473506B (en) | For the method and apparatus identifying malice APK file | |
CN106682505A (en) | Virus detection method, terminal, server and system | |
CN104063664B (en) | The safety detection method of software installation bag, client, server and system | |
US20140280155A1 (en) | Computer-implemented systems and methods for comparing and associating objects | |
CN105224414B (en) | For the method for calibration and device of the code for realizing business task | |
GB2513721A (en) | Computer-implemented systems and methods for comparing and associating objects | |
CN108255602B (en) | Task combination method and terminal equipment | |
US8364663B2 (en) | Tokenized javascript indexing system | |
US10223550B2 (en) | Generating canonical representations of JSON documents | |
CN106874180A (en) | Detection System And Method Thereof | |
CN110287247A (en) | Date storage method, device, equipment and storage medium based on Unionpay's system | |
CN105225192B (en) | One kind is based on detailed reconciliation auditing method and system | |
CN110489466B (en) | Method and device for generating invitation code, terminal equipment and storage medium | |
CN105205397A (en) | Rogue program sample classification method and device | |
CN105224415B (en) | For the generation method and device of the code for realizing business task | |
CN106709336A (en) | Method and apparatus for identifying malware | |
CN107945064A (en) | A kind of service order numbering generation method and device | |
CN104899009A (en) | Identification method and device of Android application | |
CN104574179A (en) | Double-check verification system and double-check verification method for bank card capital settlement platform | |
US11223641B2 (en) | Apparatus and method for reconfiguring signature | |
CN113486359B (en) | Method and device for detecting software loopholes, electronic device and storage medium | |
CN111355709A (en) | Data verification method and device, electronic equipment and computer readable storage medium | |
CN110196952A (en) | Search processing method, device, equipment and the storage medium of program code | |
US20220368701A1 (en) | Automated clustering of sessions of unstructured traffic |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220718 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |