CN110795604A - Method, apparatus, computing device and medium for generating transaction serial number - Google Patents

Method, apparatus, computing device and medium for generating transaction serial number Download PDF

Info

Publication number
CN110795604A
CN110795604A CN201911048395.1A CN201911048395A CN110795604A CN 110795604 A CN110795604 A CN 110795604A CN 201911048395 A CN201911048395 A CN 201911048395A CN 110795604 A CN110795604 A CN 110795604A
Authority
CN
China
Prior art keywords
serial number
target serial
type
digit
target
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
CN201911048395.1A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201911048395.1A priority Critical patent/CN110795604A/en
Publication of CN110795604A publication Critical patent/CN110795604A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/901Indexing; Data structures therefor; Storage structures
    • 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

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)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The present disclosure provides a method of generating a transaction serial number. The method comprises the following steps: receiving a serial number generation request, wherein the serial number generation request comprises a target serial number type and a target serial number digit; acquiring a target serial number set corresponding to the target serial number type; repeatedly executing the random generation operation to generate the target serial number until the target serial number is not contained in the target serial number set; storing the target serial number in the target serial number set and outputting the target serial number; wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request. The present disclosure also provides an apparatus for generating a transaction serial number, a computing device, and a medium.

Description

Method, apparatus, computing device and medium for generating transaction serial number
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a computing device, and a medium for generating a transaction serial number.
Background
The distributed transaction system may generate a transaction serial number using a UUID (universal Unique Identifier). A UUID is a set of 32-bit 16-ary digits, and can be calculated and generated based on data such as the current time, a counter (counter), and a hardware identifier (typically, a MAC address of a wireless network card).
In implementing the disclosed concept, the inventors discovered that generating a transaction serial number using a UUID had at least the following problems: the generation time of the UUID is long because the number of the UUID bits is long and the hardware identifier needs to be read.
Disclosure of Invention
One aspect of the present disclosure provides a method of generating a transaction serial number, comprising: receiving a serial number generation request, wherein the serial number generation request comprises a target serial number type and a target serial number digit; acquiring a target serial number set corresponding to the target serial number type; repeatedly executing the random generation operation to generate the target serial number until the target serial number is not contained in the target serial number set; storing the target serial number in the target serial number set and outputting the target serial number; wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
Optionally, the target serial number type includes any one of a number type, an alphabet type, and a mixed number and alphabet type.
Optionally, the randomly determining a character on each bit of the target serial number according to the target serial number type and the target serial number bit number in the serial number generation request includes: under the condition that the target serial number type is a numeric type, randomly determining a numeric character as a character on each bit of the target serial number aiming at the character on the bit; under the condition that the type of the target serial number is an alphabetic type, randomly determining an alphabetic character as the character on each position of the target serial number aiming at the character on the position; and randomly determining each digit of the target serial number as a digit or a letter digit under the condition that the type of the target serial number is a digit-letter mixed type; randomly determining a digit character for each digit as the character on the digit; and randomly determining an alphabetic character for each alphabetic digit as the character on the alphabetic digit.
Optionally, the obtaining of the target serial number set corresponding to the target serial number type includes: acquiring a mapping relation table; and searching a target serial number set corresponding to the target serial number type in the mapping relation table according to the target serial number type.
Optionally, the method further includes: the serial number generation request is locked so that, when a plurality of serial number generation requests including the same serial number type are received, only the locked serial number generation requests are processed at the same time.
Another aspect of the present disclosure provides an apparatus for generating a transaction serial number, including a receiving module for receiving a serial number generation request, the serial number generation request including a target serial number type and a target serial number digit; the first acquisition module is used for acquiring a target serial number set corresponding to the target serial number type; the execution module is used for repeatedly executing the random generation operation to generate the target serial number until the target serial number is not contained in the target serial number set; the output module is used for storing the target serial number in the target serial number set and outputting the target serial number; wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
Optionally, the target serial number type is any one of a numeric type, an alphabetical type and a mixed numeric and alphabetical type; the execution module comprises: the first determining submodule is used for randomly determining a numeric character as the character on each bit of the target serial number aiming at the character on each bit under the condition that the target serial number is of the numeric type; the second determining submodule is used for randomly determining an alphabetic character as the character on each position of the target serial number aiming at the character on each position under the condition that the type of the target serial number is the alphabetic type; the third determining submodule is used for randomly determining that each digit of the target serial number is a digit or letter digit under the condition that the type of the target serial number is a digit-letter mixed type; randomly determining a digit character for each digit as the character on the digit; and randomly determining an alphabetic character for each alphabetic digit as the character on the alphabetic digit.
Optionally, the first obtaining module includes: the second obtaining submodule is used for obtaining a mapping relation table; and the searching module is used for searching a target serial number set corresponding to the target serial number type in the mapping relation table according to the target serial number type.
Another aspect of the present disclosure provides a computing device comprising: one or more processors; memory for storing one or more computer programs, wherein the one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
According to the method and the device for generating the serial number, which are provided by the embodiment of the disclosure, the serial number generation request is received, the target serial number set corresponding to the target serial number type in the serial number generation request is obtained, and the random generation operation is repeatedly executed to generate the target serial number until the target serial number is not included in the target serial number set. Therefore, the hardware identification does not need to be read in the process of generating the serial number, and the speed is high. In addition, the generated serial number is random, so that the generated serial number is not easy to predict, and the safety is high.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of a method of generating a serial number and an apparatus of generating a transaction serial number according to an embodiment of the present disclosure;
FIG. 2 schematically shows a flow diagram of a method of generating a transaction serial number according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an example flow diagram for obtaining a set of target serial numbers corresponding to a target serial number type in accordance with an embodiment of this disclosure;
FIG. 4 schematically illustrates a flow chart of a method of generating a transaction serial number according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of an apparatus for generating a transaction serial number according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates an exemplary block diagram of an execution module according to an embodiment of the disclosure;
fig. 7 schematically illustrates an exemplary block diagram of a first acquisition module according to an embodiment of the disclosure;
FIG. 8 schematically illustrates a block diagram of an apparatus for generating a transaction serial number according to another embodiment of the present disclosure; and
FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing a method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon for use by or in connection with an instruction execution system.
The embodiment of the disclosure provides a method for generating serial numbers and a device for generating transaction serial numbers. The method comprises the steps of receiving a serial number generation request, wherein the serial number generation request comprises a target serial number type and a target serial number digit; acquiring a target serial number set corresponding to the target serial number type; repeatedly executing the random generation operation to generate the target serial number until the target serial number is not contained in the target serial number set; and storing the target serial number in the target serial number set and outputting the target serial number. Wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
Fig. 1 schematically illustrates an application scenario of a method of generating a serial number and an apparatus of generating a transaction serial number according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, an application scenario 100 according to this embodiment may comprise terminal devices 101, 102, 103, a network 104, a transaction server 105 and a central server 106. The network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the transaction server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The trading server 105 is used to provide support for trading platform websites browsed by users using the terminal devices 101, 102, 103. The transaction server 105 may analyze and/or otherwise process data received from a user request (e.g., a transaction request) and feed back the processing results (e.g., web pages, information, or data obtained or generated based on the user request) to the terminal device.
The central server 106 is configured to generate a serial number corresponding to the serial number generation request sent by the transaction server 105, and feed the serial number back to the transaction server 105.
When a user initiates a transaction via the terminal device 101, 102, 103, the terminal device submits a transaction request to the transaction server 105. Next, the transaction server 105 generates a serial number generation request based on the transaction request, and transmits the serial number generation request to the center server 106. Then, the central server 106 generates a corresponding serial number according to the serial number generation request, and sends the serial number back to the transaction server 105. Next, the transaction server 105 takes the serial number sent back by the center server as the serial number of the transaction.
It should be noted that the method for generating a transaction serial number provided by the embodiment of the present disclosure may be executed by the central server 106. Accordingly, the device for generating the transaction serial number provided by the embodiment of the present disclosure may be disposed in the central server 106. The method of generating a transaction serial number provided by the embodiments of the present disclosure may also be performed by a server or a cluster of servers that is different from the central server 106 and that is capable of communicating with the transaction server 105. Accordingly, the device for generating the transaction serial number provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the central server 106 and capable of communicating with the transaction server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 schematically illustrates a flow diagram of a method of generating a transaction serial number according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, a serial number generation request is received.
According to an embodiment of the present disclosure, the serial number generation request may be generated by the transaction server and sent to the central server. The serial number generation request is used for requesting the central server to generate a serial number required for the transaction.
The type of transaction serial number requested and the number of digits of the transaction serial number may be included in the serial number generation request. The types of transaction serial numbers may include, for example, numeric types, alphabetic types, and mixed numeric and alphabetic types. Wherein, the numeric type refers to a serial number composed of pure numbers (e.g. 0001), the alphabetic type refers to a serial number composed of pure letters (e.g. efsd), and the alphanumeric type refers to a serial number composed of numbers mixed with letters (e.g. a2b 3).
In operation S220, a target serial number set corresponding to the target serial number type is acquired.
According to the embodiment of the disclosure, each serial number type corresponds to a serial number set, and the serial number set is used for storing the generated serial numbers of the type.
Fig. 3 schematically illustrates an example flow diagram for obtaining a target serial number set corresponding to a target serial number type according to an embodiment of the present disclosure.
As shown in fig. 3, operation S220 may include operations S310 to S320.
In operation S310, a mapping relationship table is acquired.
In operation S320, according to the target serial number type, a target serial number set corresponding to the target serial number type is searched in the mapping relation table.
According to the embodiment of the disclosure, the corresponding relationship between the serial number type and the serial number is stored in the mapping relationship table in advance. The mapping relation table may be, for example, a map data type, and the storage location thereof may be a server memory.
In operation S230, the random generation operation is repeatedly performed to generate the target serial number until the target serial number is not included in the target serial number set.
Wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
According to the embodiment of the present disclosure, the method of generating the serial number differs according to the type of the serial number. For example, in the case where the target serial number type is a numeric type, one numeric character is randomly determined for the character on each bit of the target serial number as the character on the bit. And under the condition that the target serial number type is an alphabetic type, randomly determining an alphabetic character as the character on each bit of the target serial number aiming at the character on the bit. And under the condition that the target serial number type is a digital-letter mixed type, randomly determining each digit of the target serial number as a digital digit or a letter digit, then randomly determining a digital character as a character on the digital digit aiming at each digital digit, and randomly determining an alphabetic character as a character on the letter digit aiming at each letter digit.
For example, for an n-bit serial number, if the serial number is a numeric type, firstly, a random number generation function is executed for a character on the 1 st bit of the serial number (the random number generation function is used for randomly generating any one of 10 numbers of 0 to 9), and any one of 0 to 9 is obtained as the character on the 1 st bit; then, for the 2 nd bit, the random number generation function is run again, and a number is randomly obtained as the character … … on the 2 nd bit, and so on until the character on the n th bit is obtained. For example, the 1 st bit may be the least significant bit.
If the serial number is of a letter type, firstly, a random letter generation function (the random letter generation function is used for randomly generating any one of 26 letters A-Z) is operated aiming at the 1 st character of the serial number to obtain any one of the letters A-Z as the 1 st character; then, for the 2 nd digit, the random number generation function is run again, and a letter obtained randomly is used as the character … … on the 2 nd digit, and so on until the character on the n th digit is obtained.
If the serial number is of alphanumeric type, a random function (random function is used to randomly generate 0 or 1, such as random function) is first run for the 1 st character of the serial number. If the result is 0, the digit is represented as a digital digit, a random digit generation function is operated, and a digit is randomly obtained and used as a character on the 1 st digit; and then, running the random function again, if the result is 1, indicating that the digit is an alphabetical digit, running the random letter generation function, randomly obtaining a letter as the character … … on the 2 nd digit, and so on until obtaining the character on the nth digit.
In operation S240, the target serial number is stored in the target serial number set, and the target serial number is output.
According to the method for generating the serial number provided by the embodiment of the disclosure, the serial number generation request is received, the target serial number set corresponding to the target serial number type in the serial number generation request is obtained, and the random generation operation is repeatedly executed to generate the target serial number until the target serial number is not included in the target serial number set. The method does not need to read the hardware identification in the process of generating serial numbers, and has higher speed. Meanwhile, the generated serial number is random, so that the serial number is not easy to predict, and the safety is high.
It will be appreciated that the above method of generating serial numbers may also be used to generate other numbers, such as account numbers, host communication codes, third party interaction codes, order numbers, etc. requiring unique numbers.
According to another embodiment of the present disclosure, a configuration file may also be preset, where a plurality of serial number templates are preset in the configuration file, for example, as shown in table 1, and each template includes a serial number identifier, a serial number type, and a bit number. The transaction server can send the serial number identifier to the central server through the pipeline generation request, then the central server searches the type and the digit number corresponding to the serial number type from the configuration file, and the corresponding serial number can be generated according to the type and the digit number, so that the transaction server does not need to send the serial number type and the digit number, and the communication overhead can be saved.
TABLE 1
Identification Type (B) Number of bits
A Digital type 32
B Mixed type of digit and letter 18
The method shown in fig. 2 is further described below with reference to specific embodiments.
The terminal device sends a transaction request to the transaction server. The transaction server judges which type of serial number and how many serial numbers are needed according to the transaction request, correspondingly generates a serial number generation request, and then sends the serial number generation request to the central server.
And after receiving the serial number generation request, the central server analyzes the serial number generation request. And if the serial number generation request contains the serial number identification but does not contain the serial number type and the serial number digit, generating the serial number according to the configuration file. And if the serial number generation request comprises the serial number identification, the serial number type and the serial number digit, generating the serial number according to the serial number type and the digit in the serial number generation request.
And randomly generating each digit character to obtain a digit character string aiming at the serial number type, and then inquiring whether the serial number set corresponding to the serial number identification contains the digit character string in a map in a memory, for example. And if the numeric character string is not contained in the serial number set, taking the numeric character string as a target serial number. If the numeric string is already contained in the serial number set, a numeric string is regenerated until the generated numeric string is not contained in the serial number set.
And aiming at the fact that the serial number type is a pure letter type, randomly generating each letter character to obtain a letter character string, and then inquiring whether the letter character string is contained in the serial number set corresponding to the serial number identification by a map in a memory. And if the alphabetic character string is not contained in the serial number set, taking the alphabetic character string as a target serial number. If the alphabetic character string is contained in the serial number set, an alphabetic character string is regenerated until the generated alphabetic character string is not contained in the serial number set.
Aiming at the fact that the serial number type is a number-letter mixed type, firstly, a result is randomly generated according to a random function, the running result of the random function has two types of 0 and 1, and the occurrence probability is the same and is 50 percent. Then if the operation result is 0, the digit is a digital character, and a digit is randomly generated to be used as a character on the digit; if the operation result is 1, the bit is an alphabetic character, and a bit of alphabet is randomly generated to be used as the character on the bit. Then, map in memory inquires whether the serial number set corresponding to the serial number mark contains the character string. And if the character string is not contained in the serial number set, taking the character string as a target serial number. If the character string is already contained in the serial number set, a mixed alphanumeric character string is regenerated until the generated character string is not contained in the serial number set.
Fig. 4 schematically illustrates a flow chart of a method of generating a transaction serial number according to another embodiment of the present disclosure.
As shown in fig. 4, the method may further include operation S410 in addition to operations S210 to S240.
In operation S410, the serial number generation request is locked such that only the locked serial number generation request is processed at the same time when a plurality of serial number generation requests including the same serial number type are received.
According to the embodiment of the disclosure, the central server judges whether a serial number generation request which is locked by the same type is currently processed. If the locked serial number generation request of the same type is not processed currently, locking the serial number generation request, and then processing; otherwise, the serial number generation request is locked and processed after the locked request is processed and unlocked.
Fig. 5 schematically illustrates a block diagram of an apparatus for generating a transaction serial number according to an embodiment of the present disclosure.
As shown in fig. 5, the apparatus 500 for generating a transaction serial number includes: a receiving module 510, a first obtaining module 520, an executing module 530, and an outputting module 540. The apparatus 500 for generating a transaction serial number may perform the method described above with reference to fig. 2.
Specifically, the receiving module 510 is configured to receive a serial number generation request, where the serial number generation request includes a target serial number type and a target serial number bit number.
A first obtaining module 520, configured to obtain a target serial number set corresponding to a target serial number type.
An executing module 530, configured to repeatedly execute the random generating operation to generate the target serial number until the target serial number is not included in the target serial number set. Wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
And the output module 540 is configured to store the target serial number in the target serial number set, and output the target serial number.
Fig. 6 schematically illustrates an exemplary block diagram of an execution module according to an embodiment of the present disclosure.
As shown in fig. 6, the execution module 530 includes: a first determination sub-module 610, a second determination sub-module 620, and a third determination sub-module 630.
The first determining sub-module 610 is configured to, when the target serial number type is a numeric type, randomly determine a numeric character as a character on each bit of the target serial number for the character on the bit.
The second determining sub-module 620 is configured to, when the target serial number type is an alphabetical type, randomly determine an alphabetical character as a character on each digit of the target serial number for the character on the digit.
A third determining sub-module 630, configured to randomly determine each digit of the target serial number to be a digit or an alphabet if the target serial number is a mixed-digit-alphabet type; randomly determining a digit character for each digit as a character on the digit; and randomly determining an alphabetic character for each alphabetic digit to serve as the character on the alphabetic digit.
Fig. 7 schematically illustrates an exemplary block diagram of a first acquisition module according to an embodiment of the disclosure.
As shown in fig. 7, the first obtaining module 520 includes a second obtaining sub-module 710 and a searching module 720.
And a second obtaining sub-module 710, configured to obtain the mapping relationship table.
And the searching module 720 is configured to search, according to the target serial number type, a target serial number set corresponding to the target serial number type in a mapping relation table.
According to the device for generating the transaction serial number, which is provided by the embodiment of the disclosure, the serial number generation request is received, the target serial number set corresponding to the target serial number type in the serial number generation request is obtained, and the random generation operation is repeatedly executed to generate the target serial number until the target serial number is not included in the target serial number set. Therefore, the hardware identification does not need to be read in the process of generating the serial number, and the speed is high. Meanwhile, the serial number is randomly generated, so that the generated serial number is not easy to predict, and the safety is high.
Fig. 8 schematically illustrates a block diagram of an apparatus for generating a transaction serial number according to another embodiment of the present disclosure.
As shown in fig. 8, the apparatus 800 for generating a transaction serial number includes, in addition to the receiving module 510, the first obtaining module 520, the executing module 530 and the outputting module 540: a locking module 810.
The locking module 810 is configured to lock the serial number generation request, so that only the locked serial number generation request is processed at the same time when multiple serial number generation requests including the same serial number type are received.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the receiving module 510, the first obtaining module 520, the executing module 530 and the outputting module 540 may be combined and implemented in one module, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the receiving module 510, the first obtaining module 520, the executing module 530 and the outputting module 540 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware and firmware, or any suitable combination of any of them. Alternatively, at least one of the receiving module 510, the first obtaining module 520, the executing module 530 and the outputting module 540 may be at least partially implemented as a computer program module, which when executed may perform a corresponding function.
FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing the above-described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 9 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 9, computing device 900 includes a processor 910, a computer-readable storage medium 920. The computing device 900 may perform a method according to embodiments of the disclosure.
In particular, processor 910 may include, for example, a general purpose microprocessor, an instruction set processor and/or related chip set and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), and/or the like. The processor 910 may also include onboard memory for caching purposes. The processor 910 may be a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
Computer-readable storage media 920, for example, may be non-volatile computer-readable storage media, specific examples including, but not limited to: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and so on.
The computer-readable storage medium 920 may include a computer program 921, which computer program 921 may include code/computer-executable instructions that, when executed by the processor 910, cause the processor 910 to perform a method according to an embodiment of the present disclosure, or any variation thereof.
The computer program 921 may be configured with, for example, computer program code comprising computer program modules. For example, in an example embodiment, code in computer program 921 may include one or more program modules, including 921A, modules 921B, … …, for example. It should be noted that the division and number of the modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual situations, so that the processor 910 may execute the method according to the embodiment of the present disclosure or any variation thereof when the program modules are executed by the processor 910.
According to an embodiment of the present invention, at least one of the receiving module 510, the first obtaining module 520, the executing module 530 and the outputting module 540 may be implemented as a computer program module described with reference to fig. 5, which, when executed by the processor 910, may implement the corresponding operations described above.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
While the disclosure has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the disclosure as defined by the appended claims and their equivalents. Accordingly, the scope of the present disclosure should not be limited to the above-described embodiments, but should be defined not only by the appended claims, but also by equivalents thereof.

