Smart card aging test method and device and storage medium

By setting up applications in the smart card and using terminal instructions, the smart card itself performs aging test, solving the problem of inefficiency of traditional testing methods and achieving faster and more efficient testing.

CN119644099APending Publication Date: 2025-03-18ZHUHAI XH SMARTCARD CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411445402.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-03-21
Filing Date
2024-10-16
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional smart card aging testing methods are slow, low-efficiency, and have a long test cycle, making it difficult to effectively evaluate the service life of smart cards.

Method used

By setting up an application in the smart card, using the selection application instructions and update self-test instructions sent by the terminal, the smart card itself performs aging test, including writing transactions, writing the first data and the second data to the target area alternately, and generating a return value to the terminal decide whether to continue or end the test.

Benefits of technology

It improves the efficiency and speed of smart card aging test, reduces the test cycle, enables smart card to complete most of the test content independently, reduces interaction with the terminal, and improves the freedom of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119644099A_ABST
    Figure CN119644099A_ABST
Patent Text Reader

Abstract

The invention discloses a smart card aging test method and device and a storage medium, and the method comprises the steps: obtaining an application selection instruction sent by a terminal, and selecting an application according to the application selection instruction; obtaining an updating self-checking instruction sent by the terminal; a write-in transaction of the application is performed according to the update self-check instruction, the write-in transaction characterizes that the first data and the second data are written into a target area respectively, and a return value is generated; and sending the return value to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value. In the technical scheme of the embodiment, the terminal sends the application selection instruction and the updating self-checking instruction to the smart card, the aging test is carried out on the application set by the smart card, and only the finally generated return value needs to be sent to the terminal, so that the test freedom degree of the smart card is high, the interaction with the terminal is reduced, and the test efficiency is improved. Most aging test contents can be completed through the device, and the test efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart cards, and in particular to a smart card aging test method, device and storage medium. Background Art

[0002] Smart cards will inevitably age when their service life is approaching. When a smart card is close to or reaches its service life, various problems may occur, some of which may even cause a certain degree of loss to the user. Generally, the life of the same type of smart card in the same external environment is basically within a stable range. In the traditional smart card aging test, the data of the smart card is read one by one through the test terminal, the test cycle is long, the test speed is too slow, and the test efficiency is too low. Summary of the invention

[0003] In view of this, an object of the embodiments of the present invention is to provide a smart card aging test method, device and storage medium, which can improve the efficiency and test speed of the smart card aging test and reduce the test cycle.

[0004] In a first aspect, an embodiment of the present invention provides a smart card aging test method, which is applied to a smart card, wherein the smart card is communicatively connected to a terminal, the smart card is provided with an application, the smart card includes a first data area, a target area, and a second data area, the first data area is provided with first data, the second data area is provided with second data, and the first data and the second data are different, the method includes:

[0005] Obtaining an application selection instruction sent by the terminal, and selecting the application corresponding to the aging test according to the application selection instruction;

[0006] Obtaining an update self-check instruction sent by the terminal;

[0007] Performing a write transaction of the application according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value, wherein the return value is a value generated by the application of the smart card after comparing the first data and the second data after being written into the target area in sequence;

[0008] The return value is sent to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value.

[0009] In a second aspect, an embodiment of the present invention provides a smart card aging test method, which is applied to a terminal, the terminal is connected to a smart card for communication, the smart card is provided with an application, the smart card includes a first data area, a target area, and a second data area, the first data area is provided with first data, the second data area is provided with second data, the first data and the second data are different, and the method includes:

[0010] Sending an application selection instruction to the smart card, so that the smart card selects the application corresponding to the aging test according to the application selection instruction;

[0011] Sending an update self-check instruction to the smart card, so that the smart card performs a write transaction of the application according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively and generating a return value, wherein the return value is a value generated by the application of the smart card after comparing the first data and the second data after they are successively written into the target area;

[0012] Receiving the return value sent by the smart card;

[0013] The aging test is continued or terminated according to the return value.

[0014] In a third aspect, an embodiment of the present invention provides a smart card aging test device, which is applied to a smart card, and the device includes:

[0015] at least one processor;

[0016] at least one memory for storing at least one program;

[0017] When the at least one program is executed by the at least one processor, the at least one processor implements the method as described above.

[0018] In a fourth aspect, an embodiment of the present invention provides a smart card aging test device, which is applied to a terminal, and the device includes:

[0019] at least one processor;

[0020] at least one memory for storing at least one program;

[0021] When the at least one program is executed by the at least one processor, the at least one processor implements the method as described above.

[0022] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to execute the method as described above.

[0023] The implementation of the embodiment of the present invention includes the following beneficial effects: The embodiment of the present invention provides a smart card aging test method, including: obtaining an application selection instruction sent by the terminal, and selecting the application corresponding to the aging test according to the application selection instruction; obtaining an update self-test instruction sent by the terminal; performing a write transaction of the application according to the update self-test instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value; sending the return value to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value. In the technical solution of this embodiment, only the terminal needs to send an application selection instruction and an update self-test instruction to the smart card, so that the smart card's own application can perform an aging test on the smart card, and the control of the test process can be completed by the smart card itself, and only the finally generated return value needs to be sent to the terminal, so that the smart card has a high degree of freedom in testing, and the interaction with the terminal is reduced. Most of the aging test content can be completed by itself, effectively improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a schematic diagram of the steps of a smart card aging test method provided by an embodiment of the present invention;

[0025] Figure 2 is a flowchart of the steps of the aging test provided by an embodiment of the present invention;

[0026] Figure 3 It is a flowchart of the steps of smart card update self-check provided by an embodiment of the present invention;

[0027] Figure 4 is a flowchart of writing first data and second data into a target area provided by an embodiment of the present invention;

[0028] Figure 5 is a schematic diagram of random writing provided by an embodiment of the present invention;

[0029] Figure 6 is a schematic diagram of another random write provided by an embodiment of the present invention;

[0030] Figure 7 is a schematic diagram of an aging curve provided by an embodiment of the present invention;

[0031] Figure 8 is a schematic diagram of an aging test of a multi-level smart card provided by an embodiment of the present invention;

[0032] Fig. 9 It is a structural block diagram of a smart card aging test system provided by an embodiment of the present invention;

[0033] Fig.10It is a schematic diagram of the steps of another smart card aging test method provided by an embodiment of the present invention;

[0034] Fig.11 is a schematic diagram of an aging test curve provided by an embodiment of the present invention;

[0035] Fig.12 The present invention provides a block diagram of a smart card aging test device. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0038] The relevant technical terms are as follows:

[0039] Smart Cards include financial cards, non-financial cards and IC cards. Financial cards are also called bank cards, which can be divided into credit cards and cash cards. The former can be used for consumer payments and can be overdrawn according to the pre-set limit, while the latter can be used as an electronic wallet or electronic passbook, but cannot be overdrawn. Non-financial cards are also called non-bank cards, which cover a wide range of areas, including all areas other than financial cards, such as telecommunications, tourism, education and public transportation.

