WO2017097159A1 - 一种随机字符串生成方法及装置 - Google Patents

一种随机字符串生成方法及装置 Download PDF

Info

Publication number
WO2017097159A1
WO2017097159A1 PCT/CN2016/108198 CN2016108198W WO2017097159A1 WO 2017097159 A1 WO2017097159 A1 WO 2017097159A1 CN 2016108198 W CN2016108198 W CN 2016108198W WO 2017097159 A1 WO2017097159 A1 WO 2017097159A1
Authority
WO
WIPO (PCT)
Prior art keywords
sequence
value
sequence variable
basic
variable
Prior art date
Application number
PCT/CN2016/108198
Other languages
English (en)
French (fr)
Inventor
张新宇
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to KR1020187018758A priority Critical patent/KR102111871B1/ko
Priority to JP2018548262A priority patent/JP6636647B2/ja
Priority to AU2016367801A priority patent/AU2016367801B2/en
Priority to SG11201804494PA priority patent/SG11201804494PA/en
Priority to EP16872350.0A priority patent/EP3367254A4/en
Priority to MYPI2018702157A priority patent/MY194056A/en
Publication of WO2017097159A1 publication Critical patent/WO2017097159A1/zh
Priority to US16/000,146 priority patent/US10489117B2/en
Priority to PH12018501222A priority patent/PH12018501222A1/en
Priority to AU2019101559A priority patent/AU2019101559A4/en

Links

Images

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • 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/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators

Definitions

  • the present application relates to the field of electrical digital data processing, and in particular, to a random string generating method and apparatus.
  • Random strings are widely used in many businesses.
  • a service that widely uses a random string can be: a service that includes a cryptographic process, a service that needs to mark a large amount of business data, and the like.
  • each random string used by a service in order to prevent confusion of service data, it is generally required that each random string is unique within the scope of the service, that is, each random string should be different from each other.
  • a random algorithm can be used to generate a random string, and the generated random string is compared with the previously generated random string. If it is repeated, the generated random string can be discarded. And generate a random string again. In this way, for each random string in each random string generated and retained, the random string can be unique among the random strings (for convenience of description, the random string can be called Unique random string).
  • the embodiment of the present invention provides a method and an apparatus for generating a random string to solve the problem that the method for generating a unique random string in the prior art is inefficient.
  • the value of the sequence variable is a sequence consisting of a basic number in a predetermined basic number set, and the value of the sequence variable obtained this time is the same as this time The value of the sequence variable obtained at any one time is different;
  • mapping relationship that maps the sequence to a string as a generated random string.
  • An obtaining module configured to obtain a value of a sequence variable in the database, where the value of the sequence variable is a sequence consisting of a basic number in a predetermined basic number set, and the value of the sequence variable obtained this time is the same as this time
  • the values of the sequence variables obtained at any time other than the same are not the same;
  • a generating module configured to map the sequence into a character string as a generated random string according to a one-to-one mapping relationship between each character included in the set character set and each basic number included in the basic number set.
  • the value of the sequence variable obtained each time is different according to at least one technical solution, and correspondingly, the random string generated by each mapping according to the one-to-one mapping relationship is different, so It is no longer necessary to perform multiple comparisons of strings, which can improve the efficiency of generating unique random strings.
  • FIG. 1 is a flowchart of a method for generating a random string according to an embodiment of the present application
  • FIG. 2 is an implementation process of the method for generating a random string in an actual application scenario according to an embodiment of the present application
  • FIG. 3 is a structural diagram of a system that can be used to implement the process in FIG. 2 according to an embodiment of the present application;
  • FIG. 4 is a schematic structural diagram of a random string generating apparatus according to an embodiment of the present disclosure.
  • measures may be taken at the source of the process of generating a random character string, so that the generated random string is unique.
  • it is not necessary to perform verification after generating a random string which is not only efficient, but also does not waste resources for generating a random string. The details will be described below.
  • FIG. 1 is a process of a method for generating a random character string according to an embodiment of the present disclosure, and an execution body of the process may be a terminal or a server.
  • the terminal includes but is not limited to: a personal computer, a mobile phone, a tablet computer, a smart watch, a car mobile station, etc.
  • the server includes but is not limited to: a personal computer, a large and medium-sized computer, a computer cluster, and the like.
  • the executor of the present invention is not limited to the present application. For the convenience of description, the embodiments of the present application are described by taking the execution subject as a server as an example.
  • the process in FIG. 1 may be a process of generating a unique random string.
  • the process may be performed multiple times to obtain multiple random strings that are different from each other.
  • the process may be performed in a single-point environment, or may be performed in a distributed environment, and the like.
  • the execution environment of the process in this embodiment of the present application is not limited.
  • the process may specifically include the following steps:
  • S101 Acquire a value of a sequence variable in the database, where the value of the sequence variable is a sequence consisting of a basic number in a predetermined basic number set, and the value of the sequence variable acquired this time is different from the current one. The value of the sequence variable obtained at any one time is different.
  • the sequence variable may be any defined sequence variable in the database.
  • the sequence variable may be specifically defined in order to implement the function of generating a random string, or may be defined in order to implement other functions.
  • the database includes but is not limited to: Oracle, DB2, PostgreSQL and the like.
  • the sequence variable can generally be used as the primary key in the database.
  • the value of the sequence variable is obtained by using a specific instruction provided by the database, the value of the sequence variable obtained each time may be different.
  • the specific instruction may be an instruction for causing the sequence variable to increment according to a preset increment, and then incrementing the value, such as the NextVal instruction.
  • the uniqueness of the generated random string according to the value of the sequence variable acquired in the time may be guaranteed.
  • the sequence variable is a numerical variable.
  • the value can be expressed in decimal or in binary, octal, or hexadecimal. Take a sequence variable whose variable name is "seq" as an example.
  • the value of seq can be expressed as a decimal number 1
  • the sequence "123" consisting of 2, 3, that is, the decimal number 123; and in binary, the basic number set based on the binary number (the basic number included is: binary number 0, 1 ), the value of seq can be expressed as a sequence "01111011” composed of binary digits 0, 1, that is, a binary number 01111011; similarly, it can also be based on octal, hexadecimal, etc., for seq
  • the values are expressed and will not be repeated here.
  • the predetermined basic number set in step S101 may be a basic number set corresponding to a predetermined number of digits.
  • the value of the sequence variable may be a sequence of basic numbers in the basic number set. .
  • S102 Map the sequence into a character string as a generated random character string according to a one-to-one mapping relationship between each character included in the set character set and each basic number included in the basic number set.
  • the number of characters included in the character set may be the same as the number of basic numbers included in the basic number set, and the characters may be different from each other, and the basic numbers may be different from each other, in this case, A one-to-one mapping relationship between each character and each basic element can be successfully set.
  • the character set and/or the one-to-one mapping relationship may be set before the step S101 is performed, or may be set after the step S101 is performed.
  • the step S101 since the character set is determined prior to the value of the sequence variable, in order to ensure that the one-to-one mapping relationship between the character set and the basic number set corresponding to the value of the sequence variable can be successfully set, Determining, based on the number of characters included in the set of characters, a basic set of numbers used to represent the value of the sequence variable (the number of basic digits included in the set of basic numbers should be equal to the number of characters); similarly, for the latter In this case, the character set may be set according to the number of basic numbers included in the basic number set for indicating the value of the sequence variable in step S101.
  • the sequence is mapped to a character string
  • other characters may be inserted in the head, middle, or tail of the string according to a predetermined rule, and the inserted string is used as the generated random string.
  • the string of the sequence map can be part of the generated random string. It should be noted that other characters inserted should not affect the uniqueness of the generated random string.
  • Step S102 is replaced by the step of: mapping the sequence into a character string according to a one-to-one mapping relationship between each character string included in the set string set and each basic number included in the basic number set, as generated A random string.
  • the random strings generated by the mapping according to the one-to-one mapping relationship are different each time, so it is not necessary to perform multiple comparison characters.
  • the operation of the string can improve the efficiency of generating a unique random string, and can also save server resources.
  • the database since the database has provided specific instructions for making the value of the sequence variable acquired each time different, the implementation cost of the solution of the present application is small, and is beneficial to be implemented in more applicable scenarios.
  • different services may have different requirements on the complexity of the generated random string.
  • a random string containing only English letters can be generated to satisfy the requirement
  • a random string to be generated can include not only English letters, but also other types such as numbers and punctuation. character of.
  • the set of characters that meet the requirements can be set first, and then the steps in FIG. 1 are performed.
  • a basic set of numbers that can be mapped one by one with the set of characters can be determined for representing the value of the sequence variable in step S101.
  • the value of the sequence variable may be obtained, and then the basic number set representing the value may be generated and mapped to the basic number set.
  • the server may generate a random string for only one service, or may generate a random string for multiple services. In the latter case, multiple services have a requirement to obtain a unique random string. Since each of the multiple services is generally only used in the scope of the service, each random string is obtained.
  • the server can generate a random string unique to the service for each service, and does not necessarily ensure that all random strings generated by the server are globally unique.
  • acquiring the value of the sequence variable in the database may specifically include: receiving a random string generation request; and according to the type of the generation request, at least one sequence from the database In the variable, determining a predetermined sequence variable corresponding to the type; obtaining a value of the sequence variable corresponding to the type, wherein the value of the sequence variable acquired this time is acquired any time other than the current time The value of the sequence variable corresponding to the type is not the same.
  • the random string generation request can come from the need to obtain a random string service, and the generation request of different services.
  • the types can be different.
  • Each type of generation request can correspond to a sequence variable (the corresponding relationship can be preset or set after receiving the generation request), and the variable names of each sequence variable are mutually Different, you can distinguish each sequence variable by variable name.
  • the server can generate a random string unique to the corresponding service range for different services based on different sequence variables. In this way, each sequence variable can be prevented from being associated with an excessive number of services, thereby facilitating the control of each sequence variable.
  • a sequence variable can also be shared by multiple services, which is used to generate a random string for the multiple services, thereby reducing the overhead of the database.
  • each random string generated based on this sequence variable is unique within the scope of the plurality of services.
  • the server may generate a random character string for the service based on the character set set for the service.
  • mapping the sequence to a character string may include: converting, for each basic number in the sequence, each basic number into the character set, a character mapped to the basic element; the characters are concatenated to form a character string in accordance with the order of the converted characters in the converted sequence.
  • seq is the sequence "123", assuming that in the set of characters, the character mapped to the basic number "1" is '@', and the character mapped to the basic number "2" is '#', and the basic number " The 3" mapped character is '$'. These three characters can be serially concatenated to "@#$", and the sequence "123" can be mapped to the string "@#$".
  • the value may need to be converted in the hexadecimal so that the basic number set used to represent the converted value may be The set of characters is mapped one by one.
  • the predetermined basic number set is a basic number set corresponding to an N-ary number, and the basic number included is: an integer 0 to N-1; N is an integer not less than 2.
  • the value of the sequence variable in the database is obtained, wherein the value of the sequence variable is a sequence consisting of basic numbers in a predetermined basic number set, and may specifically include: acquiring a sequence in the database a value of the variable; when it is determined that the obtained value of the sequence variable is not an N-ary number, the value of the sequence number sequence variable is converted into an N-ary number, and the N-ary number is N-ary corresponding A sequence of basic numbers in a basic set of numbers.
  • the following examples are given.
  • each bracket contains A mapping pair, each pair of mappings comprising a character contained in the set of characters and a basic number in the set of basic numbers.
  • the value of the sequence variable obtained this time is a decimal number of 11002 instead of an octal number.
  • the basic set of numbers can represent the value of the sequence variable as the sequence "25372".
  • the sequence "25372" can be converted into the character string "dam3d" according to the character set and the one-to-one mapping relationship as the random character string generated this time.
  • an instruction for incrementing the sequence variable and then taking the value may be used to obtain the value of the sequence variable, so that the sequence variable is acquired each time. Values are different from each other.
  • the instruction to increment the sequence variable and then take the value can be the NextVal instruction. It should be noted that the name of the instruction is not limited in the embodiment of the present application, and “NextVal” is an example of the name of the instruction.
  • the set character set contains N characters, and the character set is created and saved in advance in the form of an array.
  • the process can include the following steps:
  • S201 Create an array of length N, assuming N is not 10, and the array contains N characters different from each other.
  • S202 Use the NextVal instruction to obtain the value of the sequence variable of the database, where the value is a decimal number.
  • S203 Convert the value of the obtained sequence variable from a decimal number to an N-ary number.
  • step S203 may be omitted and need not be performed.
  • S204 Map a sequence corresponding to the N-ary number converted into a character string according to a one-to-one mapping relationship between each character included in the basic number set corresponding to the N-ary character set in the array, and The generated random string.
  • the sequence "25372" can be mapped to the string "dam3d" as a generated random string.
  • the embodiment of the present application further provides a structural diagram of a system that can be used to implement the process in FIG. 2, as shown in FIG.
  • the system can include peripherals, service layers, algorithm layers, and database layers.
  • the processing logic of each layer can be implemented on the same device (such as a server) or on different devices.
  • the arrow line segments in FIG. 3 may represent the execution order of the processing logic of the process of generating a random character string, and the description of the steps in the process is performed within the blocks connected at both ends of the arrow line segment. Mainly can include the following steps:
  • the peripheral device sends a random string generation request to the service layer
  • the service layer in response to the generation request, acquires a predetermined value of the sequence variable corresponding to the type of the generation request from the database layer by using the NextVal instruction, and returns the value to the service layer;
  • the service layer passes the value of the sequence variable to the algorithm layer
  • the algorithm layer maps the sequence corresponding to the value of the sequence variable to a random string based on a preset set of characters, and returns the result to the service layer;
  • the service layer sends the generated random string and other related information to the database, so that the database can write and save the data;
  • the service layer returns the generated random string to the periphery
  • the generated random string is obtained at the periphery, and the process ends.
  • FIG. 3 is a structural diagram of a system that can be used to implement the method provided by the embodiment of the present application.
  • other systems different from the system structure for implementing the method may be further provided.
  • the embodiments of the present application do not limit the structure of a system that can be used to implement the method.
  • sequence variable in addition to the sequence variable of the database, similarly, the sequence variable can be replaced with other specific variables for implementing the solution of the present application.
  • the other specific variables may be variables for recording milliseconds of system time, or variables specifically defined and maintained for generating random strings, and the like.
  • the embodiment of the present application further provides a corresponding random string generating device, as shown in FIG. 4 .
  • FIG. 4 is a schematic structural diagram of a random string generating apparatus according to an embodiment of the present disclosure, which specifically includes:
  • the obtaining module 401 is configured to obtain a value of a sequence number sequence variable in the database, where the value of the sequence variable is a sequence consisting of basic numbers in a predetermined basic number set, and the value of the sequence variable acquired this time The value of the sequence variable obtained at any time other than this time is different;
  • the generating module 402 is configured to map the sequence into a character string as a generated random string according to a one-to-one mapping relationship between each character included in the set character set and each basic number included in the basic number set. .
  • the obtaining module 401 is specifically configured to: receive a random string generation request; determine, according to the type of the generation request, a predetermined sequence variable corresponding to the type from at least one sequence variable in the database; The value of the sequence variable corresponding to the type, wherein the value of the sequence variable acquired this time is different from the value of the sequence variable corresponding to the type acquired at any time other than the current time.
  • the predetermined basic number set is a basic number set corresponding to N numbers, and the basic numbers included are: integer 0 to N-1; wherein N is not less than An integer of 2;
  • the obtaining module 401 is specifically configured to: obtain a value of a sequence variable in the database; and when determining that the obtained value of the sequence variable is not an N-ary number, converting the value of the sequence variable into an N-number
  • the N-ary number is a sequence consisting of basic numbers in a basic number set corresponding to N-ary numbers.
  • the generating module may be specifically configured to: for each basic number in the sequence, convert each basic number into a character included in the character set and mapped to the basic number; according to each character converted In the sequence in the converted sequence, the characters are concatenated to form a character string.
  • the obtaining module may be specifically configured to: obtain an identifier of the sequence variable by using an instruction for incrementing the sequence variable and then taking the value.
  • the specified variable may be a sequence sequence variable of a specified database, or may be other specific variables such as a variable used to record the number of milliseconds of the system time.
  • the device shown in FIG. 4 above may be located on the terminal and the server.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention may be embodied in one or more of the computer-usable program code embodied therein.
  • the computer is in the form of a computer program product embodied on a storage medium, including but not limited to disk storage, CD-ROM, optical storage, and the like.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • Computer readable media does not include a temporary storage computer readable medium as defined herein (transitory media), such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Stored Programmes (AREA)

