CN104657432A - Method for reducing repetitive rate of converting long address into short addresses - Google Patents

Method for reducing repetitive rate of converting long address into short addresses Download PDF

Info

Publication number
CN104657432A
CN104657432A CN201510043556.3A CN201510043556A CN104657432A CN 104657432 A CN104657432 A CN 104657432A CN 201510043556 A CN201510043556 A CN 201510043556A CN 104657432 A CN104657432 A CN 104657432A
Authority
CN
China
Prior art keywords
address
character strings
character
converted
short
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.)
Granted
Application number
CN201510043556.3A
Other languages
Chinese (zh)
Other versions
CN104657432B (en
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.)
Beijing Jinher Software Co Ltd
Original Assignee
Beijing Jinher Software 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 Beijing Jinher Software Co Ltd filed Critical Beijing Jinher Software Co Ltd
Priority to CN201510043556.3A priority Critical patent/CN104657432B/en
Publication of CN104657432A publication Critical patent/CN104657432A/en
Application granted granted Critical
Publication of CN104657432B publication Critical patent/CN104657432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Machine Translation (AREA)

Abstract

The invention provides a method for reducing a repetitive rate of converting a long address into short addresses. The method comprises the steps of generating a 32-bit character string through an encryption algorithm, and dividing the 32-bit character string into four sections, wherein each section comprises an 8-bit character string; regarding the 8-bit character string in each section as a hexadecimal string, converting the hexadecimal string into 32 binary digits, and enabling all 32 binary digits to participate into operation; carrying out ten times of circular process on the 32 binary digits, and obtaining a 10-bit character string; respectively carrying out ten times of circular process on the 8-bit character strings of the four sections, and obtaining four 10-bit character strings; combining a character string array of which the length is 4 by the four 10-bit character strings, and randomly taking a short address. The invention has the beneficial effects that the method for converting the long address into the short addresses is provided, the repetitive rate of a traditional algorithm for converting the long address into the short addresses can be greatly reduced, and the specific value of repeated short address number to a total request number within a certain time range is reduced from 1.6% to 5.024e<-5>.

Description

