A card bin identification method of a bank card and related equipment

By storing bank card information in a BIN tree structure and traversing layer by layer to determine the target identification node, the problem of low bank card identification efficiency is solved, and efficient identification of bank card BIN information is achieved, reducing identification overhead and storage space.

CN114020875BActive Publication Date: 2025-11-18ZHEJIANG VIPSHOP PAYMENT SERVICES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111335446.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-11-18
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

Existing bank card identification methods are inefficient and cannot effectively identify the card's BIN information, leading to increased identification overhead.

Method used

The bank card information is stored using a BIN tree structure. The target identification node is determined by traversing the BIN tree layer by layer to obtain the card BIN information, which simplifies the identification process.

Benefits of technology

It improves bank card recognition efficiency, reduces recognition overhead, and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020875B_ABST
    Figure CN114020875B_ABST
Patent Text Reader

Abstract

The application discloses a bank card BIN identification method and related equipment, comprising: obtaining the card number and the card number length of a bank card to be identified; obtaining a pre-configured BIN tree, each branch of the BIN tree containing at least one identification node, in each branch, the digital string composed of the values corresponding to each node from the root node to the identification node representing a bank card, and the identification node corresponding to the card BIN information of the bank card; determining a target identification node according to the BIN tree, the card number and the card number length of the bank card to be identified; and obtaining the card BIN information pointed to by the target identification node. The above identification process of the application finds a branch matching the card BIN of the bank card to be identified according to the pre-configured BIN tree, the calculation process is simple, the identification efficiency of the bank card can be effectively improved, and the identification cost of the bank card is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, more particularly, to a bank card BIN identification method and related equipment. BACKGROUND

[0002] The bank card number includes a business number segment in the front part and a personal identification number segment in the back part, and the business number segment between various commercial banks has a unified provision. Initially, the first 6 digits of the bank card number represent the card issuing bank identification code, also known as BIN (Bank Identification Number), and different BIN numbers represent different bank card organizations, bank card levels and bank card categories and other information. With the development of financial business, the 6 digits gradually become insufficient to distinguish the attributes of the bank card, and the broad sense of card BIN information can include up to 10 or more digits.

[0003] At present, in the bank card identification, the card Bin information of the bank card can be matched to identify which bank the bank card is. Generally, according to the first 5 to 10 digits of the card number, plus the length of the bank card number, the number segment matched is queried in the database or cache through the exhaustive method to achieve the function of identifying the card BIN.

[0004] The above-mentioned bank card identification method has multiple matching identification processes for each card, and the identification efficiency is not high. With the popularization of mobile payment, it is necessary to study a card BIN identification method to improve the identification efficiency of the bank card and reduce the identification cost of the bank card. SUMMARY

[0005] Therefore, the present application provides a bank card BIN identification method and related equipment to improve the identification efficiency of the bank card.

[0006] To achieve the above-mentioned purpose, the first aspect of the present application provides a bank card BIN identification method, comprising:

[0007] obtaining the card number and the card number length of the bank card to be identified;

[0008] obtaining a pre-configured BIN tree, each branch of the BIN tree contains at least one identification node, in each branch, the digital string composed of the values of each node from the root node to the identification node represents a bank card, and the identification node corresponds to the card BIN information of the bank card;

[0009] determine a target recognition node according to the BIN tree, the card number of the bank card to be identified, and the card number length; wherein, in each node from the root node to the target recognition node on the branch where the target recognition node is located, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length in the card BIN information corresponding to the target recognition node is consistent with the card number length;

[0010] obtain the card BIN information pointed to by the target recognition node.

[0011] Preferably, the process of determining the target recognition node according to the BIN tree, the card number of the bank card to be identified, and the card number length comprises:

[0012] starting from the root node of the BIN tree, traverse the BIN tree layer by layer to determine a branch consistent with the first N digits of the card number of the bank card to be identified;

[0013] wherein, the value of the i-th layer node of the branch is the same as the i-th digit of the card number of the bank card to be identified, the N-th layer node of the branch is a recognition node, and the card number length in the card BIN information corresponding to the N-th layer node of the branch is equal to the card number length of the bank card to be identified, i and N are integers, and i takes a value from 1 to N;

[0014] determine the N-th layer node of the branch as the target recognition node.

[0015] Preferably, the process of starting from the root node of the BIN tree, traversing the BIN tree layer by layer to determine a branch consistent with the first N digits of the card number of the bank card to be identified comprises:

