CN115757436A - Label retrieval method for EMV transaction - Google Patents

Label retrieval method for EMV transaction Download PDF

Info

Publication number
CN115757436A
CN115757436A CN202211583389.8A CN202211583389A CN115757436A CN 115757436 A CN115757436 A CN 115757436A CN 202211583389 A CN202211583389 A CN 202211583389A CN 115757436 A CN115757436 A CN 115757436A
Authority
CN
China
Prior art keywords
emv
label
hash
tag
list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211583389.8A
Other languages
Chinese (zh)
Inventor
邱华良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Liandi Commercial Technology Co ltd
Original Assignee
Fujian Liandi Commercial Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Liandi Commercial Technology Co ltd filed Critical Fujian Liandi Commercial Technology Co ltd
Priority to CN202211583389.8A priority Critical patent/CN115757436A/en
Publication of CN115757436A publication Critical patent/CN115757436A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a label retrieval method for EMV transaction, which uses an EMV label list for storing EMV label data and related information thereof in the process of EMV transaction, and is characterized by comprising the following steps: step 1: performing Hash operation on all EMV label names in the EMV label list, establishing a Hash positioning table which is completely mapped with the EMV label list, and storing the position information of all EMV labels in the EMV label list in the obtained Hash positioning table, wherein the position of the position information in the Hash positioning table is indexed by the result of the Hash operation on the corresponding EMV label name; and 2, step: and performing Hash operation on the name of the EMV label to be retrieved, directly acquiring the position information of the EMV label to be retrieved in the EMV label list in the Hash positioning table by taking the result of the Hash operation as an index position, and directly positioning the EMV label to be retrieved in the EMV label list according to the position information to finish retrieval.

Description

Label retrieval method for EMV transaction
Technical Field
The invention relates to the technical field of EMV intelligent transaction, in particular to a quick retrieval method of an EMV label.
Background
EMV is a standard established by the international financial industry for smart payment cards and POS terminals and Automated Teller Machines (ATMs) that can use chip cards. The information of an EMV smart card (also called IC card) is stored in an integrated circuit instead of a magnetic stripe in the past, but most EMV cards also have a magnetic stripe on their back that is backwards compatible. The card chip can exchange data with a plug-in card reader, and the non-contact smart card can also exchange data within a certain range by using Radio Frequency Identification (RFID) technology. A payment card that matches the EMV standard is called a chip card.
The EMV standard refers to a general term of a specification protocol defined by EMVCo and its member card organization (e.g., masterCard, visa) for implementing EMV contact or contactless chip card transactions, and a technical specification PBOC standard similar to the EMV standard.
The EMV transaction refers to a transaction which is generated when a contact or non-contact chip card and a terminal device such as POS or ATM and the like which are realized according to the EMV standard fulfill the EMV standard.
The EMV kernel is a logic module which runs in the terminal equipment and realizes an EMV standard protocol. The terminal application program calls the module to realize a complete EMV transaction.
EMV tag data refers to a type of data that conforms to the TLV data structure defined in the EMV standard. The EMV TAG data consists of three parts, TAG name (TAG), length (Length), and Value (Value).
The EMV tag list refers to a data list used by the EMV kernel to access EMV tag data and its related information during an EMV transaction. The tags stored in this data list are required to be fully compliant with the definition of the EMV standard and cover all tags defined by the specifications of the card organization where the transaction currently takes place.
Because of the large number of EMVCo and their member card organizations, masterCard and its defined PayPass non-contact specification are presented and example analysis is performed herein. Among the card organization transactions, the PayPass transaction is also a higher one for non-contact timeliness. The PayPass kernel certification test clearly requires that the time consumed by the terminal processing in a complete PayPass transaction cannot exceed 100 milliseconds.
Taking the EMV kernel used by the inventor and the application program that passes PayPass authentication in an actual product in conjunction with the kernel as an example, the tag list of the current PayPass kernel includes 275 tags. Performing a PayPass offline approval transaction requires 284 accesses to the tag list. Each access involves either retrieval and storage or retrieval and retrieval. The efficiency of the retrieval is particularly critical in accessing the tag list. Retrieving tags means accurately finding and locating a target tag in a tag list.
In the prior art, a method for retrieving tags generally adopts a mode of traversing a list. The method comprises the steps of extracting a label name from a first label of a label list, matching the label name with a target label name, if matching is successful, searching successfully, if not, extracting the next label till the last label, if matching is successful, searching successfully, and if not, searching fails.
The inventors have found that traversing the tag list from end to end is inefficient. Especially for the tags whose target tags are located at the middle end or the tail end of the list, the target tags can be located only after all tags at the front end of the target tags are compared, which consumes relatively high time and cost. If the execution efficiency of the EMV kernel is low, the execution efficiency of the whole EMV transaction is affected, and even the production authorization cannot be obtained through the authentication standard of the card organization. Therefore, how to improve the efficiency of the conventional label retrieval method becomes an urgent technical problem to be solved.
Disclosure of Invention
In view of the above-mentioned defects in the prior art, the present invention provides a retrieval method capable of bypassing the matching (comparing) operation, which directly locates the position of the target tag in the tag list, thereby reducing the time consumed by the matching (comparing) operation and improving the retrieval efficiency of the whole scheme.
In order to achieve the above object, the present invention provides a brand new tag retrieval method for EMV transaction, in which an EMV tag list for storing EMV tag data and related information is used in the EMV transaction process, the method comprising the following steps:
step 1: performing Hash operation on all EMV label names in the EMV label list, establishing a Hash positioning table which is completely mapped with the EMV label list, and storing the position information of all EMV labels in the EMV label list in the obtained Hash positioning table, wherein the position of the position information in the Hash positioning table is indexed by the result of the Hash operation on the corresponding EMV label name;
step 2: and performing Hash operation on the name of the EMV label to be retrieved, directly acquiring the position information of the EMV label to be retrieved in the EMV label list in the Hash positioning table by taking the result of the Hash operation as a position index, and directly positioning the EMV label to be retrieved in the EMV label list according to the position information to finish the retrieval.
According to an embodiment of the present invention, the establishing the Hash positioning table in step 1 includes the following steps:
step 11: performing a Hash operation on each EMV tag X in the EMV tag list once to obtain a result Hn of the Hash operation, wherein the formula of the Hash operation is as follows:
hn = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X, hn is the result of the Hash operation;
step 12: storing the position information of the EMV label X in the EMV label list into a position Hn of the Hash positioning table;
step 13: and repeating the two steps until the whole EMV label list is traversed to form a Hash positioning table which is completely mapped with the EMV label list.
The time consumption for establishing the Hash positioning table and retrieving the Hash positioning table is needed, so the selection of the time point for establishing the Hash positioning table and the performance of the used Hash algorithm are particularly critical. For the time point of the Hash positioning table creation, the inventor finds that because the Hash positioning table only needs to record (store) the position information of the EMV label in the EMV label list, and the position information is static (unchanged) in the whole EMV transaction process, the time point of creating the Hash positioning table is set before the EMV transaction starts, and then the influence of the time consumption generated by creating the Hash positioning table on the EMV transaction can be eliminated. Thus, according to a preferred embodiment of the present invention, the set-up point in time of the Hash location table is set before the EMV transaction is started.
Furthermore, the time consumed to retrieve the Hash location table depends on the time required for one Hash operation. According to the retrieval method of the invention, when the target label X is retrieved, firstly, a Hash operation needs to be executed for the label name TAG _ X of the target label X to be retrieved. Considering that the efficiency of the Hash algorithm directly determines the efficiency of retrieving the Hash positioning table, since the result of the Hash operation is used as the index position of the Hash positioning table (also used as a collision table, as described below) to locate the corresponding table entry content (which may include, for example, the position information of the EMV tag in the EMV tag list, etc.), the range of all possible results of the selected Hash operation also directly determines the spatial size of the Hash positioning table. From the above two aspects, the selection of the Hash algorithm is particularly critical. The inventor comprehensively considers the total number of labels in the EMV transaction and EMV standard and the execution efficiency of various Hash algorithms, and obtains the optimal performance effect of the system when modulo function operation of complementation operation is adopted as the selected Hash algorithm, and the formula is as follows:
Hn=(TAG_X)%Hash_Mod,
where TAG _ X is the name of EMV TAG X (the EMV TAG name is in hexadecimal format, for example), hash _ Mod is the modulus of the modulo operation, and Hn is the result of the above function operation. The Hash algorithm adopted in the scheme only needs to execute modulo function operation of one-time complementation operation.
Furthermore, when the Hash algorithm adopts modulo function operation of the modulo function operation, the result of the function operation may be repeated, so that a conflict table needs to be established for storing the position information of a plurality of EMV tags with the same operation result in the EMV list when the same operation result occurs after the Hash operation is performed on different EMV tags. Meanwhile, the Hash positioning table also needs to record the index position of the EMV label in the conflict table, wherein the EMV label has the same operation result as the current EMV label. For example, when three different EMV tags obtain the same operation result after the Hash operation, the position information of the first EMV tag in the EMV list is stored in the table entry of the Hash positioning table corresponding to the operation result position, and the index position of the second EMV tag in the conflict table is also recorded in the table entry; the position information of the second EMV label in the EMV list is stored in the table entry of the conflict table, and the index position of the third EMV label in the conflict table is recorded in the table entry of the conflict table; and finally, storing the position information of the third EMV label in the EMV list into another table entry of the conflict table. And for a larger number of EMV labels with the same operation result, storing the EMV labels in the Hash positioning table and the conflict table, and so on.
Thus, according to a preferred embodiment of the present invention, the step 1 of establishing the Hash positioning table and the conflict table at the same time, and the step 1 of establishing the Hash positioning table and the conflict table includes the following steps:
step 11: performing a Hash operation on each EMV tag X in the EMV tag list once to obtain a result Hn of the Hash operation, wherein the formula of the Hash operation is as follows:
hn = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X, hn is the result of the Hash operation;
step 12: checking whether the content at the position Hn in the Hash positioning table is used, if not, saving the position information of the EMV label X in the EMV label list into the position Hn in the Hash positioning table, and if the content at the position Hn is used, executing the step 13;
step 13: checking whether the content at the position Hn contains the index position of the conflict table, if not, saving the position information of the EMV tag X in the EMV tag list to the first idle position in the conflict table, and simultaneously recording the first idle position of the conflict table to the position Hn of the Hash positioning table, and if the content at the position Hn contains the index position of the conflict table, executing step 14;
step 14: checking whether the content pointed by the current index position of the conflict table contains the index position of the next conflict table, if so, converting the current index position to the index position of the next conflict table, and repeatedly executing the step 14; if not, saving the position information of the EMV tag X in the EMV tag list into the content pointed by the first free position in the conflict table, and simultaneously recording the first free position of the conflict table into the content pointed by the current index position of the checked conflict table;
wherein, the step 2 further comprises the following steps:
step 21: carrying out one-time Hash operation on the label name of the EMV label Y to be retrieved to obtain a Hash operation result Yn;
step 22: taking the result Yn of the operation as an index position, checking the content pointed by the index position Yn in the Hash positioning table created in the step 1, if the content is empty, indicating that the EMV label Y to be retrieved is not included in the EMV label list, and ending the retrieval; if the content is not empty, extracting the position information of the EMV label list recorded in the content, comparing the EMV label name in the EMV label list corresponding to the position information with the label name of the EMV label Y to be retrieved, if the comparison result is consistent, successfully positioning the position of the EMV label Y to be retrieved in the EMV label list, and completing retrieval; if the comparison result is not consistent, executing step 23;
step 23: checking whether the content pointed by the index position Yn contains the index position of the conflict table, if not, indicating that the EMV label Y to be retrieved is not contained in the EMV label list, and ending the retrieval; if yes, extracting the position information of the EMV label list recorded in the conflict list item pointed by the index position of the conflict list, comparing the EMV label name in the EMV label list corresponding to the position information with the label name of the EMV label Y to be retrieved, if the comparison result is consistent, successfully positioning the position of the EMV label Y to be retrieved in the EMV label list, and completing retrieval; if the comparison result is not consistent, the current index position is converted to the next index position of the conflict table, and the step 23 is repeatedly executed.
According to the PayPass kernel statistics used by the current EMV transaction, 275 EMV tags are included in the kernel, and 284 times of accessing the EMV tag list are required for executing an offline approval transaction, that is, 284 times of retrieving the EMV tag list are required. The number of function comparison operations (e.g. memcmp function in C language) required to be performed each time the EMV tag list is retrieved is: on average 137 times (i.e. 275/2). However, according to the retrieval method of the EMV tag list of the present invention, by establishing and using the Hash location table (including the collision table), the number of function operations required to be performed each time the EMV tag list is retrieved is reduced to only need: a Hash operation (e.g., modulo the remainder operation) and a compare operation (in most cases) are performed. Even in case of collision (multiple different EMV tags get the same operation result after Hash operation), only a few additional comparison operations (generally in the order of single digit) need to be performed. Therefore, the invention adopts the Hash algorithm to replace the traditional mode of traversing the label list, greatly reduces the function operation times, obviously improves the efficiency of searching the EMV labels in the EMV label list in the EMV transaction process, obviously improves the EMV transaction speed and enhances the user experience.
In addition, although the creation of the Hash positioning table increases the space overhead of the terminal, because the Hash positioning table is static, the Hash positioning table can be directly written into the source code and exists in the form of the source code, which only increases the overhead of the nonvolatile storage space of the terminal (such as Flash code space, where executable code is usually stored in Flash of the terminal, and Flash space is usually relatively cheap and abundant), and does not increase the global variable space.
In the above description, modulo function operation of complementation is taken as a specific embodiment of the Hash algorithm, but those skilled in the art will understand that in other specific implementations, the Hash algorithm may also be other algorithms or function operations, as long as the Hash algorithm can make the retrieval efficiency higher than that in the way of traversing the tag list. Meanwhile, the data format of the EMV label name and the specific numerical value of the modulus of the complementation are not limited. For example, a Hash Value = (TAG _ Name% Mod) + N, or a Hash Value = (TAG _ Name% Mod) -N, or the like may be employed.
In addition, since the information (entry content) recorded by the Hash positioning table and the collision table is the location information of the EMV tag in the EMV tag list and the index location information of the collision table when collision occurs (a plurality of different EMV tags obtain the same operation result after Hash operation), in a specific embodiment, the Hash positioning table and the collision table may be merged into the same table, or divided into two different tables for creation, management, or maintenance.
Another aspect of the invention also relates to a POS or ATM terminal or mobile terminal device, characterized in that it comprises a memory means and a processor, said memory means having stored therein a set of instructions adapted to run on said processor, said set of instructions, when run on said processor, implementing the tag retrieval method for EMV transactions as described above.
Drawings
The present invention will be described in further detail below with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are solely for purposes of illustration and are not intended as a definition of the limits of the invention. The same reference numbers in the drawings identify the same or similar elements. For purposes of illustration, the figures are not drawn to scale.
Fig. 1 shows a mapping relationship between a Hash positioning table and an EMV tag list in a tag retrieval method for EMV transactions according to a first embodiment of the present invention.
Fig. 2 illustrates a method for retrieving a target EMV tag in an EMV tag list through the Hash location table after the method illustrated in fig. 1 establishes the Hash location table.
Fig. 3-5 illustrate the process of establishing a Hash positioning table and a collision table in the tag retrieval method for EMV transaction according to the second embodiment of the present invention, and the mapping relationship with the EMV tag list.
Fig. 6 illustrates a process of establishing a Hash positioning table and a collision table in a tag retrieval method for EMV transaction according to a third embodiment of the present invention, and a mapping relationship with an EMV tag list.
FIG. 7 shows the Hash location table and conflict table merged into the same table.
Figure 8 shows the Hash location table and conflict table split into two different tables.
Detailed Description
It will be understood by those skilled in the art that the following examples are only for the purpose of more clearly describing the technical solutions of the present invention, and do not set any limit to the scope of the present invention.
Fig. 1-2 illustrate a tag retrieval method for EMV transactions according to a first embodiment of the present invention. Figure 1 shows a schematic diagram of the establishment of a Hash location table in this embodiment. As shown in fig. 1, starting from a first position B1 of the EMV TAG list, a Hash operation is sequentially performed on TAG names corresponding to each position (e.g., position B1 corresponds to TAG _ a) one by one (B2, B3 \8230;) by the formula of An = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X and An is the result of the Hash operation. Then, the operation results (A1/A2/A3/\ 8230; an/\ 8230) are used as the index positions of the Hash positioning table, the index positions are sequentially arranged according to the size sequence, and the position information (Bi, bj, bk \8230;) of the label names corresponding to the operation results in the EMV label list is recorded into the corresponding table entry pointed to by the index positions of the operation results. For example, the location information Bm of the tag X in the EMV tag list is recorded in the entry pointed by the index location An in the Hash positioning table. In this way, a Hash operation is performed on each EMV label in the EMV label list, and relevant position information is recorded until the whole EMV label list is traversed to form a Hash positioning table which is completely mapped with the EMV label list.
After the Hash location table is established, in the subsequent EMV transaction, when the position and the related information of a certain target tag Y in the EMV tag list need to be retrieved, the location of the target tag Y in the EMV tag list can be quickly obtained according to the method shown in fig. 2, which is specifically as follows: carrying out Hash operation on the name TAG _ Y of the EMV target label Y to be retrieved to obtain an operation result At; then, directly acquiring the position information Bn in the corresponding table entry in the Hash positioning table by taking the At as an index position; and directly positioning the EMV target label Y to be retrieved in the EMV label list according to the position information Bn to finish the retrieval.
Fig. 3-5 illustrate a tag retrieval method for EMV transactions according to a second embodiment of the present invention.
● The operation steps for creating the Hash positioning table and the conflict table are as follows:
firstly, initializing the content of the whole Hash positioning table to be in an unused state, then traversing the whole EMV label list from the head to the tail of the table in sequence, and executing the following steps for each EMV label in sequence:
step 11: performing a Hash operation on each EMV label in the EMV label list once to obtain a result Hn of the Hash operation, wherein the formula of the Hash operation is as follows:
hn = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X and Hn is the result of the Hash operation.
Step 12: checking whether the content (table entry) at the position Hn in the Hash positioning table is used, if not, storing the position information An of the EMV label in the EMV label list into the content (table entry) at the position Hn in the Hash positioning table (as shown in FIG. 3), finishing the current label processing, and continuing to process the next label. If the content (entry) at this position Hn has already been used (e.g. Bn has already been recorded in the entry at position Hn in the Hash location table as shown in figure 4), step 13 is performed.
Step 13: checking whether the content (entry) at the position Hn contains the index position of the conflict table, if not, saving the position information An of the EMV tag X in the EMV tag list into the content pointed by the first free position En in the conflict table, and simultaneously recording the index position En of the conflict table into the position Hn of the Hash positioning table (see fig. 4). If the content at this location Hn already contains the index location of the conflict table (e.g. Fn is already recorded in the entry at location Hn in the Hash mapping table as shown in figure 5), step 14 is performed.
Step 14: it is checked whether the content pointed to by the current index position Fn of the conflict table contains the index position of the next conflict table, if so, the current index position is converted to the index position of the next conflict table, and the step 14 is repeated. If not, the position information An of the EMV tag X in the EMV tag list is saved into the content pointed by the first free position En in the conflict table, and at the same time, the index position En of the conflict table is recorded into the content pointed by the current index position Fn of the checked conflict table (as shown in fig. 5).
The operation steps for retrieving the Hash table are as follows:
step 21: performing one-time Hash operation on the TAG name TAG _ Y of the EMV TAG Y to be retrieved to obtain a Hash operation result Yn;
step 22: and taking the result Yn of the operation as an index position, checking the content pointed by the index position Yn in the Hash positioning table created in the step 1, and if the content is empty, indicating that the EMV label Y to be retrieved is not included in the EMV label list, and ending the retrieval. If the content is not empty, extracting the position information (assumed as Bn) of the EMV label list recorded in the content, comparing the EMV label name corresponding to the position information Bn in the EMV label list with the label name TAG _ Y of the EMV label Y to be retrieved, if the comparison result is consistent, successfully positioning the position (namely the position Bn) of the EMV label Y to be retrieved in the EMV label list, and completing the retrieval. If the comparison result is not consistent, step 23 is executed.
Step 23: and checking whether the content pointed by the current index position Yn contains the next index position of the conflict table, if not, indicating that the EMV label Y to be retrieved is not contained in the EMV label list, and ending the retrieval. If the EMV tag list contains the EMV tag name, extracting the position information (assumed to be Cn) of the EMV tag list recorded in the conflict list item pointed by the index position of the conflict list, comparing the EMV tag name corresponding to the position information Cn in the EMV tag list with the tag name of the EMV tag Y to be retrieved, if the comparison result is consistent, successfully positioning the position (namely the position Cn) of the EMV tag Y to be retrieved in the EMV tag list, and completing the retrieval. If the comparison result is not consistent, the current index position is converted to the next index position of the conflict table, and the step 23 is repeatedly executed.
The following demonstrates, in a specific embodiment, the process of establishing a Hash positioning table and a collision table when a collision (multiple different EMV tags obtain the same operation result after Hash operation) occurs, and the flow of subsequent retrieval according to the method of the present invention.
Fig. 6 shows an EMV tag list used in a tag retrieval method for EMV transactions and a Hash location table and a collision table established by mapping according to a third embodiment of the present invention.
As shown in fig. 6, the position information of the three different EMV tags a, B, and C in the EMV tag list is m1, m2, and m3, respectively. The label names (TAG _ A, TAG _ B and TAG _ C) of the three labels obtain the same Hash operation result n1 after the selected Hash operation.
When creating the Hash location and conflict tables, the process for these three tags is as follows:
when traversing to the label a, performing a Hash operation on the label name TAG _ a to obtain an operation result n1, and checking that the entry with the index position n1 in the Hash positioning table is empty, so that the position information m1 of the label a in the EMV label list is recorded in the entry content at the position n1 in the Hash positioning table.
When traversing to the TAG B, performing Hash operation on the TAG name TAG _ B to obtain an operation result n1, checking that the content of the table entry with the index position n1 in the Hash positioning table is not empty (the position information m1 of the TAG a is already recorded), and simultaneously checking that the table entry with the index position n1 does not contain the index position of the conflict table, so that the position information m2 of the TAG B in the EMV TAG list is stored in the table entry with the first idle position n2 in the conflict table, and simultaneously recording the index position n2 of the conflict table into the content pointed by the position n1 in the Hash positioning table.
When traversing to the TAG C, performing Hash operation on the TAG name TAG _ C to obtain an operation result n1, checking that the content of the entry with the index position n1 in the Hash positioning table is not empty (the position information m1 of the TAG a is already recorded), simultaneously checking that the entry with the index position n1 already contains the index position information n2 of the conflict table, and continuously checking whether the content of the index position n2 of the conflict table is empty, and finding that the content is not empty (the position information m2 of the TAG B is already recorded). At this time, since it is continuously checked that the content of the index position n2 of the conflict table does not include the position index of the next conflict table, the position information m3 of the tag C in the EMV tag list is stored in the first free position n3 in the conflict table at this time, and the information of the index position n3 of the conflict table is recorded in the content of the index position n2 of the conflict table at the same time.
Now, the target tag C is retrieved by using the Hash positioning table and the collision table established above, and then the retrieving process is as follows:
firstly, performing a Hash operation on the TAG name TAG _ C of the target TAG C to obtain an operation result n1, checking whether the content with the index position n1 in the Hash positioning table is empty, and finding that the position information m1 is recorded, thereby extracting the TAG name TAG _ a of the TAG a with the position information m1 in the EMV TAG list, and comparing the TAG name TAG _ a with the target TAG name TAG _ C to find that the comparison result is inconsistent. Therefore, whether the content of the index position n1 in the Hash positioning table contains the index position information of the conflict table is continuously checked, and the index position n2 containing the conflict table is found.
Then, checking whether the content of the index position n2 of the conflict table is empty, finding that the position information m2 is recorded, thereby extracting the TAG name TAG _ B of the TAG B with the position information m2 in the EMV TAG list, and comparing the TAG name TAG _ B with the target TAG name TAG _ C, finding that the comparison result is inconsistent. Therefore, the contents of the index position n2 in the conflict table are continuously checked to see whether the next index position information of the conflict table is included, and the index position n3 including the conflict table is found.
Finally, checking whether the content of the index position n3 of the conflict table is empty, finding that the position information m3 is recorded, thereby extracting the TAG name TAG _ C of the TAG C with the position information m3 in the EMV TAG list, comparing the TAG name TAG _ C with the target TAG name TAG _ C, finding that the comparison result is consistent, successfully locating the position of the target TAG in the EMV TAG list, and completing the retrieval.
It should be noted that, since the Hash positioning table and the collision table record the same information, and both are the position information of the tag in the EMV tag list and the index position information of the collision table when the generated operation result is the same, in a specific embodiment, the Hash positioning table and the collision table may be combined into the same table (as shown in fig. 7) or divided into two different tables (as shown in fig. 8) for management and maintenance. For the convenience of demonstration, the examples herein are illustrated by way of merging the Hash positioning table with the conflict table.
In one embodiment, not shown, modulo function operation of a modulo operation is used as the selected Hash algorithm, with the formula:
Hn=(TAG_X)%Hash_Mod,
where TAG _ X is the name of EMV TAG X (the EMV TAG name is in hexadecimal format, for example), hash _ Mod is the modulus of the modulo operation, and Hn is the result of the above function operation.
It will be appreciated by those skilled in the art that in other embodiments, the Hash algorithm may be other algorithms or function operations, as long as the Hash algorithm can make the retrieval efficiency higher than that of the label list traversal method. Meanwhile, the data format of the EMV label name and the specific numerical value of the modulus of the complementation are not limited. For example, a Hash Value = (TAG _ Name% Mod) + N, or a Hash Value = (TAG _ Name% Mod) -N, or the like may be employed.
In addition, because the total number of EMV tags is a finite number of hundreds, fewer EMV tags appear with repeated Hash values after the Hash operation. In an actual application scenario, a user can automatically adjust the size of the Hash _ Mod according to the total number of the tags, so that the probability of repeated (same) Hash operation results is minimum, and a relatively ideal state with high execution efficiency and small space consumption of a Hash positioning table is achieved.
The PayPass kernel of MasterCard is used for description, however, in an actual application scenario, other card organizations, such as Visa, discover, amex, JCB, unionPay, and the like, have an effect of improving efficiency even for contact EMV transactions, and thus the application scenario of the present invention is not limited to a certain card organization, but is applicable to application scenarios of card organizations of all EMVCO-like specifications.
Another aspect of the invention also relates to a POS or ATM terminal or mobile terminal device. In one implementation, not shown, a POS or ATM terminal device includes a memory device and a processor, the memory device having stored therein a set of instructions adapted to run on the processor, the set of instructions when run on the processor implementing the tag retrieval method for EMV transactions as described above.
Preferably, the Hash positioning table and the conflict table can be directly written into the source code, and exist in the form of the source code, so that the overhead of the nonvolatile storage space of the terminal is only increased (such as Flash code space, executable code is usually stored in Flash of the terminal, and Flash space is usually cheaper and abundant), and the global variable space is not increased.
The drawings and the foregoing description depict non-limiting specific embodiments of the invention. For the purpose of teaching inventive principles, some conventional aspects have been simplified or omitted. Those skilled in the art will appreciate variations from these embodiments that fall within the scope of the invention. Those skilled in the art will appreciate that the features described above can be combined in various ways to form multiple variations of the invention. Thus, the present invention is not limited to the specific embodiments described above, but only by the claims and their equivalents.