[0040] The embodiment of the present invention provides a smart card aging test method, including: obtaining an application selection instruction sent by a terminal, and selecting an application according to the application selection instruction; obtaining an update self-test instruction sent by the terminal; performing a write transaction of the application according to the update self-test instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value; sending the return value to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value. In the technical solution of this embodiment, only the terminal needs to send the application selection instruction and the update self-test instruction to the smart card, so that the application of the smart card itself can perform an aging test on the smart card, and the control of the test process can be completed by the smart card itself, and only the finally generated return value needs to be sent to the terminal, so that the test freedom of the smart card is high, the interaction with the terminal is reduced, and most of the aging test content can be completed by itself, effectively improving the test efficiency.

[0041] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.

[0042] like Figure 1 As shown, an embodiment of the present invention provides a smart card aging test method, which includes the following steps.

[0043] S100: Obtain an application selection instruction sent by a terminal, and select an application corresponding to the aging test according to the application selection instruction.

[0044] It should be noted that the application includes a single component that performs the aging test or an application program composed of multiple components, which is not limited here.

[0045] Specifically, the smart card is connected to the terminal in a communication manner, and the connection method includes wireless connection or wired connection, which is not limited here; after the terminal sends an application selection instruction, the smart card receives the application selection instruction, and the smart card then selects the application for aging test. The application is located in the smart card, and the terminal only needs to send the corresponding instructions to the smart card and can perform the aging test. The information interaction between the terminal and the smart card is small, and the test efficiency is high. It should be noted that the terminal can be different according to different application scenarios. It can be a computer, a bank ATM, an access control card machine, a mobile phone terminal, or other devices with authentication functions. This implementation does not specifically limit it.

[0046] S200: Obtain an update self-check instruction sent by the terminal.

[0047] Specifically, after the smart card is connected to the terminal, it obtains the update self-check instruction sent by the terminal.

[0048] S300, performing a write transaction of the application according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively and generating a return value, wherein the return value is a value generated by the smart card application after comparing the first data and the second data after writing them into the target area in sequence.

[0049] In some optional embodiments, before receiving the update self-test instruction, the smart card receives the initialization instruction sent by the terminal, and then initializes the first data area in the smart card to random data to obtain the first data; after receiving the initialization instruction, the smart card initializes the second data area to fixed data, such as initializing the page data of the second data area to 0 or 1 to obtain the second data, and the specific number of the second data area is not limited here. And ensure that the first data is different from the second data. Since the first data and the second data are different, the first data and the second data can be continuously and alternately written to the target area, that is, after writing the first data to the target area, the second data is written to the target area to cover the first data written to the target area. If the first data and the second data are the same, the first data will be written to the target area and then the second data will be stopped. When comparing the target area and the second data, the difference cannot be compared, that is, it is unknown whether the second data is written to the target area, thereby affecting the aging test.

[0050] In some optional embodiments, the target page of the first data writing target area and the target page of the second data writing target area are the same.

[0051] In some optional embodiments, after the initialization is successfully completed, the smart card sends an initialization success response to the terminal. In some specific embodiments, if the initialization of the first data area and the second data area of ​​the smart card fails, the smart card sends a failure response to the terminal and then re-receives the initialization instruction of the terminal, or the terminal performs a quality inspection of the smart card to obtain a quality inspection report, thereby repairing the smart card. After receiving the initialization success response, the terminal generates an update self-test instruction, which includes the maximum number of write times and the write instruction of the smart card. The smart card writes the first data and the second data to the target area within the maximum number of write times, and generates a first return value or a second return value after completion.

[0052] In some optional embodiments, the return value includes a first return value and a second return value, and the write transaction includes: writing the first data into the target area; after completing writing the first data into the target area, comparing the data in the target area with the first data to obtain a first comparison result; when the first comparison result indicates that the first data is the same as the data in the target area, writing the second data into the target area; after completing writing the second data into the target area, comparing the data in the target area with the second data to obtain a second comparison result; generating the first return value or the second return value according to the second comparison result, the first return value and the second return value both represent the return value; when the first comparison result indicates that the first data is different from the data in the target area, generating the second return value.

[0053] Specifically, the purpose of the aging test is to detect whether a write error occurs when the smart card is writing data, so as to detect whether the smart card is aged. In the scenario where the first data is written from the first data area to the target area, whether there is an abnormal problem with the data in the target area, when the writing is completed, if the data written in the target area is different from the first data, it means that there is an error in the writing, that is, the expected written data is inconsistent with the actual written data. At this time, the first comparison result indicates that the first data is different from the data in the target area, and the second return value is generated; and when the smart card writes the first data in the first data area to the target area without a write error, that is, the first data is the same as the data written in the target area, then the first comparison result indicates that the first data is the same as the data in the target area, and the second data is written, that is, the second data is written to the target area. After writing the second data into the target area, the second data is compared with the data written in the target area. If the second data is different from the data written in the target area, a second return value is generated. At this time, the second comparison result indicates that the second data is different from the data in the target area. If the second data is the same as the data written in the target area, the current number of loops is obtained, and the current number of loops is incremented by one. The step of determining whether the current number of loops is less than the maximum number of loops is executed until the maximum number of loops is reached and the comparison result is still the same. Then a first return value is generated. At this time, the second comparison result indicates that the second data is the same as the data in the target area.

[0054] In some optional embodiments, a first return value or a second return value is generated based on the second comparison result, including: generating a second return value when the second comparison result indicates that the second data is different from the data of the target area; generating a first return value when the second comparison result indicates that the second data is the same as the data of the target area.

[0055] Specifically, when the first comparison result indicates that the first data is different from the data in the target area, the smart card generates a second return value and ends the aging test. That is, as long as the second return value is generated, it means that the smart card has aged, thereby ending the aging test of the entire smart card. When the first comparison result indicates that the first data is the same as the data in the target area, the second data continues to be written into the target area, so that the second data and the data in the target area are compared to obtain a second comparison result. When the second comparison result indicates that the second data is different from the data in the target area (including the second data and the data of the part where the data is written to the target area are different), the smart card generates a second return value and ends the aging test; when the second comparison result indicates that the second data is the same as the data in the target area (including the second data and the data of the part where the data is written to the target area are the same), the smart card generates the first return value at this time.

[0056] In some optional embodiments, when the second comparison result indicates that the second data is identical to the data in the target area, a first return value is generated, specifically including: when the second comparison result indicates that the second data is identical to the data in the target area, obtaining the current number of writes and adding one to the current number of writes; when the current number of writes is greater than or equal to half of the maximum number of writes, ending the write transaction and generating the first return value; when the current number of writes is less than half of the maximum number of writes, continuing the write transaction.

[0057] Specifically, the current write count is how many times the second data is currently written into the target area. Since the first data must be written into the target area before the second data is written into the target area, the total number of writes is twice the current number of writes, that is, when it is determined that the current number of writes is greater than or equal to half of the maximum number of writes, the write transaction of the data into the target area is terminated, and the smart card then sends the generated first return value to the terminal. When the current number of writes is less than half of the maximum number of writes, the write transaction is continued, that is, the first data is continued to be written into the target area, and then the first comparison result is obtained, and then the second data is written into the target area, and then the second comparison result is obtained, and this cycle is repeated until the current number of writes is greater than or equal to half of the maximum number of writes.

[0058] In some optional embodiments, the maximum number of write times and the maximum number of protection pages can be sent from the terminal to the smart card end together with the update self-test instruction, or can be sent from the terminal to the smart card end separately, or the maximum number of write times and the maximum number of protection pages can be included in the update self-test instruction and sent from the terminal to the smart card end together, which is not limited here.

[0059] In some optional embodiments, a write transaction includes: first obtaining a maximum number of protection pages of a target area, the maximum number of protection pages representing the maximum number of pages of data written to the target area from the first data area or the second data area; then, when the number of target pages written to the target area in the first data area is less than the maximum number of protection pages, writing the first data of the first data area to the target page corresponding to the target area; then, after completing writing the first data to the target area, comparing the data of the target page with the first data to obtain a first comparison result; then, when the first comparison result represents that the first data is the same as the data of the target page, writing the second data of the second data area to the target page corresponding to the target area.

[0060] Specifically, the maximum number of protection pages is the maximum number of pages that page data of the first data area or the second data area can be written into the target area. The first data in the first data area can only be written within the maximum number of protection pages, otherwise it will not be written; the second data in the second data area can only be written within the maximum number of protection pages, otherwise it will not be written; if the maximum number of protection pages is 100 pages, and the first data in the first data area includes 110 pages of page data, then when the first data is written into the target area, the page data of the first 100 pages are written, and the page data of pages 101 to 110 of the first data area are not written into the target area, and the page numbers of pages 1-100 of the first data area are written into the 100 pages corresponding to the target pages of the target area, that is, the target area has 100 pages of target pages corresponding to the first data. Then, when the first comparison result indicates that the data of the first data is the same as that of the target page, the second The second data of the first 100 pages in the data area is also written into the 100 pages of the target page corresponding to the target page in the target area; or, when the first data is written into the target area, the page data of the last 100 pages is written, that is, the page data of pages 11 to 110 of the first data area is written into the 100 pages of the target page corresponding to the target area, then when the first comparison result indicates that the first data is the same as the data of the target page, the second data area is also written into the 100 pages of the second data of the last 100 pages into the 100 pages of the target page corresponding to the target area; or, when the first data is written into the target area, only the data of the first page number of the first data is written, and when the data after the data of the target area corresponding to the first page number is written into the target page is compared with the data of the first page number of the first data and is the same, then the second data area also writes the data of the first page number of the second data into the corresponding target page to cover the data of the first page number of the first data.

[0061] In some optional embodiments, when the maximum number of protection pages is 100 pages, that is, the target page has 100 pages of space for writing the first data and the second data respectively, for example, the number of pages of the first data and the second data is only 10 pages, the first data and the second data can respectively write only the page data of the first page number into the same target page, or 10 pages of data of the first data and 10 pages of data of the second data can be respectively written into the same target page, so that after the first data is written into the target page, the data after writing into the target page is the same as the first data, and then the second data is written into the same target page to cover the first data for data erasing and writing operation to test, specifically, erasing of a single page, multiple pages or all data can be selected according to actual needs.

[0062] In some optional embodiments, writing the first data of the first data area into the target page corresponding to the target area includes: first comparing the first data of the first data area with the third data of the target area to obtain a third comparison result, the third data representing the data of the target page before the first data is written, that is, the data of the target page corresponding to the first data to be written in the target area; when the third comparison result represents that the first data and the third data are different, the first data is written into the target page where the third data is located; and when the third comparison result represents that the first data and the third data are the same, the second data of the second data area is written into the target page where the third data is located or the first data is modified, and the modified first data is written into the target page where the third data is located. This embodiment is to write the first data into the number of pages corresponding to the target area, that is, the target page, and the specific writing method is not limited, that is, the writing of page data of a single page, multiple pages or all pages is not limited, and the first data can represent the page data of a single page, multiple pages or all pages of the first data area. The second data can also represent the page data of a single page, multiple pages or all pages of the second data area.

[0063] Specifically, modifying the first data includes initializing the first data, changing part or all of the order of the data, etc., which is not limited here. The modified first data is different from the third data, and the first data is written into the target page where the third data is located.

[0064] In some optional embodiments, the smart card compares data before writing data into the target area, and only when the data to be written is different from the stored data in the data writing area of ​​the target area, the data will be written. The first page data of the current page number of the first data area is compared with the second page data of the corresponding target page in the target area to obtain the corresponding comparison result, and the current page number is the page number to be written; only when the comparison result indicates that the first page data and the second page data are different, the first page data will be written into the page number where the second page data is located, that is, the first page data of the current page number is written into the page number corresponding to the target area to cover the second page data. When the comparison result indicates that the first page data and the second page data are the same, the first page data of the next page in the first data area and the second page data of the corresponding page in the target area are compared, that is, the page data of the first data area and the corresponding page number of the target area are not written when they are the same, and they are written when they are different, and the corresponding pages are compared and written page by page. The first page data of all pages in the first data area is the first data, and the second page data of all pages in the target area is the third data. In this embodiment, the first page data of all pages of the first data area are written page by page into the corresponding page number of the target area, such as writing the first page data of page 100 of the first data area into page 100 of the target area, and so on, which will not be described in detail here. Similarly, when writing the data of the second data area into the target area, the data is also compared and written page by page.

[0065] In some optional embodiments, writing the second data in the second data area into the target page corresponding to the target area includes: first comparing the second data in the second data area with the fourth data of the target page to obtain a fourth comparison result, the fourth data representing the data of the target page before the second data is written, and the fourth data is the first data or the modified first data; then, when the fourth comparison result represents that the second data and the fourth data are different, writing the second data into the target page where the fourth data is located; and when the fourth comparison result represents that the second data and the fourth data are the same, modifying the second data, and writing the modified second data into the target page where the fourth data is located.

[0066] Specifically, the fourth data is the first data or the modified first data written into the target area by the first data area, that is, when the first data is the same as the third data in the target area, the first data is modified and the modified first data is written into the page where the third data is located. Data comparison is also performed before the second data is written into the target page. If the second data and the fourth data are different, the second data is written into the target page where the fourth data is located. When the second data and the fourth data are the same, the second data is modified and the modified second data is written into the target page where the fourth data is located. The specific modification may be initializing the second data, changing part of the data, changing the order of part of the data or the order of all the data, etc. The specific modification method is not limited here.

[0067] In some optional embodiments, after the first data is written into the target area, the first data and the fourth data are compared. If the results are the same, the second data of the second data area is written into the target area. Specifically, the writing is page by page, that is, the data of the second data area is written into the page number corresponding to the target area in units of pages. Data comparison is also performed when the second data is written into the target area. Specifically, the third page data of the written page number of the second data area and the fourth page data of the corresponding target page in the target area are compared to obtain a fourth comparison result. The written page number represents the page number corresponding to the page data to be written into the target area in the second data area. In the case where the fourth comparison result represents that the third page data and the fourth page data are different, the third page data is written into the page where the fourth page data is located, that is, the third page data and the fourth page data of the corresponding page numbers of the second data area and the target area are different, then the third page data of the written page number of the second data area is written into the page number corresponding to the target area to cover the fourth page data. If the fourth comparison result indicates that the third page data and the fourth page data are the same, the third page data of the next page in the second data area and the fourth page data of the corresponding page in the target area are compared, that is, page by page comparison and writing are performed in order of page numbers.

