A smart card testing method, apparatus, device, storage medium, and product.

By introducing a performance calibration model and an instruction suggestion generation model into smart card testing, the influence of environmental factors is eliminated, test cases are optimized, the problem of unstable smart card test results is solved, and more accurate performance evaluation is achieved.

CN122309351APending Publication Date: 2026-06-30CHINA MOBILE M2M +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE M2M
Filing Date
2026-03-06
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

The performance test results of existing smart card testing methods are greatly affected by the test environment, and the test results are difficult to reproduce and have low accuracy.

Method used

Performance testing is conducted by acquiring the first test case. A pre-trained performance calibration model is used to eliminate the influence of environmental factors. Combined with the preset scenario test cases and instruction suggestion generation model, improvement suggestion information is generated to optimize the test cases.

Benefits of technology

This improves the accuracy of smart card performance test results and ensures the consistency and reliability of test results under different testing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309351A_ABST
    Figure CN122309351A_ABST
Patent Text Reader

Abstract

This application discloses a smart card testing method, apparatus, device, storage medium, and product, belonging to the field of the Internet of Things, to improve the accuracy of smart card performance test results. The method includes: acquiring a first test case and performing performance testing on the smart card to be tested based on the first test case to obtain a first performance index; acquiring test environment data of the smart card to be tested and inputting the first performance index and test environment data into a pre-trained performance calibration model to obtain a second performance index, wherein the second performance index is a performance index after environmental factor correction of the first performance index; performing scenario testing on the smart card to be tested based on preset scenario test cases to obtain a first instruction performance; inputting the first instruction performance into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and generating a test report based on the instruction improvement suggestion information and the second performance index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of Internet of Things (IoT), specifically relating to a smart card testing method, apparatus, device, storage medium, and product. Background Technology

[0002] With the advancement of technology, people's lives are becoming increasingly digitalized. While digital life brings many conveniences, it also brings numerous security risks, such as telecommunications fraud and identity theft. Smart card technology is one of the important technologies for mitigating these security risks. A smart card is an intelligent device equipped with a secure chip that can store and process sensitive information, providing highly secure data transmission and processing capabilities. It is currently widely used in scenarios such as electronic payment, identity authentication, and access control. In addition to stability and security, smart cards need to run multiple logically complex applications, which places extremely high demands on their performance. Therefore, testing the performance of smart cards has become a crucial part of the smart card industry. However, the performance test results of existing smart card testing methods are greatly affected by the testing environment, making the test results difficult to reproduce and resulting in low accuracy.

[0003] Therefore, a smart card testing method is needed to improve the accuracy of performance test results. Summary of the Invention

[0004] This application provides a smart card testing method that can improve the accuracy of performance test results.

[0005] In a first aspect, embodiments of this application provide a smart card testing method, the method comprising: acquiring a first test case, and performing performance testing on a smart card to be tested based on the first test case to obtain a first performance index, wherein the first test case is a test case for testing the smart card to be tested; acquiring test environment data of the smart card to be tested, and inputting the first performance index and the test environment data into a pre-trained performance calibration model to obtain a second performance index, wherein the second performance index is a performance index after environmental factor correction of the first performance index; performing scenario testing on the smart card to be tested based on preset scenario test cases to obtain a first instruction performance, wherein the scenario test cases are test cases for performing complete scenario testing on the smart card to be tested; inputting the first instruction performance into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and generating a test report based on the instruction improvement suggestion information and the second performance index, wherein the instruction improvement suggestion information is used to improve and optimize the first test case.

[0006] Secondly, embodiments of this application provide a smart card testing device, comprising: a first testing module, configured to acquire a first test case and perform performance testing on a smart card to be tested based on the first test case to obtain a first performance index, wherein the first test case is a test case for testing the smart card to be tested; a first calibration module, configured to acquire test environment data of the smart card to be tested and input the first performance index and the test environment data into a pre-trained performance calibration model to obtain a second performance index, wherein the second performance index is a performance index after environmental factor correction of the first performance index; a second testing module, configured to perform scenario testing on the smart card to be tested based on preset scenario test cases to obtain a first instruction performance, wherein the scenario test cases are test cases for performing complete scenario testing on the smart card to be tested; and a first generation module, configured to input the first instruction performance into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and generate a test report based on the instruction improvement suggestion information and the second performance index, wherein the instruction improvement suggestion information is used to improve and optimize the first test case.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a computer program product that, when executed by a processor, implements the steps of the method described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0011] In this embodiment, a first test case is first obtained, and a performance test is performed on the smart card under test based on the first test case to obtain a first performance index. The first test case is the test case used to test the smart card under test. Then, the test environment data of the smart card under test is obtained, and the first performance index and the test environment data are input into a pre-trained performance calibration model to obtain a second performance index. The second performance index is the performance index after environmental factor correction of the first performance index. Next, a scenario test is performed on the smart card under test based on a preset scenario test case to obtain a first instruction performance. The scenario test case is the test case used to perform a complete scenario test on the smart card under test. Finally, the first instruction performance is input into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information. A test report is generated based on the instruction improvement suggestion information and the second performance index. The instruction improvement suggestion information is used to improve and optimize the first test case, which can improve the accuracy of the smart card performance test results. Attached Figure Description

[0012] Figure 1 This is a flowchart illustrating a smart card testing method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the second smart card testing method provided in this application embodiment; Figure 3 This is a flowchart illustrating the third smart card testing method provided in this application embodiment; Figure 4 This is a schematic diagram of the structure of a smart card testing system provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a smart card testing device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a smart card testing device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0015] The smart card testing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0016] Figure 1 This illustration shows a smart card testing method provided by an embodiment of the present invention. The method can be executed by an electronic device, which may include a server and / or a terminal device, wherein the terminal device may be, for example, an in-vehicle terminal or a mobile phone terminal. In other words, the method can be executed by software or hardware installed in a smart card testing device, and the method includes the following steps: Step 102: Obtain the first test case and perform performance testing on the smart card to be tested based on the first test case to obtain the first performance index.

[0017] The first test case is a test case used to test the smart card to be tested.

[0018] The execution entity of the smart card testing method described in this application can be a smart card testing system, smart card testing software, or other execution entities. This application embodiment will use a smart card testing system (hereinafter referred to as the testing system) as an example for illustration.

[0019] The testing system acquires the first test case, which is the test case for the smart card to be tested. The smart card to be tested is the smart card that needs to undergo performance testing. The first test case can be a test case entered by the operator, or a test case pre-stored in the testing system and selected by the operator. The operator is the person performing the performance test on the smart card. In other words, the test case for performing the performance test on the smart card can be a test case entered by the operator in real time according to the test requirements, or a test case selected from multiple pre-stored test cases according to the test requirements.