Claims (7)

1. A tag retrieval method for EMV transactions, using an EMV tag list for storing EMV tag data and its related information during the EMV transaction, the method comprising the steps of:
step 1: performing Hash operation on all EMV label names in the EMV label list, establishing a Hash positioning table which is completely mapped with the EMV label list, and storing the position information of all EMV labels in the EMV label list in the obtained Hash positioning table, wherein the position of the position information in the Hash positioning table is indexed by the result of the Hash operation on the corresponding EMV label name;
step 2: and performing Hash operation on the name of the EMV label to be retrieved, directly acquiring the position information of the EMV label to be retrieved in the EMV label list in the Hash positioning table by taking the result of the Hash operation as an index position, and directly positioning the EMV label to be retrieved in the EMV label list according to the position information to finish retrieval.
2. The tag retrieval method for EMV transactions according to claim 1, wherein the step of establishing the Hash location table in step 1 comprises the steps of:
step 11: performing a Hash operation on each EMV tag X in the EMV tag list once to obtain a result Hn of the Hash operation, wherein the formula of the Hash operation is as follows:
hn = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X, hn is the result of the Hash operation;
step 12: storing the position information of the EMV label X in the EMV label list into a position Hn of the Hash positioning table;
step 13: and repeating the two steps until the whole EMV label list is traversed to form a Hash positioning table which is completely mapped with the EMV label list.
3. The tag retrieval method for EMV transactions according to claim 1 or 2, wherein the establishment time point of the Hash location table is set before the EMV transaction is started.
4. The tag retrieval method for EMV transactions according to claim 1 or 2, wherein the Hash operation employs a modulo function operation of a modulo operation, of the formula:
hn = (TAG _ X)% Hash _ Mod, where TAG _ X is the name of EMV TAG X, hash _ Mod is the modulo of the modulo operation, and Hn is the result of the above function operation.
5. The tag retrieval method for EMV transaction according to claim 1, wherein the step 1 establishes a collision table at the same time as the Hash location table, and the establishing the Hash location table and the collision table in the step 1 comprises the following steps:
step 11: performing a Hash operation on each EMV label in the EMV label list to obtain a result Hn of the Hash operation, wherein the formula of the Hash operation is as follows:
hn = Hash (TAG _ X), where TAG _ X is the name of EMV TAG X, hn is the result of the Hash operation;
step 12: checking whether the table entry of the position Hn in the Hash positioning table is used, if not, storing the position information of the EMV label X in the EMV label list into the position Hn of the Hash positioning table, and if the table entry of the position Hn is used, executing a step 13;
step 13: checking whether the content at the position Hn contains the index position of the conflict table, if not, storing the position information of the EMV label X in the EMV label list to the first idle position in the conflict table, and simultaneously recording the first idle position of the conflict table to the position Hn of the Hash positioning table; if the content at the position Hn contains the index position of the conflict table, executing step 14;
step 14: checking whether the content pointed by the current index position of the conflict table contains the index position of the next conflict table, if so, converting the current index position to the index position of the next conflict table, and repeatedly executing the step 14; if not, saving the position information of the EMV tag X in the EMV tag list into the content pointed by the first free position in the conflict table, and simultaneously recording the first free position of the conflict table into the content pointed by the current index position of the checked conflict table;
wherein, the step 2 further comprises the following steps:
step 21: carrying out one-time Hash operation on the label name of the EMV label Y to be retrieved to obtain a Hash operation result Yn;
step 22: taking the result Yn of the operation as an index position, checking the content pointed by the index position Yn in the Hash positioning table created in the step 1, if the content is empty, indicating that the EMV label Y to be retrieved is not contained in the EMV label list, and ending the retrieval; if the content is not empty, extracting the position information of the EMV label list recorded in the content, comparing the EMV label name in the EMV label list corresponding to the position information with the label name of the EMV label Y to be retrieved, if the comparison result is consistent, successfully positioning the position of the EMV label Y to be retrieved in the EMV label list, and completing retrieval; if the comparison result is not consistent, executing step 23;
step 23: checking whether the content pointed by the index position Yn contains the index position of the conflict table, if not, indicating that the EMV label Y to be retrieved is not contained in the EMV label list, and ending the retrieval; if yes, extracting the position information of the EMV label list recorded in the conflict list item pointed by the index position of the conflict list, comparing the EMV label name in the EMV label list corresponding to the position information with the label name of the EMV label Y to be retrieved, if the comparison result is consistent, successfully positioning the position of the EMV label Y to be retrieved in the EMV label list, and completing retrieval; if the comparison result is not consistent, the current index position is converted to the next index position of the conflict table, and the step 23 is repeatedly executed.
6. The tag retrieval method for an EMV transaction of claim 5, wherein the collision table and the Hash location table are merged into the same table, or the collision table and the Hash location table are separated into two different tables.
7. A POS or ATM terminal or mobile terminal device comprising a storage means and a processor, said storage means having stored therein a set of instructions adapted to run on said processor, said set of instructions when run on said processor implementing the tag retrieval method for EMV transactions according to any one of claims 1-6.
CN202211583389.8A 2022-12-09 2022-12-09 Label retrieval method for EMV transaction Pending CN115757436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211583389.8A CN115757436A (en) 2022-12-09 2022-12-09 Label retrieval method for EMV transaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211583389.8A CN115757436A (en) 2022-12-09 2022-12-09 Label retrieval method for EMV transaction

