A service card information searching method and device, an electronic device and a storage medium

By setting up a quick lookup table in the microcontroller's RAM and using preset functions to map identity identifiers to keywords for fuzzy searching, the problem of slow search speed in smart card systems is solved, achieving efficient business card information retrieval and extending the ROM's lifespan.

CN115934754BActive Publication Date: 2026-03-31HITACHI BUILDING TECH GUANGZHOU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing smart card systems are slow in searching smart card information and have requirements for the order of record storage, resulting in low search efficiency.

Method used

A cheat table is set up in the microcontroller's RAM. By using a preset function to map the identity identifier to keywords for fuzzy search, the number of searches in ROM is reduced, and precise searches are performed in ROM. The cheat table and lookup table do not require sorting of stored data, and it is easy to add, delete or modify business card records.

Benefits of technology

It improves the search speed, reduces the number of ROM searches and writes, extends the ROM's lifespan, and reduces search time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934754B_ABST
    Figure CN115934754B_ABST
Patent Text Reader

Abstract

The application discloses a service card information searching method and device, electronic equipment and a storage medium, a quick search table is arranged in RAM, a search table is arranged in ROM, the quick search table is a table including keywords generated according to the search table, the record number of each keyword in the quick search table in the quick search table is the same as the record number of the service card record associated with the identity corresponding to the keyword in the search table, after obtaining the identity of the service card to be searched, the record number of the target keyword matched with the to-be-matched keyword is searched in the quick search table, when the identity in the target service card record corresponding to the record number in the search table is matched with the identity of the service card to be searched, the service information in the target service card record is read as the service information of the service card to be searched, the keyword is searched in RAM first, then the keyword is searched in ROM, the searching speed is high, the service card record does not need to be sorted, and the service life of the ROM is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for searching business card information. Background Technology

[0002] With the development of smart card technology, smart cards can be applied to door locks, gates, elevator floor access, attendance and other services, that is, to realize related services by swiping the smart card.

[0003] After a smart card is swiped, the smart card system needs to search for the smart card's service information in a record table, such as the associated service permissions, to execute the corresponding service. In existing technology, the record table is stored in the microcontroller's external ROM. On the one hand, the microcontroller's speed in performing common read / write operations such as creating, retrieving, updating, and deleting records in the external ROM is slow. On the other hand, if a faster search method such as binary search or block search is used, the records in the record table still need to be stored sequentially. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for searching business card information, in order to solve the problems of slow search speed and the requirement for sequential storage of smart card records in existing methods for searching smart card information.

[0005] In a first aspect, the present invention provides a method for retrieving service card information, comprising:

[0006] When the microcontroller detects a card swipe event of the card to be searched, it obtains the identity identifier of the card to be searched.

[0007] The identity identifier is input into a preset function to obtain the keyword to be matched for the identity identifier;

[0008] The system searches for a target keyword that matches the keyword to be matched in a preset quick lookup table. The quick lookup table is a table containing keywords that is stored in the RAM of the microcontroller and generated based on a lookup table containing multiple business card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the identity identifier corresponding to the keyword in the lookup table. The lookup table is stored in the ROM outside the microcontroller.

[0009] Obtain the record number of the target keyword in the quick reference table;

[0010] Determine the target business card record corresponding to the record number in the lookup table;

[0011] When the identity identifier in the target service card record matches the identity identifier of the service card to be searched, the service information in the target service card record is read and used as the service information of the service card to be searched.

[0012] Secondly, the present invention provides a service card information retrieval device, comprising:

[0013] The identity identification module is used by the microcontroller to obtain the identity identification of the business card to be searched when it detects a card swipe event of the business card to be searched.

[0014] The keyword acquisition module is used to input the identity identifier into a preset function to obtain the keyword to be matched for the identity identifier;

[0015] The keyword matching module is used to search for target keywords that match the keyword to be matched in a preset quick lookup table. The quick lookup table is a table containing keywords that is stored in the RAM of the microcontroller and generated based on a lookup table containing multiple business card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the identity identifier corresponding to the keyword in the lookup table. The lookup table is stored in ROM outside the microcontroller.

[0016] The record number acquisition module is used to acquire the record number of the target keyword in the quick reference table;

[0017] The target service card record determination module is used to determine the target service card record corresponding to the record number in the lookup table.

[0018] The business information reading module is used to read the business information in the target business card record when the identity identifier in the target business card record matches the identity identifier of the business card to be searched, and use it as the business information of the business card to be searched.

[0019] Thirdly, the present invention provides an electronic device, the electronic device comprising:

[0020] At least one microcontroller; and

[0021] A memory communicatively connected to the at least one microcontroller; wherein,

[0022] The memory stores a computer program that can be executed by the at least one microcontroller, the computer program being executed by the at least one microcontroller to enable the at least one microcontroller to perform the service card information lookup method described in the first aspect of the present invention.

[0023] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions, which are used to cause a microcontroller to execute the service card information lookup method described in the first aspect of the present invention.

[0024] In this embodiment of the invention, a keyword-based quick lookup table is configured in the RAM of the microcontroller, and a lookup table is configured in the ROM outside the microcontroller. The quick lookup table is a table containing keywords generated from a lookup table storing multiple service card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the service card record associated with the corresponding identity identifier in the lookup table. When the identity identifier of the service card to be searched is obtained, the keyword to be matched corresponding to the identity identifier is determined, the target keyword matching the keyword to be matched is searched in the quick lookup table, and the record number of the target keyword in the quick lookup table is obtained. Further, the target service card record corresponding to the record number is determined in the lookup table. When the identity identifier in the target service card record matches the identity identifier of the service card to be searched, the target service card record is read. The system uses the business information in the lookup table as the business information for the business card to be searched. On the one hand, the lookup table, including keywords, is stored in RAM and does not occupy ROM space. It only stores keywords, so the lookup table occupies little RAM storage space. It first performs a fuzzy search in RAM by keywords and then a precise search in ROM. The fuzzy search for keywords in RAM is fast, which reduces the number of searches in ROM and shortens the search time. On the other hand, the record number of the business card record in the lookup table is the same as the record number of the keyword corresponding to the identity identifier in the business card record in the lookup table. The lookup table and the lookup table do not need to sort the stored data. It is easy to add, delete, and modify business card records in the lookup table. This avoids the need to move the entire business card record when storing business card records in sequence, reduces the number of ROM writes, and improves the lifespan of ROM.