A kind ofly reduce the method that long address is converted to short address repetition rate
Technical field
The present invention relates to the method that long address is converted to short address.More particularly, the present invention relates to and a kind ofly reduce the method that long address is converted to short address repetition rate.
Background technology
The rise of short address comes from microblogging, due to the restriction of main flow microblogging 140 word, so short address comes into vogue gradually, and range of application is more and more wider, this is because address itself concerning user without any meaning, user is only concerned about the content that it points to, so address is more simple better.
Short address benefit is a lot, and such as it can shorten link length, make mobile phone, microblogging shares more convenient etc., but short address needs to jump to original long address just, also causes short address to there is shortcoming, namely cannot check original long address.
The algorithm that traditional long address is converted to short address is: 1) long address MD5 is generated 32 signature strings, be divided into 4 sections, every section of 8 bytes; 2) to these four sections of circular treatment, get 8 bytes, he is regarded as 16 system strings and 0x3fffffff (30 1) and operation, ignore process namely more than 30; 3) these 30 are divided into 6 sections, and the numeral of every 5 obtains specific character as alphabetic(al) index, carry out acquisition 6 character strings successively; 4) total MD5 string can obtain 46 bit strings; Any one of getting the inside just can be used as the short address of this long address.
When large concurrent big data quantity, traditional long address is converted to the data that short address algorithm can produce repetition, and namely different long addresses generates identical short address, and what result through that short address can not be correct navigates to original long address.
Summary of the invention
The present invention is directed to the problems referred to above, provide and a kind ofly reduce the method that long address is converted to short address repetition rate, the method can reduce the repetition rate that traditional long address is converted to short address algorithm greatly, and within the scope of certain hour, the ratio repeating short address number/total number of request is reduced to 5.024e from 1.6% -5
An object of the present invention is to have studied the method that long address is converted to short address.
A further object of the invention this method solves the problem that when traditional long address is converted to short address, repetition rate is higher, within the regular hour, makes the ratio of repetition short address number/total number of request be reduced to 5.024e by 1.6% of traditional algorithm -5.
A further object of the invention is by improving the step 2 of traditional algorithm and step 3, greatly reducing the repetition rate that long address is converted to short address.
For this reason, the invention provides and a kind ofly reduce the method that long address is converted to short address repetition rate, comprising:
Long address is generated 32 character strings by cryptographic algorithm, described 32 character strings are divided into four sections, every section comprises 8 character strings;
8 character strings described in every section are all regarded as 16 system strings, and is converted to 32 bit binary number, 32 bit binary number all participate in computing;
Described 32 bit binary number are done ten circular treatment, obtains 10 character strings;
To 8 character strings of described four sections, ten circular treatment respectively, obtain 4 10 character strings;
Described 4 10 character strings, being combined into a length is the character string dimension of 4, gets a short address at random.
Preferably, wherein, the basic character array providing in advance and form short address is also comprised.
Preferably, wherein, described cryptographic algorithm is MD5 algorithm.
Preferably, wherein, described long address is the whole address of request.
Preferably, wherein, carrying out ten circular treatment concrete steps to 8 character strings described in every section is:
Step one, described 32 bit binary number and parameter are carried out and computing, obtain the first number, described first number when first character obtaining correspondence in basic character array that index; Described 32 bit binary number are moved to right three and obtains first new numeral, complete first time circulation;
Step 2, the new numeral in described step one and described parameter to be carried out and computing, obtain the second number, described second number is obtained corresponding second character when index in basic character array; Described first new numeral is moved to right three and obtains second new numeral and complete twice circulation;
Step 3, circulates ten times according to the computing method of described step 2, can obtain described 10 character string.
Preferably, wherein, described parameter is 0x0000003D.
Preferably, wherein, the length of described basic character array is 62, and described basic character array comprises numeral and the upper and lower case letter of 0 to 9.
The present invention at least comprises following beneficial effect: the invention provides and a kind ofly reduce the method that long address is converted to the repetition rate of short address, in the method, step 2 in the method for short address is converted to the long address of tradition and step 3 is improved, classic method obtains 30 (ignoring namely more than 30) through step 2, then the operation of step 3 is carried out, and step 2 of the present invention retains all, and participate in the computing of step 3; The long address of request forwarding is generated 32 character strings through md5 encryption algorithm by the present invention, 32 character strings obtain through ten Inner eycle and four outer circulations 10 character strings that length is 4, by method of the present invention, the ratio of the repetition short address number within the scope of the regular hour/total number of request are reduced to 5.024e by 1.6% of traditional algorithm -5, solve the problem that when traditional long address is converted to short address, repetition rate is higher, greatly reduce the repetition rate that long address is converted to short address.
Part is embodied by explanation below by other advantage of the present invention, target and feature, part also will by research and practice of the present invention by those skilled in the art is understood.
Accompanying drawing explanation
Fig. 1 reduces the process flow diagram that long address is converted to short address repetition rate method in one embodiment of the present of invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail, can implement according to this with reference to instructions word to make those skilled in the art.
Fig. 1 shows and a kind ofly reduces the method way of realization that long address is converted to short address repetition rate according to of the present invention, comprising: through 32 character strings that MD5 algorithm generates, 10 Inner eycle and 4 outer circulations are carried out to long address and generates four different 10 short addresses, be specially:
(1) long address is generated 32 character strings by cryptographic algorithm, 32 character strings are divided into four sections, every section comprises 8 character strings; Does is such as long address: http://XXXX.XXXX.com/app/GetAppDetail? appId=d8a701a0-067b-4e3a-abba-6d0bb40214ca, generates 32 character strings through cryptographic algorithm, and such as described 32 character strings are digital and alphabetical.
(2) comprise in every section 8 character strings are all regarded as 16 system strings, and 8 of 16 systems character strings are converted to 32 bit binary number, 32 bit binary number all participate in next step computing;
(3) 32 bit binary number in (2) are done ten circular treatment, obtain 10 character strings; The short address such as generated is: 7mFnr6IZJf;
(4) to 8 character strings, ten circular treatment respectively of four sections in (1), 4 10 character strings are obtained;
(5) described 4 10 character strings, being combined into a length is the character string dimension of 4, gets a short address at random.
In another kind of example, also comprise the basic character array providing in advance and form short address.
In another kind of example, the cryptographic algorithm generating 32 character strings through cryptographic algorithm is MD5 algorithm.
In another kind of example, the long address in (1) is the whole long address of request.
In another kind of example, carrying out ten circular treatment concrete steps to 8 character strings of 16 systems comprised in every section is:
Step one, described 32 bit binary number and parameter are carried out and computing, obtain the first number, the first number when first character obtaining correspondence in basic character array that index; Described 32 bit binary number are moved to right three and obtains first new numeral, complete first time circulation;
Step 2, the new numeral in described step one and described parameter to be carried out and computing, obtain the second number, described second number is obtained corresponding second character when index in basic character array; Described first new numeral is moved to right three and obtains second new numeral and complete twice circulation;
Step 3, circulates ten times according to the computing method of described step 2, can obtain described 10 character string.
In another kind of example, described parameter is 0x0000003D.
In another kind of example, the number forming the basic character array of short address is 62, comprises numeral and A-Z, the a-z of 0 to 9.
Although embodiment of the present invention are open as above, it is not restricted to listed in instructions and embodiment utilization.It can be applied to various applicable the field of the invention completely.For those skilled in the art, can easily realize other amendment.Therefore do not deviating under the universal that claim and equivalency range limit, the present invention is not limited to specific details and illustrates here and the legend described.