Publications (1)

Publication Number Publication Date
CN115757436A true CN115757436A (en) 2023-03-07

Family

ID=85346739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211583389.8A Pending CN115757436A (en) 2022-12-09 2022-12-09 Label retrieval method for EMV transaction

Country Status (1)

Country Link
CN (1) CN115757436A (en)

Similar Documents

Publication Publication Date Title
US8321481B2 (en) Method for incremental anti-tear garbage collection
US8458071B2 (en) Instantaneous merchant information retrieval for financial transactions
US7873763B2 (en) Multi-reader multi-writer circular buffer memory
RU2008106437A (en) METHOD AND DEVICE FOR CUSTOMIZING CHOICE ON MANY LANGUAGES FOR SYSTEM USER INTERFACE
US9495286B2 (en) Method and arrangement for completion or recovery of data transactions in a flash type memory device using a commit process
CN106155596B (en) Data writing method and device
CN103021081B (en) Method for realizing communication and interaction between non-contact integrated circuit (IC) cards and card reading terminal on basis of multi-card fusion application
CN112181902B (en) Database storage method and device and electronic equipment
US20180211242A1 (en) System and method for identifying multiple types of electronic money and apparatus employing the same
CN110188850B (en) Method, device and system for controlling temporary number of smart card
CN112882956B (en) Method and device for automatically generating full-scene automatic test cases through data combination calculation, storage medium and electronic equipment
JP3771904B2 (en) Microprocessor circuit with auxiliary register bank
CN116662327B (en) Data fusion cleaning method for database
CN115757436A (en) Label retrieval method for EMV transaction
US20090012975A1 (en) Portable electronic device and file management method for use in portable electronic device
CN113934727B (en) Adaptive acquisition and processing system and method for multi-source heterogeneous financial data
CN111753562A (en) Label identification method and device, electronic equipment and readable medium
CN115757190A (en) Production program simulation test method, device, equipment and storage medium
CN104517140A (en) RFID multi-card-in-one integration method
CN108470404B (en) Gate control method and device for card reader, financial equipment and storage medium
US7243113B2 (en) Information management system, information management method, and storage medium for managing execution records
CN113436668A (en) Method and device for distinguishing product information of multiple memory chips
US7014119B2 (en) Method of manufacturing smart cards
CN112084197B (en) Method for storing data in EMV protocol library
CN109271277A (en) Access method, device and system after database delay machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Floor 3-4, Building 3A, Zone A, Fuzhou Software Park, No. 89, Software Avenue, Gulou District, Fuzhou City, Fujian Province, 350001

Applicant after: Yinjie Nico (Fujian) Technology Co.,Ltd.

Address before: Floor 3-4, Building 3A, Zone A, Fuzhou Software Park, No. 89, Software Avenue, Gulou District, Fuzhou City, Fujian Province, 350001

Applicant before: Fujian Liandi Commercial Technology Co.,Ltd.

CB02 Change of applicant information