A card BIN information query method and device, a storage medium and an equipment

By introducing a caching mechanism and a hierarchical storage structure in card BIN information query, the problems of high database pressure and low query efficiency are solved, and more efficient card BIN information recognition is achieved.

CN115599824BActive Publication Date: 2026-07-03PING AN BANK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN BANK CO LTD
Filing Date
2022-11-04
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

The current method of identifying the card BIN results in frequent database access, causing significant pressure and low query efficiency.

Method used

A caching mechanism is introduced to load the card BIN configuration information into the target cache. A two-layer storage structure is adopted, with the first layer storing the card number by its first and second digits and the second layer storing the card BIN length. Layered queries are performed through Guava caching.

Benefits of technology

This reduces the frequency and pressure on the database, and improves the efficiency and accuracy of BIN information retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599824B_ABST
    Figure CN115599824B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a card BIN information query method and device, a storage medium and equipment. In the method, a cache mechanism is introduced, card BIN configuration information in a database is loaded into a target cache, when a target card BIN input by an external application is received, the target cache is directly searched, the access frequency and pressure of the database are reduced, and the target cache performs layered processing on the card BIN configuration information, the first layer stores the card number according to the first digit, and the second layer stores the card BIN according to the length, so that in layered query, most of the non-target data can be filtered out before accurate identification, and the query efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of financial technology and information retrieval technology, and more specifically, to a method, apparatus, storage medium, and device for querying card BIN information. Background Technology

[0002] A card's BIN (Bank Identification Number), also known as the issuing bank identification code, is typically the first six digits of the bank card number. It is assigned by international standardization organizations to bank card organizations that handle interbank switching. Different card BINs represent different bank card organizations and card tiers. Users can use the card BIN to find information such as the corresponding issuing bank or card type.

[0003] Currently, the common method for identifying the BIN of a card in related technologies is to query a database using fuzzy search. However, this method tends to lead to frequent database accesses, which not only puts significant pressure on the database but also results in low query efficiency. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, storage medium, and device for querying card BIN information, aiming to solve the problems of high pressure on the database and low query efficiency in related technologies for identifying card BINs.

[0005] In a first aspect, an embodiment of this application provides a method for querying card BIN information, including:

[0006] The card BIN configuration information in the database is loaded into the target cache. The card BIN configuration information includes the configured card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure. The first layer storage structure stores the card number by the first digit, and the second layer storage structure stores the card BIN by the card BIN length.

[0007] Receive the target card BIN input from an external application, and perform a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length;

[0008] If a card BIN configuration information matching the target card BIN is found, the found card BIN configuration information is returned.

[0009] In the above implementation process, a caching mechanism is introduced to load the card BIN configuration information from the database into the target cache. When the target card BIN is received from an external application, the target cache is searched directly, reducing the access frequency and pressure on the database. Moreover, the target cache performs hierarchical processing of the card BIN configuration information. The first layer stores the information according to the first digit of the card number, and the second layer stores it according to the length of the card BIN. In this way, when performing hierarchical queries, most of the non-target data can be filtered out first before accurate identification, thereby improving query efficiency.

[0010] Furthermore, in some embodiments, the target cache is a Guava cache.

[0011] In the above implementation process, the lightweight Guava cache is used as the target cache, which is easier to configure and can reduce development complexity.

[0012] Furthermore, in some embodiments, loading the card BIN configuration information from the database into the target cache includes:

[0013] The card BIN configuration information in the database is periodically loaded into the target cache.

[0014] During the above implementation process, the card BIN configuration information in the database is periodically loaded into the target cache to improve the accuracy of card BIN information query.

[0015] Furthermore, in some embodiments, the target cache includes multiple cache partitions, each cache partition including a cache table; loading the card BIN configuration information from the database into the target cache includes:

[0016] Store the card BIN configuration information in the database into the cache partition of the target cache according to the first digit of the card number. Different first digits of the card number correspond to different cache partitions.

[0017] The card BIN configuration information in each cache partition is sorted in reverse order according to the card BIN length and stored in the cache table of the cache partition.

[0018] In the above implementation process, a solution is provided to perform hierarchical processing of card BIN configuration information. The first layer is classified according to the first and last digits of the card number, and the second layer is summarized in reverse order according to the length of the card BIN, so as to achieve faster and more accurate identification of card BIN information.