Claims (7)

1. reduce the method that long address is converted to short address repetition rate, wherein, comprising:
Long address is generated 32 character strings by cryptographic algorithm, described 32 character strings are divided into four sections, every section comprises 8 character strings;
8 character strings described in every section are all regarded as 16 system strings, and is converted to 32 bit binary number, 32 bit binary number all participate in computing;
Described 32 bit binary number are done ten circular treatment, obtains 10 character strings;
To 8 character strings of described four sections, ten circular treatment respectively, obtain 4 10 character strings;
Described 4 10 character strings, being combined into a length is the character string dimension of 4, gets a short address at random.
2. the long address of reduction as claimed in claim 1 is converted to the method for short address repetition rate, wherein, also comprises the basic character array providing in advance and form short address.
3. the long address of reduction as claimed in claim 1 is converted to the method for short address repetition rate, and wherein, described cryptographic algorithm is MD5 algorithm.
4. the long address of reduction as claimed in claim 1 is converted to the method for short address repetition rate, and wherein, described long address is the whole address of request.
5. the long address of reduction as claimed in claim 2 is converted to the method for short address repetition rate, and wherein, carrying out ten circular treatment concrete steps to 8 character strings described in every section is:
Step one, described 32 bit binary number and parameter are carried out and computing, obtain the first number, described first number when first character obtaining correspondence in basic character array that index; Described 32 bit binary number are moved to right three and obtains first new numeral, complete first time circulation;
Step 2, the new numeral in described step one and described parameter to be carried out and computing, obtain the second number, described second number is obtained corresponding second character when index in basic character array; Described first new numeral is moved to right three and obtains second new numeral and complete twice circulation;
Step 3, circulates ten times according to the computing method of described step 2, can obtain described 10 character string.
6. the long address of reduction as claimed in claim 5 is converted to the method for short address repetition rate, and wherein, described parameter is 0x0000003D.
7. the long address of reduction as claimed in claim 2 is converted to the method for short address repetition rate, and wherein, the length of described basic character array is 62, and described basic character array comprises numeral and the upper and lower case letter of 0 to 9.
CN201510043556.3A 2015-01-28 2015-01-28 It is a kind of to reduce the method that long address conversion is short address repetitive rate Active CN104657432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510043556.3A CN104657432B (en) 2015-01-28 2015-01-28 It is a kind of to reduce the method that long address conversion is short address repetitive rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510043556.3A CN104657432B (en) 2015-01-28 2015-01-28 It is a kind of to reduce the method that long address conversion is short address repetitive rate

Publications (2)

Publication Number Publication Date
CN104657432A true CN104657432A (en) 2015-05-27
CN104657432B CN104657432B (en) 2018-01-23

Family

ID=53248560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510043556.3A Active CN104657432B (en) 2015-01-28 2015-01-28 It is a kind of to reduce the method that long address conversion is short address repetitive rate

Country Status (1)

Country Link
CN (1) CN104657432B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391587A (en) * 2017-06-23 2017-11-24 努比亚技术有限公司 Link is shared and access method, server, terminal and computer-readable storage medium
CN110365806A (en) * 2019-06-06 2019-10-22 无线生活(杭州)信息科技有限公司 Network address conversion method and device
CN111597472A (en) * 2019-02-20 2020-08-28 苏州济趣文化传播有限公司 Method for converting long address into short address
CN114553825A (en) * 2022-02-23 2022-05-27 福建天晴数码有限公司 Method and system for converting webpage address into short address
US11461301B2 (en) 2020-09-13 2022-10-04 International Business Machines Corporation Database index optimization
CN115587609A (en) * 2022-09-27 2023-01-10 深圳市智码通科技有限公司 Short-link two-dimensional code generation method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090092064A1 (en) * 2000-03-03 2009-04-09 Fan Jason C Routing switch detecting change in session identifier before reconfiguring routing table
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
AU2012100308A4 (en) * 2012-03-21 2012-04-19 Talbot, Phillip David Dynamic QR Code System
CN102651714A (en) * 2011-02-24 2012-08-29 腾讯科技(深圳)有限公司 Security method and device for mail addresses
CN102917307A (en) * 2012-10-16 2013-02-06 北京小米科技有限责任公司 Information transmission method and device, UE and communication system
CN104104649A (en) * 2013-04-02 2014-10-15 阿里巴巴集团控股有限公司 Webpage logging method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090092064A1 (en) * 2000-03-03 2009-04-09 Fan Jason C Routing switch detecting change in session identifier before reconfiguring routing table
KR20110132849A (en) * 2010-06-03 2011-12-09 주식회사 다음커뮤니케이션 Device and method for transformation url
CN102651714A (en) * 2011-02-24 2012-08-29 腾讯科技(深圳)有限公司 Security method and device for mail addresses
AU2012100308A4 (en) * 2012-03-21 2012-04-19 Talbot, Phillip David Dynamic QR Code System
CN102917307A (en) * 2012-10-16 2013-02-06 北京小米科技有限责任公司 Information transmission method and device, UE and communication system
CN104104649A (en) * 2013-04-02 2014-10-15 阿里巴巴集团控股有限公司 Webpage logging method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XYZ_LMN: "URL短地址压缩算法 微博短地址原理解析 (Java实现)", 《CSDN博客》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391587A (en) * 2017-06-23 2017-11-24 努比亚技术有限公司 Link is shared and access method, server, terminal and computer-readable storage medium
CN111597472A (en) * 2019-02-20 2020-08-28 苏州济趣文化传播有限公司 Method for converting long address into short address
CN110365806A (en) * 2019-06-06 2019-10-22 无线生活(杭州)信息科技有限公司 Network address conversion method and device
CN110365806B (en) * 2019-06-06 2022-05-10 无线生活(杭州)信息科技有限公司 Website conversion method and device
US11461301B2 (en) 2020-09-13 2022-10-04 International Business Machines Corporation Database index optimization
CN114553825A (en) * 2022-02-23 2022-05-27 福建天晴数码有限公司 Method and system for converting webpage address into short address
CN114553825B (en) * 2022-02-23 2023-05-23 福建天晴数码有限公司 Method and system for converting webpage address into short address
CN115587609A (en) * 2022-09-27 2023-01-10 深圳市智码通科技有限公司 Short-link two-dimensional code generation method and device

Also Published As

Publication number Publication date
CN104657432B (en) 2018-01-23

Similar Documents

Publication Publication Date Title
CN104657432A (en) Method for reducing repetitive rate of converting long address into short addresses
US10686589B2 (en) Combining hashes of data blocks
CN106209358B (en) A kind of realization system and method for the SM4 key schedule based on long key
CN1154293C (en) Method of and apparatus for encrypting signals for transmission
CN108111295B (en) Homomorphic encryption method based on analog-to-analog operation
CN107819569A (en) The encryption method and terminal device of log-on message
US9521128B2 (en) Using a hash of a filename to control encoding/decoding of a digital file
US20230401666A1 (en) System and method for encoding and authenticating a digital image
JP2016504874A5 (en)
CN115051798A (en) Random number generation method and device, electronic equipment and storage medium
US20160048531A1 (en) Adaptive Rate Compression Hash Processor
CN105279198A (en) Data table storage method, data table modification method, data table query method and data table statistical method
CN110704854A (en) Stream type encryption method aiming at text data reserved format
CN112487253A (en) User invitation code generation method, verification method, device, equipment and storage medium
CN104573557A (en) Cloud data storage method and device and cloud data recovery method
CN104077374B (en) A kind of method and device for realizing the storage of IP disk files
CN104679507B (en) The generation method and device of NAND Flash programmable device burning image files
US11567661B2 (en) Virtual memory management method and processor
CN105933120A (en) Spark platform-based password hash value recovery method and device
CN113765650A (en) Data encryption and decryption method and device, electronic equipment and storage medium
CN104036141A (en) Open computing language (OpenCL)-based red-black tree acceleration algorithm
CN108155985A (en) A kind of encipher-decipher method, device and user terminal
CN103077498A (en) Image encryption algorithm based on shift transformation
CN109951275A (en) Key generation method, device, computer equipment and storage medium
US11733971B2 (en) System and method of managing pseudo-random number generation in a multiprocessor environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant