[go: up one dir, main page]

CN112612790B - Card number configuration method, device, equipment and computer storage medium - Google Patents

Card number configuration method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN112612790B
CN112612790B CN202011496820.6A CN202011496820A CN112612790B CN 112612790 B CN112612790 B CN 112612790B CN 202011496820 A CN202011496820 A CN 202011496820A CN 112612790 B CN112612790 B CN 112612790B
Authority
CN
China
Prior art keywords
card number
card
target
character string
determining
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.)
Active
Application number
CN202011496820.6A
Other languages
Chinese (zh)
Other versions
CN112612790A (en
Inventor
唐兼善
江旻
吴磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011496820.6A priority Critical patent/CN112612790B/en
Publication of CN112612790A publication Critical patent/CN112612790A/en
Application granted granted Critical
Publication of CN112612790B publication Critical patent/CN112612790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • 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/2282Tablespace storage structures; Management thereof
    • 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/23Updating
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of financial science and technology (Fintech), and discloses a card number configuration method, which comprises the following steps: obtaining a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section, and detecting whether an input scene requirement is received; if the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices; determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number. The invention also discloses a card number configuration device, equipment and a computer storage medium. The invention improves the high concurrency and high real-time performance of card number distribution.

Description

Card number configuration method, device, equipment and computer storage medium
Technical Field
The present invention relates to the technical field of financial science and technology (Fintech), and in particular, to a card number configuration method, apparatus, device, and computer storage medium.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain Blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial science and technology (Fintech), but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put on card number configuration technology. At present, the conventional offline banks generally adopt a mode of generating specified card bin in advance, writing all card numbers with specified length into a database, designating some conditions and the number of the card numbers according to the requirements of products, screening a batch of cards in advance, feeding the cards Shang Zhi with the cards, and marking the card numbers as used. However, for online banking, when a customer opens an account by using a banking application program and an applet, a card number needs to be allocated to the customer in real time, and the concurrency requirement is greatly improved. For the internet banking products of hundred million users, the highest card opening TPS (Transact ion Per Second, system throughput) required by the internet banking products can reach more than 1000; on the basis of high concurrency and high real-time performance, personalized requirements are also provided for the card numbers. The off-line bank cannot meet the demands of the on-line bank, so how to improve the high concurrency and high real-time of card number distribution becomes the current urgent problem to be solved.
Disclosure of Invention
The invention mainly aims to provide a card number configuration method, device, equipment and computer storage medium, which aim to solve the technical problems of how to improve high concurrency and high real-time performance of card number allocation.
In order to achieve the above object, the present invention provides a card number configuration method, which includes the following steps:
Obtaining a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section, and detecting whether an input scene requirement is received;
If the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices;
determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number.
Optionally, after the step of detecting whether an input scene need is received, the method includes:
If the scene requirement is received, determining a keyword corresponding to the scene requirement, and detecting whether a character string corresponding to the keyword is a variable character string or not;
And if the character string corresponding to the keyword is a fixed character string, acquiring all matched card numbers matched with the keyword based on the card number table, determining a target card number based on each matched card number, and outputting the target card number.
Optionally, after the step of detecting whether the character string corresponding to the keyword is a variable character string, the method further includes:
If the character string corresponding to the keyword is a variable character string, determining the position of the card number with the variable character string in the card number table, and constructing a bitmap according to each position;
Determining whether available card numbers exist in all card numbers with the variable character string based on the bitmap;
And if the available card number exists, outputting the available card number as a target card number.
Optionally, after the step of detecting whether the character string corresponding to the keyword is a variable character string, the method further includes:
If the character string corresponding to the keyword comprises a variable character string and a fixed character string, determining all matching card numbers corresponding to the fixed character string and bitmaps corresponding to the variable character string according to the card number table;
and constructing an inverted index table according to the bitmap and each matched card number, acquiring a card number with an available state in the inverted index table, taking the card number with the available state as a target card number, and outputting the target card number.
Optionally, the step of acquiring the card number with the available state in the inverted index table and taking the card number with the available state as the target card number includes:
Traversing all packets in the inverted index table, and determining whether the traversed packets are available packets;
If the traversed packet is an unavailable packet, continuing to traverse the next packet of the traversed packet based on a preset time interval until the traversed packet reaches the available packet, and acquiring a card number with an available state from the available packet;
Updating the state of the card number with the available state from the available state to the used state, and taking the updated card number as a target card number.
Optionally, the step of determining a target slice in each slice includes:
Determining the number of fragments of each fragment, and detecting whether the number of fragments is larger than a preset threshold value;
And if the number of the fragments is larger than a preset threshold, randomly acquiring one fragment from the fragments as a target fragment.
Optionally, after the step of detecting whether the number of slices is greater than a preset threshold, the method includes:
if the number of the fragments is smaller than or equal to a preset threshold, determining the number of queuing and card opening requests in each fragment, determining the target queuing and card opening request number with the minimum number in the queuing and card opening request numbers, and taking the fragments corresponding to the target queuing and card opening request number as target fragments.
Optionally, after the step of detecting whether the input scene requirement is received, further includes:
If the scene demand is not received and the card number table is not subjected to slicing processing, determining an un-updated card number of an unused section in the card number table, and updating the state of the un-updated card number and an optimistic lock version number corresponding to the un-updated card number;
And if the updating is successful, outputting the card number which is not updated as a target card number.
In addition, in order to achieve the above object, the present invention also provides a card number configuration device, including:
the acquisition module is used for acquiring a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section and detecting whether an input scene requirement is received or not;
the slicing processing module is used for performing slicing processing on the card number table if the scene requirement is not received so as to obtain a plurality of slices;
The determining module is used for determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number.
In addition, to achieve the above object, the present invention also provides a card number configuration apparatus including: the card number configuration method comprises the steps of a memory, a processor and a card number configuration program which is stored in the memory and can run on the processor, wherein the card number configuration program realizes the card number configuration method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer storage medium having stored thereon a card number configuration program which, when executed by a processor, implements the steps of the card number configuration method as described above.
According to the method, the card section corresponding to the card product number of the target product is obtained, the card number table corresponding to the card section is determined, and whether the input scene requirement is received or not is detected; if the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices; determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number. By firstly determining the card number table of the card section corresponding to the card product number of the target product, and when the situation demand is not received, carrying out slicing processing on the card number table to obtain each slice, and obtaining the target card number according to the current cursor of the target slice in each slice for outputting.
Drawings
FIG. 1 is a schematic diagram of a card number configuration device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a card number configuration method according to a first embodiment of the present invention;
FIG. 3 is a schematic diagram of a device module of the card number configuration device of the present invention;
FIG. 4 is a schematic diagram showing a card number in the method for configuring a card number according to the present invention;
FIG. 5 is a schematic flow chart of the mapping of card product numbers and card segments in the card number configuration method of the present invention;
FIG. 6 is a schematic flow chart of a slicing process in the card number configuration method of the present invention;
fig. 7 is a schematic flow chart of card number configuration according to scene requirements in the card number configuration method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As shown in fig. 1, fig. 1 is a schematic diagram of a card number configuration device of a hardware running environment according to an embodiment of the present invention.
The card number configuration device of the embodiment of the invention can be a PC or a server device, and a Java virtual machine is operated on the card number configuration device.
As shown in fig. 1, the card number configuration apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a display (Di sp l ay), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-vo l at i le memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the card number configuration device structure shown in fig. 1 does not constitute a limitation of the device, and may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a card number configuration program may be included in a memory 1005 as one type of computer storage medium.
In the card number configuration device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call a card number configuration program stored in the memory 1005 and perform operations in a card number configuration method described below.
Based on the hardware structure, the embodiment of the card number configuration method is provided.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a card number configuration method according to the present invention, where the method includes:
Step S10, a card section corresponding to a card product number of a target product is obtained, a card number table corresponding to the card section is determined, and whether an input scene requirement is received or not is detected;
Because the current card number configuration scheme has a plurality of inconveniences for online banking, in the embodiment, a high-performance bank card number distribution mode is described, the performance of real-time card number distribution is greatly improved through a logic level splitting and slicing mode, and the splitting and slicing functions can be expanded as required. In addition, in the embodiment, the optimal personalized card number can be rapidly screened out through the efficient index structure so as to meet the card opening requirement of internet products and facilitate the rapid access of various products of banks.
In this embodiment, the card number is exemplified by a 19-bit Unionpay card number. In the case of a fixed card bin of 6 bits and 1 check bit, the card number may be divided into 5 parts as shown in fig. 4, i.e., 6 bits of card bin, such as 623633; 2-bit card type, for service standby, such as 00;3 bit card section, self-defined logic probability, used for making sub-table, such as 700; 7-bit sequence numbers from 0 to 9999999, totaling 1000 ten thousand; the 1 check bit is calculated from the first 18 bits by some algorithm, such as X. Wherein, the card bin is the prefix of the card number to distinguish which institution the card number belongs to. That is, as can be seen from fig. 4, when the card bin and the card type are fixed, 1000 3-bit card Segments (SECTION) are provided, each SECTION has 1000 ten thousand available cards, so that a logic sub-table can be performed for each SECTION to obtain a corresponding card number table, and 1000 ten thousand rows can be set in each card number table, and one row corresponds to one card number.
In this embodiment, a card product number is configured for each product, that is, if a product party that finds a new product applies for accessing the card number configuration system, the mapping relationship between the card segments and the card product numbers may be 1 to more or 1 to more, as shown in fig. 5, when the card product numbers are 100002 and the card segments are 700 and 701, the mapping relationship between 100002 and 700 and 701 may be set. When the card product numbers 100007,100013 and 100027 and the card section 124 are used, the mapping relationship between the three card product numbers 100007,100013 and 100027 and the card section 124 can be set. And if the user quantity of the development of one product is about to exceed the existing capacity, the card number table corresponding to the product can be dynamically expanded.
And the table name of the card number table in this embodiment is performed in such a manner as tm _ $ { product_cd } -card_no_p $ { SECTION }. For example, as shown in the following table, is a card number table of tm_100002_card_no_p700.
tm_100002_card_no_p700
Therefore, after the corresponding card number table is configured for each card section and the mapping relation between each card product number and each card section is established. When the card handling requirement input by the user is received, the target product corresponding to the card handling requirement is required to be determined, the card product number of the target product is determined, the card section corresponding to the card product number is determined according to the mapping relation, and the card number table corresponding to the card section is acquired, so that the target card number corresponding to the card handling requirement is acquired according to the card number table. In this embodiment, in order to meet the personalized requirement of the user, it is further required to detect whether an input scene requirement is received, where the scene requirement may be input by a product side or a user, and execute different operation steps according to different detection results.
Step S20, if the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices;
When the judgment finds that the scene requirement is not received, the card number table can be subjected to slicing processing. In order to ensure that one card can be allocated only once, when a card opening request comes, the card number table needs to be locked for serialization operation, and the performance is too low, so that the waiting time for acquiring the lock can be reduced through the split lock, and the split lock divides a data interval into a plurality of pieces, so that lock conflicts are dispersed on a plurality of locks corresponding to the plurality of splits, and the waiting time of the lock is reduced. For example, if a card number table contains 1000 ten thousand card numbers, it can be divided into 10 pieces (i.e., 10 pieces), each of which is 100 ten thousand. In addition, in order to avoid trouble in searching caused by too many fragments, each fragment can be summarized to obtain a fragment index table. For example, the slice index table tm_100002_card_no_idx may be as shown in the following table.
tm_100002_card_no_idx
Numbering device Card bin Clamping section Current cursor Index starting point Index endpoint
1 623633 700 5 1 1000000
2 623633 700 10002 1000001 2000000
3 623633 701 8 1 1000000
And step S30, determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number.
When each slice is obtained and stored in the slice index table, but before the slice record is locked by using pessimistic lock, the slice is cached in the database, in order to reduce the number of queries to the database, in this embodiment, the slice record is cached in a global ConcurrentHashMap (concurrent thread), refreshed every 30 minutes, and the slice is removed when it is used up. In this embodiment, in order to disperse the card request pressure as much as possible, it is ensured that the card opening request is uniformly distributed in each of the fragments, the number of fragments is detected, and if the number of fragments is large, one fragment is randomly selected as the target fragment. However, if the number of fragments is small, the target fragments need to be determined according to the number of queued card opening requests of each fragment. For example, when the number of fragments is greater than 5, randomly selecting one fragment as the target fragment, if the number of fragments is less than or equal to 5, determining the number of queuing card opening requests on each fragment, and selecting the fragment with the minimum queuing card opening request number as the target fragment.
Moreover, when the target fragments are determined according to the number of the queued card opening requests, TPS which can be supported by the system can be estimated. Assuming that the opening time of each opening request requires 8ms, each slice supports 1s/8 ms=125tps, and 10 slices can support 1250 TPS.
When the target fragment is obtained, the current cursor in the target fragment can be determined, all available card numbers in the target fragment are determined according to the current cursor, one available fragment is selected from the available card numbers to serve as the target card number, and then the target card number is output to a client held by a user. The current cursor refers to the position where the card number is used in the slice, namely the demarcation point of the usable card number and the unusable card number.
In addition, to assist understanding of the card number configuration flow in the present embodiment, the following description will be given by way of example.
For example, as shown in fig. 6, when card number configuration is started, a corresponding fragment index table tm_ $ { product_cd } -card_idx is found according to the PRODUCT number entered; then selecting an available fragment in the fragment index table, locking each row corresponding to the fragment by using pessimistic locks, using the current cursor of the fragment, selecting the unused card number which is larger than the cursor, as the target card number, updating the cursor and the number of the used cards, and returning the card number, namely returning the target card number to the card handling user.
In this embodiment, a card segment corresponding to a card product number of a target product is obtained, a card number table corresponding to the card segment is determined, and whether an input scene requirement is received or not is detected; if the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices; determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number. By firstly determining the card number table of the card section corresponding to the card product number of the target product, and when the situation demand is not received, carrying out slicing processing on the card number table to obtain each slice, and obtaining the target card number according to the current cursor of the target slice in each slice for outputting.
Further, based on the first embodiment of the present invention, a second embodiment of the card number configuration method of the present invention is provided, in this embodiment, step S10 in the above embodiment, after the step of detecting whether the input scene requirement is received, includes:
step a, if the scene requirement is received, determining a keyword corresponding to the scene requirement, and detecting whether a character string corresponding to the keyword is a variable character string or not;
In this embodiment, because in many current scenarios, in order to provide the best service and experience to the customer, there is generally a certain scenario requirement, for example, four consecutive digits of the card number are required to be consistent with the date of birth of the customer or four digits after the phone number of the customer; requiring as many consecutive 6 and 8, etc. as possible. Therefore, when the scene demand is received, it is necessary to determine the keyword corresponding to the scene demand, determine whether the character string corresponding to the keyword is a variable character string, and execute different operations according to different detection results. Wherein the variable string is such that the position of the character in the string is not fixed, e.g. 6 and 8 consecutive as much as possible in the card number is required.
And b, if the character string corresponding to the keyword is a fixed character string, acquiring all matched card numbers matched with the keyword based on the card number table, determining a target card number based on each matched card number, and outputting the target card number.
When the character string corresponding to the keyword is found to be a fixed character string (the position of the character string is fixed), the character string of the keyword and the character strings of all the card numbers in the card number table can be matched to obtain the matched card number matched with the keyword, and then one of the obtained matched card numbers is selected as the target card number to be output. When a plurality of keywords exist, the matching card numbers corresponding to the keywords are required to be obtained, and one target matching card number matched with all the keywords is selected from the matching card numbers to be used as the target card number for outputting. For example, if the scene requirement is that the character string required to be matched is the birthday of the user, the last 4 bits of the mobile phone number are the first 10 months and the last 4 bits of the mobile phone number are 5215, and the search finds that there are 5000 card numbers including the character string 1010 and 5000 character strings including the character string 5215, as shown in the following table 1.
Numbering device Inverted index string Inverted index set
1 0000 [1,205,478,...,100021]
2 1010 [16,102,278,323,959,2000001]
3 5215 [102,205,278,...,102925,6802346]
4 9999 [325,208,2438,...,331921,8801346]
TABLE 1
As can be seen from table 1, when the intersection of the character strings 1010 and 5215 is 278, a card number satisfying the condition is found, and after the card number of the tag card table is used, the card number needs to be deleted from the intersection. If there is no intersection, then the priority is reversed to select any of the matching sets using one string.
In this embodiment, when it is determined that a scene demand is received, a keyword corresponding to the scene demand is determined first, and when a character string corresponding to the keyword is a fixed character string, a matching card number matched with the keyword in a card number table is obtained and is output as a target card number, so that the personalized demand of card number configuration is realized, and the accuracy of the obtained target card number is ensured.
Further, after the step of detecting whether the character string corresponding to the keyword is a variable character string, the method further includes:
C, if the character string corresponding to the keyword is a variable character string, determining the position of the card number with the variable character string in the card number table, and constructing a bitmap according to each position;
Step d, determining whether available card numbers exist in all card numbers with the variable character string based on the bitmap;
And e, if the available card number exists, outputting the available card number as a target card number.
In this embodiment, when it is judged that the character string corresponding to the keyword is a variable character string, for example, 8 is required as much as possible, and a plurality of character strings including 8 exist. At this time, it is necessary to determine the positions of all the card numbers with variable strings, and then construct a bitmap according to the positions, that is, compress the index set, that is, the bitmap may be used for storage, where 0 represents unavailable and 1 represents available, that is, it may be determined whether the index is available according to the numbers in the bitmap, and then determine whether the card number corresponding to the index is available. In order to improve the processing efficiency, the bitmap is cached in the application service memory to be asynchronously updated and loaded. For the non-variable character strings, the indexes can be inverted in a digital set mode, and the indexes are grouped according to the starting positions of the card numbers where the matching character strings are located, so that the index range is reduced, the calculated amount and single-row updating of the database are reduced, and the possibility of optimistic lock conflicts is reduced. Also in the present embodiment, after the grouping, when the set size of the grouping is smaller than 1000, the grouping combining may be performed asynchronously.
In this embodiment, after the bitmap is obtained, whether available card numbers exist in all the card numbers of the variable character string can be determined according to the bitmap, and if the available card numbers exist and a plurality of available card numbers exist, one of the available card numbers is randomly selected to be output as the target card number.
In this embodiment, by setting the character string corresponding to the keyword as the variable character string, constructing a bitmap according to the position of the card number of the variable character string in the card number table, and outputting the available card number as the target card number when determining that the available card number exists according to the bitmap, the personalized requirement of card number configuration is realized, and the accuracy of the obtained target card number is ensured.
Further, after the step of detecting whether the character string corresponding to the keyword is a variable character string, the method further includes:
F, if the character string corresponding to the keyword comprises a variable character string and a fixed character string, determining all matching card numbers corresponding to the fixed character string and bitmaps corresponding to the variable character string according to the card number table;
in this embodiment, if the character string corresponding to the keyword includes a variable character string and a fixed character string, for example, the scene requirement is that the card number includes a mobile phone tail number 5215 and has at least one bit 8. At this time, all the card numbers matched with the fixed character string, namely, the matched card numbers, need to be determined in the card number table. The corresponding bitmap is also required to be constructed according to the variable character strings, and the bitmap construction mode is the same as the above mode, and is not described here.
And g, constructing an inverted index table according to the bitmap and each matched card number, acquiring a card number with an available state in the inverted index table, taking the card number with the available state as a target card number, and outputting the target card number.
And after obtaining the bitmap and each matching card number, a corresponding inverted index table may be constructed, for example, a fixed string 5215, a variable string 8, for example, the inverted index table may be as described in table 2 below,
After the inverted index table is acquired, the card number with the available state can be acquired in the inverted index table, and the card number with the available state can be output as the target card number. For example, as shown in fig. 7, when card number configuration is started, a location 5215, such as 12, is selected randomly, an index set thereof is loaded, and a bitmap of character 8 is obtained. And traversing 5215, wherein the position is an index set group of 12, checking whether the index set group is available through bitmap, getbit (index), if not available after traversing all the groups, namely, if not available, checking whether the execution time exceeds 2s, and if not, loading the next group. If so, the degradation is a mismatch 8. When the index set group is found to be available, the card number is updated to be used, whether the updating is successful or not is detected, if the updating is failed, the index in the 5215 set in the database is deleted, and the bit corresponding to the bitmap in the marked memory is 0 (unavailable). If successful, deleting the index in the 5215 set in the database, marking the bit corresponding to the bitmap in the memory as 0 (unavailable), and returning the card number to the card handling user.
In addition, when the card number configuration operation is performed in this embodiment, each application server needs to update the latest bitmap in the memory to the database at regular time and reload, and when updating, pessimistic locks are needed to be used, incremental updating is needed, and bitwise or operation is performed by using the bitmap in the memory and the bitmap of the database. And when the sum of the grouping sets is less than 1000, grouping of ALL the set modes is combined, and ALL is used for the position.
In this embodiment, when it is determined that the character string corresponding to the keyword includes a variable character string and a fixed character string, an inverted index table is constructed according to a bitmap corresponding to the variable character string and all matching card numbers corresponding to the fixed character string, and a card number in an available state is obtained in the inverted index table and is output as a target card number, so that personalized requirements of card number configuration are achieved, and accuracy of the obtained target card number is ensured.
Further, the step of obtaining the card number with the available state in the inverted index table and taking the card number with the available state as a target card number includes:
Step q, traversing all the packets in the inverted index table, and determining whether the traversed packets are available packets;
In this embodiment, after the inverted index table is built, all the packets in the inverted index table need to be traversed, whether all the card numbers in the traversed packets are available or not is determined, and if all the card numbers are unavailable, the traversed packets are determined to be unavailable packets. However, if the card number is available in the traversed packet, the traversed packet is taken as an available packet.
Step w, if the traversed packet is an unavailable packet, continuing to traverse the next packet of the traversed packet based on a preset time interval until the traversed packet reaches the available packet, and acquiring a card number with an available state from the available packet;
And step t, updating the state of the card number with the available state from the available state to the used state, and taking the updated card number as a target card number.
When the traversed packet is found to be an unavailable packet through judgment, the next non-traversed packet needs to be traversed continuously, namely, after a preset time interval (any time interval set in advance by a user, such as 2 s) is elapsed, the next packet is traversed continuously, whether the next packet is an available packet or not is determined, if the next packet is not the available packet, the next non-traversed packet is traversed continuously until the traversed packet is the available packet, then the available card number in the available packet is obtained, when a plurality of available card numbers exist in the available card number, one card number is selected randomly, the state of the available card number is updated from the available card number to the used card number, and the updated card number is used as a target card number.
In this embodiment, by traversing all the packets in the inverted index table, and when it is determined that the traversed packet is an unavailable packet, traversing is continued based on a preset time interval until the traversed packet is an available packet, and the card number in the available packet, the status of which is available, is updated to determine the target card number, thereby ensuring the validity of the obtained target card number.
Further, based on the first embodiment of the present invention, a third embodiment of the card number configuration method of the present invention is provided, in this embodiment, step S30 in the above embodiment, a step of determining a target slice in each slice includes:
step h, determining the number of fragments of each fragment, and detecting whether the number of fragments is larger than a preset threshold value;
In this embodiment, after the card number table is subjected to the slicing process, each slice is stored in the slice index table, so that the number of slices (i.e., the number of slices) can be determined in the slice index table, whether the number of slices is greater than a preset threshold (any threshold set in advance by a user, such as 5,10, etc.) is detected, and then different operations are performed according to different detection results.
And step k, if the number of the fragments is larger than a preset threshold, randomly acquiring one fragment from the fragments as a target fragment.
In this embodiment, when the number of fragments is found to be greater than the preset threshold through judgment, one fragment can be directly selected randomly from the fragments as a target fragment, and a target card number is obtained and output according to the current cursor in the target fragment.
In this embodiment, when the number of fragments of each fragment is greater than a preset threshold, one fragment is randomly acquired as a target fragment, so that the efficiency of acquiring the target fragment is ensured.
Specifically, after the step of detecting whether the number of slices is greater than a preset threshold, the method includes:
and m, if the number of the fragments is smaller than or equal to a preset threshold, determining the number of the queuing and card opening requests in each fragment, determining the target queuing and card opening request number with the minimum number in the queuing and card opening request numbers, and taking the fragments corresponding to the target queuing and card opening request number as target fragments.
In this embodiment, when the number of fragments is found to be smaller than or equal to the preset threshold through judgment, that is, the number of fragments is too small, the number of queuing opening requests in all fragments needs to be determined first, the number of queuing opening requests is compared, the number of queuing opening requests with the minimum number is determined in the number of queuing opening requests according to the comparison result, the number of queuing opening requests is used as the target number of queuing opening requests, and fragments corresponding to the target number of queuing opening requests are used as target fragments.
In this embodiment, when the number of fragments is determined to be less than or equal to the preset threshold, the fragments corresponding to the target number of queuing and opening requests with the minimum number of queuing and opening requests in each fragment are used as target fragments, so that the efficiency of card number configuration is ensured.
Further, after the step of detecting whether the input scene requirement is received, the method further includes:
Step n, if the scene requirement is not received, determining an un-updated card number of an unused section in the card number table, and updating the state of the un-updated card number and an optimistic lock version number corresponding to the un-updated card number;
and step x, if the updating is successful, outputting the card number which is not updated as a target card number.
In this embodiment, when it is determined that the scene requirement is not received and the fragmentation processing is not performed, an unused interval may be determined in advance in the card number table, an unused card number, that is, an un-updated card number, is obtained in the unused interval, and the status of the un-updated card number and the optimistic lock version number are updated, and if the updating is not successful, a new un-updated card number is reselected to continue the updating operation. If the updating is successful, the card number which is not updated is used as the target card number to be output.
In this embodiment, when it is determined that the scene requirement is not received, the card number table determines an un-updated card number in the un-used section, and when the state of the un-updated card number and the optimistic lock version number are updated successfully, the un-updated card number is output as the target card number, thereby ensuring the accuracy of the obtained target card number.
The present invention also provides a card number configuration device, referring to fig. 3, the card number configuration device includes:
The acquisition module A10 is used for acquiring a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section, and detecting whether an input scene requirement is received;
the slicing processing module a20 is configured to perform slicing processing on the card number table to obtain a plurality of slices if the scene requirement is not received;
The determining module a30 is configured to determine a target fragment in each fragment, obtain a current cursor in the target fragment, obtain a target card number in the target fragment according to the current cursor, and output the target card number.
Further, the acquiring module a10 is configured to:
If the scene requirement is received, determining a keyword corresponding to the scene requirement, and detecting whether a character string corresponding to the keyword is a variable character string or not;
And if the character string corresponding to the keyword is a fixed character string, acquiring all matched card numbers matched with the keyword based on the card number table, determining a target card number based on each matched card number, and outputting the target card number.
Further, the acquiring module a10 is configured to:
If the character string corresponding to the keyword is a variable character string, determining the position of the card number with the variable character string in the card number table, and constructing a bitmap according to each position;
Determining whether available card numbers exist in all card numbers with the variable character string based on the bitmap;
And if the available card number exists, outputting the available card number as a target card number.
Further, the acquiring module a10 is configured to:
If the character string corresponding to the keyword comprises a variable character string and a fixed character string, determining all matching card numbers corresponding to the fixed character string and bitmaps corresponding to the variable character string according to the card number table;
and constructing an inverted index table according to the bitmap and each matched card number, acquiring a card number with an available state in the inverted index table, taking the card number with the available state as a target card number, and outputting the target card number.
Further, the acquiring module a10 is configured to:
Traversing all packets in the inverted index table, and determining whether the traversed packets are available packets;
If the traversed packet is an unavailable packet, continuing to traverse the next packet of the traversed packet based on a preset time interval until the traversed packet reaches the available packet, and acquiring a card number with an available state from the available packet;
Updating the state of the card number with the available state from the available state to the used state, and taking the updated card number as a target card number.
Further, the determining module a30 is configured to:
Determining the number of fragments of each fragment, and detecting whether the number of fragments is larger than a preset threshold value;
And if the number of the fragments is larger than a preset threshold, randomly acquiring one fragment from the fragments as a target fragment.
Further, the determining module a30 is configured to:
if the number of the fragments is smaller than or equal to a preset threshold, determining the number of queuing and card opening requests in each fragment, determining the target queuing and card opening request number with the minimum number in the queuing and card opening request numbers, and taking the fragments corresponding to the target queuing and card opening request number as target fragments.
Further, the acquiring module a10 is configured to:
If the scene demand is not received, determining an un-updated card number of an unused section in the card number table, and updating the state of the un-updated card number and an optimistic lock version number corresponding to the un-updated card number;
And if the updating is successful, outputting the card number which is not updated as a target card number.
The method executed by each program unit may refer to each embodiment of the card number configuration method of the present invention, and will not be described herein.
The invention also provides a computer storage medium.
The computer storage medium of the present invention stores therein a card number configuration program which, when executed by a processor, implements the steps of the card number configuration method as described above.
The method implemented when the card number configuration program running on the processor is executed may refer to various embodiments of the card number configuration method of the present invention, which are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. The card number configuration method is characterized by comprising the following steps of:
Obtaining a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section, and detecting whether an input scene requirement is received;
If the scene requirement is received, determining a keyword corresponding to the scene requirement, and detecting whether a character string corresponding to the keyword is a variable character string or not;
If the character string corresponding to the keyword is a fixed character string, acquiring all matched card numbers matched with the keyword based on the card number table, determining a target card number based on each matched card number, and outputting the target card number;
if the character string corresponding to the keyword is a variable character string, determining the position of the card number with the variable character string in the card number table, and constructing a bitmap according to each position; determining whether available card numbers exist in all card numbers with the variable character string based on the bitmap; if the available card number exists, outputting the available card number as a target card number;
If the scene requirement is not received, performing slicing processing on the card number table to obtain a plurality of slices; determining a target fragment in each fragment, acquiring a current cursor in the target fragment, acquiring a target card number in the target fragment according to the current cursor, and outputting the target card number.
2. The card number configuration method as claimed in claim 1, wherein after the step of detecting whether the character string corresponding to the keyword is a variable character string, further comprising:
If the character string corresponding to the keyword comprises a variable character string and a fixed character string, determining all matching card numbers corresponding to the fixed character string and bitmaps corresponding to the variable character string according to the card number table;
and constructing an inverted index table according to the bitmap and each matched card number, acquiring a card number with an available state in the inverted index table, taking the card number with the available state as a target card number, and outputting the target card number.
3. The card number allocation method according to claim 2, wherein the step of acquiring the card number whose status is available in the inverted index table and taking the card number whose status is available as a target card number includes:
Traversing all packets in the inverted index table, and determining whether the traversed packets are available packets;
If the traversed packet is an unavailable packet, continuing to traverse the next packet of the traversed packet based on a preset time interval until the traversed packet reaches the available packet, and acquiring a card number with an available state from the available packet;
Updating the state of the card number with the available state from the available state to the used state, and taking the updated card number as a target card number.
4. The card number allocation method according to claim 1, wherein said step of determining a target slice among the slices comprises:
Determining the number of fragments of each fragment, and detecting whether the number of fragments is larger than a preset threshold value;
And if the number of the fragments is larger than a preset threshold, randomly acquiring one fragment from the fragments as a target fragment.
5. The card number allocation method according to claim 4, wherein after the step of detecting whether the number of fragments is greater than a preset threshold, comprising:
if the number of the fragments is smaller than or equal to a preset threshold, determining the number of queuing and card opening requests in each fragment, determining the target queuing and card opening request number with the minimum number in the queuing and card opening request numbers, and taking the fragments corresponding to the target queuing and card opening request number as target fragments.
6. A card number arrangement apparatus, characterized in that the card number arrangement apparatus comprises:
the acquisition module is used for acquiring a card section corresponding to a card product number of a target product, determining a card number table corresponding to the card section and detecting whether an input scene requirement is received or not;
the slicing processing module is used for performing slicing processing on the card number table if the scene requirement is not received so as to obtain a plurality of slices;
The determining module is used for determining target fragments in the fragments, acquiring current cursors in the target fragments, acquiring target card numbers in the target fragments according to the current cursors, outputting the target card numbers, determining keywords corresponding to the scene requirements if the scene requirements are received, detecting whether character strings corresponding to the keywords are variable character strings or not, acquiring all matching card numbers matched with the keywords based on the card number table if the character strings corresponding to the keywords are fixed character strings, determining the target card numbers based on the matching card numbers, and outputting the target card numbers; if the character string corresponding to the keyword is a variable character string, determining the position of the card number with the variable character string in the card number table, and constructing a bitmap according to each position; and determining whether available card numbers exist among all card numbers having the variable character string based on the bitmap; and the method is used for outputting the available card number as a target card number if the available card number exists.
7. A card number configuration apparatus, characterized in that the card number configuration apparatus comprises: memory, a processor and a card number configuration program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the card number configuration method of any one of claims 1 to 5.
8. A computer storage medium, wherein a card number configuration program is stored on the computer storage medium, which when executed by a processor, implements the steps of the card number configuration method according to any one of claims 1 to 5.
CN202011496820.6A 2020-12-17 2020-12-17 Card number configuration method, device, equipment and computer storage medium Active CN112612790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011496820.6A CN112612790B (en) 2020-12-17 2020-12-17 Card number configuration method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011496820.6A CN112612790B (en) 2020-12-17 2020-12-17 Card number configuration method, device, equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN112612790A CN112612790A (en) 2021-04-06
CN112612790B true CN112612790B (en) 2024-06-18

Family

ID=75240995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011496820.6A Active CN112612790B (en) 2020-12-17 2020-12-17 Card number configuration method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112612790B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342819B (en) * 2021-06-28 2024-09-20 深圳前海微众银行股份有限公司 Card number generation method, device, equipment and storage medium
CN116645751B (en) * 2023-06-27 2023-11-24 深圳市亲邻科技有限公司 IC card information changing method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095263A (en) * 2014-05-08 2015-11-25 阿里巴巴集团控股有限公司 Generation method for card number and apparatus thereof

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7308446B1 (en) * 2003-01-10 2007-12-11 Cisco Technology, Inc. Methods and apparatus for regular expression matching
US20160027000A1 (en) * 2014-07-23 2016-01-28 Bank Of America Corporation Mobile one-time bank card number generator for digital wallet
CN105956921A (en) * 2016-05-24 2016-09-21 中国银行股份有限公司 Method and device for selecting bankcard number by user himself/herself
CN108256054A (en) * 2018-01-15 2018-07-06 腾讯科技(深圳)有限公司 The method and apparatus for determining destination number set
KR20180048543A (en) * 2018-04-30 2018-05-10 주식회사 비즈모델라인 Method for Operating Dynamic Card Information
CN109542894B (en) * 2018-10-22 2023-07-11 平安科技(深圳)有限公司 User data centralized storage method, device, medium and computer equipment
CN109710619B (en) * 2018-12-29 2023-09-29 中国银联股份有限公司 Database capacity expansion method, device and readable medium
CN111914956A (en) * 2019-05-08 2020-11-10 威海新北洋荣鑫科技股份有限公司 Unordered card issuing method and device, card issuing machine and computer readable storage medium
CN111414379A (en) * 2020-03-20 2020-07-14 深圳前海微众银行股份有限公司 Serial number generation method, apparatus, device, and computer-readable storage medium
CN111563109B (en) * 2020-04-26 2023-09-01 北京奇艺世纪科技有限公司 Radix statistics method, apparatus, system, device, and computer-readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095263A (en) * 2014-05-08 2015-11-25 阿里巴巴集团控股有限公司 Generation method for card number and apparatus thereof

Also Published As

Publication number Publication date
CN112612790A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
EP3292481B1 (en) Method, system and computer program product for performing numeric searches
CN109325032B (en) Index data storage and retrieval method, device and storage medium
CN109033295B (en) Method and device for merging super-large data sets
US20120303624A1 (en) Dynamic rule reordering for message classification
CN111045988B (en) File searching method, device and computer program product
KR20130036094A (en) Managing storage of individually accessible data units
CN112612790B (en) Card number configuration method, device, equipment and computer storage medium
CN110036381B (en) In-memory data search technique
US20250181560A1 (en) Deduplication of data with two types of fingerprints
US20030158725A1 (en) Method and apparatus for identifying words with common stems
EP2897054A2 (en) Entity resolution from documents
CN107357794B (en) Method and device for optimizing data storage structure of key value database
CN115576947A (en) Data management method and device, combined library, electronic equipment and storage medium
CN112231400B (en) Access method, device, equipment and storage medium of distributed database
CN117369731B (en) Data reduction processing method, device, equipment and medium
CN114205424B (en) Bill file decompression method, device, computer equipment and storage medium
CN113076456B (en) Data search processing method, device, electronic device and storage medium
CN116957041A (en) Method, device and computing equipment for compressing neural network model
CN107085571B (en) Method and device for executing check rule
CN115455425A (en) Method, system, equipment and storage medium for generating protection patch
CN107943832A (en) Method for processing business and device
CN117729176B (en) Method and device for aggregating application program interfaces based on network address and response body
CN105468603A (en) Data selection method and apparatus
CN119691081B (en) Relational database table synchronization method and terminal device
CN116680367B (en) Data matching method, data matching device and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant