IP Library Granted Patent US 10,489,117
Granted Patent B2
US 10,489,117 · App. 16/000,146 · Granted Nov 26, 2019

Method and apparatus for generating random character string

Inventor: Xinyu Zhang (Hangzhou, CN)
Assignee: ALIBABA GROUP HOLDING LIMITED
G06F7/58G06F16/90344G06F17/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,489,117
App. No.
16/000,146
Granted
Nov 26, 2019
Kind
B2
Abstract

Method and apparatus for generating a random character string are disclosed. The method comprises: acquiring a value of a sequence number variable in a database, wherein the value of the sequence variable is a sequence comprising basic numerals in a basic numeral set, and the acquired value of the sequence variable is different from values of the sequence variable acquired at any other times; and mapping the sequence into a character string as a generated random character string according to an one-to-one mapping relationship between characters contained in a character set and the basic numerals contained in the basic numeral set.

Claims (51)

1. A method for generating a random character string, on a device, in response to a generation request from a peripheral device, comprising:

acquiring, at a service layer of the device, a value of a sequence variable in a database, wherein the acquired value of the sequence variable is a sequence comprising basic numerals from a basic numeral set, and the acquired value of the sequence variable is incremented from a previous value of the sequence variable, the acquired value being different from values of the sequence variable acquired at any other times; and

mapping, at an algorithm layer of the device, the sequence variable into a character string as a generated random character string according to a one-to-one mapping relationship between characters contained in a character set and the basic numerals contained in the basic numeral set.

2. The method according to claim 1 , wherein the acquiring a value of a sequence variable in a database comprises:

receiving a generation request for generating a random character string;

according to a type of the generation request, determining a preset sequence variable that corresponds to the type from at least one sequence variable in the database; and

acquiring a value of the sequence variable corresponding to the type, wherein the acquired value of the sequence variable is different from values of the sequence variable corresponding to the type that are acquired at any other times.

3. The method according to claim 1 , wherein: a number of the characters contained in the character set is N, the basic numeral set is a basic numeral set corresponding to a base N numeral system, comprising the basic numerals of integers 0 to N−1, and N is an integer no smaller than 2.

4. The method according to claim 3 , wherein the acquiring a value of a sequence variable in a database, wherein the value of the sequence variable is a sequence comprising basic numerals from a basic numeral set comprises:

acquiring the value of the sequence variable in the database; and

in response to determining that the acquired value of the sequence variable is not a base-N number, converting the value of the sequence variable to a base-N number, the base-N number being a sequence comprising the basic numerals in the basic numeral set corresponding to the base N numeral system.

5. The method according to claim 1 , wherein the mapping the sequence into a character string comprises:

converting each basic numeral in the sequence to a character comprised in the character set and mapped to the basic numeral; and

according to a sequence of the characters in the sequence after conversion, connecting the characters in series to form a character string.

6. The method according to claim 1 , wherein the acquiring a value of the sequence variable comprises:

acquiring the value of the sequence variable by using an instruction that allows an auto increment of the sequence variable and then acquires the value of the sequence variable.

7. The method according to claim 1 , wherein the instruction comprises a NextVal instruction.

8. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform a method for generating a random character string, on a device, in response to a generation request from a peripheral device, the method comprising:

acquiring, at a service layer of the device, a value of a sequence variable in a database, wherein the acquired value of the sequence variable is a sequence comprising basic numerals from a basic numeral set, and the acquired value of the sequence variable is incremented from a previous value of the sequence variable, the acquired value being different from values of the sequence variable acquired at any other times; and

mapping, at an algorithm layer of the device, the sequence variable into a character string as a generated random character string according to a one-to-one mapping relationship between characters contained in a character set and the basic numerals contained in the basic numeral set.

9. The non-transitory computer-readable storage medium according to claim 8 , wherein the acquiring a value of a sequence variable in a database comprises:

receiving a generation request for generating a random character string;

according to a type of the generation request, determining a preset sequence variable that corresponds to the type from at least one sequence variable in the database; and

acquiring a value of the sequence variable corresponding to the type, wherein the acquired value of the sequence variable is different from values of the sequence variable corresponding to the type that are acquired at any other times.