[0019] Furthermore, in some embodiments, the cache table is a hash table, where the key of the hash table records the configuration card BIN of each card BIN configuration information, and the value corresponding to the key records the mapping address of the card BIN information corresponding to the configuration card BIN.

[0020] In the above implementation process, using a hash table as a cache table can speed up the system's search for card BIN information.

[0021] Furthermore, in some embodiments, the step of performing a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length includes:

[0022] The cache partition to be queried is determined based on the first digit of the target card's BIN.

[0023] Based on the card BIN length of the target card BIN, query the cache table of the cache partition to be queried for card BIN configuration information that matches the target card BIN.

[0024] In the above implementation process, the cache partition to be queried is first determined according to the first digit of the target card BIN to filter out most of the non-target data. Then, according to the card BIN length of the target card BIN, the cache table of the cache partition to be queried queries the card BIN configuration information that matches the target card BIN to achieve fast and accurate identification, thereby improving query efficiency.

[0025] Further, in some embodiments, the step of querying the cache table of the cache partition to be queried for card BIN configuration information matching the target card BIN based on the card BIN length of the target card BIN includes:

[0026] The following steps are performed iteratively until the iteration termination condition is met:

[0027] Based on the card BIN length of the current target card BIN, determine the starting query position in the cache table of the cache partition to be queried;

[0028] Starting from the initial query position, the configuration card BIN recorded in the cache table is compared with the target card BIN in sequence to query whether there is card BIN configuration information that matches the target card BIN;

[0029] When the length of the BIN of the configuration card being compared is less than the length of the BIN of the current target card, the last digit of the current target card BIN is removed to obtain the new target card BIN.

[0030] The iteration termination condition includes either a query result of "yes" or the configuration card BIN being compared being the last element in the cache table.

[0031] In the above implementation process, prioritizing the matching of the longer card BIN configuration information based on the length of the target card BIN can reduce the number of traversals and comparisons, thereby improving recognition efficiency.

[0032] Secondly, an embodiment of this application provides a card BIN information query device, comprising:

[0033] The loading module is used to load the card BIN configuration information from the database into the target cache. The card BIN configuration information includes the configuration card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure, wherein the first layer storage structure stores the card number by the first digit and the second layer storage structure stores the card BIN by the card BIN length.

[0034] The query module is used to receive the target card BIN input by an external application and perform hierarchical queries in the target cache based on the first digit of the target card BIN and the card BIN length.

[0035] The output module is used to return the queried card BIN configuration information if a card BIN configuration information matching the target card BIN is found.

[0036] Thirdly, an electronic device provided in this application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the first aspects.

[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.

[0038] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.

[0039] Other features and advantages disclosed in this application will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the above-described technology disclosed in this application.

[0040] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a card BIN information query method provided in this application embodiment;

[0043] Figure 2 A schematic diagram illustrating the workflow of a multi-level configured card BIN identification scheme provided in this application embodiment;

[0044] Figure 3 A block diagram of a card BIN information query device provided in an embodiment of this application;

[0045] Figure 4 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0046] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0047] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0048] As described in the background section, existing card BIN identification schemes suffer from significant database load and low query efficiency. Therefore, this application provides a card BIN information query scheme to address these issues.

[0049] The embodiments of this application will be described below:

[0050] like Figure 1 As shown, Figure 1 This is a flowchart of a card BIN information query method provided in an embodiment of this application. The method can be applied to bank systems or other card-issuing institutions' systems.

[0051] The method includes:

[0052] In step 101, the card BIN configuration information in the database is loaded into the target cache. The card BIN configuration information includes the configured card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure, wherein the first layer storage structure stores the card number by the first digit and the second layer storage structure stores the card BIN by the card BIN length.

[0053] This embodiment introduces a caching mechanism in card BIN information querying. The card BIN configuration information stored in the database is loaded into the target cache. This allows for direct searching of the target cache when identifying the card BIN, eliminating the need to access the database and reducing database access frequency, thus lowering database load. In some embodiments, this target cache can be a Guava cache. Guava is an open-source local cache that provides cache eviction methods based on capacity, time, and references. Guava is a lightweight, high-performance cache that is easier to configure than other types of caches, reducing development complexity.

[0054] The card BIN configuration information mentioned in this step includes the configured card BIN and the corresponding card BIN information. The configured card BIN refers to the identifier range configured by the system for the bank card's BIN information. It can be the first few digits of the bank card number. In some scenarios, the configured card BIN can be the first N digits of the bank card number, where N is at least 6 and at most 16. The card BIN information can include the issuing bank, issuing bank code, bank card type, etc. The bank card type can include debit cards and credit cards, and can be further subdivided into transfer cards, special-purpose cards, stored-value cards, credit cards, and quasi-credit cards. For users, this card BIN information is the information they need to obtain.

[0055] In related technologies, the database configuration for card BIN information is at a single level, resulting in low query efficiency. Therefore, this embodiment employs a multi-level card BIN configuration, where the target cache processes the card BIN configuration information in layers. The first layer of storage stores the information according to the first digit of the card number, and the second layer stores it according to the card BIN length. This improves query efficiency.

[0056] In some embodiments, the target cache may include multiple cache partitions, each cache partition including a cache table; this step may include: storing the card BIN configuration information in the database into the cache partition of the target cache according to the first digit of the card number, with different first digits of the card number corresponding to different cache partitions; arranging the card BIN configuration information in each cache partition in reverse order according to the card BIN length, and storing it into the cache table of the cache partition. In other words, during loading, the cache partition corresponding to each card's BIN configuration information can be determined first based on the first digit of the card number. For example, the target cache can be set up with 10 cache partitions, corresponding to the first digits from 0 to 9. If the first digit of a card's BIN configuration information is 1, then the card's BIN configuration information should be stored in the cache partition corresponding to the first digit 1. Then, the card BIN configuration information in each cache partition is summarized in reverse order based on the card BIN length. Continuing with the previous example, the maximum card BIN length is 16 bits and the minimum is 6 bits. Therefore, the storage position of the card BIN configuration information with a card BIN length of 16 bits in the cache table is before the storage position of the card BIN configuration information with a card BIN length of 15 bits, the storage position of the card BIN configuration information with a card BIN length of 15 bits in the cache table is before the storage position of the card BIN configuration information with a card BIN length of 14 bits, and so on.

[0057] Furthermore, in some embodiments, the cache table can be a hash table, where the key of the hash table records the configuration card BIN of each card's BIN configuration information, and the value corresponding to the key records the mapping address of the card BIN information corresponding to the configuration card BIN. A hash table, also called a hash table, is a data structure that allows direct access to a specific value based on a given key. In other words, a hash table can map a key to a location in a table for direct access to the record, thus speeding up access. Here, the key is usually called the Key, and the record corresponding to the key is usually called the Value. In this embodiment, the key of the hash table records the configuration card BIN, and the value corresponding to the key records the mapping address of the card BIN information corresponding to the configuration card BIN, thereby speeding up the system's search for card BIN information.

[0058] It should be noted that in other embodiments, the cache partition of the target cache can also be replaced by other methods instead of the cache table. For example, each cache partition can include multiple sub-partitions, and different sub-partitions are used to store card BIN configuration information corresponding to different card BIN lengths. In this way, when querying, the cache partition can be determined first, then the sub-partitions can be determined, and then the matching card BIN configuration information can be located in the sub-partition.

[0059] Furthermore, considering that the card BIN configuration information in the database frequently needs to be updated, in some embodiments, this step may include periodically loading the card BIN configuration information from the database into the target cache. The set time period can be 2 hours, meaning the target cache is automatically reloaded from the database every 2 hours to improve the accuracy of card BIN information queries. Of course, this time period can be set according to the specific needs of the scenario, and this application does not impose any limitations on it.

[0060] In step 102, the target card BIN input from an external application is received, and a hierarchical query is performed in the target cache based on the first digit of the target card BIN and the card BIN length.

[0061] The external application mentioned in this step can be an application that provides services to the market or partners. Users can send the target card BIN to the system through the external application to query the card BIN information corresponding to the target card BIN. In other words, the external application can be considered a card BIN information query tool provided by the system to the user, which can call the interface provided by the system to input the target card BIN and receive the system's return information.

[0062] The target card BIN mentioned in this step is the number range entered by the user to query the card BIN information of a bank card. Under normal circumstances, this target card BIN should be completely consistent with a certain configured card BIN in the database. In this embodiment, the system performs a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length. That is, it first queries the first-level storage structure of the target cache according to the first digit of the target card BIN to filter out most non-target data, and then queries the second-level storage structure of the target cache according to the card BIN length, achieving fast and accurate identification, thereby improving query efficiency.