[0068] In some optional embodiments, the first data of the first data area is compared with the third data of the corresponding target page in the target area to obtain a third comparison result, the first data is the page data written into the target area by the first data area, which can be single-page data, multi-page data, or all-page data; only when the third comparison result indicates that the first data and the third data are different, the first data is written into the page number where the third data is located; when the third comparison result indicates that the first data and the third data are the same, the second data of the second data area is written into the target page where the third data is located, or the first data is modified so that the modified first data is different from the third data, and the specific modification can be initialized, the order of part of the data or all of the data is changed, and the specific modification method is not limited here, and the modified first data is written into the target page where the third data is located. After writing the first data of the first data area or the modified first data to the target area, the first data or the modified first data is compared with the fourth data after the data is written in the target area, and the second data is written if the first data or the modified first data is the same as the fourth data, and the second return value is generated if they are different, and the test ends. The second data of the second data area is compared with the fourth data of the corresponding target page in the target area to obtain a fourth comparison result. The second data is the page data written into the target area by the second data area, which can be single-page data, multi-page data, or all-page data. When writing multi-page data, a page data comparison can be performed after each page is written, that is, whether a page of data written into the target area is changed after writing. Only when the fourth comparison result indicates that the second data and the fourth data are different, the second data will be written into the page number where the fourth data is located. When the second data and the fourth data are the same, the second data is modified, and the modified second data is written into the page number where the fourth data is located. Modifying the second data is to modify the data sequence, data content, etc. of the second data, or to initialize the data, which is not specifically limited here, so that the modified second data is different from the fourth data, and then the modified second data is written into the page number where the fourth data is located. After writing, the write transaction continues to be executed, so that the first data and the second data are written into the target area in this cycle.

[0069] In some optional embodiments, the method further includes: after a page of data in the first data area is written to the target area or before the first data is written to the target area, comparing the corresponding page data in the target area with the page of data or the first data in the first data area to obtain a third comparison result; and / or after a page of data in the second data area is written to the target area or after the second data is written to the target area, comparing the corresponding page data in the target area with the page of data or the second data in the second data area to obtain a fourth comparison result.

[0070] Specifically, a page of data or first data in the first data area is written page by page into the corresponding number of pages in the target area, and a comparison is performed before the writing of the page of data or the first data; only when the third comparison result indicates that the page of data or the first data in the first data area is different from the page of data or the third data of the corresponding page in the target area, the page of data or the first data in the first data area is written into the number of pages corresponding to the target area. When the third comparison result indicates that the page of data in the first data area is the same as the page of data in the corresponding page in the target area, or the first data in the first data area is the same as the third data of the corresponding page in the target area, the step of writing the page of data or the second data in the second data area into the target area will continue, or the page of data or the first data in the first data area will be modified, and then the modified page of data or the first data in the first data area will be written page by page into the corresponding number of pages in the target area. After the first data is written into the target area, the first data is the same as the data after the first data is written into the target area, and the second data in the second data area is written into the target area. Specifically, the page of data or the second data in the second data area is written page by page into the corresponding number of pages in the target area.

[0071] In some optional embodiments, after the first data is written into the target area, the data in the target area is compared with the first data to obtain a first comparison result, including: comparing the first page data of the first data with the second page data of the target area (equivalent to the target page to be written corresponding to the first page data) to obtain a fifth comparison result, the first page data representing a page of data to be written into the target area by the first data, and the second page data representing the current page data of the target page in the target area corresponding to the first page data being written; when the fifth comparison result represents that the first page data and the second page data are different, a second return value is generated; when the fifth comparison result represents that the first page data and the second page data are the same, the first page data of the next page in the first data and the second page data of the target page in the target area corresponding to the first page data of the next page in the first data are continued to be compared; the above steps are repeated until the first data is written into the target area, and the data of the target page in the target area corresponding to the first data being written is compared with the first data to obtain the first comparison result.

[0072] In some optional embodiments, when the second data is written into the target area, the data in the target area is compared with the second data to obtain a second comparison result, including: comparing the third page data of the second data with the fourth page data of the target page in the target area corresponding to the third page data to be written to obtain a sixth comparison result, the third page data representing a page of data to be written into the target area by the second data, and the fourth page data representing the current page data of the target page in the target area corresponding to the third page data being written; when the sixth comparison result represents that the third page data and the fourth page data are different, a second return value is generated; when the sixth comparison result represents that the third page data and the fourth page data are the same, the third page data of the next page in the second data and the fourth page data of the target page in the target area corresponding to the third page data of the next page in the second data are continued to be compared; and the above steps are repeated until the comparison of the data corresponding to the target page in the target area with the second data is completed to obtain the second comparison result.

[0073] In some optional embodiments, a write transaction includes: comparing the first page data of the first data with the second page data of the target area to obtain a seventh comparison result; when the seventh comparison result indicates that the first page data and the second page data of the target area are different, writing the first page data to the target page where the second page data is located; after the first page data is written to the target page where the second page data is located, comparing the first page data of the first data with the second page data of the target area to obtain a fifth comparison result, the first page data indicating a page of data to be written into the target area by the first data, and the second page data indicating the current page data of the target page in the target area corresponding to the writing of the first page data; when the fifth comparison result indicates that the first page data and the second page data are different, generating a second return value; when the fifth comparison result indicates that the first page data and the second page data are the same, or when the seventh comparison result indicates that the first page data and the second page data of the target area are the same, continuing to write the first page data of the next page of the first data into the target area The first page data of the next page corresponding to the first data is written into the target page; the above steps are repeated until the first data is written into the target area, and the data of the target page corresponding to the first data in the target area is compared with the first data to obtain a first comparison result; when the first comparison result indicates that the first data is the same as the data of the target page, the second data is written into the target area, the first data indicates a single page data, multiple pages of data or all data in the first data area, and the second data indicates a single page data, multiple pages of data or all data in the second data area; when the first comparison result indicates that the first data is different from the data of the target page, a second return value is generated; when the second data is written into the target area, the data corresponding to the target page in the target area is compared with the second data to obtain a second comparison result; when the second comparison result indicates that the second data is the same as the data of the target page, the first return value is generated; when the second comparison result indicates that the second data is different from the data of the target page, a second return value is generated.

[0074] In some optional embodiments, writing the second data into the target area includes: comparing the third page data of the second data with the fourth page data of the target area to obtain an eighth comparison result; when the eighth comparison result indicates that the third page data and the fourth page data of the target area are different, or when the first comparison result indicates that the first data and the data of the target area are the same, writing the third page data into the target page where the fourth page data is located; after the third page data is written into the target page where the fourth page data is located, comparing the third page data of the second data with the fourth page data of the target area to obtain a sixth comparison result, the third page data indicating a page of data of the target page to be written by the second data, and the fourth page data indicating the current page data of the target page in the target area corresponding to the writing of the third page data; when the sixth comparison result indicates that the third page data and the fourth page data are different, generating a second return value; when the sixth comparison result indicates that the third page data and the fourth page data are the same, continuing to write the third page data of the next page of the second data into the target page in the target area corresponding to the writing of the third page data of the next page of the second data; repeating the above steps until the data of the target page in the target area corresponding to the writing of the second data is compared with the second data to obtain the second comparison result.