[0016] take the root node of the BIN tree as a parent node, and take the first digit of the card number of the bank card to be identified as a target digit;

[0017] from the child nodes of the parent node, determine whether there is a target child node with a value consistent with the target digit;

[0018] if there is no target child node with a value consistent with the target digit, it is confirmed that the bank card to be identified cannot be identified;

[0019] if there is a target child node with a value consistent with the target digit, determine whether the target child node is a recognition node;

[0020] if the target child node is a recognition node, obtain the target card BIN information corresponding to the target child node;

[0021] determine whether the card number length in the target card BIN information is consistent with the card number length;

[0022] If the card number length in the target card BIN information is consistent with the card number length, the branch where the target sub-node is located is determined as the branch consistent with the first N digits of the card number of the bank card to be identified, N is the number of layers where the target sub-node is located;

[0023] If the card number length in the target card BIN information is inconsistent with the card number length, or,

[0024] If the target sub-node is not an identification node:

[0025] the target sub-node is taken as a parent node, the next digit of the target digit in the card number of the bank card to be identified is taken as a target digit, and the operation of judging whether there is a target sub-node with a value consistent with the target digit from the child nodes of the parent node is executed.

[0026] Preferably, the BIN tree is generated according to the information of various bank cards in a bank card table, and the process of generating the BIN tree according to the information of various bank cards in the bank card table comprises:

[0027] creating a root node, and taking the root node as the root node of the BIN tree;

[0028] for each bank card in the bank card table:

[0029] obtaining the BIN number, the card number length and the associated information of the bank card;

[0030] taking the root node as a current node, and taking the first digit of the BIN number as a target digit;

[0031] judging whether the target digit is the last digit of the BIN number;

[0032] if yes, creating a sub-node under the current node, marking the sub-node as an identification node, and setting the value of the sub-node as the value of the target digit;

[0033] corresponding the sub-node to a card BIN information, the card BIN information comprising the BIN number, the card number length and / or the associated information;

[0034] if no, creating a sub-node under the current node, taking the sub-node as the current node, and setting the value of the sub-node as the value of the target digit;

[0035] obtaining the next digit of the target digit in the BIN number, taking the digit as a target digit, and returning to execute the operation of judging whether the target digit is the last digit of the BIN number.

[0036] Preferably, the process of corresponding the sub-node to a card BIN information comprises:

[0037] A pointer is set in the sub-node, and the pointer points to a card BIN information.

[0038] Preferably, the card BIN information is stored in a hash table, and the hash table is a hash table constructed by taking the length of the card number in the card BIN information as a key value.

[0039] The second aspect of the present application provides a card BIN identification device of a bank card, comprising:

[0040] A card information acquisition unit is configured to acquire a card number and a card number length of a bank card to be identified.

[0041] A BIN tree acquisition unit is configured to acquire a pre-configured BIN tree, wherein each branch of the BIN tree contains at least one identification node, and in each branch, a digital string composed of the values of the nodes from the root node to the identification node represents a bank card, and the identification node corresponds to the card BIN information of the bank card.

[0042] A node determination unit is configured to determine a target identification node according to the BIN tree, the card number and the card number length of the bank card to be identified, wherein in the branch where the target identification node is located, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length in the card BIN information corresponding to the target identification node is consistent with the card number length.

[0043] A card BIN identification unit is configured to acquire the card BIN information pointed to by the target identification node.

[0044] Preferably, the card BIN identification device of the bank card further comprises:

[0045] A BIN tree generation unit is configured to:

[0046] create a root node, and take the root node as the root node of the BIN tree;

[0047] for each bank card in the bank card table:

[0048] acquire the BIN number, the card number length and the associated information of the bank card;

[0049] take the root node as a current node, and take the first digit of the BIN number as a target digit;

[0050] determine whether the target digit is the last digit of the BIN number;

[0051] if yes, create a sub-node under the current node, mark the sub-node as an identification node, and set the value of the sub-node as the value of the target digit;

[0052] corresponding to the sub-node is a BIN number, a card number length and / or the association information;

[0053] If no, a sub-node is created under the current node, the sub-node is taken as the current node, a value of the sub-node is set as a value of the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed.

[0054] The next bit of the target bit in the BIN number is obtained, the bit is taken as the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed.

[0055] The third aspect of the present application provides a card BIN identification device of a bank card, comprising a memory and a processor.

[0056] The memory is configured to store a program.