[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of a service card information retrieval method provided in Embodiment 1 of the present invention;

[0028] Figure 2 This is a flowchart of a service card information retrieval method provided in Embodiment 2 of the present invention;

[0029] Figure 3 This is a schematic diagram of the structure of a business card information retrieval device provided in Embodiment 3 of the present invention;

[0030] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] Currently, the information of the service cards is stored in a lookup table as records. Each service card record in the lookup table includes the service card's identification identifier, as well as service information such as the service card type, host number, card reader number, service permissions, card issuance date, expiration date, and number of valid uses. When a service card is swiped, the relevant service information of the service card needs to be read. Taking an elevator access card as an example, the service card record can include the card number, floor permissions, expiration date, and number of valid elevator rides.

[0033] When a service card is swiped, the service information of the service card needs to be read from a lookup table to execute the relevant service. In the existing technology, the following methods can be used to look up the service card record from the lookup table:

[0034] Sequential Search: The lookup table can randomly store business card records. When searching, the search starts from the head or tail of the lookup table and searches for each record one by one until a matching record is found, such as a record with a matching card number. Since the sequential search method searches for records from the head or tail of the table, the search is time-consuming and inefficient.

[0035] Binary Search: This method stores business card records sequentially in a lookup table, for example, in ascending or descending order of card number. During a search, the system first determines the size difference between the card number of the business card record in the middle of the lookup table and the card number of the card being searched for. This determines whether to search in the first or second half of the lookup table. The binary search is repeated until a matching card number is found. Because binary search requires records to be stored in ascending or descending order, inserting or deleting records in the lookup table requires moving a large number of records.

[0036] Blocking Search: First, the lookup table is divided into several blocks. In each subsequent block, the key of all business card records is greater than the largest key in the previous block (e.g., the key is a partial serial number of the business card). An index table is created, sorted by key. When searching for a record, the block containing the key of the business card number to be searched is first determined in the index table; then, the complete card number is searched sequentially within that block. Blocking Search requires dividing the lookup table into blocks, storing them sequentially, and creating an ordered index table.

[0037] Hash table method: The storage address of a business card record is obtained by calculating a function (called a hash function) with the key of the business card record as the independent variable. When performing a search operation in the hash table, the same hash function is used to calculate the storage address of the business card record to be searched. Then, the relevant information (such as the card number) is obtained from the corresponding storage unit, and the search is then determined to be successful. The hash table method requires the construction of a hash function to resolve collisions, and the algorithm is complex.

[0038] In addition, the current lookup table is stored on the ROM outside the microcontroller, which has a slow read and write speed. The creation, retrieval, update and deletion of the lookup table in the external ROM takes a long time and the lookup efficiency is low.

[0039] To address the aforementioned technical problems, the following description, in conjunction with the accompanying drawings, illustrates the method for retrieving service card information in this embodiment.

[0040] Example 1

[0041] Figure 1 This is a flowchart of a service card information retrieval method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where service card information is read after the service card is swiped. This method can be executed by a service card information retrieval device, which can be implemented in hardware and / or software. The service card information retrieval device can be configured in an electronic device, such as in the microcontroller of the electronic device. Figure 1 As shown, the method for retrieving service card information includes:

[0042] S101. When the microcontroller detects a card swipe event of the service card to be searched, it obtains the identity identifier of the service card to be searched.

[0043] In this embodiment, the service card can be a physical service card or a virtual service card. A physical service card can be various IC cards, such as access control cards, room cards, elevator access cards, entrance / exit control cards, parking cards, etc. A virtual service card can be a virtual card used for biometric or password verification, such as a virtual card used to verify biometric features like fingerprints, finger veins, faces, or irises. The service card can be swiped on a card reader. The card reader is connected to a microcontroller, which can detect the swiping event on the card reader. Since IC cards typically have limited storage space, only the service card's identifier can be stored on the IC card. The card reader can send the read identifier to the microcontroller, which receives the identifier of the service card to be searched.

[0044] In one example, the identity identifier can be information that uniquely represents the identity of the service card. For example, the identity identifier can be the card number, the user's biometric data (fingerprint, finger vein, face, iris, etc.), password, mobile terminal identifier, etc. This embodiment uses the card number of the service card as the identity identifier as an example.

[0045] S102. Input the identity identifier into the preset function to obtain the keyword to be matched for the identity identifier.

[0046] The preset function can be a function that maps part or even all of the identity identifier to keywords. Taking the card number of the business card to be searched as an example, the identity identifier can be composed of several digits. The preset function can be a function that maps part or even all of the digits of the card number to keywords.

[0047] The preset function can be a function that extracts the lowest n bits of the card number, or it can be a function that generates the error detection code of the card number. This embodiment does not limit the preset function, as long as it can map the identity identifier to the keyword.

[0048] It should be noted that when the preset function maps identity identifiers to keywords, different identity identifiers can be mapped to the same keyword. Taking card numbers as an example, if the card numbers of multiple business cards are 00125, 00153, 00154, and 00166, and the preset function maps the first three digits of the card number to keywords, then the above card numbers have the same keyword.

[0049] S103. Search for the target keyword that matches the keyword to be matched in the preset quick lookup table. The quick lookup table is a table containing keywords that is stored in the RAM of the microcontroller and generated based on a lookup table containing multiple business card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the identity identifier corresponding to the keyword in the lookup table. The lookup table is stored in the ROM outside the microcontroller.

[0050] In this embodiment, the lookup table is a table containing service card records stored in the ROM outside the microcontroller. Each service card record in the lookup table includes the service card's identification (such as card number) and service information, where the service information may include the service permissions of the service card, card issuance date, validity period, valid card swipe count, etc. Taking an elevator access card as an example, the service information may include floor permissions, elevator access count, etc. Table 1 below shows an example of a service card record in the lookup table:

[0051] Table 1:

[0052] Byte 1 2 bytes 3 bytes 4 bytes 5 bytes Byte 6 - Byte N UID UID UID UID status flags Business Information

[0053] In Table 1 above, the UID is the identification identifier of the service card, such as the card number, which occupies 4 bytes. The status flag indicates whether the service card record is valid. Table 1 is merely an example of the format for looking up service records in the table. In practical applications, those skilled in the art can adjust the length of each field.

[0054] The quick lookup table is generated based on the keywords mapped to the identity identifiers in the business card records of the lookup table. The record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the corresponding identity identifier in the lookup table. The following uses the card number as the identity identifier of the business card as an example to illustrate the structure of the quick lookup table and the lookup table. Table 2 below shows an example of a lookup table, and Table 3 shows an example of a quick lookup table. The keywords in the quick lookup table are the first four digits of the card number in the lookup table.

[0055] Table 2:

[0056] Record number card number Valid mark Business Information 1 000152 0 xx 2 000132 1 xx 3 010356 1 xx 4 000152 1 xx 5 010369 1 xx 6 000247 1 xx 7 010388 1 xx 8 9 10

[0057] In Table 2 above, the record number indicates the position of the service card record in the lookup table. A valid flag of 1 indicates that the service card record is valid, and a valid flag of 0 indicates that the service card record is invalid. Therefore, a quick lookup table as shown in Table 3 can be generated based on the lookup table in Table 2 above:

[0058] Table 3:

[0059]

[0060]

[0061] As shown in Tables 2 and 3 above, the key in the quick lookup table Table 3 is the first four digits of the card number in Table 2. The position (record number) of each key in Table 3 is the same as the position (record number) of the business card record corresponding to that key in Table 2. It should be noted that since the valid flag of each business card record only needs to occupy 1 bit of storage space, every 8 records can share one valid status flag byte (that is, the valid flag of each record occupies 1 bit in the byte in turn), or the quick lookup table can use a certain bit of each record (such as the most significant bit (MSb)) as the valid status flag.

[0062] After inputting the identity identifier of the business card to be searched into the preset function to obtain the matching keyword corresponding to the identity identifier, the target keyword that matches the matching keyword can be found in the quick lookup table. Taking the business card to be searched 010369 as an example, its corresponding keyword is 0103. Three matching keywords 0103 can be found in the quick lookup table 3, and the record numbers in the quick lookup table are 3, 5 and 7 respectively.

[0063] S104. Obtain the record number of the target keyword in the quick reference table.

[0064] As shown in Table 3 above, taking the business card 010369 to be searched as an example, three matching keywords 0103 are found in the quick lookup table 3, with record numbers 3, 5 and 7 respectively.

[0065] S105. Determine the target business card record corresponding to the record number in the lookup table.

[0066] Since the record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the identity identifier corresponding to the keyword in the lookup table, the business card record corresponding to the record number in the lookup table is the target business card record.

[0067] As shown in Tables 2 and 3 above, the keyword 0103 in the quick lookup table 3 has three record numbers: 3, 5, and 7. Therefore, the business card record with record numbers 3, 5, and 7 in the lookup table 2 is identified as the target business card record.

[0068] S106. When the identity identifier in the target business card record matches the identity identifier of the business card to be searched, read the business information in the target business card record as the business information of the business card to be searched.

[0069] It should be noted that in RAM and ROM, the cheat sheets and lookup sheets are stored in the memory. That is, after allocating storage space for each sheet, the allocated storage space can be divided into multiple sub-storage spaces according to the length of the key corresponding to each record number in the cheat sheet and the lookup sheet, and the length of the business card record. Each sub-storage space stores one key and one business card record.

[0070] The starting storage address of the target service card record can be calculated based on the record number. Data at a specified offset from the starting storage address can be read to obtain the identity identifier of the target service card record. This identity identifier is then matched with the identity identifier of the service card to be searched. If they match, data at a specified offset from the starting storage address can be read to obtain the service information in the target service card record, which can then be used as the service information of the service card to be searched.

[0071] In one embodiment, the lookup table can be traversed from the end to the beginning of the table, keyword by keyword. When a matching keyword is encountered, the record number of the matching keyword is obtained. Then, the identity identifier in the business card record corresponding to the record number is read from the lookup table. The identity identifier in the business card record is matched with the identity identifier of the business card to be searched. If they match and the business card record is valid, the business information of the business card to be searched is obtained by reading the business information in the business card record. If the identity identifier in the business card record does not match the identity identifier of the business card to be searched, or the business card record is invalid, the lookup table is traversed back to the beginning of the table. After encountering the next matching keyword, the above process is repeated.

[0072] Using Tables 2 and 3 as examples, assuming the business card to be searched is 010369 and the keyword is 0103, we can iterate from record number 7 to record number 1 in Table 3. When we reach the keyword corresponding to record number 7, the keyword is always 0103. Then, we read the card number 010388 corresponding to record number 7 from Table 2. It does not match the business card to be searched, 010369, so we return to Table 3. When we iterate through record number 6, the keyword 0002 does not match. We continue to iterate through record number 5, where the keyword is always 0103. Then, we read the card number 010369 corresponding to record number 5 from Table 2. It matches the business card to be searched, 010369, and is valid. Therefore, we determine that the business card record corresponding to record number 5 is the target business card record. We then read the business information from this target business card record to obtain the business information of the business card to be searched, 010369.

[0073] In this embodiment of the invention, a keyword-based quick lookup table is configured in the RAM of the microcontroller, and a lookup table is configured in the ROM outside the microcontroller. The quick lookup table is a table containing keywords generated from a lookup table storing multiple service card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the service card record associated with the corresponding identity identifier in the lookup table. When the identity identifier of the service card to be searched is obtained, the keyword to be matched corresponding to the identity identifier is determined. The target keyword matching the keyword to be matched is searched in the quick lookup table, and the record number of the target keyword in the quick lookup table is obtained. The target service card record corresponding to the record number is further determined in the lookup table. When the identity identifier in the target service card record matches the identity identifier of the service card to be searched, the target service card record is read. The business information in the record is used as the business information of the business card to be searched. On the one hand, the quick lookup table, including keywords, is stored in RAM and does not occupy ROM space. It only stores keywords, so the quick lookup table occupies little storage space. It first performs a fuzzy search in RAM by keywords and then a precise search in ROM. The fuzzy search for keywords in RAM is fast, which reduces the number of searches in ROM and shortens the search time. On the other hand, the record number of the business card record in the lookup table is the same as the record number of the keyword corresponding to the identity identifier in the business card record in the quick lookup table. The quick lookup table and the lookup table do not need to sort the stored data. It is easy to add, delete, and modify business card records in the lookup table. It avoids the need to move the entire business card record when storing business card records in sequence, reduces the number of ROM writes, and improves the lifespan of ROM.

[0074] Example 2

[0075] Figure 2 This is a flowchart of a service card information retrieval method provided in Embodiment 2 of the present invention. This embodiment optimizes Embodiment 1 as described above. Figure 2 As shown, the method for retrieving service card information includes:

[0076] S201. After the microcontroller is powered on, the pre-stored lookup table is retrieved from the ROM outside the microcontroller.

[0077] In this embodiment, the lookup table can be a table that stores service card records, where each service card record can include the service card's identity identifier and service information.

[0078] As shown in Table 2 of Example 1, the identity identifier is the card number of the business card, and the validity flag indicates whether the business card record is valid.

[0079] In this embodiment, the lookup table is stored in a ROM outside the microcontroller. The microcontroller can access the ROM and read the lookup table from the ROM.

[0080] S202. Generate a quick reference table based on the lookup table.

[0081] In one embodiment, for each business card record, the identity identifier can be input into a preset function to obtain the keyword of the identity identifier, and a quick lookup table containing the keyword can be generated. The position of each keyword in the quick lookup table is the same as the position of the business card record associated with the identity identifier corresponding to the keyword in the lookup table.

[0082] The preset function can be a function that maps a part or even all of the identity identifier to a keyword. Preferably, the preset function is a function that maps a part of the identity identifier to a keyword. For example, it can be a function that extracts the lowest N bits of the card number, or it can be a function that generates the error detection code (such as CRC-8, CRC-16), error correction code, and hash function value of the card number. In this embodiment, the function that extracts the first four bits of the card number is used as an example. The card number of each business card record in the lookup table 2 in embodiment 1 is input into the bit extraction function to obtain the first four bits of the card number in each business card record, which are used as the keyword of the card number. After obtaining the first four bits of the card number in each business card record, a quick lookup table as shown in Table 3 can be generated. In this quick lookup table, the position of each keyword in the quick lookup table is the same as the position of the business card record associated with the identity identifier corresponding to the keyword in the lookup table, that is, the record number is the same. In this embodiment, the keywords (such as the first few bits of the card number) in the quick lookup table generated in RAM are much shorter than the keywords (complete card number) in the lookup table in ROM, using only a small amount of RAM space, which greatly improves the speed of looking up ROM records.

[0083] In one alternative embodiment, the lookup table is updated when an edit operation on the lookup table is detected, and the cheat table is updated based on the updated lookup table, thus achieving synchronization between the cheat table and the lookup table.

[0084] For example, when an operation to delete a service card record is detected, the status flag of the service card record is set to invalid in the lookup table, and the status flag of the keyword corresponding to the deleted service card record is set to invalid in the quick lookup table, as shown in Tables 2 and 3. When the service card record with record number 1 and card number 000152 is deleted, the valid flag of record number 1 in lookup table 2 is modified to 0, indicating that the service card record has been deleted. At the same time, the valid flag of the keyword 0001 corresponding to record number 1 in quick lookup table 3 is also set to 0. By using the valid flag bit, the service card record to be deleted can be marked as invalid, without having to delete the service card record from the ROM. This avoids the need to move the storage location of other service card records in the ROM when deleting a service card record, reduces the number of ROM writes, and improves the ROM's lifespan.

[0085] In another example, when an operation to add a business card record is detected, the business card record is added to the end of the lookup table and its status flag is set to valid. The status flag of the records in the lookup table that precede the added business card record and contain the identity identifier of the added business card record is set to invalid. The keyword corresponding to the added business card record is added to the end of the quick reference table and its status flag is set to valid. In the quick reference table, the status flag of the keyword corresponding to the identity identifier of the business card record whose status flag in the lookup table has been changed from valid to invalid is set to invalid.

[0086] As shown in Table 2, when it is necessary to add a service card record for service card 000247, record number 8 at the end of table 2 is the first free record number. Service card 000247 is added to record number 8 in table 2, and the status flag is set to 1. At the same time, the status flag of service card record 000247 with record number 6 is set to 0, resulting in a new lookup table as shown in Table 4.

[0087] Table 4

[0088]

[0089]

[0090] By updating the cheat sheet synchronously with Table 4 as shown in Table 3, we obtain the new cheat sheet as shown in Table 5:

[0091] Table 5:

[0092] Record number Keywords Valid mark 1 0001 0 2 0001 1 3 0103 1 4 0001 1 5 0103 1 6 0002 0 7 0103 1 8 0002 1

[0093] In this embodiment, the service card records are stored sequentially in the lookup table according to the storage space. That is, the service card record with the smallest record number (record number 1) is written at the beginning, and the service card record with the largest record number is written at the end. There is no need to sort the service card records according to the card number or other data in ascending or descending order. This ensures that the latest service card record is always written at the end of the table. When adding or deleting service card records in the lookup table, there is no need to move other service card records, which reduces the number of times the ROM storing the lookup table is used and improves the lifespan of the ROM. In addition, the newly added service card record is stored at the end of the table. When searching the table from the end to the beginning of the table in a later time, the probability of finding a valid service card record first is high, avoiding the search for invalid service card records when starting from the beginning of the table, thus improving the search efficiency.

[0094] S203. When the microcontroller detects a card swipe event of the card to be searched, it obtains the identity identifier of the card to be searched.

[0095] In this embodiment, the card number is used as an example to represent the identity. After the card to be searched is swiped, the card reader can read the card number of the card to be searched, and the microcontroller can receive the card number.

[0096] S204. Input the identity identifier into the preset function to obtain the keyword to be matched for the identity identifier.

[0097] This embodiment uses the preset function of retrieving the first four digits of the card number as an example. After inputting the card number of the business card to be searched into the function of retrieving the first four digits, the first four digits of the card number can be used as the keyword to be matched. Taking the business card to be searched 010369 as an example, its corresponding keyword is 0103.

[0098] Of course, the preset function can also be an error detection code (such as CRC-8, CRC-16), an error correction code, a hash function value, etc., to generate an identity identifier (card number).

[0099] S205. During the process of traversing from the end to the beginning of the cheat sheet, determine whether the current keyword being traversed matches the keyword to be matched.

[0100] As shown in Table 5, after obtaining the keyword 0103 of the card number 010369 of the business card to be searched, we can traverse from the tail of Table 5 (record number 8) to the head of Table 5 (record number 1). When traversing a keyword, we determine whether the keyword currently traversed is the keyword of the card number of the business card to be searched.

[0101] Taking the keyword 0002, which is currently being traversed to record number 8, as an example, determine whether 0002 matches 0103. If they do not match, execute S206; if they match, execute S208.

[0102] Of course, in practical applications, the reference table can also be traversed from the head to the tail. This embodiment does not restrict the traversal method of the reference table.

[0103] S206. Continue iterating through the next key in the cheat sheet.

[0104] For example, if the current iteration reaches record number 8, and the keywords 0002 and 0103 do not match, then continue iterating through record number 7 of the quick lookup table 5.

[0105] S207. Obtain the status flag of the current keyword.

[0106] Suppose that the traversal reaches a matching keyword, such as record number 7 in table 5, and the keyword corresponding to record number 7 is 0103, which matches the keyword 0103 of the card number 010369 of the business card to be searched. Then, the status flag 1 corresponding to the keyword 0103 of record number 7 is obtained from table 5.

[0107] S208. When the status flag is valid, determine the current keyword as the target keyword that matches the keyword to be matched.

[0108] That is, when the status flag is valid flag 1, the current keyword is determined to be the target keyword that matches the keyword to be matched. For example, if the status flag of the keyword 0103 corresponding to record number 7 in Table 5 is 1, then the keyword 0103 in record number 7 is determined to match the keyword 0103 of card number 010369 of the business card to be searched.

[0109] S209. When the status flag is invalid, continue traversing the next key in the cheat sheet.

[0110] When the status flag is invalid (0), the current keyword is determined to be invalid, and the corresponding business card record in the lookup table is also invalid. You can return to S206 and continue to traverse the next keyword, such as traversing the next keyword in the direction of the table header.

[0111] S210. Obtain the record number of the target keyword in the quick reference table.

[0112] As shown in Table 5, the keyword 0103 corresponding to record number 7 is the target keyword, and its record number is 7.

[0113] S211. Determine the target business card record corresponding to the record number in the lookup table.

[0114] In this embodiment, storage space can be allocated for the lookup table, and the length of each business card record can be set. The storage space is divided into multiple sub-storage spaces according to the length. Each sub-storage space stores one business card record, and the sub-storage space addresses are sorted in descending order. The business card record with record number 1 is stored in the first sub-storage space, the business card record with record number 2 is stored in the second sub-storage space, and so on, as shown in Table 6 below:

[0115] Table 6:

[0116]

[0117] Table 6 above shows an example of the service card records in Table 4 stored in the memory. We can then obtain the starting storage address of the first service card record at the head of the lookup table, calculate the target storage address based on the record number, the starting storage address, and the preset record length, and identify the service card record at that target storage address as the target service card record. Assuming record number 5, the target storage address of the target service card record with record number 5 can be calculated using the following formula:

[0118] Loc(a i )=Loc(a1)+(i-1)×L

[0119] Where Loc(ai) is the storage location of the i-th record in the lookup table, Loc(a1) is the storage location of the first record in the lookup table, and L is the number of bytes occupied by each record in the lookup table. Substituting i=5 into the above formula, we obtain the storage location of the target business card record with record number 5. The record stored in this storage location is the target business card record corresponding to record number 5.