10. The non-transitory computer-readable storage medium according to claim 8 , wherein: a number of the characters contained in the character set is N, the basic numeral set is a basic numeral set corresponding to a base N numeral system, comprising the basic numerals of integers 0 to N−1, and N is an integer no smaller than 2.

11. The non-transitory computer-readable storage medium according to claim 10 , wherein the acquiring a value of a sequence variable in a database, wherein the value of the sequence variable is a sequence comprising basic numerals from a basic numeral set comprises:

acquiring the value of the sequence variable in the database; and

in response to determining that the acquired value of the sequence variable is not a base-N number, converting the value of the sequence variable to a base-N number, the base-N number being a sequence comprising the basic numerals in the basic numeral set corresponding to the base N numeral system.

12. The non-transitory computer-readable storage medium according to claim 8 , wherein the mapping the sequence into a character string comprises:

converting each basic numeral in the sequence to a character comprised in the character set and mapped to the basic numeral; and

according to a sequence of the characters in the sequence after conversion, connecting the characters in series to form a character string.

13. The non-transitory computer-readable storage medium according to claim 8 , wherein the acquiring a value of the sequence variable comprises:

acquiring the value of the sequence variable by using an instruction that allows an auto increment of the sequence variable and then acquires the value of the sequence variable.

14. The non-transitory computer-readable storage medium according to claim 8 , wherein the instruction comprises a NextVal instruction.

15. A system comprising a peripheral device, a service layer, and an algorithm layer, for generating a random character string, comprising a processor and a non- transitory computer-readable storage medium storing instructions that, when executed by the processor, cause the system to perform a method for generating a random character string, the method comprising:

receiving, at a service layer, from the peripheral device, a generation request for generating a random character string;

in response to receiving the generation request, acquiring, at the service layer, a value of a sequence variable in a database, wherein the value of the sequence variable is a sequence comprising basic numerals from a basic numeral set, and the acquired value of the sequence variable is incremented from a previous value of the sequence variable, the acquired value being different from values of the sequence variable acquired at any other times; and

mapping, at the algorithm layer, the sequence variable into a character string as a generated random character string according to a one-to-one mapping relationship between characters contained in a character set and the basic numerals contained in the basic numeral set.

16. The system according to claim 15 , wherein the acquiring a value of a sequence variable in a database comprises:

receiving a generation request for generating a random character string;

according to a type of the generation request, determining a preset sequence variable that corresponds to the type from at least one sequence variable in the database; and

acquiring a value of the sequence variable corresponding to the type, wherein the acquired value of the sequence variable is different from values of the sequence variable corresponding to the type that are acquired at any other times.

17. The system according to claim 15 , wherein: a number of the characters contained in the character set is N, the basic numeral set is a basic numeral set corresponding to a base N numeral system, comprising the basic numerals of integers 0 to N−1, and N is an integer no smaller than 2.

18. The system according to claim 17 , wherein the acquiring a value of a sequence variable in a database, wherein the value of the sequence variable is a sequence comprising basic numerals from a basic numeral set comprises:

acquiring the value of the sequence variable in the database; and

in response to determining that the acquired value of the sequence variable is not a base-N number, converting the value of the sequence variable to a base-N number, the base-N number being a sequence comprising the basic numerals in the basic numeral set corresponding to the base N numeral system.

19. The system according to claim 15 , wherein the mapping the sequence into a character string comprises:

converting each basic numeral in the sequence to a character comprised in the character set and mapped to the basic numeral; and

according to a sequence of the characters in the sequence after conversion, connecting the characters in series to form a character string.

20. The system according to claim 15 , wherein the acquiring a value of the sequence variable comprises:

acquiring the value of the sequence variable by using an instruction that allows an auto increment of the sequence variable and then acquires the value of the sequence variable.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053796/0281 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 3, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053702/0392 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 2, 2018
From: ZHANG, XINYU
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 046251/0386 →
Priority Claims (1)
CN 2015 1 0892216 · Dec 7, 2015 · national
Continuity (2)
Continuation PCTCN2016108198 · Dec 1, 2016
Related Publication 20180285078A1 · Oct 4, 2018