Claims (10)

1. A method of generating a transaction serial number, comprising:
receiving a serial number generation request, wherein the serial number generation request comprises a target serial number type and a target serial number digit;
acquiring a target serial number set corresponding to the target serial number type;
repeatedly performing a random generation operation to generate a target serial number until the target serial number is not included in the target serial number set; and
storing the target serial number in the target serial number set and outputting the target serial number;
wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
2. The method of claim 1, wherein the target serial number type comprises any one of a numeric type, an alphabetic type, and a mixed numeric and alphabetic type.
3. The method of claim 2, wherein the randomly determining characters on each digit of the target serial number according to the target serial number type and the target serial number digit number in the serial number generation request comprises:
under the condition that the target serial number type is a numeric type, randomly determining a numeric character as a character on each digit of the target serial number aiming at the character on each digit;
under the condition that the target serial number type is an alphabetic type, randomly determining an alphabetic character as a character on each position of the target serial number aiming at the character on each position; and
under the condition that the type of the target serial number is a digital-letter mixed type, randomly determining each digit of the target serial number to be a digital digit or a letter digit; randomly determining a digit character for each digit as a character on the digit; and randomly determining an alphabetic character for each alphabetic digit to serve as the character on the alphabetic digit.
4. The method of claim 1, wherein the obtaining a set of target serial numbers corresponding to the target serial number type comprises:
acquiring a mapping relation table; and
and searching a target serial number set corresponding to the target serial number type in the mapping relation table according to the target serial number type.
5. The method of claim 1, further comprising:
and locking the serial number generation request so that only the locked serial number generation request is processed at the same time when a plurality of serial number generation requests including the same serial number type are received.
6. An apparatus for generating a transaction serial number, comprising:
the receiving module is used for receiving a serial number generation request, and the serial number generation request comprises a target serial number type and a target serial number digit;
the first acquisition module is used for acquiring a target serial number set corresponding to the target serial number type;
the execution module is used for repeatedly executing random generation operation to generate a target serial number until the target serial number is not contained in the target serial number set; and
the output module is used for storing the target serial number in the target serial number set and outputting the target serial number;
wherein the random generation operation comprises: and randomly determining characters on each bit of the target serial number according to the target serial number type and the target serial number digit in the serial number generation request.
7. The apparatus of claim 6, wherein the target serial number type is any one of a numeric type, an alphabetical type, and a mixed numeric and alphabetical type; the execution module comprises:
a first determining submodule, configured to randomly determine, for a character on each bit of the target serial number, a numeric character as a character on the bit, when the type of the target serial number is a numeric type;
a second determining submodule, configured to randomly determine, for each digit of the target serial number, an alphabetic character as a character on the digit, when the target serial number is an alphabetic type; and
the third determining submodule is used for randomly determining each digit of the target serial number to be a digit or a letter digit under the condition that the type of the target serial number is a digit-letter mixed type; randomly determining a digit character for each digit as a character on the digit; and randomly determining an alphabetic character for each alphabetic digit to serve as the character on the alphabetic digit.
8. The apparatus of claim 6, wherein the first obtaining means comprises:
the second obtaining submodule is used for obtaining a mapping relation table; and
and the searching module is used for searching a target serial number set corresponding to the target serial number type in the mapping relation table according to the target serial number type.
9. A computing device, comprising:
one or more processors;
a memory for storing one or more computer programs,
wherein the one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 5.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN201911048395.1A 2019-10-29 2019-10-29 Method, apparatus, computing device and medium for generating transaction serial number Pending CN110795604A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911048395.1A CN110795604A (en) 2019-10-29 2019-10-29 Method, apparatus, computing device and medium for generating transaction serial number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911048395.1A CN110795604A (en) 2019-10-29 2019-10-29 Method, apparatus, computing device and medium for generating transaction serial number

Publications (1)

Publication Number Publication Date
CN110795604A true CN110795604A (en) 2020-02-14

Family

ID=69442235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911048395.1A Pending CN110795604A (en) 2019-10-29 2019-10-29 Method, apparatus, computing device and medium for generating transaction serial number

Country Status (1)

Country Link
CN (1) CN110795604A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112184367A (en) * 2020-09-17 2021-01-05 北京同邦卓益科技有限公司 Order processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208141A (en) * 2015-08-19 2015-12-30 魅族科技(中国)有限公司 Equipment coding processing method and server
CN107622102A (en) * 2017-09-11 2018-01-23 平安科技(深圳)有限公司 Entity card number generation method and terminal device
CN109255701A (en) * 2018-08-27 2019-01-22 宜人恒业科技发展(北京)有限公司 A kind of net loan business data processing method
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN110297824A (en) * 2019-05-23 2019-10-01 平安银行股份有限公司 Data record method, device, equipment and storage medium based on resource transfers
CN110377268A (en) * 2019-07-25 2019-10-25 中国工商银行股份有限公司 Serial number generation method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208141A (en) * 2015-08-19 2015-12-30 魅族科技(中国)有限公司 Equipment coding processing method and server
CN107622102A (en) * 2017-09-11 2018-01-23 平安科技(深圳)有限公司 Entity card number generation method and terminal device
CN109255701A (en) * 2018-08-27 2019-01-22 宜人恒业科技发展(北京)有限公司 A kind of net loan business data processing method
CN109376155A (en) * 2018-11-06 2019-02-22 泰康保险集团股份有限公司 ID generation method and device, storage medium and electronic equipment
CN110297824A (en) * 2019-05-23 2019-10-01 平安银行股份有限公司 Data record method, device, equipment and storage medium based on resource transfers
CN110377268A (en) * 2019-07-25 2019-10-25 中国工商银行股份有限公司 Serial number generation method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112184367A (en) * 2020-09-17 2021-01-05 北京同邦卓益科技有限公司 Order processing method and device
CN112184367B (en) * 2020-09-17 2024-05-24 北京同邦卓益科技有限公司 Order processing method and device

Similar Documents

Publication Publication Date Title
US20150161207A1 (en) Assisting query and querying
CN106919634B (en) Method for sharing data across applications and web browser
CN108701121B (en) Dispatching user input to multiple input fields in a user interface
JP6803702B2 (en) Servers and programs
EP3557437B1 (en) Systems and methods for search template generation
CN110609966B (en) Page display method, device and equipment thereof
CN110036381B (en) In-memory data search technique
CN110852720A (en) Document processing method, device, equipment and storage medium
CN110020040B (en) Method, device and system for querying data
CN110110184B (en) Information inquiry method, system, computer system and storage medium
CN110795604A (en) Method, apparatus, computing device and medium for generating transaction serial number
WO2019237949A1 (en) Search method and device
CN108363707B (en) Method and device for generating webpage
CN107977381B (en) Data configuration method, index management method, related device and computing equipment
CN111460273B (en) Information pushing method and device
US10601892B2 (en) Collaborative bookmarks
CN113032820B (en) File storage method, access method, device, equipment and storage medium
CN114461912A (en) Information processing method and device, electronic equipment and storage medium
US20190179952A1 (en) Searching base encoded text
CN112559825B (en) Service processing method, device, computing equipment and medium
CN110889040B (en) Method and device for pushing information
US11120054B2 (en) Hierarchical label generation for data entries
US20230102594A1 (en) Code page tracking and use for indexing and searching
CN111914065B (en) Short message content verification method, device, computer system and computer readable medium
US8935343B2 (en) Instant messaging network resource validation

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: 20200214

RJ01 Rejection of invention patent application after publication