[0063] Specifically, when the target cache performs hierarchical processing of card BIN configuration information through cache partitions and cache tables, the system can determine the cache partition to be queried based on the first digit of the target card BIN. Then, based on the length of the target card BIN, it queries the cache table of the cache partition to be queried for the card BIN configuration information that matches the target card BIN. Taking the target card BIN as 101010 as an example, since the first digit of the target card BIN is 1, the cache partition to be queried corresponds to the cache partition with the first digit being 1. Since the length of the target card BIN is 6 digits, the system can start matching from the first 6-digit card BIN configuration information in the cache table corresponding to this cache partition. When a configuration card BIN that completely matches the target card BIN is found, the card BIN configuration information corresponding to that configuration card BIN is determined to be the card BIN configuration information that matches the target card BIN. In this way, based on the multi-level configuration of the target cache and the method of summarizing in reverse order according to the card BIN length, the target data can be queried more quickly and accurately.

[0064] Further, in some embodiments, the aforementioned method of querying the cache table of the cache partition to be queried for card BIN configuration information matching the target card BIN based on the card BIN length of the target card BIN may include: iteratively executing the following steps until the iteration termination condition is met: determining the starting query position in the cache table of the cache partition to be queried based on the current card BIN length of the target card BIN; starting from the starting query position, sequentially comparing the configuration card BINs recorded in the cache table with the target card BIN to query whether there is card BIN configuration information matching the target card BIN; when the card BIN length of the compared configuration card BIN is less than the card BIN length of the target card BIN, removing the last digit of the current target card BIN to obtain a new target card BIN; wherein, the iteration termination condition includes a query result of yes, or the position of the compared configuration card BIN in the cache table being the last digit.

[0065] This process essentially refers to prioritizing the matching of longer card BIN configuration information based on the length of the target card BIN. For example, if the maximum card BIN length is 16 bits and the minimum is 6 bits, and the target card BIN is 12 bits, then in the second-level query, the first 12-bit card BIN configuration information in the cache table can be used as the starting query position. The configuration card BIN and the target card BIN are compared sequentially. When a complete match is found, it is determined that a matching card BIN configuration information has been found. When the BIN of the configuration card being compared is 11 bits long, it indicates that all BIN configuration information with a length of 12 bits does not match the target BIN. In this case, the first 11 bits of the target BIN can be taken as the new target BIN. However, the query starts again from the first 11-bit BIN in the cache table, comparing the configuration card BIN and the target BIN sequentially, and so on, until a matching BIN is found or the last element of the cache table has been reached. This reduces the number of traversals and comparisons, improving recognition efficiency.

[0066] In step 103, if a card BIN configuration information matching the target card BIN is found, the found card BIN configuration information is returned.

[0067] After retrieving the card BIN configuration information that matches the target card BIN, the system can return this information to the external application for display to the user. Alternatively, if no matching card BIN configuration information is found, it indicates that the database does not contain the corresponding card BIN information. This is highly likely due to the user entering an incorrect card BIN. In this case, a query failure result can be returned to remind the user to enter the correct card BIN.

[0068] In this embodiment, a caching mechanism is introduced to load the card BIN configuration information from the database into the target cache. When the target card BIN is received from an external application, the target cache is searched directly, reducing the access frequency and pressure on the database. Moreover, the target cache performs hierarchical processing of the card BIN configuration information. The first layer stores the information according to the first digit of the card number, and the second layer stores it according to the length of the card BIN. In this way, during hierarchical querying, most of the non-target data can be filtered out first before accurate identification, thereby improving query efficiency.

[0069] To provide a more detailed explanation of the solution in this application, a specific embodiment is described below:

[0070] This embodiment relates to a scenario involving bank card BIN information query. In related technologies, the system queries a remote server database based on the user-inputted card BIN, resulting in frequent database access, high read pressure, and low query efficiency. Therefore, this embodiment provides a multi-level configured card BIN recognition scheme that reduces database pressure while improving query efficiency.

[0071] The workflow of this embodiment is as follows: Figure 2 As shown, the workflow includes:

[0072] S201. Periodically load the BIN configuration information from the remote server database into the Guava cache;

[0073] S202. Organize the storage structure according to a multi-level configuration method. Specifically, the card BIN configuration information is processed in layers. The first layer is a cache partition, which is stored according to the first and last digits of the card number. The second layer is a cache table, which is stored according to the card BIN length and summarized in reverse order according to the card BIN length.

[0074] S203. Receive card BIN query information input by an external application, which carries the target card BIN.