[0020] Furthermore, the testing system can include a cloud module and a client module. The testing system stores pre-selected test cases in the cloud module. Once the operator determines the first test case to be tested for performance, the testing system retrieves and selects the first test case from the pre-selected test cases stored in the cloud module. This allows the client module to perform performance testing on the smart card under test based on the first test case. In other words, the testing system pre-selects and stores a set of test cases in the cloud module. This set of test cases includes existing performance indicator test cases. The file service in this step can be implemented using the mature Spring Boot framework, providing APIs for file upload, modification, and deletion. The database can be a relational database, such as MySQL.

[0021] After obtaining the first test case, the testing system performs performance testing on the smart card to be tested based on the first test case and determines the test result as the first performance indicator. The first performance indicator is the performance indicator data of the smart card to be tested obtained after testing the smart card to be tested based on the first test case. That is, the smart card performance indicator data refers to the test data of multiple smart card performance indicators that have been tested and used as standards.

[0022] Specifically, during performance testing, the results of a single test are prone to significant fluctuations due to external influences. Therefore, the testing system repeatedly executes the same test case and calculates the average result from these repetitions. The primary performance metric is then determined based on this average. For example, after a tester launches the client, the client automatically synchronizes test cases to the cloud. The tester then selects the test cases and initiates their execution. After completing the pre-configuration, the performance metric test case simultaneously starts executing the performance metric task, typically repeating it 3000 times. Simultaneously, the instrumentation is invoked to monitor data, and the average value of the performance metric is ultimately calculated.

[0023] Furthermore, during performance testing, the test system typically uses a PC to record the time at two points: before the command is issued and after the command is received, and calculates the difference t. 耗时 =t 返回 -t 发出 To determine performance test results. For example, the test system connects to instruments to accurately record the processing time of smart card commands, recording the end time of command transmission and the start time of command return; the difference, i.e., the duty cycle in logic analysis, is used as the smart card's performance index t. 耗时 =t 占空比 .

[0024] Step 104: Obtain the test environment data of the smart card to be tested, and input the first performance index and the test environment data into the pre-trained performance calibration model to obtain the second performance index.

[0025] The second performance index is the performance index after environmental factor correction of the first performance index.

[0026] After determining the primary performance metric, the testing system acquires the test environment data for the smart card under test. This test environment data refers to the environment in which the smart card is placed during performance testing. Furthermore, the test environment data includes the hardware information of the PC on which the smart card is located, such as CPU information, benchmark scores, memory frequency, and memory I / O.

[0027] After determining the test environment data, the test system inputs the first performance index and the test environment data into the pre-trained performance calibration model to obtain the second performance index. The pre-trained performance calibration model is used to eliminate the influence of test environment factors on the determined performance index data, and the second performance index is the performance index data after eliminating the influence of test environment factors on the first performance index data. In other words, the second performance index is the performance index after correcting the first performance index for environmental factors.

[0028] Specifically, when performing performance testing on smart cards, the results are significantly affected by the testing environment, such as the PC hardware / software and the card reader hardware / driver. Not only are the test results difficult to reproduce, but the performance results also differ depending on the testing environment. In other words, performing the same performance test on the same smart card under test will produce different results due to environmental factors. Therefore, after performing performance testing on the smart card and obtaining the performance index data, the testing system needs to eliminate the influence of environmental factors on the performance index data.

[0029] More specifically, after the test task is completed, the test system inputs the primary performance index and test environment data into the pre-trained performance calibration model. This allows the performance calibration model to be calibrated in conjunction with the test environment data, eliminating errors caused by the test environment. The calibrated results are then uniformly converted into a score evaluation. For example, the time taken to complete function xx 3000 times is converted into a score. This ensures that the same test object can eliminate the influence of environmental factors on the performance test results in different test environments, so that the same performance card can obtain the same or nearly the same score in different test environments.

[0030] When eliminating the influence of environmental factors on performance index data, the testing system inputs a first performance index into a pre-trained performance calibration model. This model calibrates the first performance index and outputs a calibrated second performance index. In other words, the performance calibration model can eliminate the impact of environmental factors on defined performance index data, ensuring that the same smart card under test can achieve the same performance index data even when tested in different environments. For example, the testing system first obtains the performance index data generated by the performance index test cases, then obtains local test environment information, calls the cloud-based performance calibration model API to obtain calibration coefficients, and finally calculates the calibrated performance index.

[0031] Step 106: Perform scenario testing on the smart card under test based on preset scenario test cases to obtain the first instruction performance.

[0032] The scenario test cases are test cases for performing a complete scenario test on the smart card under test.

[0033] After determining the performance metrics (secondary performance metrics) of the smart card under test, the testing system performs scenario testing on the smart card based on preset scenario test cases, and determines the scenario test results as the primary instruction performance. In other words, the testing system not only performs performance testing on the smart card under test, but also scenario testing.

[0034] When performing scenario testing on the smart card under test, the testing system first obtains preset scenario test cases, which can also be pre-stored in the cloud module. Specifically, the tester selects the scenario test cases and starts execution. When the test cases start, the instrument will be invoked to start data monitoring. After the test is completed, the client reads and standardizes the instrument monitoring logs to generate instruction-level performance data, i.e., the first instruction performance, in the form of {“80E400000D4F0bA00000015143456C663030”: “0.02”, “80E602000C071011121314151600000000”: “0.1”}.

[0035] Step 108: Input the performance of the first instruction into the pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and generate a test report based on the instruction improvement suggestion information and the second performance index.

[0036] The instruction improvement suggestion information is used to improve and optimize the first test case.

[0037] After determining the performance of the first instruction, the testing system inputs the determined performance of the first instruction into a pre-trained instruction suggestion generation model, so that the suggestion generation model generates instruction improvement suggestion information based on the performance of the first instruction. The instruction suggestion generation model is used to perform data analysis on the performance of the first instruction and generate instruction improvement suggestions for the first test case based on the data analysis results. The instruction improvement suggestion information is used to improve and optimize the first test case. It is related information of instruction improvement suggestions. The instruction improvement suggestions are used to advise operators to modify and optimize the first test case based on the generated improvement strategy.

[0038] In other words, the pre-trained instruction suggestion generation model can analyze the performance of the first instruction to identify problems revealed during scenario testing of the smart card under test. Based on these problems, it generates improvement suggestions for the first test case, allowing operators to improve the test case accordingly. Specifically, when generating instruction improvement suggestions, the testing system can simultaneously input the performance of the first instruction and the first test case into the pre-trained instruction suggestion generation model. This allows the model to identify the weakest instruction in the scenario test based on the performance of the first instruction, and then generate improvement suggestions based on the weakest instruction and the first test case. This enables operators to improve the first test case in subsequent performance tests (such as adding the weakest instruction identified in the scenario test to the first test case).

