CN110135144B - Invitation code generation method, verification method, device, electronic equipment and storage medium - Google Patents
Invitation code generation method, verification method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110135144B CN110135144B CN201910420054.6A CN201910420054A CN110135144B CN 110135144 B CN110135144 B CN 110135144B CN 201910420054 A CN201910420054 A CN 201910420054A CN 110135144 B CN110135144 B CN 110135144B
- Authority
- CN
- China
- Prior art keywords
- code
- redundancy check
- character string
- characteristic value
- invitation
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
- G06F21/36—User authentication by graphic or iconic representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2133—Verifying human interaction, e.g., Captcha
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The application discloses an invitation code generation method, an authentication method and related equipment thereof, wherein the invitation code generation method comprises the following steps: generating a character string according to a preset rule, and generating a first redundancy check code according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code. Therefore, by storing part of character strings in the invitation codes in the database in the form of characteristic values (namely ciphertext), the security and the stability of the system are increased, and the verification efficiency and the performance of the invitation codes can be effectively improved.
Description
Technical Field
The present application relates to the field of information processing technologies, and in particular, to an invitation code generation method, an invitation code verification method, an invitation code generation device, an invitation code verification device, an electronic device, and a computer-readable storage medium.
Background
At present, the invitation code information processing service based on character string verification is wide, for example, some websites and applications need a special pass, namely the invitation code, in order to prevent malicious registration by a machine, and in addition, some internet merchants use an activity invitation code to attract consumers to purchase goods in order to promote sales. In the related art, when the invitation code is issued to the consumer, the issued invitation code is usually recorded in a database in a plaintext manner, so that when it is detected that the consumer uses the invitation code, whether the invitation code is legal or not is verified in a database query manner.
However, there are problems that: the traditional invitation code is transmitted and recorded in a plaintext mode, and is easy to crack, so that the safety and the stability of the system are reduced. In addition, in the whole verification process, the invitation codes can only be verified in a mode of inquiring the database, and when a large number of invitation codes are verified at the same time, a large number of data inquiries are generated by the system, so that the inquiry verification efficiency is reduced.
Disclosure of Invention
The object of the present application is to solve at least to some extent one of the above mentioned technical problems.
To this end, a first object of the present application is to propose an invitation code generation method. According to the method, part of character strings in the invitation codes are stored in the database in a characteristic value (namely ciphertext) form, so that the safety and the stability of the system are improved, and meanwhile, the verification efficiency and the verification performance of the invitation codes are effectively improved.
A second objective of the present application is to provide an invite code verification method.
A third object of the present application is to provide an invitation code generating apparatus.
A fourth object of the present application is to provide an invitation code verification apparatus.
A fifth object of the present application is to provide an electronic device.
A sixth object of the present application is to propose a computer-readable storage medium.
A seventh object of the present application is to propose another electronic device.
An eighth object of the present application is to propose another computer-readable storage medium.
To achieve the above object, an embodiment of a first aspect of the present application provides an invite code generating method, including: generating a character string according to a preset rule, and generating a first redundancy check code according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code.
According to the invitation code generation method, a character string is generated according to a preset rule, and a first redundancy check code is generated according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code. Therefore, by storing part of the character strings in the invitation code into the database in the form of characteristic values (namely ciphertext), the safety and the stability of the system can be improved, and the invitation code is generated by combining a plurality of character strings, so that when the invitation code input by a user is verified, the input invitation code can be divided into a plurality of character strings, the validity of the invitation code is verified firstly through part of the character strings, and when the invitation code is verified to be valid, the validity is verified based on the rest of the character strings and the characteristic values stored in the database, and the verification efficiency of the invitation code can be improved.
According to an embodiment of the present application, the generating a second redundancy check code according to the first eigenvalue includes: calculating a redundancy check code value corresponding to the first characteristic value; judging whether the redundancy check code value is eight-bit data or not; if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data; and if so, taking the redundancy check code value corresponding to the first characteristic value as the second redundancy check code.
In order to achieve the above object, a second aspect of the present application provides an invite code verification method, including the following steps: receiving invitation code information input by a user; analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string; verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string; when the invitation code information is verified to be valid, searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database; the reference characteristic value is generated by an invitation code generation method in the embodiment of the application; and calculating the characteristic value of the second character string, and matching the characteristic value of the second character string with the target reference characteristic value to verify whether the invitation code information is legal or not.
The invitation code verification method of the embodiment of the application receives invitation code information input by a user; analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string; verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string; when the invitation code information is verified to be valid, searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database; the reference characteristic value is generated by an invitation code generation method in the embodiment of the application; and calculating the characteristic value of the second character string, and matching the characteristic value of the second character string with the target reference characteristic value to verify whether the invitation code information is legal or not. Therefore, when the invitation code information input by the user is verified, validity verification is performed on the invitation code based on the information of the invitation code, if the invitation code is verified to be invalid, the database does not need to be queried to verify the validity of the invitation code, the verification efficiency is improved, the query times of the database are reduced, and the system stability is improved; when the invitation code is verified to be valid, the database is queried based on the character string in the invitation code to further verify the invitation code, so that the validity of the invitation code is ensured; moreover, the character strings in the invitation codes are stored in the database in a ciphertext mode (such as a reference characteristic value), so that the condition that the character strings are easy to crack can be avoided, and the safety and the stability of the system are improved.
According to an embodiment of the present application, the verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string, and the third character string includes: generating a second characteristic value according to a preset private key, the first character string and the second character string; generating a third redundancy check code according to the second characteristic value; and matching the third redundancy check code with the third character string to verify whether the invitation code information is valid.
According to an embodiment of the present application, the generating a third redundancy check code according to the second feature value includes: calculating a redundancy check code value corresponding to the second characteristic value; judging whether the redundancy check code value is eight-bit data or not; if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data; and if so, taking the redundancy check code value corresponding to the second characteristic value as the third redundancy check code.
According to an embodiment of the present application, the searching for the target reference feature value corresponding to the first character string from the reference feature values stored in the database in advance includes: searching a target identification code corresponding to the first character string from the identification codes of the database; and searching the target reference characteristic value from the database according to the target identification code.
According to an embodiment of the application, the method further comprises: and when the invitation code information is verified to be legal, determining a business event corresponding to the invitation code information, and responding to the business event.
To achieve the above object, a third aspect of the present application provides an invitation code generating apparatus, including: the first redundancy check code generation module is used for generating a character string according to a preset rule and generating a first redundancy check code according to the character string; a reference characteristic value generating module, configured to generate a reference characteristic value of the character string according to the first redundancy check code; the identification code generating module is used for generating an identification code which is used for uniquely representing the reference characteristic value; the data storage module is used for storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; the first characteristic value generating module is used for generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; the second redundancy check code generating module is used for generating a second redundancy check code according to the first characteristic value; and the invitation code generating module is used for generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code.
The invitation code generation device of the embodiment of the application generates a character string according to a preset rule and generates a first redundancy check code according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code. Therefore, by storing part of the character strings in the invitation code into the database in the form of characteristic values (namely ciphertext), the safety and the stability of the system can be improved, and the invitation code is generated by combining a plurality of character strings, so that when the invitation code input by a user is verified, the input invitation code can be divided into a plurality of character strings, the validity of the invitation code is verified firstly through part of the character strings, and when the invitation code is verified to be valid, the validity is verified based on the rest of the character strings and the characteristic values stored in the database, and the verification efficiency of the invitation code can be improved.
According to an embodiment of the present application, the second redundancy check code generating module is specifically configured to: calculating a redundancy check code value corresponding to the first characteristic value; judging whether the redundancy check code value is eight-bit data or not; if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data; and if so, taking the redundancy check code value corresponding to the first characteristic value as the second redundancy check code.
To achieve the above object, a fourth aspect of the present application provides an invitation code verification apparatus, including: the information receiving module is used for receiving invitation code information input by a user; the information analysis module is used for analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string; the validity verification module is used for verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string; the searching module is used for searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database when the invitation code information is verified to be valid; and the legality verification module is used for calculating the characteristic value of the second character string and matching the characteristic value of the second character string with the target reference characteristic value so as to verify whether the invitation code information is legal or not.
The invitation code verification device receives invitation code information input by a user; analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string; verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string; when the invitation code information is verified to be valid, searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database; the reference characteristic value is generated by an invitation code generation method in the embodiment of the application; and calculating the characteristic value of the second character string, and matching the characteristic value of the second character string with the target reference characteristic value to verify whether the invitation code information is legal or not. Therefore, when the invitation code information input by the user is verified, validity verification is performed on the invitation code based on the information of the invitation code, if the invitation code is verified to be invalid, the database does not need to be queried to verify the validity of the invitation code, the verification efficiency is improved, the query times of the database are reduced, and the system stability is improved; when the invitation code is verified to be valid, the database is queried based on the character string in the invitation code to further verify the invitation code, so that the validity of the invitation code is ensured; moreover, the character strings in the invitation codes are stored in the database in a ciphertext mode (such as a reference characteristic value), so that the condition that the character strings are easy to crack can be avoided, and the safety and the stability of the system are improved.
According to an embodiment of the present application, the validity verification module is specifically configured to: generating a first characteristic value according to a preset private key, the first character string and the second character string; and generating a third redundancy check code according to the second characteristic value.
According to an embodiment of the present application, the validity verification module is specifically configured to: calculating a redundancy check code value corresponding to the second characteristic value; judging whether the redundancy check code value is eight-bit data or not; if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data; and if so, taking the redundancy check code value corresponding to the second characteristic value as the third redundancy check code.
According to an embodiment of the present application, the search module is specifically configured to: searching a target identification code corresponding to the first character string from the identification codes of the database; and searching the target reference characteristic value from the database according to the target identification code.
According to an embodiment of the application, the apparatus further comprises: and the business processing module is used for determining the business event corresponding to the invitation code information and responding to the business event when verifying that the invitation code information is legal.
In order to achieve the above object, a fifth embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the invitation code generating method according to the embodiment of the first aspect of the present application.
To achieve the above object, a sixth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the invitation code generation described in the first aspect of the present application.
In order to achieve the above object, a seventh embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the invitation code authentication method according to the embodiment of the second aspect of the application.
To achieve the above object, an eighth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the invite code verification method according to the second aspect of the present application.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of an invitation code generation method according to an embodiment of the application;
FIG. 2 is a flow diagram of an invitation code verification method according to an embodiment of the application;
FIG. 3 is a schematic structural diagram of an invitation code generating device according to an embodiment of the present application;
FIG. 4 is a block diagram of an invitation code verification apparatus according to an embodiment of the present application;
FIG. 5 is a block diagram of an invitation code verifying apparatus according to another embodiment of the present application;
FIG. 6 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
An invitation code generation method, an authentication method, an apparatus, an electronic device, and a computer-readable storage medium according to embodiments of the present application are described below with reference to the accompanying drawings. The invitation code generation and verification method can be applied to any business event corresponding to information processing depending on the invitation code, the event comprises registration of a terminal program, payment purchase certificates, game invitation, platform collaborative office and the like, and when the invitation code information is verified to be legal, the business event is determined and responded.
Fig. 1 is a flowchart illustrating an invite code generation method according to an embodiment of the present application.
As shown in fig. 1, the invite code generating method includes the following steps:
In the embodiment of the present application, the preset rule may be a randomly generated rule, for example, a character string may be randomly generated from a plurality of characters according to the randomly generated rule, wherein the characters may include, but are not limited to, letters, numbers, words, symbols, etc. used in a computer, such as 1, 2, 3, A, B, C,! # -% … … - # () and the like. The check code of the randomly generated string may then be calculated using a CRC32 (which may be understood as a cyclic redundancy check algorithm for generating a 32-bit check value) algorithm and converted to 16-ary as the first redundancy check code. It can be understood that the purpose of converting the check code into the 16-ary code is to enable the check code to be issued to the client, that is, the client supports 16-ary data, so when the invite code is generated, the used characters generally need to be converted into the 16-ary code, so that the client can present the invite code to the user in the 16-ary form.
It should be noted that the preset rule may be a formula for randomly generating a character string, may also be a formula for intercepting a string, and may also be any other method capable of generating a character string, which is not limited herein.
And 102, generating a reference characteristic value of the character string according to the first redundancy check code.
Optionally, after the first redundancy check code is obtained, a first preset algorithm is adopted to calculate a characteristic value of the first redundancy check code, where the characteristic value is a reference characteristic value. In the present embodiment, the first preset Algorithm may include, but is not limited to, an MD5(Message Digest Algorithm, fifth edition) Algorithm, a hash Algorithm, and the like.
And 103, generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code. It is easy to understand that, in order to facilitate the rapid location of the reference characteristic value during the database search, when the generated reference characteristic value is stored in the database, an identification code for uniquely representing the reference characteristic value needs to be generated and stored in the database, so that the data query can be rapidly and accurately performed through the identification code during the subsequent database query. Alternatively, in an embodiment of the present application, an identification code for uniquely representing the reference feature value may be generated, a correspondence between the reference feature value and the identification code may be established, and the reference feature value, the identification code, and the correspondence may be stored in a database. For example, a data table of a reference characteristic value is created in a database, the data table at least comprises two attributes, one is an attribute representing the reference characteristic value, and the other is an attribute representing an identification code, wherein the identification code attribute is a main key of the data table, and the reference characteristic value and the identification code are correspondingly stored in the data table through the corresponding relation between the reference characteristic value and the identification code, so that the purpose of storing a character string generated according to a preset rule in the database in a form of a ciphertext is achieved. For example, when the reference feature value is written into the database, a decimal identification code ID, such as 101, 102, 103 …, etc., may be generated. Therefore, when the database is inquired subsequently, the reference characteristic value corresponding to the ID can be quickly searched in the database through the ID of the identification code.
And 104, generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key.
It is understood that, after the first redundancy check code and the identification code used for uniquely representing the reference characteristic value are obtained, in order to generate a 16-system invitation code so as to issue the generated invitation code to the client, the identification code may be converted into a 16-system invitation code, the 16-system first redundancy check code, the identification code and a preset private key are spliced together, and a second preset algorithm is adopted to calculate the spliced character strings to obtain the corresponding first characteristic value. The second preset algorithm may be, but is not limited to, MD5 algorithm, hash algorithm, etc.
And 105, generating a second redundancy check code according to the first characteristic value.
And further, generating a second redundancy check code according to the first characteristic value generated in the step corresponding to a third preset algorithm. In the embodiment of the present application, the CRC32 algorithm may be used to calculate the second redundancy check code corresponding to the first characteristic value.
In the embodiment of the present application, to ensure that the CRC32 value is eight bits, after the redundancy check code corresponding to the first characteristic value is calculated, it may be determined whether the calculated redundancy check code is eight bits of data, if not, a character is selected from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight bits of data, for example, a character may be selected from a lower case letter [ g-z ] to fill the redundancy check code value less than eight bits, and the redundancy check code value filled and satisfying eight bits of data is used as the second redundancy check code; if the calculated redundancy check code is eight-bit data, the calculated redundancy check code value can be directly used as the second redundancy check code.
It should be noted that, since the client supports 16-ary data, in order to generate a 16-ary invite code so as to issue the generated invite code to the client, after obtaining the second redundancy check code, the second redundancy check code may be converted into a 16-ary invite code.
And 106, generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code.
It is easy to understand that the invitation code information is further generated according to a certain generation rule by the first redundancy check code, the identification code and the second redundancy check code generated through the above steps. For example, the first redundancy check code, the identification code, and the second redundancy check code may be concatenated to obtain the invite code information.
According to the invitation code generation method, the character string is generated according to the preset rule, and the first redundancy check code is generated according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code. Therefore, by storing part of the character strings in the invitation code into the database in the form of characteristic values (namely ciphertext), the safety and the stability of the system can be improved, and the invitation code is generated by combining a plurality of character strings, so that when the invitation code input by a user is verified, the input invitation code can be divided into a plurality of character strings, the validity of the invitation code is verified firstly through part of the character strings, and when the invitation code is verified to be valid, the validity is verified based on the rest of the character strings and the characteristic values stored in the database, and the verification efficiency of the invitation code can be improved.
The application also provides an invitation code verification method. FIG. 2 is a flowchart illustrating an invite code verification method according to an embodiment of the present application. As shown in fig. 2, the invite code verification method includes the following steps:
It should be noted that, in the embodiment of the present application, the invitation code may be generated in advance, and after the invitation code is generated, the generated invitation code may be issued to the user at the client, so that after the user shares the invitation code, other users may trigger a corresponding service event through the issued invitation code, for example, other users may trigger an event of "enjoying a discount price" and a registration event through the invitation code. As an example, the invitation code may be a string of characters including, but not limited to, letters, numbers, words, symbols, etc. used in a computer, such as, for example, 1, 2, 3, A, B, C, -! # -% … … - # () and the like.
In the embodiment of the application, when invitation code information input by a user at an application terminal is received, the invitation code information may be analyzed, for example, the invitation code input by the user may be split according to a preset generation rule of an invitation code character string, and the split character string may be split into a plurality of character strings, which are a first character string, a second character string and a third character string. Wherein, the invitation code input by the user can be given by others.
And step 203, verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string.
Specifically, after splitting the input invitation code information into a first character string, a second character string and a third character string, a corresponding second feature value may be generated according to a preset private key, the first character string and the second character string, a corresponding third redundancy check code may be generated according to the second feature value, and then the third redundancy check code and the third character string are compared and matched to verify whether the input invitation code information is valid.
As an example, a preset private key, a first character string, and a second character string may be character-spliced, and then a preset Algorithm is used to calculate a second feature value corresponding to the spliced character string, for example, the preset Algorithm may be, but is not limited to, an MD5(Message Digest Algorithm, fifth edition) Algorithm, a hash Algorithm, and the like; then, a third redundancy check code of the second characteristic value can be calculated by using a CRC32 algorithm, wherein the check code is an 8-bit hexadecimal check value; then, a similarity algorithm may be used to determine whether the third redundancy check code is consistent with the third string, and if not, the verification invitation code is invalid. And if the third redundancy check code is consistent with the third character string, verifying that the invitation code is effective, and further performing next verification on the invitation code.
It should be noted that, in order to ensure that the CRC32 value is eight bits of data, in the embodiment of the present application, after the redundancy check code value corresponding to the second characteristic value is calculated, it may be determined whether the calculated redundancy check code value is eight bits of data, if not, a character is selected from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight bits of data, for example, a character may be selected from a lower case [ g-z ] to fill the redundancy check code value less than eight bits, and the redundancy check code value that is filled and satisfies eight bits of data is used as the third redundancy check code; if the calculated redundancy check code is eight-bit data, the redundancy check code value corresponding to the second characteristic value can be directly used as the third redundancy check code.
It should be further noted that, in the embodiment of the present application, if the invite code is 16-ary data, and therefore the first character string, the second character string, and the third character string are all 16-ary data, before the third redundancy check code is compared and matched with the third character string, the third redundancy check code may be converted into 16-ary data, and the 16-ary third redundancy check code is used for comparing and matching with the 16-ary third character string, so as to ensure matching between the data in the same system.
It should be understood that, in the embodiment of the present application, when validity verification is performed on the invitation code information according to the preset private key, the first character string, and the second character string, if the verification invitation code is invalid, the next validity verification of the invitation code is not required. Therefore, when a large number of invitation codes need to be verified, a part of invalid invitation codes can be screened out in the step, the number of the invitation codes for inquiring the database subsequently for validity verification is reduced, the inquiry frequency of the database can be reduced, and the stability of the system can be improved. In addition, the whole invitation code does not need to be compared character by character in the step, and the data verification in the database is not involved, so that the verification efficiency of the invitation code is improved.
Optionally, in an embodiment of the present application, the above steps 201 to 203 may be performed locally by the client, or may be performed by the server. Preferably, the steps 201 to 203 are placed locally at the client, so that the first step of verification (i.e., validity verification) of the invitation codes can be realized locally at the client, and a part of invalid invitation codes can be screened out through the first step of verification, thereby reducing the number of invitation codes for validity verification by subsequently querying the database, reducing the number of queries of the database, and further improving the stability of the system.
Specifically, after the invitation code information is verified to be valid, the first character string and the second character string are used for performing next validity verification on the invitation code information. For example, first, a target reference feature value corresponding to the first character string is searched for from reference feature values stored in advance in the database.
It will be appreciated that a plurality of reference characteristic values may be stored in the database, which may be pre-generated. In the embodiment of the present application, the reference characteristic value may be generated in advance in the following manner: generating a character string according to a preset rule, generating a first redundancy check code according to the character string, and generating a reference characteristic value corresponding to the first redundancy check code.
In order to facilitate the rapid positioning of the reference characteristic value during the database search, when the generated reference characteristic value is stored in the database, an identification code for uniquely representing the reference characteristic value needs to be generated and stored in the database, so that the data can be rapidly and accurately queried through the identification code during the subsequent database query. Alternatively, in an embodiment of the present application, an identification code for uniquely representing the reference feature value may be generated, a correspondence between the reference feature value and the identification code may be established, and the reference feature value, the identification code, and the correspondence may be stored in a database. For example, a data table of a reference characteristic value is created in a database, the data table at least comprises two attributes, one is an attribute representing the reference characteristic value, and the other is an attribute representing an identification code, wherein the identification code attribute is a main key of the data table, and the reference characteristic value and the identification code are correspondingly stored in the data table through the corresponding relation between the reference characteristic value and the identification code, so that the purpose of storing a character string generated according to a preset rule in the database in a form of a ciphertext is achieved.
In the embodiment of the application, in order to quickly and accurately find the target reference characteristic value corresponding to the first character string, the target identification code corresponding to the first character string may be found in the database, and the reference characteristic value corresponding to the target identification code may be found from the database according to the correspondence between the identification code and the reference characteristic value, where the reference characteristic value is the target characteristic value.
It should be noted that, in the embodiment of the present application, if the invitation code is 16-ary data, the first character string is also 16-ary data, and since the identification code in the database for uniquely representing the reference feature value is decimal, the 16-ary first character string may be converted into decimal, and then the corresponding target reference feature value may be found from the database according to the decimal first character string.
In this embodiment of the application, a feature value of the second string may be calculated, and the feature value of the second string may be matched with the target reference feature value to verify whether the invitation code information is legal. For example, a similarity algorithm may be used to determine whether the feature value of the second character string is consistent with a target reference feature value, if so, verify that the invitation code information is legal, and if not, verify that the invitation code information is illegal, that is, the invitation code is not a legal invitation code issued by the system to the client user, that is, the database does not store the reference feature value of the invitation code.
In order to improve the usability and feasibility of the present application, optionally, in an embodiment of the present application, when the invite code information is verified to be legitimate, a service event corresponding to the invite code information may be determined, and the service event may be responded. For example, assuming that the invitation code generation method and the verification method of the embodiment of the present application are applied to a scenario of purchasing an application function, that is, an invitation code with a preferential function may be generated and issued to a user at a client, and the user forwards the invitation code to other users, and the other users may enjoy a discount price through the invitation code. When a user purchases the application program function, if the user is detected to input the invitation code, the invitation code input by the user needs to be verified, and when the invitation code input by the user is verified to be valid and legal, the business event corresponding to the invitation code is determined to be 'discount price enjoyment', and then the purchase price after 'discount price enjoyment' can be provided for the user so that the user can enjoy the promotion price when purchasing.
According to the invitation code verification method, when invitation code information input by a user is received, the invitation code information is analyzed to obtain a plurality of character strings, wherein the character strings comprise a first character string, a second character string and a third character string, then whether the invitation code information is valid is verified according to a preset private key, the first character string, the second character string and the third character string, when the invitation code information is verified to be valid, a target reference characteristic value corresponding to the first character string is searched from reference characteristic values stored in a database in advance, a characteristic value of the second character string is calculated, and the characteristic value of the second character string is matched with the target reference characteristic value to verify whether the invitation code information is legal. Therefore, when the invitation code information input by the user is verified, validity verification is performed on the invitation code based on the information of the invitation code, if the invitation code is verified to be invalid, the database does not need to be queried to verify the validity of the invitation code, the verification efficiency is improved, the query times of the database are reduced, and the system stability is improved; when the invitation code is verified to be valid, the database is queried based on the character string in the invitation code to further verify the invitation code, so that the validity of the invitation code is ensured; moreover, the character strings in the invitation codes are stored in the database in a ciphertext mode (such as a reference characteristic value), so that the condition that the character strings are easy to crack can be avoided, and the safety and the stability of the system are improved.
In order to facilitate a clear understanding of the present application by those skilled in the art, the invitation code generation and verification process in the present application will be exemplified below.
For example, first, the invite code generation process may be as follows:
the first step is as follows: randomly generating an 8-bit character string A, calculating a CRC32 value of the character string by using a CRC32 algorithm, converting the CRC32 value into a 16-system, filling less than 8 bits with preset characters (such as lower case letters [ g-z ]) to ensure that the CRC32 value is 8 bits, and then obtaining a first redundancy check code B, and calculating a reference characteristic value C of the first redundancy check code B by using a Hash algorithm.
The second step is that: and generating an identification code D for uniquely representing the reference characteristic value C, and correspondingly storing the reference characteristic value C and the identification code D into a database. It should be noted that the identification code ID may be a decimal auto-increment ID, such as 101, 102, etc., and for example, each time a reference characteristic value C is written into the database, an identification code D is automatically generated, and the identification code D may be a decimal auto-increment ID, that is, may be auto-increment with the writing operation of the reference characteristic value C.
The third step: and performing character splicing on the first redundancy check code B, the identification code D and a preset private key E in the system, and calculating the spliced characters by adopting an MD5 algorithm to generate a first characteristic value F, namely MD5 (DBE).
In this step, the identification code D may be obtained from the database, the identification code D is converted from decimal to 16-ary, and then the identification code D in 16-ary, the first redundancy check code B in 16-ary, and the private key E are character-spliced, and the MD5 algorithm is used to calculate the spliced characters, thereby generating the first characteristic value F.
The fourth step: and calculating the CRC32 value of the first characteristic value F by using a CRC32 algorithm, generating a corresponding second redundancy check code G and converting the corresponding second redundancy check code G into a 16-system number, and filling the corresponding second redundancy check code G with lower case letters [ G-z ] if the redundancy check code G is less than eight bits.
The fifth step: and splicing the identification code D, the first redundancy check code B and the second redundancy check code G to form the invitation code.
Based on the embodiment, the generation of the invitation code can be realized, and the generated invitation code can be issued to the user for use. When detecting that the user uses the invitation code to trigger the corresponding service event, the user needs to verify the invitation code input by the user. The verification process of the invitation code may be as follows:
the first step is as follows: the invitation code input by the user is obtained and is split into a first character string D1, a second character string B and a third character string G according to every eight character groups. Wherein, the invitation code is 16-system data.
The second step is that: and connecting the first character string D1, the second character string B and a system built-in private key E, and calculating by using an MD5 algorithm to obtain a characteristic value F.
The third step: and calculating the CRC32 value of the characteristic value F by using a CRC32 algorithm and converting the value into a 16-system number, wherein if the CRC32 value is less than 8 bits, the value can be filled with preset characters (such as lower case letters [ G-z ]), and a redundancy check code G1 is obtained.
The fourth step: if the redundancy check code G1 is not equal to the third string G, the invite code is invalid, otherwise proceed to the next step.
The fifth step: and converting the first character string D1 into a decimal system, and searching the hash value corresponding to D1 in the database to obtain the target reference characteristic value C.
It should be noted that, since the identification code in the database for uniquely representing the reference feature value is a decimal number, in this step, the first character string D1 may be converted into a decimal number, D1 corresponds to the identification code recorded in the reference feature value table in the database, and then the hash value corresponding to the first character string D1 may be found out, which is the target reference feature value C. And a sixth step: and calculating a hash value C1 of the second character string B by adopting a hash algorithm, comparing the hash value C1 with the target reference characteristic value C in the fifth step, if the hash value C is equal to the target reference characteristic value C, passing verification, namely determining that the invitation code input by the user is legal, otherwise failing verification, determining that the invitation code input by the user is illegal, namely not the true invitation code issued by the system server to the user, and understanding that the database does not store the ciphertext corresponding to the invitation code.
Corresponding to the invitation code generating methods provided in the foregoing embodiments, an embodiment of the present application further provides an invitation code generating device, and since the invitation code generating device provided in the embodiment of the present application corresponds to the invitation code generating methods provided in the foregoing embodiments, the implementation of the invitation code generating method is also applicable to the invitation code generating device provided in the embodiment, and will not be described in detail in the embodiment. Fig. 3 is a schematic structural diagram of an invitation code generating apparatus according to an embodiment of the present application. As shown in fig. 3, the invitation code generating means includes: the system comprises a first redundancy check code generating module 01, a reference characteristic value generating module 02, an identification code generating module 03, a data storage module 04, a first characteristic value generating module 05, a second redundancy check code generating module 06 and an invitation code generating module 07.
Specifically, the first redundancy check code generation module 01 is configured to generate a character string according to a preset rule, and generate a first redundancy check code according to the character string.
The reference characteristic value generating module 02 is configured to generate a reference characteristic value of the character string according to the first redundancy check code.
The identification code generating module 03 is used for generating an identification code which is used for uniquely representing the reference characteristic value.
The data storage module 04 is configured to store the reference feature value and the identification code in the database according to the correspondence between the reference feature value and the identification code.
The first eigenvalue generation module 05 is configured to generate a first eigenvalue according to the first redundancy check code, the identification code, and a preset private key.
The second redundancy check code generating module 06 is configured to generate a second redundancy check code according to the first characteristic value. As an example, the second redundancy check code generating module 06 is specifically configured to: calculating a redundancy check code value corresponding to the first characteristic value, judging whether the redundancy check code value is eight-bit data or not, if not, selecting characters from preset characters to fill the redundancy check code value, and enabling the filled redundancy check code value to be eight-bit data; and if so, taking the redundancy check code value corresponding to the first characteristic value as the second redundancy check code.
The invitation code generating module 07 is configured to generate invitation code information according to the first redundancy check code, the identification code, and the second redundancy check code.
According to the invitation code generation device, a character string is generated according to a preset rule, and a first redundancy check code is generated according to the character string; generating a reference characteristic value of the character string according to the first redundancy check code; generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code; generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key; generating a second redundancy check code according to the first characteristic value; and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code. Therefore, by storing part of the character strings in the invitation code into the database in the form of characteristic values (namely ciphertext), the safety and the stability of the system can be improved, and the invitation code is generated by combining a plurality of character strings, so that when the invitation code input by a user is verified, the input invitation code can be divided into a plurality of character strings, the validity of the invitation code is verified firstly through part of the character strings, and when the invitation code is verified to be valid, the validity is verified based on the rest of the character strings and the characteristic values stored in the database, and the verification efficiency of the invitation code can be improved. Corresponding to the invitation code verification methods provided in the above embodiments, an embodiment of the present application further provides an invitation code verification apparatus, and since the invitation code verification apparatus provided in the embodiment of the present application corresponds to the invitation code verification methods provided in the above embodiments, the implementation of the invitation code verification method is also applicable to the invitation code verification apparatus provided in the embodiment, and will not be described in detail in the embodiment. FIG. 4 is a block diagram of an invite code verification apparatus according to an embodiment of the present application. As shown in fig. 4, the invitation code verification apparatus includes: the system comprises an information receiving module 11, an information analysis module 21, a validity verification module 31, a search module 41 and a validity verification module 51.
Specifically, the information receiving module 11 is configured to receive invitation code information input by a user.
The information analysis module 21 is configured to analyze the invitation code information to generate a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string.
The validity verifying module 31 is configured to verify whether the invitation code information is valid according to a preset private key, the first character string, the second character string, and the third character string.
The searching module 41 is configured to search a target reference feature value corresponding to the first character string from reference feature values pre-stored in the database when the invitation code information is validated. Wherein the reference characteristic value is generated by the invitation code generating means of the above-mentioned embodiment.
The validity verifying module 51 is configured to calculate a feature value of the second character string, and match the feature value of the second character string with the target reference feature value to verify whether the invitation code information is valid.
As a possible implementation manner of the embodiment of the present application, the validity verification module 31 may generate a second feature value according to a preset private key, a first character string, and a second character string; then generating a third redundancy check code according to the second characteristic value; and finally, matching the third redundancy check code with the third character string to verify whether the invitation code information is valid or not. The validity verification module 31 is specifically configured to: calculating a redundancy check code value corresponding to the second characteristic value; judging whether the redundancy check code value is eight-bit data or not; if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data; and if so, taking the redundancy check code value corresponding to the second characteristic value as the third redundancy check code.
In the embodiment of the present application, the specific implementation process of the searching module 41 searching the target reference feature value corresponding to the first character string from the reference feature values pre-stored in the database may be as follows: and searching the target identification code corresponding to the first character string from the identification code of the database, and searching the target reference characteristic value from the database according to the target identification code.
As a possible implementation manner, as shown in fig. 5, on the basis of fig. 4, the invitation code verification apparatus may further include: a service processing module 61. The service processing module 61 is configured to determine a service event corresponding to the invitation code information when the invitation code information is verified to be legal, and respond to the service event.
The invitation code verification device of the embodiment of the application analyzes invitation code information to obtain a plurality of character strings when receiving the invitation code information input by a user, wherein the character strings comprise a first character string, a second character string and a third character string, then verifies whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string, searches a target reference characteristic value corresponding to the first character string from reference characteristic values stored in a database in advance when the invitation code information is verified to be valid, calculates a characteristic value of the second character string, and matches the characteristic value of the second character string with the target reference characteristic value to verify whether the invitation code information is valid. Therefore, when the invitation code information input by the user is verified, validity verification is performed on the invitation code based on the information of the invitation code, if the invitation code is verified to be invalid, the database does not need to be queried to verify the validity of the invitation code, the verification efficiency is improved, the query times of the database are reduced, and the system stability is improved; when the invitation code is verified to be valid, the database is queried based on the character string in the invitation code to further verify the invitation code, so that the validity of the invitation code is ensured; moreover, the character strings in the invitation codes are stored in the database in a ciphertext mode (such as a reference characteristic value), so that the condition that the character strings are easy to crack can be avoided, and the safety and the stability of the system are improved
In order to implement the foregoing embodiments, an electronic device is further provided in an embodiment of the present application, including a processor, a memory, and a computer program stored in the memory and executable on the processor; wherein, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the invitation code generation method as described in the above embodiments.
FIG. 6 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present application. The electronic device 12 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in FIG. 6, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein with respect to fig. 1.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiment shown in fig. 1, by executing programs stored in the system memory 28.
In order to implement the foregoing embodiments, the present application further proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the invitation code generation method of the foregoing embodiments.
In order to implement the foregoing embodiments, the present application further provides another electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor; wherein, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the invitation code authentication method as described in the above embodiments.
In order to implement the foregoing embodiments, the present application further proposes another non-transitory computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the invitation code authentication method according to the foregoing embodiments.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (18)
1. An invitation code generating method, comprising:
generating a character string according to a preset rule, and generating a first redundancy check code according to the character string;
generating a reference characteristic value of the character string according to the first redundancy check code;
generating an identification code for uniquely representing the reference characteristic value, and storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code;
generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key;
generating a second redundancy check code according to the first characteristic value;
and generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code.
2. The method of claim 1, wherein the generating a second redundancy check code according to the first eigenvalue comprises:
calculating a redundancy check code value corresponding to the first characteristic value;
judging whether the redundancy check code value is eight-bit data or not;
if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data;
and if so, taking the redundancy check code value corresponding to the first characteristic value as the second redundancy check code.
3. An invitation code verification method, comprising the steps of:
receiving invitation code information input by a user;
analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string;
verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string;
when the invitation code information is verified to be valid, searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database; wherein the reference feature value is generated by using the invitation code generation method of claim 1;
and calculating the characteristic value of the second character string, and matching the characteristic value of the second character string with the target reference characteristic value to verify whether the invitation code information is legal or not.
4. The method of claim 3, wherein the verifying whether the invitation code information is valid according to a preset private key, the first string, the second string and the third string comprises:
generating a second characteristic value according to a preset private key, the first character string and the second character string;
generating a third redundancy check code according to the second characteristic value;
and matching the third redundancy check code with the third character string to verify whether the invitation code information is valid.
5. The method of claim 4, wherein generating a third redundancy check code according to the second characteristic value comprises:
calculating a redundancy check code value corresponding to the second characteristic value;
judging whether the redundancy check code value is eight-bit data or not;
if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data;
and if so, taking the redundancy check code value corresponding to the second characteristic value as the third redundancy check code.
6. The method according to claim 3, wherein the searching for the target reference feature value corresponding to the first character string from the reference feature values pre-stored in the database comprises:
searching a target identification code corresponding to the first character string from the identification codes of the database;
and searching the target reference characteristic value from the database according to the target identification code.
7. The method according to any one of claims 3 to 6, further comprising:
and when the invitation code information is verified to be legal, determining a business event corresponding to the invitation code information, and responding to the business event.
8. An invitation code generating apparatus, comprising:
the first redundancy check code generation module is used for generating a character string according to a preset rule and generating a first redundancy check code according to the character string;
a reference characteristic value generating module, configured to generate a reference characteristic value of the character string according to the first redundancy check code;
the identification code generating module is used for generating an identification code which is used for uniquely representing the reference characteristic value;
the data storage module is used for storing the reference characteristic value and the identification code into a database according to the corresponding relation between the reference characteristic value and the identification code;
the first characteristic value generating module is used for generating a first characteristic value according to the first redundancy check code, the identification code and a preset private key;
the second redundancy check code generating module is used for generating a second redundancy check code according to the first characteristic value;
and the invitation code generating module is used for generating invitation code information according to the first redundancy check code, the identification code and the second redundancy check code.
9. The apparatus of claim 8, wherein the second redundancy check code generating module is specifically configured to:
calculating a redundancy check code value corresponding to the first characteristic value;
judging whether the redundancy check code value is eight-bit data or not;
if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data;
and if so, taking the redundancy check code value corresponding to the first characteristic value as the second redundancy check code.
10. An invitation code verification apparatus, comprising:
the information receiving module is used for receiving invitation code information input by a user;
the information analysis module is used for analyzing the invitation code information to obtain a plurality of character strings; wherein the plurality of character strings includes a first character string, a second character string, and a third character string;
the validity verification module is used for verifying whether the invitation code information is valid according to a preset private key, the first character string, the second character string and the third character string;
the searching module is used for searching a target reference characteristic value corresponding to the first character string from reference characteristic values pre-stored in a database when the invitation code information is verified to be valid; wherein the reference characteristic value is generated by using the invitation code generating means according to claim 8 or 9;
and the legality verification module is used for calculating the characteristic value of the second character string and matching the characteristic value of the second character string with the target reference characteristic value so as to verify whether the invitation code information is legal or not.
11. The apparatus of claim 10, wherein the validity verification module is specifically configured to:
generating a second characteristic value according to a preset private key, the first character string and the second character string;
generating a third redundancy check code according to the second characteristic value;
and matching the third redundancy check code with the third character string to verify whether the invitation code information is valid.
12. The apparatus of claim 11, wherein the validity verification module is specifically configured to:
calculating a redundancy check code value corresponding to the second characteristic value;
judging whether the redundancy check code value is eight-bit data or not;
if not, selecting characters from preset characters to fill the redundancy check code value, so that the filled redundancy check code value is eight-bit data;
and if so, taking the redundancy check code value corresponding to the second characteristic value as the third redundancy check code.
13. The apparatus of claim 10, wherein the lookup module is specifically configured to:
searching a target identification code corresponding to the first character string from the identification codes of the database;
and searching the target reference characteristic value from the database according to the target identification code.
14. The apparatus of any one of claims 10 to 13, further comprising:
and the business processing module is used for determining the business event corresponding to the invitation code information and responding to the business event when verifying that the invitation code information is legal.
15. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the invitation code generation method according to claim 1 or 2 when executing the computer program.
16. A computer-readable storage medium on which a computer program is stored, the computer program, when being executed by a processor, implementing the invitation code generation method according to claim 1 or 2.
17. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the invitation code verification method according to any of claims 3 to 7.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the invitation code authentication method according to any one of claims 3 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910420054.6A CN110135144B (en) | 2019-05-20 | 2019-05-20 | Invitation code generation method, verification method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910420054.6A CN110135144B (en) | 2019-05-20 | 2019-05-20 | Invitation code generation method, verification method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110135144A CN110135144A (en) | 2019-08-16 |
CN110135144B true CN110135144B (en) | 2020-12-18 |
Family
ID=67571594
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910420054.6A Active CN110135144B (en) | 2019-05-20 | 2019-05-20 | Invitation code generation method, verification method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110135144B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110619204A (en) * | 2019-08-28 | 2019-12-27 | 深圳市融壹买信息科技有限公司 | Invitation code generation method and device, terminal equipment and storage medium |
CN112487253B (en) * | 2020-11-03 | 2024-04-05 | 光蕊科技(深圳)有限公司 | User invitation code generation method, verification method, device, equipment and storage medium |
CN112559497B (en) * | 2020-12-25 | 2023-06-23 | 北京百度网讯科技有限公司 | Data processing method, information transmission method, device and electronic equipment |
CN113836364A (en) * | 2021-10-12 | 2021-12-24 | 北京京东拓先科技有限公司 | Invitation code generation method and device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105657699A (en) * | 2016-02-22 | 2016-06-08 | 成都北纬航信网络科技有限责任公司 | Safe data transmission method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5668043B2 (en) * | 2012-11-26 | 2015-02-12 | ビッグローブ株式会社 | Management system, management server, management method and program |
CN103812660B (en) * | 2014-02-13 | 2018-09-14 | 陈炳福 | A kind of invitation code for certification generates and methods for using them and system |
CN107743085B (en) * | 2016-09-05 | 2019-11-15 | 腾讯科技(深圳)有限公司 | Invite code management method and invitation code managing device |
CN108829650B (en) * | 2018-06-01 | 2022-08-23 | 腾讯科技(北京)有限公司 | Card number generation method, device, server and storage medium |
-
2019
- 2019-05-20 CN CN201910420054.6A patent/CN110135144B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105657699A (en) * | 2016-02-22 | 2016-06-08 | 成都北纬航信网络科技有限责任公司 | Safe data transmission method |
Also Published As
Publication number | Publication date |
---|---|
CN110135144A (en) | 2019-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110135144B (en) | Invitation code generation method, verification method, device, electronic equipment and storage medium | |
US20200294048A1 (en) | Blockchain-based data verification method and apparatus, and electronic device | |
KR101948721B1 (en) | Method and apparatus for examining forgery of file by using file hash value | |
JP4470069B2 (en) | Input assist device, input assist system, input assist method, and input assist program | |
CN109740317A (en) | A kind of digital finger-print based on block chain deposits card method and device | |
CN106469261B (en) | Identity verification method and device | |
CN108183907A (en) | A kind of authentication method, server and Verification System | |
US20160036796A1 (en) | Method and system for facilitating terminal identifiers | |
US10783277B2 (en) | Blockchain-type data storage | |
US20130232551A1 (en) | Method and device for anonymous entity identification | |
CN105429929B (en) | Information processing method, client, server and system | |
US20220269739A1 (en) | Search and retrieval of keyed data maintained using a keyed database | |
US12067587B2 (en) | System and methods for using enhanced QR codes in a call to action | |
KR102676770B1 (en) | Information processing method, information display method, program, terminal, and server | |
CN112994900B (en) | File countersigning method, device, client, server and storage medium | |
JP2015531518A (en) | Method and apparatus for processing electronic transaction information | |
CN106709733A (en) | Verification strategy selection method and device | |
CN114826623B (en) | Mock test message processing method and device | |
CN110209890A (en) | The querying method and user equipment of information browse data on block chain | |
CN114461912A (en) | Information processing method and device, electronic equipment and storage medium | |
WO2022144966A1 (en) | Information processing system, control method, information processing device, and control program | |
CN110858803B (en) | Authentication method, system, server, and computer-readable storage medium | |
CN114124766A (en) | Test method and device based on simulation data | |
KR102533833B1 (en) | Shipping address translation server which is able to translate a shipping address and provide it to a shipping agent, and the operating method thereof | |
CN112163224A (en) | Android software integrity verification method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |