Abnormal case detection method and detection device
By storing exception characteristics rather than complete exception case data on the smart card, and replacing or format conversion during testing to generate transaction data, the problem of testing time and memory space occupation in traditional testing methods is solved, and a more efficient financial transaction terminal is achieved test.
Patent Information
- Application Number
- CN202411229247.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional financial transaction terminal testing methods require regenerating personalized data when generating exception cases, resulting in a longer test time and occupying a large amount of memory space.
The smart card stores a personalized standard data and multiple exception cases. Each exception case is set with an exception feature and an expected error message. By replacing the exception feature or converting the personalized standard data, the transaction data of the exception case is generated, thereby reducing the transaction data of the exception case. The time and storage space for personalized data.
It reduces the time for personalized data generation in each test case, reduces the use of test time and memory space, and improves the efficiency and efficiency of testing.
Smart Images

Figure CN119250815A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial transactions, and in particular to an abnormal case detection method and a detection device. Background Art
[0002] When a smart card is used for a transaction, payment is usually collected through a cash register, such as a financial POS machine or cash register. When a cash register fails, it often affects the transaction. Therefore, the cash register needs to be tested before it is used commercially. The traditional detection method is to make test cards with different abnormal cases, and the cash register tests the test cards with different abnormal cases. However, there are usually many abnormal cases, and each time a case is switched, the personalized data needs to be regenerated. When there are too many abnormal cases, it takes more time to generate personalized data, which prolongs the test time.
[0003] There is an existing test method for a financial transaction terminal, which is to write a test case to a test card; the financial transaction terminal sends a transaction instruction to the test card; after receiving the transaction instruction, the test card applies the test case to analyze the transaction instruction and returns the personalized data corresponding to the transaction instruction; and determines whether the financial transaction terminal correctly processes the personalized data, and if so, confirms the correctness of the operation of the financial transaction terminal. However, the command message of this test method corresponds to the personalized data one by one, that is, when an abnormal case is generated, the personalized data needs to be regenerated, which prolongs the test time, and one case corresponds to one command message and one personalized data, which occupies a large amount of memory space of the test card. Summary of the invention
[0004] The first object of the present invention is to provide an abnormal case detection method that reduces test time and memory space.
[0005] The second object of the present invention is to provide a detection device using the above-mentioned abnormal case detection method.
[0006] To achieve the first purpose of the present invention, the present invention provides an abnormal case detection method, in which a smart card stores a personalized standard data and multiple abnormal cases, and an abnormal case is provided with an abnormal feature and an expected error message; the method comprises: the smart card receives a transaction command sent by a cash register, and selects a target abnormal case to execute a transaction operation; the smart card obtains the personalized standard data, organizes the transaction data according to the target abnormal feature of the target abnormal case and the personalized standard data, and sends the transaction data and the expected error information corresponding to the abnormal case data to the cash register; after the cash register receives the transaction data, the transaction data is detected to determine whether the transaction data has an error, and if so, the expected error information is written into an error detection log.
[0007] As can be seen from the above scheme, a personalized standard data and multiple abnormal cases are written into the smart card, and the abnormal case only stores the abnormal feature part. When testing, the abnormal feature can replace the data at the corresponding position of the personalized standard data or convert the transaction data format according to the abnormal feature, so as to obtain the transaction data of the abnormal case. Since there is only one personalized standard data and the abnormal case only stores the abnormal feature, when testing, only part of the personalized standard data or transaction data is changed, and the personalized data does not need to be regenerated, thereby reducing the personalized card generation time for each test case, thereby reducing the test time. Since only one personalized standard data is stored, the storage capacity of the smart card memory is reduced.
[0008] In a further scheme, the abnormal feature includes an abnormal label feature or an abnormal format feature; the step of organizing the transaction data according to the target abnormal feature of the target abnormal case and the standard data includes: determining whether the target abnormal feature is an abnormal label feature; if so, replacing the correct label feature in the personalized standard data with the target abnormal feature to form abnormal standard data; organizing the transaction data according to the abnormal standard data.
[0009] It can be seen from this that if the abnormal feature is an abnormal label feature, the normal label feature at the corresponding position of the personalized standard data can be replaced with the abnormal label feature, so as to complete the replacement of the abnormal personalized data and reduce the production time of the personalized card.
[0010] In a further solution, if the target abnormal feature is not an abnormal label feature, the abnormal transaction data is organized according to the target abnormal feature.
[0011] It can be seen from this that if the target abnormal feature is not an abnormal label feature, then the target abnormal feature is an abnormal format feature. After completing the transaction data organization, the abnormal transaction data can be reorganized according to the abnormal format. The abnormal transaction data does not need to be generated by additionally generating abnormal personalized data, thereby reducing the production time of personalized cards.
[0012] In a further solution, after the cash register writes the expected error information into the error detection log, the cash register further executes: the cash register sends a next transaction command to the smart card.
[0013] It can be seen from this that after the test is completed, the test of the next abnormal case can be executed, and the tester does not need to check whether the test is successful in the middle, which reduces the test time.
[0014] In a further solution, after the smart card sends the expected information corresponding to the transaction data and the abnormal case data to the cash register, it also executes: determining whether the transaction operation has been executed for all abnormal cases; if the transaction operation has not been executed for any of the abnormal cases, when receiving the next transaction command sent by the cash register, selecting the abnormal case that has not executed the transaction operation to execute the transaction operation; if all abnormal cases have completed the transaction operation, the smart card will no longer execute the transaction operation.
[0015] It can be seen that by marking the abnormal cases, the smart card marks the current abnormal case each time it sends transaction data, thereby completing the traversal of multiple abnormal cases.
[0016] In a further solution, the step of the smart card receiving the transaction command sent by the cash register includes: determining whether the transaction command includes the number of the abnormal case; if so, selecting the target abnormal case corresponding to the number to execute the transaction operation according to the number.
[0017] It can be seen that users can enter the number on the cash register and select abnormal cases for detection during testing.
[0018] In a further solution, if the transaction command does not include the number of the abnormal case, the abnormal case in which the transaction operation has not been executed is selected to execute the transaction operation.
[0019] It can be seen that if the transaction command does not include the number of the abnormal case, the abnormal case in which the transaction operation is not executed is selected for testing, thereby completing the traversal of multiple abnormal cases.
[0020] In a further solution, after the smart card no longer performs the transaction operation, the cash register analyzes the error detection log.
[0021] It can be seen that after completing the test of all abnormal cases, the error detection log can be viewed centrally to determine whether the cash register has detected all abnormal cases, thereby determining whether there is a problem with the cash register. By viewing the error detection log in batches, the card test interruption time can be reduced.
[0022] In order to achieve the second purpose, the detection device provided by the present invention includes a smart card and a cash register. The smart card stores multiple abnormal cases, and each abnormal case is provided with an abnormal feature and an expected error message; the smart card is used to receive a transaction command sent by the cash register, and select a target abnormal case to perform a transaction operation; the smart card is also used to obtain personalized standard data, organize the transaction data according to the target abnormal feature of the target abnormal case and the personalized standard data, and send the transaction data and the expected error information corresponding to the abnormal case data to the cash register; the cash register is used to detect the transaction data after receiving it, and determine whether the transaction data has an error. If so, record the expected error information. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a system structure block diagram of an embodiment of the detection device of the present invention.
[0024] Figure 2 It is a flow chart of an embodiment of the abnormal case detection method of the present invention.
[0025] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0026] The present invention sets a personalized standard data and multiple abnormal cases through a smart card. When testing the cash register, the abnormal characteristics can be used to replace the data at the corresponding position of the personalized standard data or the transaction data can be formatted according to the abnormal characteristics to obtain the transaction data of the abnormal case. The present invention does not need to generate personalized data for each case, thereby reducing the time for generating personalized data.
[0027] Detection device embodiment: The detection device of this embodiment includes a smart card 1 and a cash register 2. The smart card 1 stores a personalized standard data and multiple abnormal cases. An abnormal case is provided with an abnormal feature and an expected error message. The cash register 2 can send a transaction command to the smart card 1, and the smart card 1 can return transaction data to the cash register 2. The smart card 1 can complete the data generation of the abnormal case by format replacement or label replacement.
[0028] Abnormal case detection method embodiment: The detection method for detecting abnormal cases in this embodiment uses the detection device of the detection device embodiment. Among them, the smart card stores a personalized standard data and multiple abnormal cases, and an abnormal case is provided with an abnormal feature and an expected error message. Among them, the personalized standard data is the data that writes the personalized data into the card according to the standard data of the card organization through the Apdu instruction. The abnormal feature in the abnormal case is the data that does not meet the requirements of the card organization. For example, the length of UnionPay data TAG9F08 is 2 bytes. If the length of this segment of data is 3 bytes, the segment of data is the data of abnormal features. When the smart card stores multiple abnormal cases, each abnormal case is provided with a number. There are two types of abnormal features in this embodiment, and the abnormal features include abnormal label features or abnormal format features. The abnormal label feature is the value of the erroneous data of DGI-TAG. TAG is a label for data, such as name data, and the label 5F20 is defined to facilitate storage and use inside the card. DGI is data composed of one or more TAGs. Multiple TAGs are organized into one DGI, and the position of TAG can be located by DGI. In this embodiment, the DGI-TAG data is the value of DGI and TAG specified in the setting data, for example, the value of DGI0301-TAG9F08 is set to 000030.
[0029] Among them, the personalized standard data is 10KB of memory space, and the abnormal case is set with an abnormal feature and an expected error message, then one abnormal feature is about 100B of memory space, and one expected error message is 100B of memory space. If the smart card stores 1000 abnormal cases, it is also necessary to store the name and usage status of the abnormal case, which requires 20B*1000=20KB of memory space. The smart card needs 10K + 100B*1000+20KB=130KB of memory space. If one abnormal case is set with one personalized data, 1000 abnormal cases require 1000*10KB=9.766MB of storage space. This embodiment reduces the storage space for storing personalized data.
[0030] When testing, firstly, step S1 is executed, the smart card receives the transaction command sent by the cash register, and selects the target abnormal case to perform the transaction operation. When selecting the target abnormal case, the smart card first determines whether the transaction command includes the number of the abnormal case. The tester can input the number of the abnormal case through the cash register to specify the abnormal case for testing. If the transaction command does not include the number of the abnormal case, the target abnormal case corresponding to the number is selected according to the number to perform the transaction operation. If the transaction command does not include the number of the abnormal case, the abnormal case that has not performed the transaction operation will perform the transaction operation.
[0031] After selecting the target abnormal case to perform the transaction operation, step S2 is executed, the smart card obtains personalized standard data, organizes the transaction data, and sends the transaction data and the expected error information to the cash register. Among them, when returning the transaction data, personalized data may be used in the step. In the step of organizing the transaction data according to the target abnormal feature and standard data of the target abnormal case, it is first determined whether the target abnormal feature is an abnormal label feature; since the abnormal feature of this embodiment includes an abnormal label feature or an abnormal format feature, if the target abnormal feature is not an abnormal label feature, the target abnormal feature is an abnormal format feature. If the target abnormal feature is an abnormal label feature, the correct label feature in the personalized standard data is replaced with the target abnormal feature to form abnormal standard data, and the transaction data is organized according to the abnormal standard data. For example, the length of UnionPay data TAG9F08 is 2 bytes, and the length of the data of the abnormal feature is 3 bytes, then the 3-byte abnormal feature replaces the 2-byte normal feature in TAG9F08 to form abnormal standard data.
[0032] If the target abnormal feature is not an abnormal label feature, then the target abnormal feature is an abnormal format feature. When organizing the transaction data return, the abnormal transaction data is organized according to the target abnormal feature, that is, the transaction data is organized according to the abnormal format, so that the format of the transaction data is incorrect.
[0033] After the smart card sends the transaction data and expected error information to the cash register, the usage status of the target exception case is set to 1, indicating that the exception case has been used for detection, which is convenient for screening as an execution case.
[0034] After the smart card sends the transaction data and expected error information to the cash register, step S3 is executed, where the cash register receives the transaction data and detects the transaction data. The cash register parses the transaction data.
[0035] After the cash register detects the transaction data, step S4 is executed to determine whether the transaction data has errors. The cash register can detect whether the data returned by the smart card meets the specification requirements. For example, the length of UnionPay data TAG9F08 is 2 bytes. If the length of this byte in the transaction data is 3 bytes, the cash register can detect the error.
[0036] If the cash register confirms that the transaction data is wrong, step S5 is executed, and the cash register writes the expected information into the error detection log. The cash register is set with an error detection log. After each detection, the error detection log and all abnormal cases of the smart card can be analyzed to check whether the cash register has undetected error cases, so as to determine whether the cash register has abnormal conditions.
[0037] If the cash register confirms that there is no error in the transaction data, step S6 is executed, and the cash register does not record the expected error information of the transaction data. If the cash register does not detect an error, the cash register cannot record the transaction data, so that when the subsequent analysis is performed, it is confirmed that the undetected error case does not appear in the error detection log, which is convenient for analyzing the cash register.
[0038] After the cash register writes the expected error information into the error detection log, it sends the next transaction command to the smart card to continue the detection. After the smart card sets the usage status of the target abnormal case to 1, it also determines whether all abnormal cases have executed the transaction operation, that is, checks whether there are any cases that have not executed the test. If there are abnormal cases that have not executed the transaction operation, when receiving the next transaction command sent by the cash register, the abnormal case that has not executed the transaction operation is selected to execute the transaction operation, that is, the abnormal case with the usage status set to 0 is executed. If all abnormal cases have completed the transaction operation, the smart card will no longer execute the transaction operation. The smart card traverses all abnormal cases in this way, so that all abnormal cases can be traversed in one detection. After all abnormal cases are completed, the cash register analyzes the error detection log to speed up the test. Subsequently, by manually comparing the error detection log and the abnormal cases of the smart card, it is determined whether the expected error information of all abnormal cases of the smart card is contained. If so, it proves that the cash register can detect all errors and that the cash register executes normal transactions. If it does not contain the expected error information of all abnormal cases of the smart card, it proves that the program of the cash register has errors and needs further inspection.
[0039] In this implementation, since there is only one personalized standard data and the abnormal case only stores the abnormal features, when testing, only a part of the personalized standard data is changed and there is no need to regenerate the personalized data, thereby reducing the personalized data generation time for each test case and thus reducing the testing time.
[0040] The above are only preferred embodiments of the present invention, but the design concept of the invention is not limited thereto. Without departing from the concept of the present invention, more other equivalent embodiments may be included. It is obvious to those skilled in the art that various changes, readjustments and substitutions can be made without departing from the protection scope of the present invention.
Claims
1. An abnormal case detection method, characterized in that: The smart card stores a personalized standard data and a plurality of abnormal cases, wherein one of the abnormal cases is provided with an abnormal feature and an expected error message; The method includes: The smart card receives the transaction command sent by the cash register and selects the target abnormal case to execute the transaction operation; The smart card obtains the personalized standard data, organizes transaction data according to the target abnormal characteristics of the target abnormal case and the personalized standard data, and sends the expected error information corresponding to the transaction data and the abnormal case data to the cash register; After receiving the transaction data, the cash register detects the transaction data to determine whether there is an error in the transaction data. If so, the expected error information is written into an error detection log.
2. The abnormal case detection method according to claim 1, characterized in that: The abnormal feature includes an abnormal label feature or an abnormal format feature; The steps of organizing transaction data according to target abnormal features and standard data of target abnormal cases include: Determine whether the target abnormal feature is an abnormal label feature; If so, replace the correct label feature in the personalized standard data with the target abnormal feature to form abnormal standard data; The transaction data is organized according to the abnormal standard data.
3. The abnormal case detection method according to claim 2, characterized in that: If the target abnormal feature is not an abnormal label feature, the abnormal transaction data is organized according to the target abnormal feature.
4. The abnormal case detection method according to any one of claims 1 to 3, characterized in that: After the cash register writes the expected error information into the error detection log, the cash register further executes: The cash register sends a next transaction command to the smart card.
5. The abnormal case detection method according to claim 4, characterized in that: After the smart card sends the transaction data and the expected information corresponding to the abnormal case data to the cash register, the smart card further executes: Determine whether trading operations have been executed for all abnormal cases; If there is an abnormal case where the transaction operation is not executed, when receiving the next transaction command sent by the cash register, the abnormal case where the transaction operation is not executed is selected to execute the transaction operation; If all of the abnormal cases complete the transaction operation, the smart card will no longer perform the transaction operation.
6. The abnormal case detection method according to any one of claims 1 to 3, characterized in that: The steps of the smart card receiving the transaction command sent by the cash register include: Determining whether the transaction command includes the number of the abnormal case; If so, the target abnormal case corresponding to the number is selected according to the number to execute the transaction operation.
7. The abnormal case detection method according to claim 6, characterized in that: If the transaction command does not include the number of the abnormal case, the abnormal case in which the transaction operation has not been executed is selected to execute the transaction operation.
8. The abnormal case detection method according to claim 5, characterized in that: After the smart card no longer performs transaction operations, it also performs: The cash register analyzes the error detection log.
9. A detection device, comprising a smart card and a cash register, characterized in that: The smart card stores a plurality of abnormal cases, and each of the abnormal cases is provided with an abnormal feature and an expected error message; The smart card is used to receive the transaction command sent by the cash register and select the target abnormal case to perform the transaction operation; The smart card is also used to obtain personalized standard data, organize transaction data according to target abnormal characteristics of target abnormal cases and personalized standard data, and send expected error information corresponding to the transaction data and the abnormal case data to the cash register; After receiving the transaction data, the cash register is used to detect the transaction data to determine whether there is an error in the transaction data, and if so, record the expected error information.