[0075] Specifically, when the third page data and the fourth page data are different, the third page data is written into the target page where the fourth page data is located. At this time, after writing, the data written into the target page can be compared to see if it is the third page data, so that the data written into the target page and the third page data can be compared to determine whether the smart card is aged, that is, to generate the first return value or the second return value. When the first comparison result indicates that the first data is the same as the data in the target area, the third page data can be directly written into the target page where the fourth page data is located, because the first data and the second data are initialized to different data, when the first data and the data in the target area are the same, it indicates that the second data is different from the data in the target area. When the sixth comparison result indicates that the third page data and the fourth page data are the same, the third page data of the next page of the second data is continued to be written into the target page where the third page data of the next page of the second data corresponding to the target area is written, that is, the second data in the second data area is compared page by page with the corresponding page of the target area and then written into the target area, and after writing into the target area, the written data is compared to see if there is an error.

[0076] S400: Send a return value to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value.

[0077] Specifically, after receiving the return value, the terminal determines whether to continue the aging test according to the return value.

[0078] In some optional embodiments, the terminal continues the aging test or ends the aging test according to the return value, including:

[0079] When the return value represents the first return value, the terminal adds one to the current number of cycles. If the current number of cycles is less than the maximum number of cycles, an update self-test instruction is sent to the smart card to continue the aging test. When the return value represents the second return value, the terminal ends the aging test and generates a test result.

[0080] Specifically, if the maximum number of cycles is set to 1000, the number of cycles starts counting from 0, the current number of cycles is 998, and after adding one to the current number of cycles, the current number of cycles is 999, which is less than the maximum number of cycles. The update self-test instruction is sent to the smart card, so that the smart card repeats the above update self-test. The aging test ends only when the terminal receives the second return value or the current number of cycles is greater than or equal to 1000. When the second return value is received, the smart card ages, and the life of the smart card is the current number of cycles when aging occurs; when the first return value is received and the current number of cycles is greater than or equal to 1000, the test result is successful, and the smart card has not aged.

[0081] As long as the terminal receives the second return value, it generates a test result and ends the aging test. The test result is that the smart card has aged. The life of the smart card is the current number of cycles when aging occurs.

[0082] In some optional embodiments, when the comparison result is still the same after reaching the maximum number of cycles, the data of the portion in the target area where no data is written can be compared with the original data of the portion to determine whether the data in the portion changes when other data is erased in the target area. Based on the comparison result, it can be determined whether the smart card is aging, or the terminal performs a quality inspection of the smart card to obtain a quality inspection report, thereby repairing the smart card.

[0083] In a specific embodiment, after the smart card is powered on, it is connected to the JAVA application and then performs an aging test: before this, the smart card creates a first data area and a second data area of ​​256*N bytes. The created first data area and the second data area are initialized, that is, assigned initial values, and the initial values ​​of 256*N bytes are stored in the application. When the smart card performs an update self-test, the first data of the first data area and the second data of the second data area are respectively updated to the corresponding page numbers of the target area, and the pages of the target area also include 256*N bytes of storage space.

[0084] In some optional implementations, such as Figure 2 As shown, Figure 2 The embodiment of the present invention provides an application Fig. 9 The aging test flowchart of the smart card aging test method in the aging test scenario is provided, and the aging test includes but is not limited to steps S201 to S212.

[0085] Step S201, the terminal connects to the smart card;

[0086] Wherein, the smart card and the terminal communicate with each other;

[0087] Step S202, the terminal sends a select application instruction to the smart card;

[0088] Step S203, the smart card selects an application according to the select application instruction;

[0089] Step S204, the terminal sends an initialization instruction to the smart card;

[0090] Step S205, the smart card initializes the first data area as the first data and the second data area as the second data;

[0091] Step S206, determine whether i < N (i = 0)?

[0092] Wherein, i is the current loop count and N is the maximum loop count;

[0093] Step S207, when i < N, the terminal sends an update self-check instruction to the smart card. When i is not less than N, the test ends;

[0094] Step S208, the smart card performs card update self-check according to the update self-check instruction;

[0095] Step S209, the smart card generates a first return value or a second return value;

[0096] Step S210, the terminal determines whether it has received the first return value;

[0097] Step S211, if the terminal receives the first return value, then i++, and return to step S206 to repeat;

[0098] Step S212, if the terminal does not receive the first return value, then generate smart card aging information;

[0099] Wherein, i++ means that i is incremented by 1 on the original basis, i = i + 1.

[0100] Regarding the technical problems that can be solved by each step or the combination of multiple steps in steps S201 to S212 of this embodiment, and the technical effects that can be obtained, please refer to the above embodiment, and no specific elaboration will be made here.

[0101] In some alternative implementations, as Figure 3 shown, Figure 3 is the flowchart of the smart card update self-check of the smart card aging test method applied to the Fig. 9 aging test scenario of the present invention. The smart card update self-check includes but is not limited to steps S301 to S308.

[0102] Step S301, the smart card determines C <M / 2?

[0103] Where C is the current number of writes to the smart card, and M is the maximum number of writes;

[0104] Step S302, when C is not less than M / 2, the smart card sends a first return value to the terminal;

[0105] Step S303, the smart card writes the first data into the target area;

[0106] Step S304, the smart card compares the first data with the data in the target area to see if they are equal. If they are not equal, then execute step S307; if they are equal, then execute step S305;

[0107] Step S305, the smart card writes the second data into the target area;

[0108] Step S306, the smart card compares the second data with the data in the target area to see if they are equal. If they are equal, execute step S308; if they are not equal, execute step S307;

[0109] Step S307, generating a second return value and ending the test;

[0110] Step S308, generate the first return value, and C++, and jump to step S301 to repeat the execution.

[0111] Among them, C++ means that C increases by 1 on the original basis, C=C+1.

[0112] For the technical problems that can be solved by each step or a combination of multiple steps in step S301 to step S308 of this embodiment and the technical effects that can be obtained, please refer to the above embodiments and will not be described in detail here.

[0113] In some optional implementations, such as Figure 4 As shown, another embodiment of the present invention provides an application in Fig. 9 A flowchart of writing first data and second data into a target area of ​​a smart card aging test method in an aging test scenario, where the first data and second data are written into the target area including but not limited to steps S401 to S402.

[0114] Step 401, the smart card determines whether T1 is less than the maximum number of protected pages. If so, step 402 is executed, otherwise, writing data is terminated;

[0115] T1 is the number of pages currently written into the target area in the first data area or the second data area.

[0116] In step 402 , the smart card writes the expected data into the target area, and T1++, and jumps to execute step 401 .

[0117] Among them, T1++ means that T1 is increased by 1 on the basis of the original value, T1=T1+1.

[0118] The expected data is data in the first data area or the second data area that is expected to be written into the target area.