[0057] The processor is configured to execute the program, and implement each step of the card BIN identification method of the bank card.

[0058] The fourth aspect of the present application provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements each step of the card BIN identification method of the bank card.

[0059] According to the technical solution, the card number and the card number length of the bank card to be identified are obtained first, then a BIN tree pre-configured is obtained, wherein each branch of the BIN tree contains at least one identification node, and a digital string composed of values of nodes from a root node to an identification node in each branch represents a bank card, and the identification node corresponds to card BIN information of the bank card. The BIN number of the bank card is stored in the form of a tree, which effectively saves storage space. Then, a target identification node is determined according to the BIN tree, the card number and the card number length of the bank card to be identified. In the branch where the target identification node is located, a value of an i-layer node in nodes from the root node to the target identification node is the same as an i-bit of the card number, and a card number length in the card BIN information corresponding to the target identification node is consistent with the card number length. Finally, card BIN information pointed to by the target identification node is obtained, the card BIN information contains information of the card BIN of the bank card to be identified, and thus the identification operation of the bank card to be identified is completed. The above identification process of the present application finds a branch matched with the BIN number of the bank card to be identified according to the BIN tree pre-configured, and the calculation process is simple, which can effectively improve the identification efficiency of the bank card and reduce the identification cost of the bank card. BRIEF DESCRIPTION OF DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below only illustrate some of the embodiments of the present application, and not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of the present application.

[0061] Figure 1 A schematic diagram of the card BIN identification method of the bank card disclosed in the embodiments of the present application;

[0062] Figure 2 A schematic diagram of determining the branch consistent with the first N digits of the card number of the bank card to be identified disclosed in the embodiments of the present application;

[0063] Figure 3 Another schematic diagram of determining the branch consistent with the first N digits of the card number of the bank card to be identified disclosed in the embodiments of the present application;

[0064] Figure 4 A schematic diagram of generating a BIN tree according to the information of various bank cards in a bank card table disclosed in the embodiments of the present application;

[0065] Figure 5 Another schematic diagram of generating a BIN tree according to the information of various bank cards in a bank card table disclosed in the embodiments of the present application;

[0066] Figure 6 Part of the information of the bank card table disclosed in the embodiments of the present application is illustrated;

[0067] Figure 7 Part of the branches of the BIN tree disclosed in the embodiments of the present application is illustrated;

[0068] Figure 8 A schematic diagram of the card BIN identification device of the bank card disclosed in the embodiments of the present application;

[0069] Figure 9 A schematic diagram of another card BIN identification device of the bank card disclosed in the embodiments of the present application;

[0070] Figure 10 A schematic diagram of the card BIN identification device of the bank card disclosed in the embodiments of the present application. DETAILED DESCRIPTION

[0071] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of the present application.

[0072] The card BIN identification method of the bank card provided by the embodiment of the present application is described below. Please refer to Figure 1 The card BIN identification method of the bank card provided by the embodiment of the present application can include the following steps:

[0073] Step S101, obtaining the card number and the card number length of the bank card to be identified.

[0074] The card number is the account number of the bank card to be identified, and the card number length is the number of digits of the account number of the bank card to be identified. For example, for a bank card with an account number of 370246888888888, the card number is 370246888888888, and the card number length is 15.

[0075] Step S102, obtaining a pre-configured BIN tree.

[0076] Each branch of the BIN tree contains at least one identification node, and in each branch, the digital string composed of the values of the nodes from the root node to the identification node represents a bank card, and the identification node corresponds to the card BIN information of the bank card.

[0077] For example, for one branch of the BIN tree, the values of the nodes from the root node to the leaf node are 3, 7, 0, 2, 4, and 6, respectively, wherein the leaf node is the identification node. Then 370246 represents a bank card, specifically a B bank credit card; and the identification node should have the card BIN information of the bank card, which can include the BIN number: 370246, the card number length: 15, and the bank card associated information: B bank credit card, and other information.

[0078] Step S103, determining a target identification node according to the BIN tree, the card number and the card number length of the bank card to be identified.

[0079] The target identification node satisfies the following conditions: in the branch where the target identification node is located, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length contained in the card BIN information corresponding to the target identification node is consistent with the card number length.

[0080] For example, the card number of the bank card to be identified is 370246888888888, the values of the nodes from the root node to the target identification node in the branch where the target identification node is located are 3, 7, 0, 2, 4, and 6, respectively, and the card number length in the card BIN information corresponding to the target identification node is 15.

[0081] Step S104, acquiring the card BIN information pointed by the target recognition node.

[0082] When the target recognition node is determined, the card BIN information pointed by the target recognition node contains the specific card BIN information of the bank card to be identified, thus completing the identification of the bank card BIN.

[0083] The embodiment of the present application first acquires the card number and the card number length of the bank card to be identified; then acquires the pre-configured BIN tree, wherein each branch of the BIN tree contains at least one recognition node, and in each branch, the digital string composed of the values of the nodes from the root node to the recognition node represents a bank card, and the recognition node corresponds to the card BIN information of the bank card. The BIN of the bank card is stored in the form of a tree, which effectively saves the storage space. Then, the target recognition node is determined according to the BIN tree, the card number and the card number length of the bank card to be identified. In the branch where the target recognition node is located, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length in the card BIN information corresponding to the target recognition node is consistent with the card number length. Finally, the card BIN information pointed by the target recognition node is acquired, which contains the information of the card BIN of the bank card to be identified, thus completing the identification operation of the bank card to be identified. The above identification process of the present application finds the branch matching the BIN number of the bank card to be identified according to the pre-configured BIN tree, and the calculation process is simple, which can effectively improve the identification efficiency of the bank card and reduce the identification cost of the bank card.

[0084] In some embodiments of the present application, the process of determining the target recognition node according to the BIN tree, the card number and the card number length of the bank card to be identified in the above step S103 can include:

[0085] S1, starting from the root node of the BIN tree, traversing the BIN tree layer by layer to determine the branch consistent with the first N digits of the card number of the bank card to be identified.

[0086] Wherein, the branch satisfies the following conditions: the value of the i-th layer node of the branch is the same as the i-th digit of the card number of the bank card to be identified, the N-th layer node of the branch is the recognition node, and the card number length in the card BIN information corresponding to the N-th layer node of the branch is equal to the card number length of the bank card to be identified. Wherein, i and N are integers, and i takes a value from 1 to N.

[0087] It can be understood that the root node is the 0-th layer node, which only exists as the root node of the BIN tree and contains no other information except the connection relationship with the child nodes.

[0088] S2, determine the Nth layer node of the branch as the target identification node.

[0089] The above embodiment matches the branch consistent with the first N digits of the card number of the bank card to be identified from the BIN tree through layer sequence traversal, and then determines the Nth layer node of the branch as the target identification node, so that the calculation process is simple and the calculation complexity is not high.

[0090] In some embodiments of the present application, please refer to Figure 2 and Figure 3 The process of determining the branch consistent with the first N digits of the card number of the bank card to be identified from the root node of the BIN tree through layer sequence traversal in the above S1 can include:

[0091] Step S201, taking the root node of the BIN tree as the parent node and the first digit of the card number of the bank card to be identified as the target digit.

[0092] Step S202, from the child nodes of the parent node, determine whether there is a target child node whose value is consistent with the target digit: if yes, execute step S203; if no, confirm that the bank card to be identified cannot be identified.

[0093] Step S203, determine whether the target child node is an identification node: if yes, execute step S204; if no, execute step S207.

[0094] Step S204, obtain the target card BIN information corresponding to the target child node.

[0095] Step S205, determine whether the card number length in the target card BIN information is consistent with the card number length: if yes, execute step S206; if no, execute step S207.

[0096] Step S206, determine the branch where the target child node is as the branch consistent with the first N digits of the card number of the bank card to be identified.

[0097] Wherein, N is the layer number of the target child node.

[0098] Step S207, taking the target child node as the parent node and the next digit of the target digit in the card number of the bank card to be identified as the target digit, returning to execute step S202.

[0099] It can be understood that in the above step S207, when the target digit in the card number of the bank card to be identified is the last digit of the card number of the bank card to be identified, the target digit does not have the next digit. At this time, the next digit of the target digit cannot be obtained, and in this case, it can be confirmed that the bank card to be identified cannot be identified.

[0100] Therefore, before step S207, a judging operation can be added to determine whether the target digit is the last digit in the card number of the bank card to be identified.

[0101] In some embodiments of the present application, please refer to Figure 3 and Figure 4 The BIN tree mentioned above is generated according to the information of various bank cards in the bank card table. The process of generating the BIN tree according to the information of various bank cards in the bank card table can include:

[0102] Step S301, a root node is created, and the root node is taken as the root node of the BIN tree.

[0103] For each bank card in the bank card table:

[0104] Step S302, the BIN number, the card number length and the associated information of the bank card are obtained.

[0105] Step S303, the first digit of the BIN number is taken as the target digit, and the root node is taken as the current node.

[0106] Step S304, it is judged whether the target digit is the last digit of the BIN number. If yes, step S305 is executed, and if no, step S307 is executed.

[0107] Step S305, a child node is created under the current node, the child node is marked as an identification node, and the value of the child node is set as the value of the target digit.

[0108] Step S306, the child node is corresponded to a card BIN information, and the card BIN information includes the BIN number, the card number length and the associated information.

[0109] At this point, the card BIN of the bank card is established, and step S302 is returned to construct the branch of the card BIN of the next bank card.

[0110] Step S307, a child node is created under the current node, the child node is taken as the current node, and the value of the child node is set as the value of the target digit.

[0111] Step S308, the next digit of the target digit in the BIN number is obtained, the digit is taken as the target digit, and step S304 is returned.

[0112] Figure 6 Part of the information in the bank card table is exemplarily given. The process of generating the BIN tree is introduced below by taking the bank card with the BIN number 370246 as an example.

[0113] First, the BIN number of the bank card is obtained as 370246, the card number length is 15, and the associated information is a B bank credit card. Then, taking the root node as the current node and taking the first digit (digit 3) of the BIN number as the target digit, since the target digit is not the last digit of the BIN number, a child node is created under the current node, taking the child node as the current node, and setting the value of the child node as the value of the target digit "3". Then, the next digit of the target digit in the BIN number is obtained, i.e., the second digit (digit 7) of the BIN number, taking the digit as the target digit, and returning to step S304.

[0114] Until the sixth digit (digit 6) of the BIN number, step S305 is executed, a child node is created under the current node, the child node is marked as an identification node, and the value of the child node is set as 6. Then, the child node is mapped to a card BIN information, and the card BIN information includes the BIN number, the card number length, and the associated information.

[0115] Finally, the state of the BIN number in the BIN tree is as shown in Figure 7

[0116] In some embodiments of the present application, the process of mapping the child node to a card BIN information in step S306 can include:

[0117] A pointer is set in the child node, and the pointer points to a card BIN information.

[0118] In the above embodiments, the identification node is linked to the corresponding card BIN information in the form of a pointer, so that the BIN number and the card BIN information are stored separately, the structure of the BIN tree is simplified, and the byte space occupied by the BIN tree is optimized.

[0119] In some embodiments of the present application, the card BIN information mentioned above is stored in a hash table, and the hash table is a hash table constructed by taking the card number length in the card BIN information as the key value.

[0120] Next, a bank card card BIN identification device provided by the embodiments of the present application is described. The bank card card BIN identification device described below can be correspondingly referred to the bank card card BIN identification method described above.

[0121] Referring to Figure 8 The bank card card BIN identification device provided by the embodiments of the present application can include:

[0122] The card information acquisition unit 21 is configured to acquire the card number and the card number length of the bank card to be identified.

[0123] ​The BIN tree acquisition unit 22 is configured to acquire a preconfigured BIN tree, each branch of the BIN tree comprising at least one identification node, and in each branch, a digital string composed of values corresponding to nodes from a root node to an identification node represents a bank card, and the identification node corresponds to card BIN information of the bank card.

[0124] The node determination unit 23 is configured to determine a target identification node according to the BIN tree, the card number of the bank card to be identified, and the card number length.

[0125] The card BIN identification unit 24 is configured to acquire card BIN information pointed to by the target identification node.

[0126] In some embodiments of the present application, the process of determining the target identification node by the node determination unit 23 according to the BIN tree, the card number of the bank card to be identified, and the card number length can comprise:

[0127] Starting from the root node of the BIN tree, the BIN tree is traversed layer by layer to determine a branch consistent with the first N digits of the card number of the bank card to be identified.

[0128] The value of the i-th layer node of the branch is the same as the i-th digit of the card number of the bank card to be identified, the N-th layer node of the branch is an identification node, the card number length in the card BIN information corresponding to the N-th layer node of the branch is equal to the card number length of the bank card to be identified, i and N are integers, and i is an integer from 1 to N.

[0129] The N-th layer node of the branch is determined as the target identification node.