[0075] S204. Filter the first digit of the input, that is, determine the cache partition based on the first digit of the target card BIN;

[0076] S205. Calculate the card BIN length of the target card BIN and determine the starting query position in the cache table corresponding to the determined cache partition; the starting query position is the first card BIN configuration information in the cache table whose card BIN length is the same as the target card BIN.

[0077] S206. Starting from the initial query position, compare the BIN configuration information of each card with the target card BIN from top to bottom.

[0078] S207. Determine whether the BIN configuration information of the card being compared matches the BIN of the target card. If yes, execute S208; otherwise, execute S209.

[0079] S208. Return the card's BIN configuration information as a query result to the external application;

[0080] S209. Determine whether the card BIN length of the next card BIN configuration information to be compared is less than the card BIN length of the target card BIN. If yes, execute S210; otherwise, execute S211.

[0081] S210: Remove the last digit of the target card BIN to obtain a new target card BIN, then return to S205;

[0082] S211. Determine the card BIN configuration information to be compared next as the card BIN configuration information to be compared currently, and return to S207.

[0083] The solution in this embodiment has at least the following advantages: First, it introduces a caching mechanism, which reduces the frequency and pressure of database access; Second, it adopts a multi-level configuration, which can filter out most non-target data in the first-level filtering and identify card BIN information more quickly and accurately in the second-level matching. Moreover, since the second level summarizes in reverse order based on the card BIN length, it can reduce the number of times to traverse and compare downwards, thereby improving query efficiency.

[0084] Corresponding to the embodiments of the aforementioned methods, this application also provides embodiments of a card BIN information query device and a terminal for its application:

[0085] like Figure 3 As shown, Figure 3 This is a block diagram of a card BIN information query device provided in an embodiment of this application. The device includes:

[0086] The loading module 31 is used to load the card BIN configuration information in the database into the target cache. The card BIN configuration information includes the configuration card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure, wherein the first layer storage structure stores the card number by the first digit and the second layer storage structure stores the card BIN by the card BIN length.

[0087] The query module 32 is used to receive the target card BIN input by an external application and perform a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length.

[0088] Output module 33 is used to return the queried card BIN configuration information if a card BIN configuration information matching the target card BIN is found.

[0089] In some embodiments, the target cache described above is a Guava cache.

[0090] In some embodiments, the loading module 31 is specifically used to periodically load the card BIN configuration information in the database into the target cache.

[0091] In some embodiments, the target cache includes multiple cache partitions, each cache partition including a cache table; the loading module 31 includes a classification submodule and a summary submodule, wherein the classification submodule is used to: store the card BIN configuration information in the database into the cache partition of the target cache according to the first digit of the card number, with different first digits of the card number corresponding to different cache partitions; the summary submodule is used to: sort the card BIN configuration information in each cache partition in reverse order according to the card BIN length, and store it into the cache table of the cache partition.

[0092] In some embodiments, the cache table is a hash table, where the key of the hash table records the configuration card BIN of each card BIN configuration information, and the value corresponding to the key records the mapping address of the card BIN information corresponding to the configuration card BIN.

[0093] In some embodiments, the query module includes a hierarchical query module, which includes a filtering submodule and a matching submodule. The filtering submodule is used to: determine the cache partition to be queried based on the first digit of the target card BIN; the matching submodule is used to: query the cache table of the cache partition to be queried for card BIN configuration information that matches the target card BIN based on the card BIN length of the target card BIN.

[0094] In some embodiments, the matching submodule is specifically used to: iteratively execute the following steps until the iteration termination condition is met: determine the starting query position in the cache table of the cache partition to be queried based on the card BIN length of the current target card BIN; starting from the starting query position, sequentially compare the configuration card BINs recorded in the cache table with the target card BIN to query whether there is card BIN configuration information that matches the target card BIN; when the card BIN length of the compared configuration card BIN is less than the card BIN length of the current target card BIN, remove the last digit of the current target card BIN to obtain a new target card BIN; wherein, the iteration termination condition includes the query result being yes, or the position of the compared configuration card BIN in the cache table being the last digit.

[0095] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0096] This application also provides an electronic device, please refer to [link to application]. Figure 4 , Figure 4This is a structural block diagram of an electronic device provided in an embodiment of this application. The electronic device may include a processor 410, a communication interface 420, a memory 430, and at least one communication bus 440. The communication bus 440 is used to enable direct communication between these components. In this embodiment, the communication interface 420 of the electronic device is used for signaling or data communication with other node devices. The processor 410 may be an integrated circuit chip with signal processing capabilities.

[0097] The processor 410 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 410 can be any conventional processor.

[0098] The memory 430 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 430 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 410, the electronic device can perform the aforementioned operations. Figure 1 The various steps involved in the method implementation examples.

[0099] Alternatively, the electronic device may also include a storage controller and an input / output unit.

[0100] The memory 430, storage controller, processor 410, peripheral interface, and input / output unit are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 440. The processor 410 is used to execute executable modules stored in the memory 430, such as software function modules or computer programs included in electronic devices.

[0101] The input / output unit is used to provide users with the ability to create tasks and to set optional start periods or preset execution times for those tasks, thereby enabling user-server interaction. The input / output unit may be, but is not limited to, a mouse and keyboard.

[0102] Understandable. Figure 4 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown. Figure 4 The components shown can be implemented using hardware, software, or a combination thereof.

[0103] This application also provides a storage medium storing instructions. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, the method will not be described again here.

[0104] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0106] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0107] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0108] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0109] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0110] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for querying card BIN information, characterized in that, include: The card BIN configuration information in the database is loaded into the target cache. The card BIN configuration information includes the configured card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure. The first layer storage structure stores the card number by the first digit, and the second layer storage structure stores the card BIN by the card BIN length. Receive the target card BIN input from an external application, and perform a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length; If a card BIN configuration information matching the target card BIN is found, the found card BIN configuration information is returned; The step of performing a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length includes: querying the first layer of the target cache based on the first digit of the target card BIN, and then querying the second layer of the target cache based on the card BIN length.

2. The method of claim 1, wherein, The target cache is the Guava cache.

3. The method of claim 1, wherein, The step of loading the card BIN configuration information from the database into the target cache includes: The card BIN configuration information in the database is periodically loaded into the target cache.

4. The method of claim 1, wherein, The target cache includes multiple cache partitions, each cache partition including a cache table; loading the card BIN configuration information from the database into the target cache includes: Store the card BIN configuration information in the database into the cache partition of the target cache according to the first digit of the card number. Different first digits of the card number correspond to different cache partitions. The card BIN configuration information in each cache partition is sorted in reverse order according to the card BIN length and stored in the cache table of the cache partition.

5. The method of claim 4, wherein, The cache table is a hash table. The key of the hash table records the configuration card BIN of each card BIN configuration information, and the value corresponding to the key records the mapping address of the card BIN information corresponding to the configuration card BIN.

6. The method of claim 4, wherein, The step of performing a hierarchical query in the target cache based on the first digit of the target card BIN and the card BIN length includes: The cache partition to be queried is determined based on the first digit of the target card's BIN. Based on the card BIN length of the target card BIN, query the cache table of the cache partition to be queried for card BIN configuration information that matches the target card BIN.

7. The method of claim 6, wherein, The step of querying the cache table of the cache partition to be queried for card BIN configuration information that matches the target card BIN based on the card BIN length includes: The following steps are performed iteratively until the iteration termination condition is met: Based on the card BIN length of the current target card BIN, determine the starting query position in the cache table of the cache partition to be queried; Starting from the initial query position, the configuration card BIN recorded in the cache table is compared with the target card BIN in sequence to query whether there is card BIN configuration information that matches the target card BIN; When the length of the BIN of the configuration card being compared is less than the length of the BIN of the current target card, the last digit of the current target card BIN is removed to obtain the new target card BIN. The iteration termination condition includes either a query result of "yes" or the configuration card BIN being compared being the last element in the cache table.

8. A card BIN information inquiry apparatus, characterized by comprising: include: The loading module is used to load the card BIN configuration information from the database into the target cache. The card BIN configuration information includes the configuration card BIN and the corresponding card BIN information. The target cache includes a two-layer storage structure, wherein the first layer storage structure stores the card number by the first digit and the second layer storage structure stores the card BIN by the card BIN length. The query module is used to receive the target card BIN input by an external application and perform hierarchical queries in the target cache based on the first digit of the target card BIN and the card BIN length. The output module is used to return the queried card BIN configuration information if a card BIN configuration information matching the target card BIN is found. The query module is specifically used to query the first layer of the target cache based on the first digit of the target card BIN, and then query the second layer of the target cache based on the length of the target card BIN.

9. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method as described in any one of claims 1 to 7.

10. An electronic device, comprising: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any one of claims 1 to 7.