[0039] After determining the instruction improvement suggestions, the testing system integrates and organizes these suggestions with the secondary performance indicators, and then compiles the results into a test report. Once the test report is finalized, the system displays it to the operators, allowing them to understand not only the smart card's performance but also the weakest instructions identified during the performance test.

[0040] The smart card testing method provided in this invention first obtains a first test case and performs performance testing on the smart card under test based on the first test case to obtain a first performance index. The first test case is the test case used to test the smart card under test. Then, it obtains the test environment data of the smart card under test and inputs the first performance index and the test environment data into a pre-trained performance calibration model to obtain a second performance index. The second performance index is the performance index after environmental factor correction of the first performance index. Next, it performs scenario testing on the smart card under test based on preset scenario test cases to obtain a first instruction performance. The scenario test cases are the test cases used to perform complete scenario testing on the smart card under test. Finally, it inputs the first instruction performance into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information. A test report is generated based on the instruction improvement suggestion information and the second performance index. The instruction improvement suggestion information is used to improve and optimize the first test case, which can improve the accuracy of smart card performance test results.

[0041] In one implementation, the step of inputting the first performance metric and the test environment data into a pre-trained performance calibration model to obtain a second performance metric (step 104) can be performed via steps A1-A2: Step A1: Input the test environment data into the pre-trained performance calibration model to obtain the environmental impact factor.

[0042] The environmental impact factor is used to characterize the degree of influence of the test environment on the performance of the smart card under test.

[0043] When inputting the first performance index and test environment data into the pre-trained performance calibration model to obtain the second performance index, the test system first inputs the test environment data into the pre-trained performance calibration model so that the performance calibration model processes the test environment data and obtains the environmental impact factor. The environmental impact factor is used to characterize the degree of influence of the test environment on the performance of the smart card under test.

[0044] Specifically, the performance calibration model can determine the environmental impact factor based on the test environment data by using a preset formula for determining the environmental impact factor, or it can determine the environmental impact factor by using a preset correspondence table between the test environment and the environmental impact factor. For example, the correspondence table stores the environmental impact factors corresponding to various test environments in advance.

[0045] Step A2: Input the environmental impact factor and the first performance index into the pre-trained performance calibration model to obtain the second performance index.

[0046] After determining the environmental impact factors, the testing system inputs the environmental impact factors and the first performance index into the pre-trained performance calibration model, so that the performance calibration model can perform data correction on the first performance index based on the environmental impact factors, and obtain and output the second performance index.

[0047] Specifically, the performance calibration model can determine a second performance index based on a preset performance index determination formula, using an environmental impact factor and a first performance index. For example, the value of the first performance index can be divided by the value of the environmental impact factor, and the result can be used as the second performance index. Further, when determining the second performance index, the client calls the cloud calibration API, passing in the measured score, CPU information, and memory I / O. The cloud model calculates the calibration count and outputs the final score. The final score (second performance index) = measured score (first performance index) ÷ calibration count (environmental impact factor).

[0048] In one implementation, before inputting the first performance metric and the test environment data into the pre-trained performance calibration model to obtain the second performance metric (step 104), steps B1-B3 may also be performed: Step B1: Obtain the performance calibration model to be trained, multiple sample test cases, multiple sample performance metrics, and multiple sample environment data.

[0049] The performance calibration model to be trained is based on a multilayer perceptron (MLP) regression model. The sample test cases are the performance test cases that have been completed by the smart card. The sample performance indicators are the performance indicators corresponding to the sample test cases. The sample environment data is the smart card environment data when the performance test is performed using the sample test cases.

[0050] Before calibrating the first performance metric using a pre-trained performance calibration model, the testing system needs to train the model to obtain a pre-trained performance calibration module. During model training, the testing system first needs to collect multiple sample test cases with different configurations, sample environment data, and sample performance metrics corresponding to each sample test user and sample environment. The acquired data is then imported into the module. Finally, the obtained data undergoes routine cleaning and preprocessing operations to form a standardized dataset, which is then divided into training and test sets.

[0051] The test system acquires sample test cases from completed smart card performance test cases, sample environment data from the environment in which the smart card operates during performance testing based on these test cases, and sample performance metrics from the performance metrics obtained under the corresponding test environment and based on the sample test cases. The performance calibration model to be trained is based on a multilayer perceptron (MLP) regression model. Furthermore, the test system uses complete data from completed performance tests for model training, including the testing environment, the test cases, and the test results. In other words, there is a one-to-one correspondence between the sample test cases, sample environment data, and sample performance metrics acquired by the test system; each sample test case has corresponding sample environment data and sample performance metrics.

[0052] Step B2: Determine the sample performance index and the sample environment data corresponding to the same sample test case as the training performance index and training environment data, respectively.

[0053] Since the acquired sample test cases, sample performance metrics, and sample environment data are all multiple data sets, the testing system needs to determine the correspondence between the sample test cases, sample performance metrics, and sample environment data before model training, and determine the sample performance metrics and sample environment data that correspond to the sample test cases as training performance metrics and training environment data, respectively.

[0054] Specifically, during model training, the testing system needs to train the model based on the performance test results of the same sample test case in different environments in order to determine the degree of influence of the same sample test case in different environments. Therefore, the testing system determines the sample performance index and sample environment data corresponding to the same sample test case as the training performance index and training environment data, respectively, so as to train the model based on the sample test case, training performance index and training environment data.

[0055] Step B3: Iteratively train the performance calibration model to be trained based on the training performance metrics and the training environment data to obtain the pre-trained performance calibration model.

[0056] During model training, the testing system iteratively trains the performance calibration model to be trained based on sample test cases, training performance metrics corresponding to the sample test cases, and training environment data corresponding to the sample test cases, thereby obtaining a pre-trained performance calibration model. During training, the testing system uses the scikit-learn tool to fit a regression model to the training dataset.

[0057] Specifically, the performance calibration model's role is to predict the impact of the test environment on performance metrics based on the CPU benchmark score and memory I / O score of the input test environment, thereby obtaining calibration coefficients to calibrate the performance metric results. During model training, the test system first collects data, gathering a large number of CPU benchmark scores from different test environments (achieved by querying a public benchmark database based on the CPU model) and memory I / O scores (obtained via the winsatmem command under Windows). Based on these test environments, it tests the performance metrics of a smart card. Since the obtained performance metrics are usually time-consuming, we convert them into standardized scores, referencing industry benchmark implementations, and use all performance metrics of a smart card product as the standard, with 100 points as the baseline, i.e., P=T. s / T i , among which, T s As the baseline time, T i P represents the test time and P represents the training performance metric after standardized scoring.

[0058] The testing system used a Multilayer Perceptron (MLP) regression model to predict the performance metric impact coefficient. An MLP is a feedforward neural network consisting of an input layer, one or more hidden layers, and an output layer. Neurons in each layer are connected to neurons in the next layer via weights. The model comprises an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer contains two neurons (x = [x1, x2], representing CPU_benchmark and Memory_IO respectively); the first hidden layer contains 100 neurons; the second hidden layer contains 50 neurons; and the output layer contains one neuron (representing the predicted performance metric impact coefficient).

[0059] The function of a multilayer perceptron regression model can be decomposed into a series of matrix multiplications and activation functions. The mapping from the input layer to the first hidden layer can be: h1 = ReLU(W1) x+b1), the mapping from the first hidden layer to the second hidden layer can be: h2=ReLU(W2) (h1+b2), the mapping from the second hidden layer to the output layer can be: y=W3 h2+b3, where W1 is the weight matrix of the first hidden layer with a dimension of 100. 2. b1 is the bias vector of the first hidden layer, with a dimension of 100. 1. W2 is the weight matrix of the second layer, with a dimension of 50. 100, b2 is the bias vector of the second hidden layer, with a dimension of 50. 1. W3 is the weight matrix of the output layer, with a dimension of 1. 50, b3 is the bias vector of the output layer, with a dimension of 1. 1.

[0060] Therefore, the final model function can be determined as: y = W3 ReLU (W2) ReLU (W1) x + b1) + b2) + b3. During model validation, the test system validated the model using RMSE (Root Mean Square Error). The statistical RMSE was 0.39, where RMSE = √(1 / n). √((∑y i -y i ) 2 ).

[0061] After the model training is completed, the testing system uses the test dataset to evaluate the pre-trained performance calibration model, and determines whether the performance calibration model has been successfully trained or selects the optimal model and identifies it as the pre-trained performance calibration model based on the evaluation results.

[0062] More specifically, to address the issue of varying impacts of different testing environments on performance test results, the testing system tests a specific metric of the same smart card (using the same sample test cases) on client PCs with different configurations, records the data, cleans and standardizes the obtained data, and then splits it into training and validation sets. Next, a performance calibration model is built and trained using the training set, employing gradient descent to optimize the loss function. The model is then evaluated using the validation set, and optimized based on the evaluation results until the model is accurately usable. Finally, the model is deployed, and an API is made available for client modules to use.

[0063] Figure 2 This is a flowchart illustrating the second smart card testing method provided in this application embodiment, as shown below. Figure 2 As shown, the schematic diagram includes: Step 202: Obtain the first test case and perform performance testing on the smart card to be tested based on the first test case to obtain the first performance index.

[0064] The first test case is a test case used to test the smart card to be tested.

[0065] Step 204: Obtain the performance calibration model to be trained, multiple sample test cases, multiple sample performance metrics, and multiple sample environment data.

[0066] The performance calibration model to be trained is based on an MLP regression model, the sample test cases are the completed performance test cases of the smart card, the sample performance indicators are the performance indicators corresponding to the sample test cases, and the sample environment data is the smart card environment data during the performance test of the sample test cases.

[0067] Step 206: Determine the sample performance index and the sample environment data corresponding to the same sample test case as the training performance index and training environment data, respectively.

[0068] Step 208: Iteratively train the performance calibration model to be trained based on the training performance metrics and the training environment data to obtain a pre-trained performance calibration model.

[0069] Step 210: Input the test environment data into the pre-trained performance calibration model to obtain the environmental impact factor.

[0070] The environmental impact factor is used to characterize the degree of influence of the test environment on the performance of the smart card under test.

[0071] Step 212: Input the environmental impact factor and the first performance index into the pre-trained performance calibration model to obtain the second performance index.

[0072] The second performance index is the performance index after environmental factor correction of the first performance index.

[0073] Step 214: Perform scenario testing on the smart card under test based on preset scenario test cases to obtain the first instruction performance.

[0074] The scenario test cases are test cases for performing a complete scenario test on the smart card under test.

[0075] Step 216: Input the performance of the first instruction into the pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and generate a test report based on the instruction improvement suggestion information and the second performance index.

[0076] The instruction improvement suggestion information is used to improve and optimize the first test case.

[0077] In the embodiments described in the specification, machine learning technology is introduced into the performance test to train a performance calibration model and calibrate the errors caused by different test environments. This ensures that the smart card performance indicators are the same or very close in any test environment, so that the performance evaluation no longer has extremely strict requirements for test environment preparation and improves the accuracy of smart card performance test results.

[0078] In one implementation, the step of inputting the performance of the first instruction into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information (step 108) can be performed via steps C1-C3: Step C1: Input the performance of the first instruction into the pre-trained instruction suggestion generation model to obtain the first operation type information.

[0079] Wherein, the first operation type information is the operation type information of the first instruction, the first instruction is the operation instruction corresponding to the performance of the first instruction, and the pre-trained instruction suggestion generation model includes a large language model.

[0080] When generating instruction improvement suggestions through a pre-trained instruction suggestion generation model, the test system first inputs the first instruction performance into the pre-trained instruction suggestion generation model so that the module can determine the first operation type information based on the first instruction performance. Here, the first operation type information is the operation type information of the first instruction, and the first instruction is the operation instruction corresponding to the first instruction performance. That is, the instruction performance data obtained by executing the first instruction is the first instruction performance. The pre-trained instruction suggestion generation model can be a large language model.

[0081] Specifically, the pre-trained instruction suggestion generation model obtains the performance of the first input instruction, and then the instruction suggestion generation model (i.e., the large language model) parses the instruction operation type of the smart card and determines the first operation type information based on the parsed type.

[0082] Step C2: Determine the performance of multiple second instructions corresponding to the first operation type information based on a preset instruction performance database.

[0083] The instruction performance database pre-stores the instruction performance corresponding to various operation instructions of different operation types.

[0084] After determining the first operation type information, the testing system determines the second instruction performance corresponding to the first operation type information based on a preset instruction performance database. This database pre-stores the instruction performance corresponding to various operation types, and the second instruction performance is the instruction performance data corresponding to the same operation type as the first instruction performance. In other words, the testing system identifies the instruction performance data from the pre-stored instruction performance data that has the same operation type as the first instruction performance and designates it as the second instruction performance.

[0085] Step C3: Input the first instruction performance and multiple second instruction performances into the pre-trained instruction suggestion generation model, so that the pre-trained instruction suggestion generation model compares the first instruction performance with each of the second instruction performances and generates the instruction improvement suggestions based on the comparison results.

[0086] After determining the performance of multiple second instructions, the test system inputs the performance of the first instruction and the performance of multiple second instructions into a pre-trained instruction suggestion generation model (i.e., a large language model). This allows the instruction suggestion generation model (i.e., a large language model) to compare the performance of the first instruction with the performance of each second instruction. Then, it summarizes the smart card scenarios that may be affected by the performance-deficient instructions and finally generates natural language (i.e., instruction improvement suggestions) based on the determined performance-deficient instructions.

[0087] Specifically, when generating instruction improvement suggestions through the instruction suggestion generation model, the test system first determines the instruction-level performance data to be analyzed, then calls the LLM (Large Language Model) to parse the smart card instruction operation type, then calls the database to query and compare the performance data of similar operations, then calls the LLM to summarize the smart card scenarios that may be affected by performance-short instructions, and finally calls the LLM to generate natural language improvement suggestions.

[0088] In one implementation, before inputting the first instruction performance into the pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information (step 108), steps D1-D4 may also be performed: Step D1: Obtain multiple preset sample instruction performances and the sample instructions corresponding to each of the sample instruction performances.

[0089] Wherein, the sample instruction performance refers to the test cases for conducting a complete scenario test on the smart card under test based on preset sample scenario test cases, and the sample instruction is the instruction corresponding to the sample instruction performance.

[0090] Before generating instruction improvement suggestions through the pre-trained instruction suggestion generation model, the testing system needs to build a pre-trained instruction suggestion generation model. When building this model, the testing system first needs to obtain multiple preset sample instruction performances and the sample instructions corresponding to each sample instruction performance. The sample instruction performance is a complete scenario test case that has been executed by the smart card under test based on the preset sample scenario test cases. The sample instruction is the instruction corresponding to the sample instruction performance. That is, the performance data obtained after executing the sample instruction is the sample instruction performance.

[0091] Step D2: Determine multiple sample scenarios and the sample instructions corresponding to each sample scenario based on the performance of the sample instructions.

[0092] After determining the performance of multiple sample instructions and the corresponding sample instructions for each performance, the testing system determines multiple sample scenarios and the corresponding sample instructions for each sample scenario based on the performance of the sample instructions. In other words, the testing system classifies the performance (or sample instructions) of each sample instruction according to the test scenario, thereby determining multiple smart card scenarios and the performance (or sample instructions) of the sample instructions corresponding to each smart card scenario.

[0093] Step D3: Determine the instruction correspondence database based on the correspondence between the sample scenario and the sample instruction.

[0094] After identifying multiple sample scenarios and their corresponding sample instructions, the testing system constructs an instruction mapping database based on the correspondence between the sample scenarios and the sample instructions for data storage. Specifically, the testing system can complete this by accessing the instrument monitoring card and running the existing test case set; then, it needs to collect smart card scenario-instruction mapping relationship data and structured APDU instruction parsing data to form a vectorized knowledge base.

[0095] Specifically, the testing system pre-loads trusted instruction set performance data for multiple card types into a performance database for subsequent performance comparison and supports future updates to the performance database. A local LLM or cloud-based LLM is built to organize the mapping relationship between APDU instructions and smart card application scenarios, import it into the RAG knowledge base, and perform pre-testing. For example: {“Application Installation”:[“80E60200XX”, “80E8XX00XX”, “80E60C00XX”],”UICC Configuration”:[“00E0000XX”,“80D8020XX”, “0DC07043XX”]}.

[0096] Step D4: Input the instruction correspondence database into the pre-trained large language model, so that the large language model can learn knowledge based on the instruction correspondence database and obtain the pre-trained instruction suggestion generation model.

[0097] After determining the instruction mapping database, the testing system inputs the instruction mapping database into the pre-trained large language model, so that the large language model can learn based on the knowledge included in the database, and then determine the learned large language model as the instruction suggestion generation model.

[0098] Specifically, the workflow of the test system's intelligent agent (i.e., instruction suggestion generation model) is as follows: input the instruction-level performance data to be analyzed; call the LLM to parse the smart card instruction operation type; call the database to query and compare the performance data of similar operations; call the LLM to summarize the smart card scenarios that performance-impacted instructions may affect; call the LLM to generate natural language improvement suggestions, which can be achieved through tools such as Coze and LangChain. In other words, the pre-trained large language model can compare the instruction-level performance data with the performance data of other cards in the performance database, generate comparison results, and filter out performance-impacted instructions. Then, based on the filtered performance-impacted instructions, it examines the actual application scenarios that the performance-impacted instructions may involve and outputs natural language improvement suggestions.

[0099] Figure 3 This is a flowchart illustrating the third smart card testing method provided in this application embodiment, as shown below. Figure 3 As shown, the schematic diagram includes: Step 302: Obtain the first test case and perform performance testing on the smart card to be tested based on the first test case to obtain the first performance index.

[0100] The first test case is a test case used to test the smart card to be tested.

[0101] Step 304: Obtain the test environment data of the smart card to be tested, and input the first performance index and the test environment data into the pre-trained performance calibration model to obtain the second performance index.

[0102] The second performance index is the performance index after environmental factor correction of the first performance index.

[0103] Step 306: Perform scenario testing on the smart card under test based on preset scenario test cases to obtain the first instruction performance.

[0104] The scenario test cases are test cases for performing a complete scenario test on the smart card under test.

[0105] Step 308: Obtain multiple preset sample instruction performances and the sample instructions corresponding to each of the sample instruction performances.

[0106] Wherein, the sample instruction performance refers to the test cases for conducting a complete scenario test on the smart card under test based on preset sample scenario test cases, and the sample instruction is the instruction corresponding to the sample instruction performance.

[0107] Step 310: Determine multiple sample scenarios and the sample instructions corresponding to each sample scenario based on the performance of the sample instructions.

[0108] Step 312: Determine the instruction correspondence database based on the correspondence between the sample scenario and the sample instruction.

[0109] Step 314: Input the instruction correspondence database into the pre-trained large language model, so that the large language model can learn knowledge based on the instruction correspondence database and obtain the pre-trained instruction suggestion generation model.

[0110] Step 316: Input the performance of the first instruction into the pre-trained instruction suggestion generation model to obtain the first operation type information.

[0111] Wherein, the first operation type information is the operation type information of the first instruction, the first instruction is the operation instruction corresponding to the performance of the first instruction, and the pre-trained instruction suggestion generation model includes a large language model.

[0112] Step 318: Determine the performance of multiple second instructions corresponding to the first operation type information based on the preset instruction performance database.

[0113] The instruction performance database pre-stores the instruction performance corresponding to various operation instructions of different operation types.

[0114] Step 320: Input the first instruction performance and multiple second instruction performances into the pre-trained instruction suggestion generation model, so that the pre-trained instruction suggestion generation model compares the first instruction performance with each of the second instruction performances and generates the instruction improvement suggestions based on the comparison results.

[0115] Step 322: Generate a test report based on the instruction improvement suggestion information and the second performance indicator, wherein the instruction improvement suggestion information is used to improve and optimize the first test case.

[0116] In the embodiments described in the specification, by incorporating scenario testing into the performance testing, a massive amount of performance data generated by smart cards when completing various application scenarios is collected. Using LLM + RAG technology, a professional knowledge base for smart card performance evaluation is constructed. A fully automated pipeline is introduced to complete the analysis, comparison, and scenario mapping of massive amounts of data. Furthermore, improvement suggestions are provided for test cases, which increases the testing scope for smart cards and makes the performance testing more closely aligned with card usage scenarios, thereby improving the professionalism of the test results.

[0117] In one implementation, generating a test report based on the instruction improvement suggestion and the second performance indicator (step 108) can be performed via steps E1-E2: Step E1: Generate a visualization chart based on the second performance metric.

[0118] After determining the second performance metric, the testing system generates a visualization chart based on the second performance metric, so that operators can more easily and accurately understand the test results (i.e., the second performance metric) based on the visualization chart.

[0119] Step E2: Generate the test report based on the visualization chart and the suggested improvements to the instructions.

[0120] After determining the visualization charts, the testing system generates a test report based on the visualization charts and instruction improvement suggestions, and displays the test report to the operators so that they can intuitively determine the performance test results and how to improve the performance test.

[0121] Figure 4 This is a schematic diagram of the structure of a smart card testing system provided in an embodiment of this application, as shown below. Figure 4 As shown, the smart card testing system includes a client module and a cloud module. The client module includes an access management submodule, a card and application management submodule, a performance test task management submodule, a data synchronization submodule, an instrument data acquisition submodule, a data display submodule, and an intelligent calibration submodule. The cloud module includes a test case repository management submodule, a performance database submodule, a calibration model training submodule, and a performance data analysis submodule.

[0122] Specifically, the access management submodule is responsible for interfacing with instruments and card readers, integrating the device's SDK and drivers, and providing API support for the performance data acquisition and performance test task management submodules. The card and application management submodule is responsible for card connection management, including reading card information and registering it, controlling card connection status, and providing command transmission and reception channels during test task execution; it also manages applications on the cards, including downloading, installing, and deleting them. The performance test task management submodule is responsible for loading the local performance test case library, arranging user-selected test cases into test tasks, executing test tasks, and tracking execution progress and results. The data synchronization submodule is responsible for synchronizing data with the cloud, including downloading and updating performance test cases and application data; downloading, updating, and uploading the card performance database. The instrument data acquisition submodule is responsible for collecting communication data during the testing process through instrument devices. For example, this submodule can be a logic analyzer, used to capture and parse communication data from the ISO7816 interface, perform necessary data cleaning, and upload it to the cloud-based performance data analysis submodule to provide data support for performance test reports. The data visualization submodule acquires performance data processed by the local intelligent calibration module and text reports generated by the cloud-based performance analysis module, forming a visual display of performance test results. The intelligent calibration submodule performs intelligent calibration on the performance test results, eliminating the influence of environmental factors on the results.

[0123] The test case repository management submodule provides test case downloads for the client side. Operators can add, delete, modify, and query test cases via the web. The repository hosts two types of test cases: existing performance indicator test cases and smart card scenario simulation test cases. The performance database submodule stores certified card performance data, providing performance benchmarks to the performance analysis module and helping to generate performance test reports. Operators can add reliable card performance test data via the web. The calibration model training submodule is responsible for training the smart model used in the client's smart calibration module. The purpose of this model is to predict the calibration coefficient (i.e., environmental impact factor) of the smart card performance test results based on the configuration parameters of the test environment. The performance data analysis submodule analyzes the performance data of each instruction of the smart card during the test process, comparing it horizontally with data from other cards to generate performance comparison reports and improvement suggestions.

[0124] It should be understood that the training and prediction processes of the AI ​​models involved in the various embodiments of this specification all adhere to multiple legal and compliant principles, including legal data sources, compliant data content, compliant data governance, compliant training objectives and schemes, compliant training processes, compliant training environments and tools, and compliant ethical verification of training results, and comply with the requirements of Article 5 of the Patent Law. Among them: Data source legitimacy: All datasets used for AI model training were obtained through legal means, covering three categories: publicly authorized data, data authorized by partners, and self-collected compliant data. Publicly authorized data comes from compliant data sources following open-source licenses such as Apache 2.0, with complete copyright attribution and authorization scope clearly marked, and no unauthorized open-source code or data reuse. Data authorized by partners has been subject to formal data usage agreements, clearly defining the scope, duration, and confidentiality obligations, and possessing a complete authorization chain. For self-collected data involving personal information, strict informed consent procedures have been followed, and anonymization processes (including but not limited to field masking, feature anonymization, and differential privacy technology applications) have been implemented to remove personally identifiable information, fully complying with the requirements of relevant laws and regulations such as the "Interim Measures for the Administration of Generative Artificial Intelligence Services" and the "Personal Information Protection Law."

[0125] Data content compliance: The AI ​​model's dataset undergoes multiple screenings and cleaning processes to remove all content that may violate social morality or harm public interests. It contains no obscene, pornographic, violent, discriminatory, or information that endangers national or public safety, nor does it involve the illegal acquisition or use of genetic resources. For data in sensitive fields (such as healthcare and finance), an additional privacy-preserving computation module (including federated learning and secure multi-party computation technologies) ensures that the data is "usable but not visible," avoiding compliance risks during the original data transmission process and ensuring that the data application scenarios and uses comply with public order and good morals and industry regulatory requirements.

[0126] Data governance norms: A complete data traceability system is established during the AI ​​model training process to automatically record the source, collection time, annotation process, cleaning rules, and permission allocation of training data, generating traceable compliance reports to ensure that the data is verifiable throughout its entire lifecycle. The dataset annotation process for AI models is completed by a professional human R&D team, clearly defining the proportion of human creative contributions and avoiding reliance on AI-generated data that has not undergone substantial human modification, thus meeting the examination requirements for "human main contributions" in AI patent applications.

[0127] Training objectives and plans are compliant: The AI ​​model training objective focuses on the training scenario of smart card performance testing. The training scheme and the final output results do not violate any mandatory provisions of laws and administrative regulations, do not harm the public interest or the legitimate rights and interests of others, and do not pose any potential risks of being used for illegal activities, infringing on privacy, or disrupting public safety. It strictly adheres to the ethical principle of "intelligent for good".