[0130] In some embodiments of the present application, the process of starting from the root node of the BIN tree, traversing the BIN tree layer by layer, and determining a branch consistent with the first N digits of the card number of the bank card to be identified by the node determination unit 23 can comprise:

[0131] The root node of the BIN tree is taken as a parent node, and the first digit of the card number of the bank card to be identified is taken as a target digit.

[0132] From the child nodes of the parent node, it is determined whether there is a target child node with a value consistent with the target digit.

[0133] If there is no target child node with a value consistent with the target digit, it is confirmed that the bank card to be identified cannot be identified.

[0134] If the target sub-node exists, it is determined whether the target sub-node is a recognition node;

[0135] If the target sub-node is a recognition node, target card BIN information corresponding to the target sub-node is acquired;

[0136] It is determined whether the card number length in the target card BIN information is consistent with the card number length;

[0137] If the card number length in the target card BIN information is consistent with the card number length, a branch where the target sub-node is located is determined as a branch consistent with the first N digits of the card number of the bank card to be recognized, N being the number of layers where the target sub-node is located;

[0138] If the card number length in the target card BIN information is inconsistent with the card number length, or,

[0139] If the target sub-node is not a recognition node:

[0140] the target sub-node is taken as a parent node, a digit next to the target digit in the card number of the bank card to be recognized is taken as a target digit, and the operation of determining whether a target sub-node with a value consistent with the target digit exists from the child nodes of the parent node is executed.

[0141] In some embodiments of the present application, referring to Figure 9 the bank card BIN recognition device can further include:

[0142] a BIN tree generation unit 25, configured to:

[0143] create a root node, and take the root node as a root node of a BIN tree;

[0144] for each bank card in a bank card table:

[0145] acquire a BIN number, a card number length and associated information of the bank card;

[0146] take the root node as a current node, and take a first digit of the BIN number as a target digit;

[0147] determine whether the target digit is the last digit of the BIN number;

[0148] if yes, create a sub-node under the current node, mark the sub-node as a recognition node, and set a value of the sub-node to a value of the target digit;

[0149] correspond the sub-node to a card BIN information, the card BIN information including the BIN number, the card number length and / or the associated information;

[0150] If no, a child node is created under the current node, the child node is taken as the current node, a value of the child node is set as a value of the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed again.

[0151] The next bit of the target bit in the BIN number is obtained, the bit is taken as the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed again.

[0152] In some embodiments of the present application, the BIN tree in the card BIN identification device of the bank card is generated according to information of various bank cards in a bank card table, and the process of generating the BIN tree according to the information of various bank cards in the bank card table can include:

[0153] A root node is created, and the root node is taken as a root node of the BIN tree.

[0154] For each bank card in the bank card table:

[0155] The BIN number, the card number length and the associated information of the bank card are obtained.

[0156] The root node is taken as a current node, and a first bit of the BIN number is taken as a target bit.

[0157] It is judged whether the target bit is the last bit of the BIN number.

[0158] If yes, a child node is created under the current node, the child node is marked as an identification node, and a value of the child node is set as a value of the target bit.

[0159] The child node is corresponded to a card BIN information, and the card BIN information includes the BIN number, the card number length and / or the associated information.

[0160] If no, a child node is created under the current node, the child node is taken as the current node, a value of the child node is set as a value of the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed again.

[0161] The next bit of the target bit in the BIN number is obtained, the bit is taken as the target bit, and the operation of judging whether the target bit is the last bit of the BIN number is executed again.

[0162] The card BIN identification device of the bank card provided in the embodiments of the present application can be applied to a card BIN identification device of a bank card, such as a computer and the like. Optionally, Figure 10 A hardware structure block diagram of the card BIN identification device of the bank card is shown, and the hardware structure of the card BIN identification device of the bank card can include at least one processor 31, at least one communication interface 32, at least one memory 33 and at least one communication bus 34. Figure 10 ​

[0163] In the embodiments of the present application, the number of the processor 31, the communication interface 32, the memory 33 and the communication bus 34 is at least one, and the processor 31, the communication interface 32 and the memory 33 complete the communication with each other through the communication bus 34;

[0164] The processor 31 can be a central processing unit CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present application, etc.

[0165] The memory 32 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory, etc.

[0166] The memory 33 stores a program, and the processor 31 can invoke the program stored in the memory 33, and the program is used for:

[0167] Obtaining a card number and a card number length of a bank card to be identified;