Abstract

一种随机字符串生成方法及装置,该方法包括:获取数据库中的序列号sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同(S101);根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串(S102)。由于每次获取到的sequence变量的值均不相同,相应的,每次根据所述一一映射关系映射生成的随机字符串也均不相同,因此,不必再执行多次对比字符串的操作,从而可以提高生成唯一随机字符串的效率。

Description

一种随机字符串生成方法及装置
本申请要求2015年12月07日递交的申请号为201510892216.8、发明名称为“一种随机字符串生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电数字数据处理领域,尤其涉及一种随机字符串生成方法及装置。
背景技术
随机字符串在很多业务中被广泛地使用。例如,广泛使用随机字符串的业务可以是:包含密码术过程的业务、需要对大量业务数据进行标记的业务,等等。
目前,对于业务使用的各随机字符串,为了防止业务数据混淆,一般要求各随机字符串在该业务的范围内具有唯一性,也即,各随机字符串应互不相同。
在现有技术中,一般可以采用随机算法生成随机字符串,并将本次生成的随机字符串与之前生成的各随机字符串进行对比,若重复,则可以将本次生成的随机字符串丢弃,并再次生成随机字符串。如此,可以使得对于生成并保留下来的各随机字符串中的每个随机字符串,该随机字符串在所述各随机字符串中具有唯一性(为了便于描述,可以将该随机字符串称为唯一随机字符串)。
但是,当已生成并保留下来的各随机字符串的数量较多时,在生成随机字符串时,需要执行多次对比字符串的操作,以防止随机字符串重复,因此,这种生成唯一随机字符串的方法效率很低。
发明内容
本申请实施例提供一种随机字符串生成方法及装置,用以解决现有技术中生成唯一随机字符串的方法效率很低的问题。
本申请实施例提供的一种随机字符串生成方法,包括:
获取数据库中的序列号(sequence)变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同;
根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一 一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
本申请实施例提供的一种随机字符串生成装置,包括:
获取模块,用于获取数据库中的sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同;
生成模块,用于根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
本申请实施例通过上述至少一种技术方案,由于每次获取到的sequence变量的值均不相同,相应的,每次根据所述一一映射关系映射生成的随机字符串也均不相同,因此,不必再执行多次对比字符串的操作,从而可以提高生成唯一随机字符串的效率。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例提供的随机字符串生成方法的过程;
图2为本申请实施例提供的在实际应用场景下,所述随机字符串生成方法的一种实施过程;
图3为本申请实施例提供的可用于实现图2中的过程的一种系统的结构图;
图4为本申请实施例提供的随机字符串生成装置结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在背景技术中已经提到,目前生成唯一随机字符串时,是采用后验方式(先生成随机字符串,再校验该随机字符串是否唯一),确保生成并保留下的随机字符串的唯一性。对于某次生成的随机字符串,若该随机字符串与已保留的任一随机字符串相同,则将该次生成的随机字符串丢弃,在这种情况下,不仅效率很低,而且还浪费了用于生成随机字符串的资源。
为了解决以上问题,在本申请实施例中,可以在生成随机字符串的过程的源头处就采取措施,使得生成的随机字符串是唯一的。这样的话,可以不用在生成随机字符串后再进行校验,不仅效率较高,而且也不会浪费用于生成随机字符串的资源。下面进行具体说明。
图1为本申请实施例提供的随机字符串生成方法的过程,该过程的执行主体可以是终端或服务器。所述终端包括但不限于:个人计算机、手机、平板电脑、智能手表、车载移动台等;所述服务器包括但不限于:个人计算机、大中型计算机、计算机集群等。执行主体并不构成对本申请的限定,为了便于描述,本申请实施例均以执行主体是服务器为例进行说明。
在本申请实施例中,图1中的过程可以是生成一个唯一随机字符串的过程,在实际应用中,可以通过多次执行该过程,获取到多个互不相同的随机字符串。该过程可以是在单点环境下执行的,也可以是在分布式环境下执行的,等等;本申请实施例对该过程的执行环境并不做限定。
该过程具体可以包括以下步骤:
S101:获取数据库中的sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同。
在本申请实施例中,sequence变量可以是数据库中的、任一已定义的sequence变量。sequence变量可以是为了实现生成随机字符串的功能专门定义的,也可以是原本为了实现其他功能定义的,本申请实施例对此并不做限定。所述数据库包括但不限于:Oracle、DB2、PostgreSQL等数据库。
sequence变量一般可以作为数据库中的主键(Primary Key)。当采用数据库提供的特定指令获取sequence变量的值时,可以使得每次获取到的该sequence变量的值均不相同。所述特定指令可以是用于让sequence变量按照预设自增步长,自增后再取值的指令,如NextVal指令。
在本申请实施例中,可以基于每次获取的sequence变量的值的唯一性,保证根据该次获取的sequence变量的值,对应生成的随机字符串的唯一性。
由于上述的特定指令是数据库已经实现的功能部分,因此,在实施本申请的方案时,并不需要我们自己开发额外的功能模块,以用于保证在步骤S101中每次获取的sequence变量的值互不相同,从而可以减小本申请的方案的实施成本。
在本申请实施例中,sequence变量是数值型变量。对于数值型变量,其值可以采用10进制进行表示,也可以采用2进制、8进制、16进制等进制进行表示。以一个变量名称为“seq”的sequence变量为例进行说明。
在10进制下,假定seq=123,则基于10进制对应的基本数字集合(包含的基本数字为:10进制数字0~9),可以将seq的值表示为由10进制数字1、2、3构成的序列“123”,也即,10进制数123;而在2进制下,基于2进制对应的基本数字集合(包含的基本数字为:2进制数字0、1),可以将seq的值表示为由2进制数字0、1构成的序列“01111011”,也即,2进制数01111011;类似的,还可以基于8进制、16进制等,对seq的值进行表示,在此不一一赘述。
根据上面的说明,步骤S101中的所述预定基本数字集合可以是一种预定的数字进制对应的基本数字集合,相应的,sequence变量的值可以是该基本数字集合中的基本数字构成的序列。
S102:根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
在本申请实施例中,字符集合中包含的各字符的数量与基本数字集合中包含的各基本数字的数量可以相同,且各字符可以互不相同,各基本数字可以互不相同,这样的话,可以成功地设定各字符与各基本元素之间的一一映射关系。
字符集合和/或一一映射关系可以是在执行步骤S101之前设定的,也可以是在执行步骤S101之后设定的。对于前一种情况,在执行步骤S101时,由于字符集合是先于sequence变量的值确定的,为了保证可以成功设定字符集合与sequence变量的值对应的基本数字集合的一一映射关系,可以根据字符集合中包含的各字符的数量,确定用于表示sequence变量的值的基本数字集合(该基本数字集合中包含的基本数字的数量应与各字符的数量相等);类似地,对于后一种情况,则可以根据步骤S101中用于表示sequence变量的值的基本数字集合包含的各基本数字的数量,设定字符集合。
另外,在实际应用中,序列映射为字符串后,还可以按照预定规则,在该字符串头部、中部或尾部插入其他的字符,再将插入后的该字符串作为生成的随机字符串,在这种情况下,序列映射的字符串可以是生成的随机字符串的一部分。需要说明的是,插入的其他的字符应当不影响生成的随机字符串的唯一性。
在本申请实施例中,除了可以采用设定的字符集合映射所述序列以外,类似地,也可以采用设定的字符串集合映射所述序列,生成随机字符串。在这种情况下,可以将步 骤S102替换为以下步骤:根据设定的字符串集合中包含的各字符串与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
通过上述方法,由于每次获取到的sequence变量的值均不相同,相应的,每次根据所述一一映射关系映射生成的随机字符串也均不相同,因此,不必再执行多次对比字符串的操作,从而可以提高生成唯一随机字符串的效率,而且也可以节省服务器的资源。不仅如此,由于数据库已经提供了特定指令,用于使每次获取到的sequence变量的值均不相同,因此,本申请的方案的实施成本较小,有利于在更多的适用场景下实施。
为了便于理解,下面对图1中的步骤进一步地进行说明。
在本申请实施例中,不同的业务对生成的随机字符串的复杂程度的需求可能不同。例如,在对于某个业务,生成仅包含有英文字母的随机字符串即可满足需求,而对于另一个业务,需要生成的随机字符串不仅可以包含英文字母,还可以包含数字、标点等其他类型的字符。
因此,可以根据诸如以上的需求,先设定符合需求的字符集合,再执行图1中的各步骤。在这种情况下,可以根据设定的字符集合,确定出可以与该字符集合一一映射的基本数字集合,以用于对步骤S101中的sequence变量的值进行表示。
当然,若对生成的随机字符串的复杂程度的并没有特别需求的话,也可以在获取sequence变量的值后,再根据表示该值的基本数字集合,生成与该基本数字集合可以一一映射的字符集合。
在本申请实施例中,服务器可以只为一个业务生成随机字符串,也可以分别为多个业务生成随机字符串。对于后一种情况,多个业务都有获取唯一随机字符串的需求,由于对这多个业务中的每个业务,一般只在该业务的范围内使用的获取的各随机字符串,因此,服务器可以针对每个业务,分别为该业务生成在该业务的范围内具有唯一性的随机字符串即可,而不一定要保证服务器生成的所有的随机字符串是全局唯一的。
根据对上述的后一种情况的分析,对于步骤S101,获取数据库中的sequence变量的值,具体可以包括:接收随机字符串生成请求;根据所述生成请求的类型,从数据库中的至少一个sequence变量中,确定预定的、与该类型对应的sequence变量;获取所述与该类型对应的sequence变量的值,其中,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述与该类型对应的sequence变量的值均不相同。
随机字符串生成请求可以来自需要获取随机字符串业务,不同的业务的生成请求的 类型可以不同,每种类型的生成请求可以分别对应于一个sequence变量(该对应关系可以是预先设定的,也可以是在接收到生成请求后再设定的),各sequence变量的变量名称互不相同,进而可以通过变量名称对各sequence变量进行区分。
由此可见,服务器可以基于不同的sequence变量,分别为不同的业务生成在对应的业务范围内具有唯一性的随机字符串。这样的话,可以防止各sequence变量与过多数量的业务产生关联,从而便于对各sequence变量进行管控。
当然,在实际应用中,一个sequence变量也可以由多个业务共用,用于为所述多个业务生成随机字符串,从而可以减少数据库的开销。在这种情况下,基于这个sequence变量生成的各随机字符串在所述多个业务的范围内具有唯一性。
进一步的,若服务器分别为多个业务生成随机字符串,则针对不同的业务设置的字符集合也可以不同。进而,服务器在获取某业务对应的sequence变量的值后,可以基于为该业务设定的字符集合,为该业务生成随机字符串。
在本申请实施例中,对于步骤S102,将所述序列映射为字符串,具体可以包括:针对所述序列中的各基本数字,分别将每个基本数字转换为所述字符集合中包含的、与该基本元素映射的字符;按照转换出的各字符在转换后的所述序列中的顺序,将所述各字符进行串接构成字符串。下面沿用上述的sequence变量seq举例进行说明。
例如,seq为序列“123”,假定在设定的字符集合中,与基本数字“1”映射的字符为‘@’,与基本数字“2”映射的字符为‘#’,与基本数字“3”映射的字符为‘$’。这三个字符可以顺序串接为“@#$”,则可以将序列“123”映射为字符串“@#$”。
在本申请实施例中,若先设定了字符集合,再获取sequence变量的值,则可能需要对该值在进制上进行转换,以使得用于表示转换后该值的基本数字集合可以与设定的字符集合一一映射。
具体的,当所述字符集合中包含的字符的数量为N时,所述预定基本数字集合中为N进制对应的基本数字集合,包括的基本数字为:整数0~N-1;其中,N为不小于2的整数。在这种情况下,对于步骤S101,获取数据库中的sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,具体可以包括:获取数据库中的sequence变量的值;当确定获取的所述sequence变量的值不为N进制数时,将所述序列号sequence变量的值转换为N进制数,所述N进制数为由N进制对应的基本数字集合中的基本数字构成的序列。下面举例进行说明。
例如,假定设定的字符集合为{‘r’、‘7’、‘d’、‘m’、‘g’、‘a’、‘x’、 ‘3’},包含8个字符(也即,N=8),可以设定该字符集合中包含的各字符,与由8进制对应的基本数字集合{‘0’、‘1’、‘2’、‘3’、‘4’、‘5’、‘6’、‘7’}中包含的各基本数字之间的一一映射关系。假定设定的一一映射关系表示为:{(‘r’,‘0’);(‘7’,‘1’);(‘d’,‘2’);(‘m’,‘3’);(‘g’,‘4’);(‘a’,‘5’);(‘x’,‘6’);(‘3’,‘7’)},其中,每个括号中包含一个映射对,每个映射对包含相互映射的、该字符集合中包含的一个字符与该基本数字集合中的一个基本数字。
假定本次获取到的sequence变量的值为10进制数11002,而不是为8进制数,则可以将该10进制数11002转换为8进制数25372,也即,基于8进制对应的基本数字集合可以将sequence变量的值表示为序列“25372”。进而,可以根据该字符集合和所述一一映射关系,将序列“25372”转换为字符串“dam3d”,作为本次生成的随机字符串。
在本申请实施例中,每次执行步骤S101时,都可以采用用于让sequence变量自增后再取值的指令,获取所述sequence变量的值,以使得每次获取的所述sequence变量的值互不相同。前面已经提到,目前在大多数数据库中,用于让sequence变量自增后再取值的指令可以是NextVal指令。需要说明的是,本申请实施例对该指令的名称并不做限定,“NextVal”是该指令的名称的一种示例。
以上是对图1中的各步骤的进一步说明。为了便于理解,下面对在实际应用场景下,对本申请实施例提供的随机字符串生成方法的一种实施过程进行举例说明。
假定数据库中的sequence变量的值默认为10进制数,设定的字符集合中包含的字符数量为N,且该字符集合用数组的形式预先进行创建和保存。如图2所示,该过程可以包括以下步骤:
S201:创建长度为N的数组,假定N不为10,该数组中包含有N个互不相同的字符。
仍沿用上例中的字符集合和一一映射关系,可以用以下指令创建该数组:
char[]digit={‘r’,‘7’,‘d’,‘m’,‘g’,‘a’,‘x’,‘3’}。
S202:采用NextVal指令获取数据库的sequence变量的值,其中,该值为10进制数。
假定获取到的sequence变量的值为10进制数11002。
S203:将获取的sequence变量的值由10进制数转换为N进制数。
假定N=8,则转换后的sequence变量的值为8进制数25372,对应的序列为“25372”。
需要说明的是,若N=10,则步骤S203也可以省略,不必执行。
S204:根据设定的该数组中包含的各字符与N进制对应的基本数字集合中包含的各基本数字的一一映射关系,将转换得到N进制数字对应的序列映射为字符串,作为生成的随机字符串。
将序列“25372”可以映射为字符串“dam3d”,作为生成的随机字符串。
进一步的,本申请实施例还提供了可用于实现图2中的过程的一种系统的结构图,如图3所示。
该系统可以包含外围、服务层、算法层和数据库层。各层的处理逻辑可以在同一个设备(如服务器)上实现,也可以在不同的设备上实现。
图3中的箭头线段可以表示在生成随机字符串的过程的处理逻辑的执行顺序,箭头线段的两端连接的方框内是对该过程中的步骤的描述。主要可以包括以下步骤:
外围设备向服务层发送随机字符串生成请求;
服务层响应于该生成请求,采用NextVal指令从数据库层获取预定的、与该生成请求的类型对应的sequence变量的值,并返回给服务层;
服务层将sequence变量的值传递给算法层;
算法层基于预先设定的字符集合,将sequence变量的值对应的序列映射生成随机字符串,并返回给服务层;
服务层将生成的随机字符串,以及其他相关信息发送给数据库,以便于数据库写入和保存这些数据;
服务层将生成的随机字符串返回给外围;
外围获得生成的随机字符串,至此,该过程结束。
当然,图3是举例说明的可用于实施本申请实施例提供的方法的一种系统的结构图,在实际应用中,还可以有用于实施所述方法的、与该系统结构不同的其他系统,本申请实施例对可用于实施所述方法的系统的结构并不做限定。
在实际应用中,除了数据库的sequence变量以外,类似的,也可以用其他特定变量替换sequence变量,用于实施本申请的方案。例如,所述其他特定变量可以是用于记录系统时间的毫秒数的变量、或专门为生成随机字符串定义及维护的变量,等等。
需要说明的是,若采用其他特定变量实施本申请的方案时,在每次获取sequence变量的值之后,可能要对该sequence变量执行变更操作,以使得下一次获取的该sequence变量的值,与除了所述下一次以外的任一次获取的该sequence变量的值均不相同。对于不同的特定变量,实现所述变更操作所耗费的成本也可能不同,在实际应用中,可以选 择使用的特定变量实施本申请的方案。
以上为本申请实施例提供的随机字符串生成方法,基于同样的思路,本申请实施例还提供相应的随机字符串生成装置,如图4所示。
图4为本申请实施例提供的随机字符串生成装置结构示意图,具体包括:
获取模块401,用于获取数据库中的序列号sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同;
生成模块402,用于根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
所述获取模块401具体可以用于:接收随机字符串生成请求;根据所述生成请求的类型,从数据库中的至少一个sequence变量中,确定预定的、与该类型对应的sequence变量;获取所述与该类型对应的sequence变量的值,其中,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述与该类型对应的sequence变量的值均不相同。
当所述字符集合中包含的字符的数量为N时,所述预定基本数字集合为N进制对应的基本数字集合,包括的基本数字为:整数0~N-1;其中,N为不小于2的整数;
所述获取模块401具体可以用于:获取数据库中的sequence变量的值;当确定获取的所述sequence变量的值不为N进制数时,将所述sequence变量的值转换为N进制数,所述N进制数为由N进制对应的基本数字集合中的基本数字构成的序列。
所述生成模块具体可以用于:针对所述序列中的各基本数字,分别将每个基本数字转换为所述字符集合中包含的、与该基本数字映射的字符;按照转换出的各字符在转换后的所述序列中的顺序,将所述各字符进行串接构成字符串。
所述获取模块具体可以用于:采用用于让sequence变量自增后再取值的指令,获取所述sequence变量的值。
在实际应用中,所述指定变量可以为指定数据库的序列sequence变量,也可以为用于记录系统时间的毫秒数的变量等其他特定变量。
具体的上述如图4所示的装置可以位于终端、服务器上。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的 计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体 (transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (10)

  1. 一种随机字符串生成方法,其特征在于,包括:
    获取数据库中的序列号sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同;
    根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
  2. 如权利要求1所述的方法,其特征在于,获取数据库中的sequence变量的值,具体包括:
    接收随机字符串生成请求;
    根据所述生成请求的类型,从数据库中的至少一个sequence变量中,确定预定的、与该类型对应的sequence变量;
    获取所述与该类型对应的sequence变量的值,其中,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述与该类型对应的sequence变量的值均不相同。
  3. 如权利要求1所述的方法,其特征在于,当所述字符集合中包含的字符的数量为N时,所述预定基本数字集合为N进制对应的基本数字集合,包括的基本数字为:整数0~N-1;其中,N为不小于2的整数;
    获取数据库中的序列号sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,具体包括:
    获取数据库中的sequence变量的值;
    当确定获取的所述sequence变量的值不为N进制数时,将所述sequence变量的值转换为N进制数,所述N进制数为由N进制对应的基本数字集合中的基本数字构成的序列。
  4. 如权利要求1所述的方法,其特征在于,将所述序列映射为字符串,具体包括:
    针对所述序列中的各基本数字,分别将每个基本数字转换为所述字符集合中包含的、与该基本数字映射的字符;
    按照转换出的各字符在转换后的所述序列中的顺序,将所述各字符进行串接构成字符串。
  5. 如权利要求1~3任一项所述的方法,其特征在于,获取sequence变量的值,具 体包括:
    采用用于让sequence变量自增后再取值的指令,获取所述sequence变量的值。
  6. 一种随机字符串生成装置,其特征在于,包括:
    获取模块,用于获取数据库中的序列号sequence变量的值,其中,所述sequence变量的值为由预定基本数字集合中的基本数字构成的序列,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述sequence变量的值均不相同;
    生成模块,用于根据设定的字符集合中包含的各字符与所述基本数字集合中包含的各基本数字的一一映射关系,将所述序列映射为字符串,作为生成的随机字符串。
  7. 如权利要求6所述的装置,其特征在于,所述获取模块具体用于:接收随机字符串生成请求;根据所述生成请求的类型,从数据库中的至少一个sequence变量中,确定预定的、与该类型对应的sequence变量;获取所述与该类型对应的sequence变量的值,其中,本次获取到的所述sequence变量的值与本次之外的任一次获取到的所述与该类型对应的sequence变量的值均不相同。
  8. 如权利要求6所述的装置,其特征在于,当所述字符集合中包含的字符的数量为N时,所述预定基本数字集合为N进制对应的基本数字集合,包括的基本数字为:整数0~N-1;其中,N为不小于2的整数;
    所述获取模块具体用于:获取数据库中的sequence变量的值;当确定获取的所述sequence变量的值不为N进制数时,将所述sequence变量的值转换为N进制数,所述N进制数为由N进制对应的基本数字集合中的基本数字构成的序列。
  9. 如权利要求6所述的装置,其特征在于,所述生成模块具体用于:针对所述序列中的各基本数字,分别将每个基本数字转换为所述字符集合中包含的、与该基本数字映射的字符;按照转换出的各字符在转换后的所述序列中的顺序,将所述各字符进行串接构成字符串。
  10. 如权利要求6~8任一项所述的装置,所述获取模块具体用于:采用用于让sequence变量自增后再取值的指令,获取所述sequence变量的值。
PCT/CN2016/108198 2015-12-07 2016-12-01 一种随机字符串生成方法及装置 WO2017097159A1 (zh)

Priority Applications (9)

Application Number Priority Date Filing Date Title
KR1020187018758A KR102111871B1 (ko) 2015-12-07 2016-12-01 랜덤 문자열을 생성하기 위한 방법 및 장치
JP2018548262A JP6636647B2 (ja) 2015-12-07 2016-12-01 ランダム文字列を生成する方法および装置
AU2016367801A AU2016367801B2 (en) 2015-12-07 2016-12-01 Method and apparatus for generating random character string
SG11201804494PA SG11201804494PA (en) 2015-12-07 2016-12-01 Method and apparatus for generating random character string
EP16872350.0A EP3367254A4 (en) 2015-12-07 2016-12-01 METHOD AND APPARATUS FOR GENERATING A CHAIN OF RANDOM CHARACTERS
MYPI2018702157A MY194056A (en) 2015-12-07 2016-12-01 Method and apparatus for generating random character string
US16/000,146 US10489117B2 (en) 2015-12-07 2018-06-05 Method and apparatus for generating random character string
PH12018501222A PH12018501222A1 (en) 2015-12-07 2018-06-07 Method and apparatus for generating random character string
AU2019101559A AU2019101559A4 (en) 2015-12-07 2019-12-12 Method and apparatus for generating random character string

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510892216.8 2015-12-07
CN201510892216.8A CN106844288B (zh) 2015-12-07 2015-12-07 一种随机字符串生成方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/000,146 Continuation US10489117B2 (en) 2015-12-07 2018-06-05 Method and apparatus for generating random character string

Publications (1)

Publication Number Publication Date
WO2017097159A1 true WO2017097159A1 (zh) 2017-06-15

Family

ID=59013677

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108198 WO2017097159A1 (zh) 2015-12-07 2016-12-01 一种随机字符串生成方法及装置

Country Status (10)

Country Link
US (1) US10489117B2 (zh)
EP (1) EP3367254A4 (zh)
JP (1) JP6636647B2 (zh)
KR (1) KR102111871B1 (zh)
CN (1) CN106844288B (zh)
AU (2) AU2016367801B2 (zh)
MY (1) MY194056A (zh)
PH (1) PH12018501222A1 (zh)
SG (1) SG11201804494PA (zh)
WO (1) WO2017097159A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087368B (zh) * 2018-06-14 2023-04-07 创新先进技术有限公司 一种字符串图形化方法和装置
CN109445749A (zh) * 2018-09-14 2019-03-08 高斯贝尔数码科技股份有限公司 一种不重复随机序列号生成方法及计算机终端
CN110262289B (zh) * 2019-07-18 2022-04-26 潍柴动力股份有限公司 A2l文件中变量的处理方法、装置和存储介质
CN113744013B (zh) * 2020-09-28 2024-05-21 北京沃东天骏信息技术有限公司 订单号的生成方法、装置、服务器及存储介质
CN112835555A (zh) * 2021-01-22 2021-05-25 广东智源机器人科技有限公司 随机数生成方法、装置和设备
CN114995799B (zh) * 2022-07-18 2022-10-25 新华三半导体技术有限公司 一种汇编代码生成方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533435A (zh) * 2009-04-16 2009-09-16 北京水晶石数字科技有限公司 一种序列号生成和验证的方法
US20090328146A1 (en) * 2007-05-15 2009-12-31 Lg Electronics Inc. Method of generating authentication code in digital device
CN101976241A (zh) * 2010-09-26 2011-02-16 用友软件股份有限公司 识别码生成方法和系统
CN104363584A (zh) * 2014-11-27 2015-02-18 宇龙计算机通信科技(深圳)有限公司 一种短消息加、解密的方法、装置及终端

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5805911A (en) * 1995-02-01 1998-09-08 Microsoft Corporation Word prediction system
CA2327078C (en) 2000-11-30 2005-01-11 Ibm Canada Limited-Ibm Canada Limitee Secure session management and authentication for web sites
US20040015702A1 (en) 2002-03-01 2004-01-22 Dwayne Mercredi User login delegation
JP4308676B2 (ja) 2003-01-24 2009-08-05 株式会社リコー 文字列処理装置,文字列処理方法および画像形成装置
US7218252B2 (en) 2004-02-25 2007-05-15 Computer Associates Think, Inc. System and method for character conversion between character sets
US7676797B2 (en) 2005-01-31 2010-03-09 Computer Associates Think, Inc. System and method for managing long names in an application programming interface
US7840399B2 (en) 2005-04-07 2010-11-23 Nokia Corporation Method, device, and computer program product for multi-lingual speech recognition
KR100755533B1 (ko) 2005-07-25 2007-09-06 주식회사 팬택 캐릭터 셋 생성 방법 및 그 장치
CN101441637A (zh) 2007-11-22 2009-05-27 国际商业机器公司 对已排序的字符串序列再排序的方法及装置
US9098560B2 (en) 2009-12-22 2015-08-04 International Business Machines Corporation Client message distribution in a distributed directory based on language and character sets
CN102236581B (zh) 2010-04-30 2013-08-14 国际商业机器公司 用于数据中心的映射化简方法和系统
US9665864B2 (en) 2010-05-21 2017-05-30 Intel Corporation Method and device for conducting trusted remote payment transactions
WO2012123986A1 (ja) * 2011-03-14 2012-09-20 三菱電機株式会社 文字列配置装置
US9454753B2 (en) 2011-03-28 2016-09-27 Paypal, Inc. Friendly funding source
CN102129478B (zh) * 2011-04-26 2012-10-03 广州从兴电子开发有限公司 数据库同步方法及系统
US20130159173A1 (en) 2011-12-19 2013-06-20 Sridhar Sivaraman Shared Mobile Payments
CN102609477B (zh) * 2012-01-19 2014-10-22 北京思特奇信息技术股份有限公司 一种流水号生成器的实现方法
CN103020268B (zh) * 2012-12-26 2016-05-04 大唐软件技术股份有限公司 关系型数据库序列号应用方法和系统
EP3691220B1 (en) 2013-02-28 2021-08-25 Amazon Technologies, Inc. Configurable-quality random data service
US9819727B2 (en) 2013-02-28 2017-11-14 Amazon Technologies, Inc. Computing infrastructure for configurable-quality random data
US9048854B2 (en) 2013-03-12 2015-06-02 Bmc Software Inc. Unicode character conversion using one of two conversion services

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090328146A1 (en) * 2007-05-15 2009-12-31 Lg Electronics Inc. Method of generating authentication code in digital device
CN101533435A (zh) * 2009-04-16 2009-09-16 北京水晶石数字科技有限公司 一种序列号生成和验证的方法
CN101976241A (zh) * 2010-09-26 2011-02-16 用友软件股份有限公司 识别码生成方法和系统
CN104363584A (zh) * 2014-11-27 2015-02-18 宇龙计算机通信科技(深圳)有限公司 一种短消息加、解密的方法、装置及终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3367254A4 *

Also Published As

Publication number Publication date
JP2019504426A (ja) 2019-02-14
JP6636647B2 (ja) 2020-01-29
KR102111871B1 (ko) 2020-05-18
AU2016367801A1 (en) 2018-06-21
SG11201804494PA (en) 2018-06-28
PH12018501222A1 (en) 2019-02-04
US10489117B2 (en) 2019-11-26
US20180285078A1 (en) 2018-10-04
KR20180088895A (ko) 2018-08-07
EP3367254A4 (en) 2019-06-05
MY194056A (en) 2022-11-10
AU2019101559A4 (en) 2020-01-23
AU2016367801B2 (en) 2019-10-31
CN106844288A (zh) 2017-06-13
CN106844288B (zh) 2022-03-22
EP3367254A1 (en) 2018-08-29

Similar Documents

Publication Publication Date Title
WO2017097159A1 (zh) 一种随机字符串生成方法及装置
CN109614823B (zh) 一种数据的处理方法、装置及设备
CN111767143A (zh) 交易数据处理方法、装置、设备及系统
US9619492B2 (en) Data migration
WO2023131218A1 (zh) 图数据的存储
CN114490656A (zh) 数据查询方法、装置、设备及存储介质
CN110362630B (zh) 数据管理方法、装置、设备与计算机可读存储介质
Choi et al. Improving database system performance by applying NoSQL
CN113641633B (zh) 文件处理方法、装置、电子设备、介质和计算机程序
CN113360889B (zh) 权限管理方法和装置、服务器、计算机可读存储介质
CN115795187A (zh) 资源访问方法、装置及设备
CN114629951A (zh) 地址服务切换方法、装置、计算机设备和存储介质
US20180046656A1 (en) Constructing filterable hierarchy based on multidimensional key
CN113407657A (zh) 基于单级数据库的数据查询方法、装置、设备及存储介质
CN112581141A (zh) 基于区块链的交易处理方法、装置及系统
CN113722334B (zh) 数据处理的方法、装置、电子设备及介质
CN115203176B (zh) 数据库操作方法、装置、设备、存储介质和程序产品
CN116431630A (zh) 一种基于隐私计算的数据处理方法及相关设备
US10896193B2 (en) Cache fetching of OLAP based data using client to client relationships and data encoding
CN112487317A (zh) 一种统一资源定位符转换方法、装置、设备及介质
CN114385630A (zh) 血缘关系梳理方法、装置、设备、存储介质和程序产品
CN113961636A (zh) 对象关系查询方法、装置、计算机设备、存储介质
CN115114375A (zh) 基于区块链的数据存储方法、装置、电子设备及存储介质
CN116910115A (zh) 客群查询方法、装置、计算机设备和存储介质
CN115687535A (zh) 关系型数据库的管理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16872350

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2016872350

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 11201804494P

Country of ref document: SG

WWE Wipo information: entry into national phase

Ref document number: 2018548262

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 12018501222

Country of ref document: PH

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2016367801

Country of ref document: AU

Date of ref document: 20161201

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20187018758

Country of ref document: KR

Kind code of ref document: A