[0128] Training process compliance: A closed-loop training framework is adopted to ensure compliance and controllability of the training process. The specific process is as follows: First, training samples are obtained through compliant data sources. After the aforementioned data cleaning and desensitization, they are input into the neural network model to generate preliminary training results. Second, an expert system is introduced to verify the preliminary results. Based on preset rules and human expert experience, the feasibility of the results is evaluated, and outputs that may pose ethical risks or compliance hazards are corrected (such as removing decision-making logic that violates public order and good morals, and adjusting model parameters that do not comply with safety regulations). Finally, the loss function weights are dynamically optimized based on expert system feedback to strengthen the model's learning of compliant results, avoid overfitting errors or non-compliant labels, and form a closed-loop control of "data input - model training - expert verification - parameter optimization - result feedback" to ensure that the entire training process complies with A5 ethical review requirements.

[0129] Training environment and tool compliance: AI model training is implemented using nationally licensed chips and a compliant training platform. All open-source frameworks and components used in the training process have obtained their corresponding licenses, and copyright statements and patent citation information are fully retained, with no instances of infringement or reuse. The training environment is built using virtual devices (containers / virtual machines) with fixed random seeds and initial parameter configurations to ensure the reproducibility of the training process. Furthermore, through access control and operation log recording, risks such as data leakage and parameter tampering during training are prevented, ensuring the security and compliance of the training process.

[0130] Training results ethical verification compliance: After the model is trained, it undergoes additional third-party ethical compliance assessment and algorithm filing review to verify that the model output does not violate social morality or harm public interests. For potentially sensitive scenarios (such as public services and intelligent decision-making), a special result verification mechanism is established to ensure that the model always complies with Article 5 of the Patent Law and relevant laws and regulations in practical applications.

[0131] In summary, the data and training process used in the AI ​​model of this specification strictly comply with the relevant provisions of Article 5 of the Patent Law and the Patent Examination Guidelines (2023 Edition), and there are no violations of laws, social ethics, public interests, or illegal use of genetic resources. It fully meets the compliance requirements for patent authorization.

[0132] It should be noted that the smart card testing method provided in this application embodiment can be executed by a smart card testing device or a control module within that smart card testing device for executing the smart card testing method. This application embodiment uses the execution of the smart card testing method by a smart card testing device as an example to illustrate the smart card testing device provided in this application embodiment.

[0133] Figure 5 This is a schematic diagram of the structure of a smart card testing device according to an embodiment of the present invention. Figure 5 As shown, the smart card testing device includes: a first testing module 502, a first calibration module 404, a second testing module 506, and a first generation module 508.

[0134] The first test module 502 is used to obtain a first test case and perform performance testing on the smart card to be tested based on the first test case to obtain a first performance index. The first test case is a test case for testing the smart card to be tested. The first calibration module 504 is used to acquire the test environment data of the smart card to be tested, and input the first performance index and the test environment data into the pre-trained performance calibration model to obtain the second performance index, wherein the second performance index is the performance index after environmental factor correction of the first performance index. The second test module 506 is used to perform scenario testing on the smart card under test based on preset scenario test cases to obtain the first instruction performance. The scenario test cases are test cases for performing complete scenario testing on the smart card under test. The first generation module 508 is used to input the performance of the first instruction into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and to generate a test report based on the instruction improvement suggestion information and the second performance index. The instruction improvement suggestion information is used to improve and optimize the first test case.

[0135] The smart card testing device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0136] The smart card testing device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0137] The smart card testing device provided in this application embodiment can achieve… Figures 1 to 3 The various processes implemented in the method embodiments are not described in detail here to avoid repetition.

[0138] Based on the same technical concept, embodiments of this application also provide an electronic device for performing the above-described smart card testing method. Figure 6 This is a schematic diagram of the structure of an electronic device to implement various embodiments of this application. The electronic device can vary significantly due to differences in configuration or performance, and may include a processor 602, a communications interface 604, a memory 606, and a communication bus 608. The processor 602, communications interface 604, and memory 606 communicate with each other via the communication bus 608. The processor 602 can call a computer program stored in the memory 606 and executable on the processor 602 to perform the following steps: Obtain a first test case, and perform performance testing on the smart card to be tested based on the first test case to obtain a first performance index. The first test case is a test case for testing the smart card to be tested. The test environment data of the smart card to be tested is obtained, and the first performance index and the test environment data are input into the pre-trained performance calibration model to obtain the second performance index. The second performance index is the performance index after environmental factor correction of the first performance index. The smart card under test is subjected to scenario testing based on preset scenario test cases to obtain the first instruction performance. The scenario test cases are test cases for performing complete scenario testing on the smart card under test. The performance of the first instruction is input into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information. A test report is then generated based on the instruction improvement suggestion information and the second performance metric. The instruction improvement suggestion information is used to improve and optimize the first test case.

[0139] In one implementation, the step of inputting the first performance metric and the test environment data into a pre-trained performance calibration model to obtain a second performance metric includes: The test environment data is input into the pre-trained performance calibration model to obtain the environmental impact factor, which is used to characterize the degree of influence of the test environment on the performance of the smart card under test. The environmental impact factor and the first performance index are input into the pre-trained performance calibration model to obtain the second performance index.

[0140] In one implementation, before inputting the first performance metric and the test environment data into a pre-trained performance calibration model to obtain the second performance metric, the method further includes: The system acquires a performance calibration model to be trained, multiple sample test cases, multiple sample performance indicators, and multiple sample environment data. The performance calibration model to be trained is based on an MLP regression model. The sample test cases are the performance test cases that have been completed by the smart card. The sample performance indicators are the performance indicators corresponding to the sample test cases. The sample environment data is the smart card environment data when the performance test is performed using the sample test cases. The sample performance metrics and sample environment data corresponding to the same sample test case are respectively determined as training performance metrics and training environment data; The performance calibration model to be trained is iteratively trained based on the training performance metrics and the training environment data to obtain the pre-trained performance calibration model.

[0141] In one implementation, the step of inputting the performance of the first instruction into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information includes: The first instruction performance is input into the pre-trained instruction suggestion generation model to obtain first operation type information. The first operation type information is the operation type information of the first instruction. The first instruction is the operation instruction corresponding to the first instruction performance. The pre-trained instruction suggestion generation model includes a large language model. Based on a preset instruction performance database, multiple second instruction performances corresponding to the first operation type information are determined. The instruction performance database pre-stores the instruction performances corresponding to operation instructions of various different operation types. The first instruction performance and multiple second instruction performances are input into the pre-trained instruction suggestion generation model, so that the pre-trained instruction suggestion generation model compares the first instruction performance with each of the second instruction performances and generates the instruction improvement suggestions based on the comparison results.

[0142] In one implementation, before inputting the first instruction performance into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, the method further includes: The system obtains multiple preset sample instruction performances and sample instructions corresponding to each of the sample instruction performances. The sample instruction performances are test cases for performing a complete scenario test on the smart card under test based on preset sample scenario test cases. The sample instructions are instructions corresponding to the sample instruction performances. Based on the performance of the sample instructions, multiple sample scenarios and the sample instructions corresponding to each sample scenario are determined. A database of instruction correspondences is determined based on the correspondence between the sample scenarios and the sample instructions. The instruction mapping database is input into a pre-trained large language model, so that the large language model can learn knowledge based on the instruction mapping database and obtain the pre-trained instruction suggestion generation model.

[0143] In one implementation, generating a test report based on the instruction improvement suggestion and the second performance metric includes: Generate a visualization chart based on the second performance metric; The test report is generated based on the visualization charts and the suggested improvements to the instructions.

[0144] The specific execution steps can be found in the various steps of the above-described smart card testing method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0145] It should be noted that the electronic devices in the embodiments of this application include: servers, terminals, or other devices besides terminals.

[0146] The above electronic device structure does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or arrange them differently. For example, an input unit may include a Graphics Processing Unit (GPU) and a microphone, and a display unit may use a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar display panels. User input units include at least one of a touch panel and other input devices. A touch panel is also called a touchscreen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.

[0147] Memory can be used to store software programs and various data. Memory can primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory can include volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).

[0148] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.

[0149] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described smart card testing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0150] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0151] This application also provides a computer program product. When the computer program product is executed by a processor, it implements the various processes of the above-described smart card testing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0152] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described smart card testing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0153] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0154] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0156] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method of testing a smart card, characterized in that, include: Obtain a first test case, and perform performance testing on the smart card to be tested based on the first test case to obtain a first performance index. The first test case is a test case for testing the smart card to be tested. The test environment data of the smart card to be tested is obtained, and the first performance index and the test environment data are input into the pre-trained performance calibration model to obtain the second performance index. The second performance index is the performance index after environmental factor correction of the first performance index. The smart card under test is subjected to scenario testing based on preset scenario test cases to obtain the first instruction performance. The scenario test cases are test cases for performing complete scenario testing on the smart card under test. The performance of the first instruction is input into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information. A test report is then generated based on the instruction improvement suggestion information and the second performance metric. The instruction improvement suggestion information is used to improve and optimize the first test case.

2. The method of claim 1, wherein, The step of inputting the first performance metric and the test environment data into a pre-trained performance calibration model to obtain the second performance metric includes: The test environment data is input into the pre-trained performance calibration model to obtain the environmental impact factor, which is used to characterize the degree of influence of the test environment on the performance of the smart card under test. The environmental impact factor and the first performance index are input into the pre-trained performance calibration model to obtain the second performance index.

3. The method of claim 1, wherein, Before inputting the first performance metric and the test environment data into the pre-trained performance calibration model to obtain the second performance metric, the method further includes: The system acquires a performance calibration model to be trained, multiple sample test cases, multiple sample performance indicators, and multiple sample environment data. The performance calibration model to be trained is based on a multilayer perceptron (MLP) regression model. The sample test cases are the performance test cases that have been completed by the smart card. The sample performance indicators are the performance indicators corresponding to the sample test cases. The sample environment data is based on the smart card environment data when the sample test cases are used for performance testing. The sample performance metrics and sample environment data corresponding to the same sample test case are respectively determined as training performance metrics and training environment data; The performance calibration model to be trained is iteratively trained based on the training performance metrics and the training environment data to obtain the pre-trained performance calibration model.

4. The method according to claim 1, characterized in that, The step of inputting the performance of the first instruction into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information includes: The first instruction performance is input into the pre-trained instruction suggestion generation model to obtain first operation type information. The first operation type information is the operation type information of the first instruction. The first instruction is the operation instruction corresponding to the first instruction performance. The pre-trained instruction suggestion generation model includes a large language model. Based on a preset instruction performance database, multiple second instruction performances corresponding to the first operation type information are determined. The instruction performance database pre-stores the instruction performances corresponding to operation instructions of various different operation types. The first instruction performance and multiple second instruction performances are input into the pre-trained instruction suggestion generation model, so that the pre-trained instruction suggestion generation model compares the first instruction performance with each of the second instruction performances and generates the instruction improvement suggestions based on the comparison results.

5. The method according to claim 1, characterized in that, Before inputting the first instruction performance into the pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, the method further includes: The system acquires multiple preset sample instruction performances and sample instructions corresponding to each of the preset sample instruction performances. The sample instruction performances are test cases for performing a complete scenario test on the smart card under test based on preset sample scenario test cases, and the sample instructions are instructions corresponding to the sample instruction performances. Based on the performance of the sample instructions, multiple sample scenarios and the sample instructions corresponding to each sample scenario are determined. A database of instruction correspondences is determined based on the correspondence between the sample scenarios and the sample instructions. The instruction mapping database is input into a pre-trained large language model, so that the large language model can learn knowledge based on the instruction mapping database and obtain the pre-trained instruction suggestion generation model.

6. The method according to claim 1, characterized in that, The generation of a test report based on the instruction improvement suggestions and the second performance metric includes: Generate a visualization chart based on the second performance metric; The test report is generated based on the visualization charts and the suggested improvements to the instructions.

7. A smart card testing device, characterized in that, include: The first testing module is used to obtain a first test case and perform performance testing on the smart card to be tested based on the first test case to obtain a first performance index. The first test case is a test case for testing the smart card to be tested. The first calibration module is used to acquire the test environment data of the smart card to be tested, and input the first performance index and the test environment data into the pre-trained performance calibration model to obtain the second performance index, which is the performance index after environmental factor correction of the first performance index. The second testing module is used to perform scenario testing on the smart card under test based on preset scenario test cases to obtain the first instruction performance. The scenario test cases are test cases for performing complete scenario testing on the smart card under test. The first generation module is used to input the performance of the first instruction into a pre-trained instruction suggestion generation model to obtain instruction improvement suggestion information, and to generate a test report based on the instruction improvement suggestion information and the second performance indicator. The instruction improvement suggestion information is used to improve and optimize the first test case.

8. An electronic device, characterized in that, The device includes: Processor; and A memory configured to store computer-executable instructions configured to be executed by the processor, the executable instructions including steps for performing the smart card testing method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is used to store computer-executable instructions that cause the computer to perform the smart card testing method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the smart card testing method according to any one of claims 1 to 6.