CN115587609A - Short-link two-dimensional code generation method and device - Google Patents

Short-link two-dimensional code generation method and device Download PDF

Info

Publication number
CN115587609A
CN115587609A CN202211182861.7A CN202211182861A CN115587609A CN 115587609 A CN115587609 A CN 115587609A CN 202211182861 A CN202211182861 A CN 202211182861A CN 115587609 A CN115587609 A CN 115587609A
Authority
CN
China
Prior art keywords
short
chain
character string
index
character
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.)
Pending
Application number
CN202211182861.7A
Other languages
Chinese (zh)
Inventor
王继春
阮高
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhimaitong Technology Co ltd
Original Assignee
Shenzhen Zhimaitong Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhimaitong Technology Co ltd filed Critical Shenzhen Zhimaitong Technology Co ltd
Priority to CN202211182861.7A priority Critical patent/CN115587609A/en
Publication of CN115587609A publication Critical patent/CN115587609A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9554Retrieval from the web using information identifiers, e.g. uniform resource locators [URL] by using bar codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides a short-chain two-dimensional code generation method and a device, wherein a long-chain grounding address of a commodity is encrypted to obtain a uniquely corresponding encrypted character string, the first two characters of the encrypted character string are taken as a database identifier of a short-chain address, the encrypted character string is subjected to numerical value conversion to obtain an index character string, index numerical values consistent with the number of characters of the short-chain character string are selected from the index character string, characters at corresponding positions are taken out from a character set according to the index numerical values to construct a short-chain address, and the short-chain address is constructed according to the database identifier and the short-chain character string to generate a two-dimensional code of the commodity; the method can convert the long-chain grounding address into the short-chain address, is simple and reliable, has low repetition rate, generates the two-dimensional code according to the short chain connection, and improves the recognition degree of the two-dimensional code.

Description

Short-link two-dimensional code generation method and device
Technical Field
The invention relates to the technical field of two-dimensional codes, in particular to a short-chain-connection two-dimensional code generation method and device.
Background
Along with the maturity of two-dimensional code technique, make it increasingly wide by scope and trade that is used, along with the complicacy of intelligent packing material business and the joining of marketing class link, the length of two-dimensional code that intelligent packing material demonstrates is longer and longer more, and two-dimensional code pattern density is higher and higher, leads to the recognition rate after the two-dimensional code figure printing to reduce by a wide margin.
When a user scans a code, the user spends a long time even cannot smoothly perform the next operation because the code scanning recognition degree is too low, so that the functions of the marketing entrance and the propagation channel of the intelligent packaging material are reduced or lost, and the user experience is also extremely influenced.
Disclosure of Invention
The invention provides a method and a device for generating a short-chain-connection two-dimensional code, and aims to provide a reliable method for easily converting a long chain connection into a short chain connection, so that a two-dimensional code is generated according to the short chain connection, and the recognition degree of the two-dimensional code is improved.
In a first aspect, the present invention provides a short-link two-dimensional code generation method, including:
setting a character set contained in a short-chain character string of a short-chain address and the number of characters of the short-chain character string;
acquiring a long-chain grounding address of a commodity, and encrypting the long-chain grounding address to obtain a unique corresponding encryption character string;
taking the first two characters of the encrypted character string as the database identifier of the short link address;
performing numerical value conversion on the encrypted character string to obtain an index character string;
selecting index numerical values with the number consistent with the number of the characters from the index character strings, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings;
and constructing a short link address according to the database identifier and the short chain character string to generate a two-dimensional code of the commodity.
In one embodiment, numerically converting the encrypted string to obtain an index string includes,
and carrying out hexadecimal number conversion on the encrypted character string, and carrying out bit AND operation to obtain an index character string with a preset length.
In one embodiment, the selecting an index number value from the index character string that is consistent with the number of the characters, and correspondingly extracting corresponding characters from the character set according to the index number value to form the short-chain character string includes,
performing bit AND operation on the index character string and a preset numerical value to obtain an index position of a first character of the short-chain character string in the character set, and taking out a corresponding character in the character set according to the index position to serve as the first character;
and right shifting the index character string according to a preset length, and returning to the step of performing bit AND operation on the index character string and a preset numerical value until the remaining characters of the short-chain character string are obtained.
In one embodiment, the short string comprises a character set consisting of 62 letters and numbers, and the number of characters of the short string is 6.
In one embodiment, before encrypting the long-chain grounding address to obtain the uniquely corresponding encrypted character string, the method further includes,
and mixing the long link address and the key, and then carrying out hash encryption to obtain a hash encryption character string.
In one embodiment, before the constructing the short link address according to the database identifier and the short chain character string, further comprises,
traversing all short-chain character strings in a list consistent with the database identifier of the short-link address in a database, and if the short-chain character strings are not repeated with the short-chain character strings in the list, constructing the short-link address according to the short-chain character strings to generate the two-dimensional code of the commodity.
In one embodiment, before performing the numerical conversion on the encrypted string to obtain the index string, further includes,
grouping the encrypted character strings to obtain a plurality of groups of character strings;
performing numerical value conversion on the encrypted character string to obtain an index character string;
selecting index numerical values with the same number as the characters from the index character strings, correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings,
carrying out numerical value conversion on each group of character strings to obtain a plurality of groups of index character strings;
selecting index numerical values with the number consistent with the number of the characters from the multiple groups of index character strings, and correspondingly taking out corresponding characters from the character set according to the multiple groups of index numerical values to form multiple groups of short-chain character strings;
correspondingly, before the short link address is constructed according to the database identifier and the short chain character string, the method further comprises the following steps,
and traversing all short-chain character strings in the list which are consistent with the database identifier of the short-link address in the database, and if the short-chain character strings are repeated with the short-chain character strings in the list, verifying the next short-chain character string in the multiple groups of short-chain character strings.
In one embodiment, the encrypting the long chain address to obtain the uniquely corresponding encryption character string is specifically,
and performing MD5 encryption on the long link address to obtain a uniquely corresponding encryption character string.
In a second aspect, the present invention provides a short-link two-dimensional code generating device, including:
the setting unit is used for setting a character set contained in a short-chain character string of a short-link address and the number of characters of the short-chain character string;
the system comprises a first encryption unit, a second encryption unit and a third encryption unit, wherein the first encryption unit is used for acquiring a long-chain grounding address of a commodity and encrypting the long-chain grounding address to obtain a unique corresponding encryption character string;
an identifier obtaining unit, configured to obtain the first two-digit character of the encrypted character string as a database identifier of the short link address;
the index character string acquisition unit is used for carrying out numerical value conversion on the encrypted character string to obtain an index character string;
the character acquisition unit is used for selecting index numerical values with the number consistent with the number of the characters from the index character string, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character string;
and the address construction unit is used for constructing a short link address according to the database identifier and the short chain character string to generate a two-dimensional code of the commodity.
In a third aspect, the present invention further provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed, the method for generating a short-link two-dimensional code is implemented.
The invention relates to a short-chain two-dimensional code generation method, a short-chain two-dimensional code generation device and a computer storage medium.A long-chain grounding address of a commodity is encrypted to obtain a uniquely corresponding encrypted character string, the first two characters of the encrypted character string are taken as a database identifier of a short-chain address, the encrypted character string is subjected to numerical value conversion to obtain an index character string, index numerical values consistent with the number of characters of a short-chain character string are selected from the index character string, characters at corresponding positions are taken out from a character set according to the index numerical values to construct a short-chain address, and a short-chain address is constructed according to the database identifier and the short-chain character string to generate a two-dimensional code of the commodity; the method can convert the long-chain grounding address into the short-chain address, is simple and reliable, has low repetition rate, generates the two-dimensional code according to the short chain connection, and improves the recognition degree of the two-dimensional code.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required to be used in the embodiments are briefly introduced below, the drawings in the following description are only corresponding to some embodiments of the present invention, and it is obvious for a person skilled in the art to obtain drawings of other embodiments according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating a short-link two-dimensional code according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating a short-link two-dimensional code according to another embodiment of the present invention;
FIG. 3a is a schematic diagram of a long concatenated two-dimensional code according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of the short link two-dimensional code correspondingly generated in FIG. 3 a;
fig. 4 is a schematic structural diagram of a short-link two-dimensional code generating device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
Referring to fig. 1, the present invention relates to a method for generating a short-link two-dimensional code, and in one embodiment, the method includes:
and S01, setting a character set contained in a short-chain character string of the short-chain address and the number of characters of the short-chain character string.
In one embodiment, the short string comprises a character set consisting of 62 letters and numbers, and the short string comprises 6 characters.
The character set specifically includes:
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"。
it is easy to think that the number of characters in the character set and the short-chain character string is a certain embodiment, and the number of characters included in other character sets and short-chain character strings can be set according to requirements in specific implementation.
And S02, acquiring a long-chain grounding address of the commodity, and encrypting the long-chain grounding address to obtain a unique corresponding encrypted character string.
In one embodiment, the encryption mode is MD5 encryption, and a unique corresponding encryption string can be obtained through MD5 encryption.
Specifically, the result after MD5 encryption is a 32-bit string.
For example, long chain ground address:
https://24253.ky5221.cn/BuildWeb/#/pages/product/productdetailproid=1391271&specid=1E7AAE5A-2C5D-43F2-A6B3-B148E61D842B&xt=wx.kyk;
obtaining an encrypted character string after MD5 encryption: 9CBC3189D75876F58D4BD3BAF60AF627.
And S03, taking the first two-digit characters of the encrypted character string as the database identifier of the short link address.
The database stores long link addresses, short chain character strings and corresponding relations among the long link addresses and the short chain character strings, and the database identifiers are used for classifying and storing the information. Specifically, different database identifiers correspond to different stored lists.
And S04, performing numerical value conversion on the encrypted character string to obtain an index character string.
Specifically, hexadecimal conversion is performed on the encrypted character string, and then bit and operation is performed on the hexadecimal number to obtain an index character string with a preset length.
And converting the encrypted character string into hexadecimal data, performing bit AND operation to remove some binary digits to obtain data with a preset length, and using the data as an index character string.
Here, the value is not limited to hexadecimal, but may be binary or other types of values.
And S05, selecting index numerical values with the number consistent with the number of the characters from the index character strings, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings.
Because the encrypted character string corresponding to the long-chain grounding address is unique after encryption and the index character string obtained after numerical value conversion is also unique, after the index numerical value with the same number as the character number is selected from the index character string, the character combination correspondingly taken out from the character set according to the index numerical value also has high uniqueness, and the correspondingly formed short-chain character string also has high uniqueness.
And S06, constructing a short link address according to the database identifier and the short chain character string, and generating a two-dimensional code of the commodity.
The short link address is constructed according to the database identifier and the short chain character string, and the two-dimensional code of the commodity is generated according to the short chain grounding address, so that the two-dimensional code is greatly simplified, and the identification speed is greatly improved.
Specifically, referring to fig. 2, in one embodiment, if the encrypted string is very long and exceeds a certain length, before performing bit and operation on a hexadecimal number corresponding to the encrypted string to obtain an index string with a preset length, the method further includes:
and grouping the encrypted character strings to obtain a plurality of groups of character strings.
Correspondingly, the encrypted character string is subjected to numerical value conversion to obtain an index character string;
selecting index numerical values with the same number as the characters from the index character strings, correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings,
carrying out numerical value conversion on each group of character strings to obtain a plurality of groups of index character strings;
and selecting index numerical values with the same number as the characters from the multiple groups of index character strings, and correspondingly taking out corresponding characters from the character set according to the multiple groups of index numerical values to form multiple groups of short-chain character strings.
Taking the above encryption string as an example, the encryption string:
the 9CBC3189D75876F58D4BD3BAF60AF627 is divided into 4 groups and 8-bit character groups, for example, the first group character string is 9CBC3189, the first group character string is subjected to hexadecimal conversion to obtain a string of 32-bit binary bit data, and the data and 0x3FFFFFFF are subjected to bit AND operation to obtain an index character string corresponding to 30-bit binary bit number.
In one embodiment, in step S04, specifically, performing a bit and operation on the index character string and a preset numerical value to obtain an index position of an initial character of the short-chain character string in the character set, and taking out a corresponding character in the character set according to the index position as the initial character;
and right shifting the index character string according to a preset length, and returning to the step of performing bit AND operation on the index character string and a preset numerical value until the remaining characters of the short-chain character string are obtained.
And performing a bit AND operation on the index character string and 0x0000003D to obtain an index of the first character of the short-chain character string in the character set.
Since the set character set includes 62 characters, the maximum value of the index cannot exceed 62, and thus the preset value is set to 0x0000003d and 0x0000003d as hexadecimal numbers.
If the set short-chain character string comprises 6 characters, 6 characters need to be taken out from the character set, the preset length is set to be 5-bit binary bits due to the fact that the index character string comprises 30-bit binary bits, after the index character string is subjected to bit AND operation with 0x0000003D, the index character string is circularly shifted to the right by 5-bit binary bits and is subjected to bit AND operation with 0x0000003D again, after 6 index data are obtained, the index character string is circularly shifted for one period, and 6 characters are correspondingly taken out from the character set according to the 6 index data.
Taking the first group of character string "9CBC3189" as an example, the finally obtained 6 characters are "jmmUjm".
It is understood that if the short-chain string contains a number of characters other than 6, the number of bits of the index string and the number of bits of the index string shifted to the right each time can be adjusted accordingly.
The index value may also be selected from the index string in other ways, such as randomly, or in other conceivable ways.
The method of the embodiment can be applied to various use occasions needing to add the two-dimensional code, such as the occasions needing to visit the online shopping mall of the commodity, such as commodity sales promotion, exhibition, propaganda and the like.
Referring to fig. 2, in another embodiment, the method for generating a short-link two-dimensional code includes:
and S11, mixing the long link address and the key, and then carrying out hash encryption to obtain a hash encryption character string.
Also taking the above long link address as an example:
https://24253.kyk221.cn/BuildWeb/#/pages/product/productdetailproid=1391271&specid=1E7AAE5A-2C5D-43F2-A6B3-B148E61D842B&xt=wx.kyk;
s12, performing MD5 encryption on the hash encryption character string to obtain an encryption character string:
9CBC3189D75876F58D4BD3BAF60AF627。
and S13, taking the two former characters of the encrypted character string as the database identifier of the short link address.
S14, dividing the encrypted character string into 4 groups, defining a 4-bit group for storing the final result, wherein the 8-bit group is a group.
S15, taking the first group as an example, the first group of character strings is: 9CBC3189.
And S16, after hexadecimal conversion is carried out on the first group of character strings, carrying out bit AND operation on the first group of character strings and 0x3FFFFFFF to obtain an index character string corresponding to 30-bit binary digits.
And S17, carrying out bit AND operation on the index character string and 0x0000003D to obtain the index of the first character of the short-chain character string of the short-link address in the character set.
And S18, circularly shifting the index character string to the right by 5 bits.
S19, until 6 characters corresponding to the 6 index addresses are taken out from the character set, obtaining a group of short-chain character strings: jmmUjm.
And S20, searching duplication in a target database through the database identifier, if duplication does not exist, storing the long link address and the obtained short chain character string into the database, and establishing a one-to-one correspondence relationship.
In one embodiment, if the obtained short-chain character string is repeated with the short-chain address under the identifier of the database in the database, the short-chain character string obtained by the method is verified for other groups of character strings after the encrypted character string is grouped.
In specific implementation, a plurality of groups of character strings are obtained after the encrypted character strings are grouped, and the calculation process of obtaining the short-chain character strings according to the plurality of groups of character strings can be carried out simultaneously, so that 4 groups of 6-bit short-chain character strings can be obtained simultaneously through the method, if the short-chain character strings obtained by the first group of character strings are repeated, the short-chain character strings obtained by the second group of character strings are verified, the uniqueness of the short-link address can be further improved, and the reliability is high.
And S21, generating a two-dimensional code according to the short-chain character string and the database identifier for printing by a merchant.
And generating a short link address according to the obtained database identifier and the short chain character string jmmUjm. In the method of the embodiment, the short link address is composed of 2-bit database identifiers and 6-bit short-chain character strings, wherein the 6-bit short-chain character strings are distinguished from upper and lower cases and are generated by character sets composed of 26 lower case letters +26 upper case letters +10 digits and 62 characters in total, therefore, theoretically, the short-chain character strings which can be generated by a single table corresponding to one database identifier are 6-degree short chains of 62, namely 56800235584 short chains, under the expansion of two-bit database identifiers, the database identifiers are not distinguished from upper and lower cases, 1296 sub-tables of 36 squares can be obtained, and the capacity of the short-chain character strings is basically infinite.
Referring to fig. 3a and 3b, if the long link address is:
https://www.1651ky.com/Details/17374.htm,
the two-dimensional code generation effect is as shown in fig. 3a, and the two-dimensional code is converted into a short link address by the method:
https://qqyin.cn/DCFvuaMj,
the effect of generating the two-dimensional code of the commodity according to the short-chain grounding address is shown in fig. 3b, and it can be seen that the two-dimensional code is greatly simplified, and the recognition speed is greatly improved.
The method for generating the short-chain-connection two-dimensional code comprises the steps of mixing a long-chain grounding address and a key, carrying out hash encryption to obtain a hash encryption character string, carrying out MD5 encryption to the hash encryption character string to obtain a unique encryption character string, taking the two former characters as database identifiers of short-chain addresses, grouping the encryption character strings, limiting each group of character strings, obtaining a plurality of groups of index numerical values at certain intervals, correspondingly taking out a plurality of groups of character strings in a character set through the index numerical values to form short-chain character strings of the short-chain addresses, taking one short-chain character string to search for duplication in a corresponding database list according to the database identifier of the short-chain character string, generating the short-chain addresses according to the short-chain character strings and the database identifiers if the short-chain character strings are not repeated, and repeatedly verifying another short-chain character string to finally obtain the short-chain addresses of commodities.
The uniqueness of the short-chain address is improved through the setting of the database identifier, the duplication checking speed of the short-chain character string is accelerated, and the generation efficiency of the short-chain grounding address is greatly improved.
The embodiment of the present invention further provides a short-link two-dimensional code generation apparatus, referring to fig. 4, including:
a setting unit 10, configured to set a character set included in a short-chain character string of a short-link address, and a character number of the short-chain character string;
the first encryption unit 20 is configured to obtain a long-chain grounding address of a commodity, and encrypt the long-chain grounding address to obtain a uniquely corresponding encryption character string;
an identifier obtaining unit 30, configured to obtain the first two characters of the encrypted character string as a database identifier of the short link address;
an index character string obtaining unit 40, configured to perform numerical value conversion on the encrypted character string to obtain an index character string;
a character obtaining unit 50, configured to select an index numeric value from the index character string, where the index numeric value is consistent with the number of characters, and correspondingly take out a corresponding character from the character set according to the index numeric value to form the short-chain character string;
and the address constructing unit 60 is used for constructing a short link address according to the database identifier and the short chain character string, and generating a two-dimensional code of the commodity.
In one embodiment, the index string obtaining unit 30 is specifically configured to perform hexadecimal number conversion on the encrypted string, and perform bit and operation to obtain an index string with a preset length.
In one embodiment, the character obtaining unit 40 is specifically configured to perform a bit and operation on the index character string and a preset numerical value to obtain an index position of a first character of the short-chain character string in the character set, and take out a corresponding character in the character set according to the index position as the first character;
and right shifting the index character string according to a preset length, and returning to the step of performing bit AND operation on the index character string and a preset numerical value until the characters left by the short-chain character string are obtained.
In one embodiment, the short string comprises a character set consisting of 62 letters and numbers, and the number of characters of the short string is 6.
In one embodiment, the linked two-dimensional code generating apparatus further includes:
and the second encryption unit is used for carrying out hash encryption after the long link address and the key are mixed to obtain a hash encryption character string.
In one embodiment, the linked two-dimensional code generating apparatus further includes:
and the first duplication checking unit is used for traversing all short-chain character strings in a list consistent with the database identifier of the short-link address in a database, and if the short-chain character strings are not repeated with the short-chain character strings in the list, constructing the short-link address according to the short-chain character strings to generate the two-dimensional code of the commodity.
In one embodiment, the short-chained two-dimensional code generating apparatus further includes:
the grouping unit is used for grouping the encrypted character strings to obtain a plurality of groups of character strings;
the character acquisition unit 40 is specifically configured to,
carrying out numerical value conversion on each group of character strings to obtain a plurality of groups of index character strings;
selecting index numerical values with the same number as the characters from the index character strings, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form short-chain character strings;
correspondingly, the short-link two-dimensional code generating device further comprises:
and the second duplication checking unit is used for traversing all short-chain character strings in the list which are consistent with the database identifier of the short-link address in the database, and verifying the next group of short-chain character strings in the multiple groups of short-chain character strings if the short-chain character strings are repeated with the short-chain character strings in the list.
In one embodiment, the first encryption unit 20 is specifically configured to perform MD5 encryption on the long link address to obtain a uniquely corresponding encryption string.
The specific processes of each unit for executing the corresponding steps are already described in detail in the above method embodiments, and are not described herein again for brevity.
An embodiment of the present invention further provides a computer device, which includes a processor and a memory, where a computer program is stored in the memory, and when the computer program is loaded and executed by the controller, the computer program implements the method steps described in any of the above method embodiments.
An embodiment of the present invention further provides a computer storage medium, where a computer program is stored, and when the computer program is executed, the method steps described in any of the above method embodiments are implemented.
In the above embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which may be a mobile terminal, a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In summary, although the present invention has been disclosed in terms of the preferred embodiments, the scope of the present invention is not limited thereto, and any person skilled in the art can substitute or change the technical solution of the present invention within the scope of the present invention.
All possible combinations of the technical features of the above embodiments may not be described for the sake of brevity, but should be considered as within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.