[0168] Obtaining a pre-configured BIN tree, each branch of the BIN tree includes at least one identification node, in each branch, a digital string composed of the values of the nodes from the root node to the identification node represents a bank card, and the identification node corresponds to card BIN information of the bank card;

[0169] According to the BIN tree, the card number and the card number length of the bank card to be identified, a target identification node is determined, wherein in the branch where the target identification node is located, the value of the i-th layer node in the nodes from the root node to the target identification node is the same as the i-th bit of the card number, and the card number length in the card BIN information corresponding to the target identification node is consistent with the card number length;

[0170] Obtaining the card BIN information pointed to by the target identification node.

[0171] Optionally, the detailed functions and extended functions of the program can refer to the description above.

[0172] The embodiments of the present application also provide a storage medium, which can store a program suitable for a processor to execute, and the program is used for:

[0173] Obtaining a card number and a card number length of a bank card to be identified;

[0174] obtain a pre-configured BIN tree, each branch of the BIN tree comprising at least one identification node, in each branch, a digital string composed of values corresponding to nodes from a root node to the identification node represents a bank card, and the identification node corresponds to card BIN information of the bank card;

[0175] determine a target identification node according to the BIN tree, the card number of the bank card to be identified, and the card number length; wherein in a branch where the target identification node is located, a value of an i-layer node is the same as an i-bit of the card number, and a card number length in the card BIN information corresponding to the target identification node is consistent with the card number length;

[0176] obtain the card BIN information pointed to by the target identification node.

[0177] Optionally, the refinement function and the extension function of the program can refer to the description above.

[0178] In summary:

[0179] The application first obtains a card number and a card number length of a bank card to be identified, and then obtains a pre-configured BIN tree, wherein each branch of the BIN tree comprises at least one identification node, in each branch, a digital string composed of values corresponding to nodes from a root node to the identification node represents a bank card, and the identification node corresponds to card BIN information of the bank card. The BIN number of the bank card is stored in the form of a tree, which effectively saves storage space. Then, a target identification node is determined according to the BIN tree, the card number of the bank card to be identified, and the card number length. In a branch where the target identification node is located, a value of an i-layer node is the same as an i-bit of the card number, and a card number length in the card BIN information corresponding to the target identification node is consistent with the card number length. Finally, the card BIN information pointed to by the target identification node is obtained, which contains the card BIN information of the bank card to be identified, and thus the identification operation of the bank card to be identified is completed. The above identification process of the application finds a branch matched with the card BIN of the bank card to be identified according to the pre-configured BIN tree, and the calculation process is simple, which can effectively improve the identification efficiency of the bank card and reduce the identification cost of the bank card.

[0180] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are not intended to denote the presence of any such actual relationship or order. Moreover, the terms "include", "have", or any other variant thereof are intended to encompass non-exclusive inclusions, such that processes, methods, articles, or apparatuses that comprise a list of elements are not required to comprise only those elements in the list, but can include other elements not expressly listed, or also include elements inherent in such processes, methods, articles, or apparatuses. Without additional restrictions, an element preceded by "comprises... a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the stated element.

[0181] The various embodiments in the specification are described in progressive order with each embodiment building on one or more of the previous embodiments, however the order of the embodiments described is not intended to be construed as a requirement or limitation for these embodiments. Any one or more of the embodiments described with reference to a particular set of one or more other embodiments are optionally employable together with one or more other embodiments and / or in any appropriate combination.

[0182] The above description of disclosed embodiments is intended to be illustrative and not restrictive. Many embodiments will be apparent to those of skill in the art upon reading and understanding the above description, the applications, therefore, are not limited to the embodiments described above but can be practiced with modification and alteration within the scope and spirit of the appended claims. Accordingly, the ensure scope of the application is set forth in the following claims.

Claims