[0119] For the technical problems that can be solved by the individual steps or the combination of multiple steps in step S401 to step S402 of this embodiment and the technical effects that can be obtained, please refer to the above embodiments and will not be described in detail here.

[0120] In some optional embodiments, the write transaction includes: obtaining first random length data of the first data area, the first random length data representing the first data with random data size; writing the first random length data into a first cache area of ​​the target area, the first cache area representing a cache area in the target area for storing the first random length data; after completing writing the first random length data into the first cache area, comparing the data in the first cache area with the first random length data to obtain a first comparison result; when the first comparison result represents that the first random length data is the same as the data in the first cache area, obtaining second random length data of the second data area, the second random length data representing the second data with random data size; writing the second random length data into a second cache area of ​​the target area, the second cache area representing a cache area in the target area for storing the second random length data; when completing writing the second random length data into the second cache area, comparing the data in the second cache area with the second random length data to obtain a second comparison result; generating a first return value or a second return value according to the second comparison result; when the first comparison result represents that the first random length data is different from the data in the first cache area, generating the second return value.

[0121] Specifically, refer to Figure 5The first random length data is the first data indicating that the data size in the first data area is random and the data storage position is also random, that is, the data of the random size of the random storage area in the first data area is written into the first cache area of ​​the target area; similarly, the first cache area is also a cache area at a random position in the target area, that is, a first cache area is randomly determined before writing, and the first random length data is continuously written to the first cache area, and the writing result of writing the first random length data into the first cache area is detected, so as to detect the random writing performance of the smart card. Compared with full writing or partial sequential writing, the first random length data is more in line with the daily smart card data writing scenario, so that the aging life of the smart card in daily use can be more accurately tested, and the test is more accurate. The second random length data is also the second data with random data size and random data storage location in the second data area, that is, the second data of random size in the random storage area in the second data area is written into the second cache area of ​​the target area; the second cache area is also a cache area randomly determined by the target area before writing, and the writing result of writing the second random length data into the second cache area is tested. The first data and the second data are different, thereby avoiding the phenomenon that the writing error cannot be detected due to the writing of repeated data; the first random length data and the second random length data are written alternately in a cycle, so as to quickly detect the aging of the smart card and have high testing efficiency.

[0122] In some optional embodiments, a write transaction includes: obtaining first random length data of a first data area, the first random length data representing first data with random data size; writing the first random length data into a first cache area of ​​a target area, the first cache area representing a cache area in the target area for storing first and second random length data; after completing writing the first random length data into the first cache area, comparing the data in the first cache area with the first random length data to obtain a first comparison result; when the first comparison result represents that the first random length data is the same as the data in the first cache area, obtaining second random length data of a second data area, the second random length data representing second data with random data size; writing the second random length data into the first cache area of ​​the target area; when completing writing the second random length data into the first cache area, comparing the data in the first cache area with the second random length data to obtain a second comparison result; generating a first return value or a second return value according to the second comparison result; generating a second return value when the first comparison result represents that the first random length data is different from the data in the first cache area.

[0123] Specifically, refer to Figure 6The first random length data and the second random length data are written into the same cache area, that is, the first cache area and the second cache area are the same area, and the first random length data and the second random length data are alternately written into the same area.

[0124] In some optional embodiments, the method further includes: obtaining a write rate of writing the first data and / or the second data into the target area; obtaining a read rate of reading write data from the target area, the write data representing the first data and / or the second data written into the target area; determining the aging degree of the smart card according to the write rate and the read rate; drawing an aging curve according to the aging degree of different test times; configuring the aging curve corresponding to a preset number range as a standard curve; and determining the aging life of the smart card according to the standard curve.

[0125] Specifically, refer to Figure 7 When performing the aging test, the writing rate of the first data and the second data written into the target area when the aging test is performed is obtained through the on-chip operating system of the smart card itself, and the reading rate of the data read from the target area when the data is compared is obtained, and the aging degree is calculated according to the preset formula The specific aging degree C is obtained, where the integration coefficient of the write rate A is φ, and the integration coefficient of the read rate B is δ. It can be seen that the greater the write rate and the read rate, the smaller the aging degree C; on the contrary, the smaller the write rate and the read rate, the greater the aging degree C, and the closer it is to the aging life of the smart card. For example, after the test, it is obtained that the aging curve after 600,000 write times conforms to the curve function, so the aging curve after 600,000 write times can be fitted into the standard curve of the curve function. The aging times of the standard curve can be calculated through the curve function, that is, the aging life of the smart card, so that the aging life of the smart card can be tested without completing all the aging tests, the number of tests is small, and the test time is short, thereby greatly improving the aging test rate of the smart card.

[0126] For example, when testing a large number of smart cards from the same batch, a small number of smart cards are randomly selected for a complete aging test to detect the aging curve of the smart card. After the number of writes to the smart card reaches a corresponding number, the aging curve of the smart card is fitted to the standard curve, that is, the subsequent aging of the smart card is on the standard curve. Therefore, the relationship between the subsequent aging degree and the number of writes can be obtained through the curve function of the standard curve, so as to obtain the number of times after the smart card is completely aged, that is, the aging life of the smart card. It can be seen that for different smart cards, the curve function of the standard curve is different, so that the aging life of different smart cards is different, that is, the aging curve of the smart card of the same batch conforms to a standard curve after the number of times obtained in the experiment, but the specific standard curve is determined according to different smart cards. Therefore, when testing other smart cards of the same batch in the future, it is only necessary to stop the test after the number of times within the preset number range obtained by the smart card writing test, so as to fit the aging curve within the preset number range to the standard curve, so as to calculate the number of times the smart card is completely aged, that is, to obtain the aging life. For example, if the preset number range is 600,000-1,000,000, after the smart card is written 600,000 times, the test continues to 700,000 times, and the aging curve within 600,000-700,000 can be fitted into a standard curve. The number of writes for complete aging of the smart card can be calculated based on the standard curve, which greatly reduces the number of writes for subsequent smart cards in the same batch, thereby shortening the aging test time and improving the test efficiency.

[0127] In the process of testing the same batch of smart cards, a comparison group is set to detect whether the current batch of smart cards meets the aging life prediction value of the standard curve, so as to determine whether to increase the comparison group based on the fit. When the fits of multiple comparison groups are less than the preset fits, the curve function of the standard curve is adjusted based on the fits to correct the aging life prediction value.

[0128] In some optional embodiments, when multiple smart cards are tested, the multiple smart cards are assigned to devices of the same level for aging testing, or the multiple smart cards are assigned to devices of different levels for aging testing. In the embodiment of assigning multiple smart cards to devices of different levels for aging testing, the multiple smart cards can be assigned to devices of different levels for aging testing at the same time.

[0129] In some optional embodiments, multiple smart cards are assigned to devices of different levels for aging testing, including: the first-level device sends the application selection instruction and the update self-test instruction of the terminal to the first-level card, the application of the first-level card executes the write transaction of the first-level card, and the first-level card represents the smart card undergoing aging testing on the first-level device; the Nth-level card on the Nth-level device receives the aging test instruction sent by the N-1th-level card on the N-1th-level device, executes the write transaction of the Nth-level card through the application, and at the same time, the Nth-level card sends the aging test instruction to the N+1th-level card on the N+1th-level device, where N represents a positive integer greater than or equal to 2.

[0130] Specifically, refer to Figure 8 , the first-level device communicates with the terminal, the first-level card receives the application selection instruction and the update self-test instruction through the first-level device, and the first-level card itself starts the aging test, that is, starts the write transaction, and generates the corresponding return value; the first-level card is connected to multiple second-level cards at the same time, that is, the first-level device communicates with multiple second-level devices, and the corresponding aging test instruction generated by the on-chip operating system of the first-level card is sent to the second-level device through the first-level device, and the second-level device sends it to the second-level card, and the application of the second-level card starts to perform an aging test on the second-level card, that is, executes the write transaction and generates the corresponding return value. Similarly, the second-level card can also continue to send the aging test instruction to the next-level card connected to it, so that the next-level card performs the aging test, that is, the N-th level card sends the aging test instruction to the N+1-th level card on the N+1-th level device through the N-th level device, so that the N+1-th level card performs a self-aging test (the application inside the smart card performs the aging test), and the N-th level card represents the smart card that performs the aging test on the N-th level device. The aging test results of the next-level card are returned to the previous-level card, and the previous-level card determines whether to perform aging test on the next-level card; and the final test results are transmitted to the terminal level by level, and are uniformly summarized and displayed through the terminal. The aging test of smart cards is controlled by devices at different levels, so there is no need for the terminal to control them one by one, which greatly improves the test efficiency. Moreover, the terminal only needs to interact with the first-level device to test multiple levels of cards on multiple levels of devices, so as to perform aging test on multiple smart cards at the same time, which greatly improves the test efficiency and greatly reduces the test pressure on the terminal.

[0131] The implementation of the embodiment of the present invention includes the following beneficial effects: The embodiment of the present invention provides a smart card aging test method, including: obtaining an application selection instruction sent by a terminal, and selecting an application according to the application selection instruction; obtaining an update self-test instruction sent by the terminal; performing an application write transaction according to the update self-test instruction, the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value; sending the return value to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value. When the return value represents the first return value, the terminal adds one to the current number of cycles, and if the current number of cycles is less than the maximum number of cycles, sends the update self-test instruction to the smart card; when the return value represents the second return value, the terminal ends the aging test and generates a test result. Only the terminal needs to send the application selection instruction and the update self-test instruction to the smart card, so that the application of the smart card itself can perform an aging test on the smart card, and the control of the test process is completed by the smart card itself, and only the return value generated at the end needs to be sent to the terminal, so that the test freedom of the smart card is high, the interaction with the terminal is reduced, and most of the aging test content can be completed by itself, effectively improving the test efficiency.

[0132] Second, refer to Fig.10 The embodiment of the present invention provides a smart card aging test method, which is applied to a terminal, the terminal is connected to a smart card in communication, the smart card is provided with an application, the smart card includes a first data area, a target area, and a second data area, the first data area is provided with first data, the second data area is provided with second data, the first data and the second data are different, and the method includes:

[0133] S601, sending an application selection instruction to a smart card, so that the smart card selects an application according to the application selection instruction;

[0134] S602, sending an update self-check instruction to the smart card, so that the smart card performs an application write transaction according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value, wherein the return value is a value generated by the smart card application after comparing the first data and the second data after they are written into the target area in sequence;

[0135] S603, receiving the return value sent by the smart card;

[0136] S604: Determine whether to continue the aging test or end the aging test according to the returned value.

[0137] It should be noted that Fig. 9It is a schematic diagram of an application scenario of the smart card aging test method provided by an embodiment of the present invention. The application scenario is a smart card authentication and identification scenario, and the application scenario includes a terminal and a smart card. A unit for information interaction with the smart card is provided on the terminal, and the terminal and the smart card may be physically connected (provided with a card slot and a unit for reading and writing smart card information), or may be wirelessly connected, which is not specifically limited in this embodiment. Among them, the smart card is divided into a first data area, a target area and a second data area, the first data area stores the first data, and the second data area stores the second data. The information transmission direction of the smart card is that the data from the first data area is written to the target area, and after the data of the first data area is pasted in the target area, the data of the second data area is written to the target area.

[0138] In some optional embodiments, after the aging test is finished, the method further includes:

[0139] The aging times of the smart cards in the same batch are obtained, where the aging times represent the test times corresponding to the aging of the smart cards; and an aging test curve is generated according to the aging times.

[0140] Specifically, refer to Fig.11 The aging test curve visually displays the number of tests corresponding to smart cards with different numbers in the same batch of tested smart cards. Through the aging test curve generated by the terminal, it is possible to clearly see the smart cards with specific test problems. Fig.11 As shown in the figure, the total number of tests is 1 million times, the aging times of smart cards fluctuate around 1 million times, and the aging times of smart cards with problems drop sharply, which can be seen intuitively through the aging test curve. It can be known that the number of smart card aging tests corresponding to different product requirements is different, and the specific number of tests is not limited here.

[0141] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0142] Thirdly, refer to Fig.12 The embodiment of the present invention provides a smart card aging test device, which is applied to a smart card, and the device includes:

[0143] at least one processor;

[0144] at least one memory for storing at least one program;

[0145] When at least one program is executed by at least one processor, the at least one processor implements the above method.

[0146] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0147] Fourthly, refer to Fig.12 The embodiment of the present invention provides a smart card aging test device, which is applied to a terminal and includes:

[0148] at least one processor;

[0149] at least one memory for storing at least one program;

[0150] When at least one program is executed by at least one processor, the at least one processor implements the above method.

[0151] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0152] In a fifth aspect, in addition, the embodiments of the present application further disclose a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program so that the computer device executes the above method or the above system. Similarly, the contents in the above method embodiments are all applicable to the present storage medium embodiments, and the functions specifically implemented by the present storage medium embodiments are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0153] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital information processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally contain computer readable instructions, data structures, program modules, or other data in modulated data information such as carrier waves or other transport mechanisms, and may include any information delivery media.

[0154] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present invention.

Claims

1. A smart card aging test method, characterized in that: Applied to a smart card, the smart card is connected to a terminal for communication, the smart card is provided with an application, the smart card comprises a first data area, a target area, and a second data area, the first data area is provided with first data, the second data area is provided with second data, the first data and the second data are different, the method comprises: Obtaining an application selection instruction sent by the terminal, and selecting the application corresponding to the aging test according to the application selection instruction; Obtaining an update self-check instruction sent by the terminal; Performing a write transaction of the application according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively, and generating a return value, wherein the return value is a value generated by the application of the smart card after comparing the first data and the second data written into the target area in sequence; The return value is sent to the terminal, so that the terminal continues the aging test or ends the aging test according to the return value.

2. The method according to claim 1, characterized in that The terminal continues the aging test or ends the aging test according to the return value, including: When the return value represents the first return value, the terminal adds one to the current cycle number, and if the current cycle number is less than the maximum cycle number, sends the update self-test instruction to the smart card to continue the aging test; When the return value represents a second return value, the terminal ends the aging test and generates a test result.