Claims (10)

1. A short-chain-connection two-dimensional code generation method is characterized by comprising the following steps:
setting a character set contained in a short-chain character string of a short-link address and the number of characters of the short-chain character string;
acquiring a long-chain grounding address of a commodity, and encrypting the long-chain grounding address to obtain a unique corresponding encryption character string;
taking the first two characters of the encrypted character string as the database identifier of the short link address;
performing numerical value conversion on the encrypted character string to obtain an index character string;
selecting index numerical values with the number consistent with the number of the characters from the index character strings, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings;
and constructing a short link address according to the database identifier and the short chain character string to generate a two-dimensional code of the commodity.
2. The short-link two-dimensional code generation method according to claim 1, wherein the obtaining of the index string by numerically converting the encrypted string comprises,
and carrying out hexadecimal number conversion on the encrypted character string, and carrying out bit AND operation to obtain an index character string with a preset length.
3. The short-chain-link two-dimensional code generation method according to claim 1 or 2, wherein the selecting an index numerical value consistent with the number of the characters from the index character string, and correspondingly taking out corresponding characters from the character set according to the index numerical value to form the short-chain character string comprises,
performing bit AND operation on the index character string and a preset numerical value to obtain an index position of a first character of the short-chain character string in the character set, and taking out a corresponding character in the character set according to the index position to serve as the first character;
and right shifting the index character string according to a preset length, and returning to the step of performing bit AND operation on the index character string and a preset numerical value until the characters left by the short-chain character string are obtained.
4. The method for generating the short chain-linked two-dimensional code according to claim 1, wherein the short chain character string comprises a character set consisting of 62 letters and numbers, and the number of the characters of the short chain character string is 6.
5. The short-link two-dimensional code generation method according to claim 1, wherein before encrypting the long link address to obtain a uniquely corresponding encrypted string, further comprising,
and mixing the long link address and the key, and then carrying out hash encryption to obtain a hash encryption character string.
6. The method for generating short-chain two-dimensional code according to claim 1, wherein before the constructing the short-chain address according to the database identifier and the short-chain character string, further comprising,
traversing all short-chain character strings in a list consistent with the database identifier of the short-link address in a database, and if the short-chain character strings are not repeated with the short-chain character strings in the list, constructing the short-link address according to the short-chain character strings to generate the two-dimensional code of the commodity.
7. The short-link two-dimensional code generation method according to claim 1, wherein before the numeric value conversion of the encrypted string to obtain the index string, further comprising,
grouping the encrypted character strings to obtain a plurality of groups of character strings;
carrying out numerical value conversion on the encrypted character string to obtain an index character string;
selecting index numerical values with the same number as the characters from the index character strings, correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character strings,
carrying out numerical value conversion on each group of character strings to obtain a plurality of groups of index character strings;
selecting index numerical values with the number consistent with the number of the characters from the multiple groups of index character strings, and correspondingly taking out corresponding characters from the character set according to the multiple groups of index numerical values to form multiple groups of short-chain character strings;
correspondingly, before the constructing the short link address according to the database identifier and the short chain character string, the method further comprises the following steps,
traversing all short-chain character strings in a list which is consistent with the database identifier of the short-link address in the database, and if the short-chain character strings are repeated with the short-chain character strings in the list, verifying the next short-chain character string in the multiple groups of short-chain character strings.
8. The short-link two-dimensional code generation method according to claim 1, wherein the encrypting the long link address to obtain the uniquely corresponding encrypted string is specifically,
and performing MD5 encryption on the long link address to obtain a uniquely corresponding encryption character string.
9. A short-chain-connection two-dimensional code generation device is characterized by comprising:
the setting unit is used for setting a character set contained in a short-chain character string of a short-link address and the number of characters of the short-chain character string;
the system comprises a first encryption unit, a second encryption unit and a third encryption unit, wherein the first encryption unit is used for acquiring a long-chain grounding address of a commodity and encrypting the long-chain grounding address to obtain a unique corresponding encryption character string;
the identifier acquisition unit is used for acquiring the first two characters of the encrypted character string as the database identifier of the short link address;
the index character string acquisition unit is used for carrying out numerical value conversion on the encrypted character string to obtain an index character string;
the character acquisition unit is used for selecting index numerical values with the number consistent with the number of the characters from the index character string, and correspondingly taking out corresponding characters from the character set according to the index numerical values to form the short-chain character string;
and the address construction unit is used for constructing a short link address according to the database identifier and the short chain character string to generate a two-dimensional code of the commodity.
10. A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed, the method for generating a short-link two-dimensional code according to any one of claims 1 to 8 is implemented.
CN202211182861.7A 2022-09-27 2022-09-27 Short-link two-dimensional code generation method and device Pending CN115587609A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211182861.7A CN115587609A (en) 2022-09-27 2022-09-27 Short-link two-dimensional code generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211182861.7A CN115587609A (en) 2022-09-27 2022-09-27 Short-link two-dimensional code generation method and device

Publications (1)

Publication Number Publication Date
CN115587609A true CN115587609A (en) 2023-01-10

Family

ID=84773219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211182861.7A Pending CN115587609A (en) 2022-09-27 2022-09-27 Short-link two-dimensional code generation method and device

Country Status (1)

Country Link
CN (1) CN115587609A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136372A (en) * 2013-03-21 2013-06-05 陕西通信信息技术有限公司 Method of quick location, classification and filtration of universal resource locator (URL) in network credibility behavior management
CN104392197A (en) * 2014-11-24 2015-03-04 深圳市通用条码技术开发中心 Method for increasing reading rate and encryption of website two-dimensional code tags
CN104657432A (en) * 2015-01-28 2015-05-27 北京金和软件股份有限公司 Method for reducing repetitive rate of converting long address into short addresses
CN106412140A (en) * 2015-08-03 2017-02-15 沈阳东软睿道教育服务有限公司 Short link address generating method and system thereof
CN111026985A (en) * 2019-12-02 2020-04-17 北京齐尔布莱特科技有限公司 Short link generation method, device and server
CN112307058A (en) * 2020-10-27 2021-02-02 北京健康之家科技有限公司 Short link processing method and device, storage medium and computer equipment
CN112380464A (en) * 2020-11-10 2021-02-19 中国平安人寿保险股份有限公司 Short link generation method and related equipment
CN113505318A (en) * 2021-07-26 2021-10-15 全景智联(武汉)科技有限公司 Short link generation method, device, equipment and storage medium
CN113612869A (en) * 2021-08-25 2021-11-05 福建凯米网络科技有限公司 Short network address generation method, terminal and storage medium
CN114039801A (en) * 2022-01-11 2022-02-11 深圳魔方网络科技有限公司 Short link generation method, short link analysis system, short link analysis equipment and storage medium
CN114553825A (en) * 2022-02-23 2022-05-27 福建天晴数码有限公司 Method and system for converting webpage address into short address

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136372A (en) * 2013-03-21 2013-06-05 陕西通信信息技术有限公司 Method of quick location, classification and filtration of universal resource locator (URL) in network credibility behavior management
CN104392197A (en) * 2014-11-24 2015-03-04 深圳市通用条码技术开发中心 Method for increasing reading rate and encryption of website two-dimensional code tags
CN104657432A (en) * 2015-01-28 2015-05-27 北京金和软件股份有限公司 Method for reducing repetitive rate of converting long address into short addresses
CN106412140A (en) * 2015-08-03 2017-02-15 沈阳东软睿道教育服务有限公司 Short link address generating method and system thereof
CN111026985A (en) * 2019-12-02 2020-04-17 北京齐尔布莱特科技有限公司 Short link generation method, device and server
CN112307058A (en) * 2020-10-27 2021-02-02 北京健康之家科技有限公司 Short link processing method and device, storage medium and computer equipment
CN112380464A (en) * 2020-11-10 2021-02-19 中国平安人寿保险股份有限公司 Short link generation method and related equipment
CN113505318A (en) * 2021-07-26 2021-10-15 全景智联(武汉)科技有限公司 Short link generation method, device, equipment and storage medium
CN113612869A (en) * 2021-08-25 2021-11-05 福建凯米网络科技有限公司 Short network address generation method, terminal and storage medium
CN114039801A (en) * 2022-01-11 2022-02-11 深圳魔方网络科技有限公司 Short link generation method, short link analysis system, short link analysis equipment and storage medium
CN114553825A (en) * 2022-02-23 2022-05-27 福建天晴数码有限公司 Method and system for converting webpage address into short address

Similar Documents

Publication Publication Date Title
US9934400B2 (en) System and methods for encrypting data
US8811611B2 (en) Encryption/decryption of digital data using related, but independent keys
EP2779522B1 (en) Configurable key-based data shuffling and encryption
CN106610995B (en) Method, device and system for creating ciphertext index
US20080063187A1 (en) Hash value generation device, program, and hash value generation method
CN110489466B (en) Method and device for generating invitation code, terminal equipment and storage medium
GB2539966A (en) Data processing method and apparatus
CN112487253B (en) User invitation code generation method, verification method, device, equipment and storage medium
US20150304103A1 (en) Method of generating unique and hardly predictable numbers of coupons
US20190158271A1 (en) Method and system of synchronous encryption to render computer files and messages impervious to pattern recognition and brute force attacks
Panduranga et al. Hybrid approach for image encryption using scan patterns and carrier images
CN111062456A (en) Two-dimensional code encryption algorithm
US20210152340A1 (en) Secure aggregate order system, secure computation apparatus, secure aggregate order method, and program
WO2021255668A1 (en) A computer implemented method for the generation and management of codes.
CN115587609A (en) Short-link two-dimensional code generation method and device
KR101045222B1 (en) Method of encrypting and synthesizing personal information into order information and contents information, apparatus, server and recording media
KR100910303B1 (en) Data encryption and decryption apparatus using variable code table and method thereof
CN103257977B (en) Obtain the method and device of identification number
KR101977128B1 (en) Fixed length encryption apparatus and method for long text strings
KR20230124207A (en) Document sharing service server for managing document sharing service based on cloud, and the operating method thereof
CN114297985A (en) Method, device and storage medium for generating product information unordered codes
Yang et al. Practical Frequency‐Hiding Order‐Preserving Encryption with Improved Update
Skliar et al. A Hybrid Random Number Generator (HRNG) un generador híbrido de números aleatorios
CN111324908A (en) Batch data desensitization method
CN106230593A (en) ID generates 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230110

RJ01 Rejection of invention patent application after publication