[0120] S212. Read the identity identifier of the target business card from the target business card record.

[0121] That is, the identity of the target service card can be obtained by reading a specified number of bytes of data from the storage location determined by S211. Specifically, as shown in Table 1, the first four bytes of the service card record are the card number, so the card number can be obtained by reading four bytes of data starting from the beginning position of the storage location determined by S211.

[0122] S213. Determine whether the identity identifier of the target business card matches the identity identifier of the business card to be searched.

[0123] Specifically, taking the card number as an example, in one embodiment, the complete card number can be read and then compared with the card number of the business card to be searched. For example, the complete four-byte card number can be read and compared. If they match completely, S214 is executed; otherwise, S206 is returned.

[0124] In another embodiment, after reading a digit from one position of the card number, it can be immediately matched with the corresponding position of the card number of the service card to be searched. If there is no match, return to S206; if there is a match, continue reading the digit from the next position for matching. When the digits from all positions match the corresponding data of the card number of the service card to be searched, it means that the card number of the target service card is a complete match with the card number of the service card to be searched, and then execute S214. For example, if the card number of the service card to be searched is 010369, and the card number of the target service card in the lookup table is 010357, then there is no match when reading 5, so there is no need to read the digits of subsequent positions, reducing the amount of data read and improving the search speed when looking up long service card records.

[0125] In another embodiment, the card number can be read from a specified position for comparison. If there is no match, return to S206. If there is a match, continue reading the number at the next position for matching. For example, if the card number of the business card to be searched is 010369, and the card number of the target business card in the search table is 010357, the card number can be read from the 5th position. That is, the number 5 is read. If there is no match when reading 5, there is no need to read several numbers before the specified position for matching, which reduces the amount of data read and improves the search speed when the business card record is long.

[0126] S214. Determine whether the status flag of the target business card record is a valid flag.

[0127] The status flag of the target service card is stored in a specified location. The status flag can be read from this specified location. A status flag of 1 indicates that the card is valid, and a status flag of 0 indicates that the card is invalid.

[0128] Then it can be determined whether the status flag is 1. If it is, execute S215; otherwise, execute S206.

[0129] S215. When the status flag of the target service card record is valid, read the service information in the target service card record as the service information of the service card to be searched.

[0130] Specifically, data can be read from a specified storage location according to the storage format of the target service card to obtain the service information of the target service card. As shown in Table 1, after calculating the starting storage address of the target service card record in S211, the service information starts from byte 6. Therefore, the service information is read starting from the starting storage address of the target service card record offset by 6 bytes.

[0131] It should be noted that if no matching keyword is found after traversing the entire cheat sheet, or if no matching keyword with a valid status flag is found, the search fails and a search failure message is generated. Similarly, if no matching business card record with a valid status flag is found in the lookup table after searching the cheat sheet for matching keywords with a valid status flag, the search also fails and a search failure message is generated.

[0132] In an optional embodiment, it is also possible to first determine whether the status flag is valid, and then match the identity identifier if it is valid. Since the number of bytes occupied by the status flag is small, on the one hand, the reading speed is fast, and on the other hand, the identity identifier can be matched only if the status flag is valid, avoiding the time consumption caused by determining that the status flag is invalid after the identity identifier is matched, thus improving the search speed.

[0133] In another alternative embodiment, when multiple consecutive keywords in the quick lookup table are the same, multiple consecutive business card records corresponding to the corresponding record number can be read from the lookup table to match the identity identifier and determine the status flag, so as to improve the search speed of shorter business card records.

[0134] This embodiment includes a keyword-based quick lookup table in the microcontroller's RAM and a lookup table in the ROM outside the microcontroller. The quick lookup table is generated from a lookup table containing multiple service card records including identity identifiers, and includes a keyword-based table. The record number of each keyword in the quick lookup table is the same as the record number of the service card record associated with the corresponding identity identifier in the lookup table. On the one hand, the keyword-based quick lookup table is stored in RAM and does not occupy ROM space. It only stores keywords, so the quick lookup table occupies little storage space. It first performs a fuzzy search in RAM by keyword and then a precise search in ROM. The fuzzy keyword search in RAM is fast, which reduces the number of searches in ROM and shortens the search time. On the other hand, the record number of the service card record in the lookup table is the same as the record number of the keyword corresponding to the identity identifier in the service card record in the quick lookup table. The quick lookup table and the lookup table do not need to sort the stored data. It is easy to add, delete, and modify service card records in the lookup table. This avoids the need to move the entire service card record when storing it sequentially, reduces the number of ROM writes, and improves the ROM's lifespan.

[0135] Furthermore, the quick reference table includes keywords and corresponding record numbers. The storage address of the corresponding business card is calculated using the record number. The quick reference table does not need to store the address of the corresponding business card record, and the quick reference table occupies little RAM space.

[0136] Furthermore, the length of keywords in the quick lookup table can be adjusted. Increasing the length of keywords can improve the accuracy of fuzzy searches, further shorten search time, and reduce the number of times the lookup table in the ROM is searched.

[0137] Example 3

[0138] Figure 3 This is a schematic diagram of a service card information retrieval device provided in Embodiment 3 of the present invention. Figure 3 As shown, the service card information lookup device includes:

[0139] The identity identification module 301 is used by the microcontroller to obtain the identity identification of the business card to be searched when it detects a card swiping event of the business card to be searched.

[0140] The keyword acquisition module 302 is used to input the identity identifier into a preset function to obtain the keyword to be matched for the identity identifier;

[0141] The keyword matching module 303 is used to search for a target keyword that matches the keyword to be matched in a preset quick lookup table. The quick lookup table is a table containing keywords that is stored in the RAM of the microcontroller and generated based on a lookup table containing multiple business card records including identity identifiers. The record number of each keyword in the quick lookup table is the same as the record number of the business card record associated with the identity identifier corresponding to the keyword in the lookup table. The lookup table is stored in ROM outside the microcontroller.