3. The method according to claim 1, characterized in that The return value includes a first return value and a second return value, and the write transaction includes: Writing the first data into the target area; After the first data is written into the target area, the data in the target area is compared with the first data to obtain a first comparison result; When the first comparison result indicates that the first data is identical to the data in the target area, writing the second data into the target area; When the second data is written into the target area, the data of the target area is compared with the second data to obtain a second comparison result; Generate the first return value or the second return value according to the second comparison result; When the first comparison result indicates that the first data is different from the data of the target area, the second return value is generated.

4. The method according to claim 3, characterized in that Before writing the first data into the target area, the method includes: Acquire a maximum number of protection pages of the target area, where the maximum number of protection pages represents a maximum number of pages of data in the first data area or the second data area written into the target area; A single page or multiple pages of data are selected from the first target data as the first data, wherein the number of data pages of the first data is not greater than the maximum number of protected pages.

5. The method according to claim 4, characterized in that The step of writing the first data into the target area comprises: The writing of the first data is triggered according to a comparison result between the first data and third data, and the third data represents data of the target area before the first data is written.

6. The method according to claim 5, characterized in that The triggering the writing of the first data according to the comparison result between the first data and the third data includes: When a comparison result between the first data and the third data indicates that the first data and the third data are different, writing the first data into the target area to cover the third data; In a case where the comparison result between the first data and the third data indicates that the first data and the third data are identical, the first data is modified, and the modified first data is written into the target area to cover the third data.

7. The method according to claim 1, characterized in that The write transaction includes: Acquire first random length data of the first data area, where the first random length data represents the first data having a random data size; Writing the first random length data into a first cache area of ​​the target area, where the first cache area represents a cache area in the target area for storing the first and second random length data; After the first random length data is written into the first cache area, the data in the first cache area is compared with the first random length data to obtain a first comparison result; When the first comparison result indicates that the first random length data is the same as the data in the first cache area, obtaining second random length data in the second data area, wherein the second random length data indicates the second data having a random data size; Writing the second random length data into a first cache area of ​​the target area; When the second random length data is written into the first cache area, the data in the first cache area is compared with the second random length data to obtain a second comparison result; Generate a first return value or a second return value according to the second comparison result; When the first comparison result indicates that the first random length data is different from the data in the first cache area, the second return value is generated.

8. The method according to claim 1, characterized in that The write transaction includes: Acquire first random length data of the first data area, where the first random length data represents the first data having a random data size; Writing the first random length data into a first cache area of ​​the target area, where the first cache area represents a cache area in the target area for storing the first random length data; After the first random length data is written into the first cache area, the data in the first cache area is compared with the first random length data to obtain a first comparison result; When the first comparison result indicates that the first random length data is the same as the data in the first cache area, obtaining second random length data in the second data area, wherein the second random length data indicates the second data having a random data size; Writing the second random length data into a second cache area of ​​the target area, where the second cache area represents a cache area in the target area for storing the second random length data; When the second random length data is written into the second cache area, the data in the second cache area is compared with the second random length data to obtain a second comparison result; Generate a first return value or a second return value according to the second comparison result; When the first comparison result indicates that the first random length data is different from the data in the first cache area, the second return value is generated.

9. The method according to claim 1, characterized in that: The method further comprises: Acquire a writing rate of the first data and / or the second data into the target area; Acquire a read rate of writing data from the target area, the writing data representing the first data and / or the second data written into the target area; determining an aging degree of the smart card according to the write rate and the read rate; Draw an aging curve according to the aging degree of different test times; Configuring the aging curve corresponding to the preset number range as a standard curve; The aging life of the smart card is determined according to the standard curve.

10. The method according to claim 1, characterized in that When testing a plurality of the smart cards, the plurality of smart cards are assigned to devices of the same level for aging testing, or the plurality of smart cards are assigned to devices of different levels for aging testing.

11. The method according to claim 10, characterized in that The allocating the plurality of smart cards to devices of different levels for aging testing includes: allocating the plurality of smart cards to devices of different levels for aging testing at the same time.

12. The method according to claim 10, characterized in that The step of allocating the plurality of smart cards to devices of different levels for aging testing comprises: The first-level device sends the application selection instruction and the update self-test instruction of the terminal to the first-level card, the application of the first-level card executes the write transaction of the first-level card, and the first-level card represents the smart card undergoing the aging test on the first-level device; The Nth level card on the Nth level device receives the aging test instruction sent by the N-1th level card on the N-1th level device, executes the write transaction of the Nth level card through the application, and at the same time, the Nth level card sends the aging test instruction to the N+1th level card on the N+1th level device, where N represents a positive integer greater than or equal to 2.

13. The method according to claim 3, characterized in that The generating a first return value or a second return value according to the second comparison result includes: If the second comparison result indicates that the second data is different from the data of the target area, generating a second return value; When the second comparison result indicates that the second data is identical to the data of the target area, a first return value is generated.

14. The method according to claim 13, characterized in that When the second comparison result indicates that the second data is identical to the data in the target area, generating a first return value specifically includes: When the second comparison result indicates that the second data is identical to the data in the target area, obtaining a current number of writes, and adding one to the current number of writes; When the current number of write times is greater than or equal to half of the maximum number of write times, ending the write transaction and generating a first return value; When the current write count is less than half of the maximum write count, the write transaction is continued.

15. The method according to claim 3, characterized in that The write transaction includes: Acquire a maximum number of protection pages of the target area, where the maximum number of protection pages represents a maximum number of pages of data in the first data area or the second data area written into the target area; When the number of target pages written to the target area in the first data area is less than the maximum number of protection pages, writing the first data of the first data area into the target page corresponding to the target area; After the first data is written into the target area, the data of the target page is compared with the first data to obtain a first comparison result; When the first comparison result indicates that the first data is identical to the data of the target page, the second data in the second data region is written into the target page corresponding to the target area.

16. A smart card aging test method, characterized in that: The method is applied to a terminal, the terminal is connected to a smart card, the smart card is provided with an application, the smart card includes a first data area, a target area, and a second data area, the first data area is provided with first data, the second data area is provided with second data, the first data and the second data are different, and the method includes: Sending an application selection instruction to the smart card, so that the smart card selects the application corresponding to the aging test according to the application selection instruction; Sending an update self-check instruction to the smart card, so that the smart card performs a write transaction of the application according to the update self-check instruction, wherein the write transaction represents writing the first data and the second data into the target area respectively and generating a return value, wherein the return value is a value generated by the application of the smart card after comparing the first data and the second data after being written into the target area in sequence; Receiving the return value sent by the smart card; The aging test is continued or terminated according to the return value.

17. The method according to claim 16, characterized in that After the aging test is finished, the method further includes: Obtaining the aging times of the smart cards in the same batch, where the aging times represent the number of tests corresponding to the aging of the smart cards; An aging test curve is generated according to the aging times.

18. A smart card aging test device, applied to a smart card, comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 15.

19. A smart card aging test device, applied to a terminal, comprising: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 16 to 17.

20. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to execute the method according to any one of claims 1 to 15 or to execute the method according to any one of claims 16 to 17 when executed by the processor.

Citation Information

Cited By

  • Aging test method for solid state disk

    CN120823874A