1. A method for identifying the BIN (Bank Identifier) ​​of a bank card, characterized in that, include: Obtain the card number and card number length of the bank card to be identified; Obtain a pre-configured BIN tree, each branch of which contains at least one identification node. In each branch, a string of numbers composed of the values ​​corresponding to each node from the root node to the identification node represents a bank card. The identification node corresponds to the card BIN information of the bank card. Based on the BIN tree, the card number of the bank card to be identified, and the card number length, a target identification node is determined; wherein, on the branch where the target identification node is located, among the nodes from the root node to the target identification node, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length in the card BIN information corresponding to the target identification node is consistent with the card number length. Obtain the card BIN information pointed to by the target identification node; The process involves traversing the BIN tree layer by layer, starting from the root node, to identify branches that match the first N digits of the bank card number to be identified. The BIN tree is generated based on information from various bank cards in a bank card table. This generation process includes: creating a node and using it as the root of the BIN tree; for each bank card in the bank card table: obtaining the BIN number, card number length, and associated information; using the root node as the current node and the first digit of the BIN number as the target digit; and determining whether the target digit is the most significant digit of the BIN number. If the next digit is the target digit, create a child node under the current node, mark the child node as an identification node, and set the value of the child node to the value of the target digit; map the child node to a card BIN information, the card BIN information including the BIN number, the card number length, and / or the association information; if not, create a child node under the current node, use the child node as the current node, and set the value of the child node to the value of the target digit; obtain the next digit of the target digit in the BIN number, use the next digit as the target digit, and return to perform the operation of determining whether the target digit is the last digit of the BIN number.

2. The method according to claim 1, characterized in that, Starting from the root node of the BIN tree, the process of traversing the BIN tree level by level to determine the branch that matches the first N digits of the card number of the bank card to be identified includes: Using the root node of the BIN tree as the parent node, and the first digit of the card number of the bank card to be identified as the target number; Determine whether there exists a target child node whose value matches the target number among the child nodes of the parent node; If there is no target child node with a value matching the target number, then it is confirmed that the bank card to be identified cannot be identified; If there is a target child node whose value matches the target number, determine whether the target child node is an identification node; If the target sub-node is an identification node, obtain the target card BIN information corresponding to the target sub-node; Determine whether the card number length in the target card BIN information is consistent with the card number length; If the card number length in the target card BIN information is the same as the card number length, then the branch where the target sub-node is located is determined to be the branch that is consistent with the first N digits of the card number of the bank card to be identified, where N is the layer number where the target sub-node is located; If the card number length in the target card BIN information is inconsistent with the card number length, or if the target child node is not an identification node: Then, taking the target child node as the parent node and the last digit of the target number in the card number of the bank card to be identified as the target number, the operation of determining whether there is a target child node with the same value as the target number from the child nodes of the parent node is returned.

3. The method according to claim 1, characterized in that, The process of mapping the child nodes to a card's BIN information includes: Set a pointer in the child node, the pointer pointing to a card BIN information.

4. The method according to claim 1, characterized in that, The card BIN information is stored in a hash table, which is constructed using the card number length in the card BIN information as the key.

5. A bank card BIN recognition device, characterized in that, include: The card information acquisition unit is used to acquire the card number and card number length of the bank card to be identified; BIN tree acquisition unit is used to acquire a pre-configured BIN tree. Each branch of the BIN tree contains at least one identification node. In each branch, a string of numbers composed of the values ​​corresponding to each node from the root node to the identification node represents a bank card. The identification node corresponds to the card BIN information of the bank card. The node determination unit is used to determine the target identification node based on the BIN tree, the card number of the bank card to be identified, and the card number length; wherein, on the branch where the target identification node is located, among the nodes from the root node to the target identification node, the value of the i-th layer node is the same as the i-th digit of the card number, and the card number length in the card BIN information corresponding to the target identification node is consistent with the card number length. Card BIN identification unit, used to obtain the card BIN information pointed to by the target identification node; It also includes a BIN tree generation unit, used for: Starting from the root node of the BIN tree, the BIN tree is traversed level by level to determine the branch that matches the first N digits of the card number of the bank card to be identified. The BIN tree is generated based on the information of various bank cards in the bank card table. The process of generating the BIN tree based on the information of various bank cards in the bank card table includes: creating a node, using the root node as the root node of the BIN tree; for each bank card in the bank card table: obtaining the BIN number, card number length, and associated information of the bank card; using the root node as the current node, using the first digit of the BIN number as the target digit; determining whether the target digit is the last digit of the BIN number. If yes, create a child node under the current node, mark the child node as an identification node, and set the value of the child node to the value of the target digit; map the child node to a card BIN information, the card BIN information including the BIN number, the card number length, and / or the association information; if no, create a child node under the current node, use the child node as the current node, and set the value of the child node to the value of the target digit; obtain the next digit of the target digit in the BIN number, use the digit as the target digit, and return to perform the operation of determining whether the target digit is the last digit of the BIN number.

6. A device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the bank card BIN identification method as described in any one of claims 1 to 4.

7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the bank card BIN identification method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Query method, device and equipment for bank identification code

    CN108563685A