[0142] Record number acquisition module 304 is used to acquire the record number of the target keyword in the quick reference table;

[0143] The target service card record determination module 305 is used to determine the target service card record corresponding to the record number in the lookup table.

[0144] The business information reading module 306 is used to read the business information in the target business card record when the identity identifier in the target business card record matches the identity identifier of the business card to be searched, so as to use it as the business information of the business card to be searched.

[0145] In one embodiment, it also includes:

[0146] The lookup table acquisition module is used to acquire a pre-stored lookup table from the ROM outside the microcontroller after the microcontroller is powered on. The lookup table includes multiple service card records, and each service card record includes the identity identifier and service information of the service card.

[0147] The quick reference table generation module is used to generate a quick reference table based on the lookup table.

[0148] In one embodiment, it also includes:

[0149] The table synchronization module is used to update the lookup table when an edit operation is detected on the lookup table, and to update the quick reference table according to the updated lookup table.

[0150] In one embodiment, the keywords in the quick reference table and the business card records in the lookup table are set with status flags, and the table synchronization module includes:

[0151] The first service card record deletion unit is used to set the status flag of the service card record to an invalid flag in the lookup table when an operation to delete a service card record is detected.

[0152] The first quick lookup table keyword deletion unit is used to set the status flag of the keyword corresponding to the deleted business card record in the quick lookup table to an invalid flag.

[0153] or,

[0154] A service card record addition unit is used to add a service card record to the end of the lookup table when an operation to add a service card record is detected.

[0155] The second business card record deletion unit is used to set the status flag of the record in the lookup table that is before the added business card record and contains the identity identifier in the added business card record to an invalid flag;

[0156] The keyword addition unit is used to add the keyword corresponding to the business card record to the end of the quick reference table and set the status flag to a valid flag.

[0157] The second quick lookup table keyword deletion unit is used to set the status flag of the keyword corresponding to the identity identifier of the business card record whose status flag has been changed from valid to invalid in the quick lookup table to an invalid flag.

[0158] In one embodiment, the keyword matching module 303 includes:

[0159] The keyword traversal unit is used to determine whether the currently traversed keyword matches the keyword to be matched during the traversal from the end to the beginning of the lookup table.

[0160] Continue traversing the cell to continue traversing the next key in the lookup table;

[0161] A status flag acquisition unit is used to acquire the status flag of the current keyword;

[0162] The target keyword determination unit is used to determine the current keyword as a target keyword that matches the keyword to be matched when the status flag is a valid flag;

[0163] The invalidation determination unit is used to continue traversing the next key in the lookup table when the status flag is invalid.

[0164] In an optional embodiment, the target service card record determination module 305 includes:

[0165] The starting storage address acquisition unit is used to acquire the starting storage address of the first business card record located at the head of the lookup table;

[0166] The target storage address calculation unit is used to calculate the target storage address based on the record number, the starting storage address, and the preset record length.

[0167] The target service card record determination unit is used to determine the service card record in the target storage address as the target service card record.

[0168] In one embodiment, it also includes:

[0169] An identity identification reading unit is used to read the identity identification of the target service card from the target service card record;

[0170] The identity identification unit is used to determine whether the identity identification of the target service card matches the identity identification of the service card to be searched; if not, it returns to the traversal unit.

[0171] A status flag determination unit is used to determine whether the status flag recorded by the target service card is a valid flag;

[0172] The service information reading unit is used to read the service information in the target service card record from the target service card record when the status flag of the target service card record is a valid flag, so as to use it as the service information of the service card to be searched;

[0173] The invalid flag determination unit is used to return to the continue traversal unit when the status flag of the target service card record is an invalid flag.

[0174] The business card information search device provided in this embodiment of the invention can execute the business card information search method provided in Embodiment 1 and Embodiment 2 of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0175] Example 4

[0176] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device 40 is intended to represent various forms of digital computers, such as desktop computers, workbenches, servers, blade servers, mainframe computers, etc. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0177] like Figure 4As shown, the electronic device 40 includes at least one microcontroller 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the microcontroller 41. The memory stores computer programs executable by the microcontroller. The microcontroller 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The microcontroller 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0178] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, sensor, etc.; output unit 47, such as various types of display, speaker, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0179] Microcontroller 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of microcontroller 41 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various controllers running machine learning model algorithms, digital signal processors (DSPs), and any suitable controller, microcontroller (MCU), microprocessor (MPU), etc. Microcontroller 41 performs the various methods and processes described above, such as the business card information lookup method.

[0180] In some embodiments, the service card information lookup method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by microcontroller 41, one or more steps of the service card information lookup method described above may be performed. Alternatively, in other embodiments, microcontroller 41 may be configured to perform the service card information lookup method by any other suitable means (e.g., by means of firmware).

[0181] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable controller, which may be a dedicated or general-purpose programmable controller, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0182] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a microcontroller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the microcontroller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0183] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FRAM), ferroelectric memory (FRAM), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0184] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0185] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0186] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0187] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0188] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method of searching for information of a service card, characterized by, The application comprises: After the microcontroller is powered on, a pre-stored lookup table is obtained from the ROM outside the microcontroller, each service card record in the lookup table comprising an identity of a service card and service information, each service card record being provided with a record number, the record number in the lookup table indicating a position of the service card record in the lookup table, the record number in the lookup table being sequentially increased from the head to the tail of the table; A quick lookup table is generated according to the lookup table; When the microcontroller detects a card swiping event of a service card to be looked up, the identity of the service card to be looked up is obtained; The identity is input into a preset function to obtain a to-be-matched keyword of the identity; A target keyword matching the to-be-matched keyword is looked up in the quick lookup table, the quick lookup table being a table comprising keywords generated according to the lookup table comprising a plurality of service card records comprising identities and stored in the RAM of the microcontroller, each keyword in the quick lookup table being provided with a record number in the quick lookup table, the record number being the same as a record number of a service card record associated with the keyword in the lookup table, the record number in the quick lookup table indicating a position of the keyword in the quick lookup table, and the record number in the quick lookup table being sequentially increased from the head to the tail of the table, the lookup table being stored in the ROM outside the microcontroller; A record number of the target keyword in the quick lookup table is obtained; A starting storage address of a first service card record at the head of the lookup table is obtained; A target storage address is calculated according to the record number, the starting storage address and a preset record length; The service card record in the target storage address is determined as a target service card record; When the identity in the target service card record matches the identity of the service card to be looked up, the service information in the target service card record is read as the service information of the service card to be looked up.

2. The method of claim 1, wherein, Further comprising: When an editing operation for the lookup table is detected, the lookup table is updated, and the quick lookup table is updated according to the updated lookup table.

3. The method of claim 2, wherein, The keyword in the quick lookup table and the service card record in the lookup table are provided with a state flag, and the updating of the lookup table and the updating of the quick lookup table according to the updated lookup table when the editing operation for the lookup table is detected comprises: When an operation of deleting a service card record is detected, a state flag of the service card record in the lookup table is set as an invalid flag; A state flag of a keyword corresponding to the deleted service card record in the quick lookup table is set as an invalid flag; Or, When an operation of adding a service card record is detected, a service card record is added at the tail of the lookup table; State flags of records containing the identity in the added service card record in the lookup table before the added service card record are set as invalid flags; A keyword corresponding to the added service card record is added at the tail of the quick lookup table, and a state flag is set as a valid flag; The state flag corresponding to the key of the identity of the service card record whose state flag in the lookup table is changed from the valid flag to the invalid flag in the quick lookup table is set as the invalid flag.

4. The method according to any one of claims 1 to 3, characterized in that, The target key matching the to-be-matched key is searched in the preset quick lookup table, and the searching comprises: In the process of traversing from the tail of the quick lookup table to the head, it is determined whether the current key currently traversed matches the to-be-matched key; If not, the next key in the quick lookup table is continuously traversed; If yes, the state flag of the current key is acquired; When the state flag is the valid flag, it is determined that the current key is the target key matching the to-be-matched key; When the state flag is the invalid flag, the next key in the quick lookup table is continuously traversed.

5. The method according to any one of claims 1 to 3, wherein Before the business information in the target service card record is read as the business information of the to-be-searched service card when the identity in the target service card record matches the identity of the to-be-searched service card, the method further comprises: The identity of the target service card is read from the target service card record; It is determined whether the identity of the target service card matches the identity of the to-be-searched service card; If not, the step of continuously traversing the next key in the quick lookup table is returned; If yes, it is determined whether the state flag of the target service card record is the valid flag; When the state flag of the target service card record is the valid flag, the business information in the target service card record is read from the target service card record as the business information of the to-be-searched service card; When the state flag of the target service card record is the invalid flag, the step of continuously traversing the next key in the quick lookup table is returned.

6. A service card information search apparatus characterized by comprising: The method comprises: A lookup table acquisition module is configured to acquire a pre-stored lookup table from a ROM outside the microcontroller after the microcontroller is powered on, each service card record in the lookup table comprising an identity of a service card and business information, each service card record being provided with a record number, the record number in the lookup table representing a position of the service card record in the lookup table, and the record number in the lookup table increasing sequentially from the head to the tail; A quick lookup table generation module is configured to generate a quick lookup table according to the lookup table; An identity acquisition module is configured to acquire the identity of a to-be-searched service card when the microcontroller detects a card swiping event of the to-be-searched service card; A key acquisition module is configured to input the identity into a preset function to obtain a to-be-matched key of the identity. The keyword matching module is configured to search for a target keyword matching the to-be-matched keyword in a quick search table. The quick search table is a keyword table stored in the RAM of the microcontroller and generated according to a search table in which a plurality of service card records including identity identifiers are stored. Each keyword in the quick search table has a record number in the quick search table, and the record number of the service card record associated with the keyword in the search table is the same as the record number of the service card record associated with the keyword in the quick search table. The record number in the quick search table represents the position of the keyword in the quick search table, and the record number in the quick search table increases sequentially from the head to the tail of the quick search table. The search table is stored in a ROM outside the microcontroller. The record number acquisition module is configured to acquire the record number of the target keyword in the quick search table. The target service card record determination module is configured to determine a target service card record corresponding to the record number in the search table. The service information reading module is configured to read service information in the target service card record as service information of the to-be-searched service card when the identity identifier in the target service card record matches the identity identifier of the to-be-searched service card. The target service card record determination module includes: The start storage address acquisition unit is configured to acquire a start storage address of a first service card record at the head of the search table. The target storage address calculation unit is configured to calculate a target storage address according to the record number, the start storage address, and a preset record length. The target service card record determination unit is configured to determine the service card record in the target storage address as a target service card record.

7. An electronic device, comprising: The electronic device includes: at least one microcontroller; and a memory in communication connection with the at least one microcontroller; wherein The memory stores a computer program executable by the at least one microcontroller. The computer program is executed by the at least one microcontroller to enable the at least one microcontroller to perform the service card information search method of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the microcontroller to perform the service card information search method of any one of claims 1-5 when executed.

Citation Information

Patent Citations

  • Flow stream searching method and device

    CN101540723A

  • Card transaction terminal device

    JP1993012322A