Automatic test method, system and equipment for digital card

Through PC agents and APP agents forwarding test instructions on computers and devices, the inefficiency and incomplete coverage of digital card automation testing is solved, and an efficient and comprehensive testing process is achieved.

CN120429176APending Publication Date: 2025-08-05SHENZHEN SNOWBALL TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510491503.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The prior art cannot effectively implement automated testing of digital cards, especially the inability to simulate the real hardware status and directly trade with the card reader, resulting in low testing efficiency and easy to miss abnormal scenarios.

Method used

Through the PC proxy and APP proxy, test instructions are forwarded to the card reader and security chip on the computer and the device to be tested respectively, to realize the automated test process of the digital card, including the sending of test instructions and the acquisition of feedback data, and the generation of test reports.

Benefits of technology

It realizes efficient automated testing of digital cards, improves testing efficiency, ensures coverage of all abnormal scenarios, reduces manual intervention, and improves the integrity and accuracy of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429176A_ABST
    Figure CN120429176A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to an automatic test method, system and device for a digital card, and the method comprises the steps: determining test information for the digital card; starting a PC agent and an APP agent, and enabling the PC agent and the APP agent to be connected with the test service; wherein the PC agent is deployed at a computer end and is used for receiving a test instruction of a test service and forwarding the test instruction to the card reader, and the APP agent is deployed at a to-be-tested equipment end and is used for receiving the test instruction of the test service and forwarding the test instruction to a security chip of the to-be-tested equipment; determining a target PC agent and a target APP agent; acquiring a test instruction through a business service based on the test information, sending the test instruction to the card reader and the to-be-tested device end through the target PC agent and the target APP agent for testing, and acquiring feedback data through the target PC agent and the target APP agent; and generating a test report based on the feedback data. Therefore, the test of the digital card can be automatically and efficiently realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an automatic testing method, system and equipment for a digital card. Background Art

[0002] With the development of digital technology, digital card services such as virtual bus cards and digital car keys are mostly implemented based on mobile devices with NFC functions and installed security chips. The testing of such services depends on the device hardware. Although virtual devices can be integrated into the test platform in existing technologies to complete the testing of some services, the execution of real devices is still indispensable in the complete regression testing process of the services.

[0003] Specifically, on the one hand, the test platform cannot fully simulate the working state of real hardware, resulting in the possibility that the test may pass, but unexpected problems may occur after running on the real hardware device; on the other hand, the virtual security chip method cannot directly conduct transactions with the card reader, resulting in such use cases being unable to be covered using an automated method; and relying on test engineers to manually execute use cases on mobile devices. This method is not only inefficient but also prone to missing some abnormal scenarios. In addition, existing technical solutions use Appnium to implement automated testing. This method is more scripted and achieves the needs of automated testing services by driving the test mobile app. This method relies on the mobile app. If the interface or process changes, the app version needs to be re-released and the test script needs to be modified, which is inconvenient to maintain and cannot meet the needs of automated testing. Summary of the Invention

[0004] In view of this, an object of the present invention is to provide a method, system and device for automated testing of digital cards, so as to overcome the problem that currently efficient automated testing of digital cards cannot be achieved.

[0005] To achieve the above objectives, the present invention adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides an automated testing method for a digital card, comprising:

[0007] Determine test information for digital cards;

[0008] Start the PC agent and the APP agent, so that both the PC agent and the APP agent are connected to the test service; wherein the PC agent is deployed on the computer side, and is used to receive the test instructions of the test service and forward them to the card reader; the APP agent is deployed on the device to be tested, and is used to receive the test instructions of the test service and forward them to the security chip of the device to be tested;

[0009] Determine the target PC agent and target APP agent;

[0010] Obtaining a test instruction through a business service based on the test information, and sending the test instruction to the card reader and the device to be tested through a target PC agent and a target APP agent to perform the test, and obtaining feedback data through the target PC agent and the target APP agent;

[0011] A test report is generated based on the feedback data.

[0012] Furthermore, in some embodiments of the present application, determining the test information for the digital card includes:

[0013] Create a test plan;

[0014] selecting target test cases for the test plan;

[0015] A test execution task is generated based on the target test case.

[0016] Furthermore, in some embodiments of the present application, obtaining a test instruction through a business service based on the test information, sending the test instruction to the card reader and the device to be tested through a target PC agent and a target APP agent to perform the test, and obtaining feedback data through the target PC agent and the target APP agent, includes:

[0017] Parse the current target test case;

[0018] Execute and record the test of the current target test case, including obtaining the test instructions corresponding to the current target test case through the business service, sending the test instructions corresponding to the current target test case to the card reader and the device under test through the target PC agent and the target APP agent, and obtaining feedback data through the target PC agent and the target APP agent;

[0019] Parse the next target test case, execute and record the test of the next target test case, until the test of all target test cases is executed and recorded.

[0020] Furthermore, in some embodiments of the present application, the target test case is used to simulate test operations, and the test operations include card activation, recharging, and consumption.

[0021] Furthermore, in some embodiments of the present application, after the test execution of all target test cases is completed, the following is further included:

[0022] Sending a card reading instruction to the APP agent through the test service, so that the APP agent sends the card reading instruction to the security chip of the device under test to obtain the final status of the security chip of the device under test;

[0023] A consumption instruction is sent to a PC agent through a test service, so that the consumption instruction is sent to a card reader through the PC agent, so that the card reader performs a card swiping operation.

[0024] In a second aspect, an embodiment of the present application provides an automated testing system for a digital card, including: a testing service, a PC agent, and an APP agent, for executing the automated testing method for a digital card as described above.

[0025] Furthermore, in some embodiments of the present application, the test service communicates with the PC agent based on the websocke protocol; the test service communicates with the APP agent based on the websocke protocol; the test service communicates with the preset business service based on the HTTP protocol; the PC agent communicates with the card reader based on the PC / CS protocol.

[0026] In a third aspect, an embodiment of the present application provides an automated testing device for a digital card, including a processor and a memory, wherein the processor is connected to the memory:

[0027] The processor is configured to call and execute the program stored in the memory;

[0028] The memory is used to store the program, and the program is at least used to execute the above-mentioned automatic testing method for the digital card.

[0029] The present invention relates to the field of data processing technology, and more specifically to an automated testing method, system, and device for digital cards. The method comprises: determining test information for a digital card; starting a PC agent and an APP agent, connecting both the PC agent and the APP agent to a test service; wherein the PC agent is deployed on a computer and is used to receive test instructions from the test service and forward them to a card reader; and the APP agent is deployed on a device to be tested and is used to receive test instructions from the test service and forward them to a security chip of the device to be tested; determining a target PC agent and a target APP agent; obtaining test instructions through a business service based on the test information, and sending the test instructions to the card reader and the device to be tested through the target PC agent and the target APP agent for testing, and obtaining feedback data through the target PC agent and the target APP agent; and generating a test report based on the feedback data. In this way, digital card testing can be automatically and efficiently implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0031] Figure 1 The figure is a flow chart of an automated testing method for a digital card provided by an embodiment of the present invention.

[0032] Figure 2 This is a flow chart of the automated testing method for a digital card provided by an embodiment of the present invention.

[0033] Figure 3 It is a communication diagram of the automated testing method for a digital card provided by an embodiment of the present invention.

[0034] Figure 4 The figure is a schematic diagram of the structure of the automatic testing equipment for digital cards provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0035] To make the objectives, technical solutions, and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementations obtained by those of ordinary skill in the art without inventive effort are within the scope of protection of the present invention.

[0036] Figure 1 This is a flow chart of the automated testing method for a digital card provided by an embodiment of the present invention. Figure 1 , this embodiment may include the following steps:

[0037] S101: Determine test information for a digital card.

[0038] S102: Start the PC agent and the APP agent, so that both the PC agent and the APP agent are connected to the test service.

[0039] Among them, the PC agent is deployed on the computer side to receive the test instructions of the test service and forward them to the card reader. The APP agent is deployed on the device to be tested to receive the test instructions of the test service and forward them to the security chip of the device to be tested.

[0040] S103: Determine the target PC agent and the target APP agent.

[0041] S104. Obtain a test instruction through the business service based on the test information, and send the test instruction to the card reader and the device to be tested through the target PC agent and the target APP agent to perform the test, and obtain feedback data through the target PC agent and the target APP agent.

[0042] S105: Generate a test report based on the feedback data.

[0043] Figure 2FIG. 1 is a flow chart of the automated testing method for a digital card provided by an embodiment of the present invention. Figure 2 As shown (user is the relevant personnel such as the test engineer, PC-Proxy is the computer agent, which is used to receive the instructions of the test service and forward them to the card reader; APP-Proxy is the APP agent, which is also the agent on the mobile phone side, which is used to receive the instructions of the test service and forward them to the security chip; SE is the security chip; testserver is the test service; snbserver is the business service; reader is the card reader), in this application, determining the test information for the digital card includes: creating a test plan; then selecting the target test case for the test plan; and generating a test execution task based on the target test case.

[0044] Specifically, using the existing preset test platform, test engineers can first create a test plan and set the content, such as logging into the test platform, creating a test plan and executing tasks, and planning the specific content and objectives of the test.

[0045] On this basis, the test engineer inserts the card reader into the computer and launches the PC-Proxy. Once launched, the PC-Proxy automatically checks the connection status between the card reader and the device (such as a mobile phone). If successful, it establishes communication with the test service and notifies the user that the connection configuration is complete. The test engineer then launches the App-Proxy, which establishes a connection with the test service and completes the configuration, thus achieving device connection and proxy startup.

[0046] The test engineer can then configure the test plan, including associating the connected PC-Proxy and APP-Proxy to the test plan in the test plan management page of the test platform (that is, selecting the target PC proxy and target APP proxy) to ensure that subsequent tasks use the corresponding devices and proxies.

[0047] At this time, the test service corresponding to the test platform can automatically perform testing, and the execution steps include parsing the current target test case; executing and recording the test of the current target test case, including obtaining the test instructions corresponding to the current target test case through the business service, and sending the test instructions corresponding to the current target test case to the card reader and the device to be tested through the target PC agent and the target APP agent, and obtaining feedback data through the target PC agent and the target APP agent; parsing the next target test case, executing and recording the test of the next target test case, until the tests of all target test cases are executed and recorded.

[0048] Specifically, the test service can also perform a pre-check before the task starts to confirm that the device status and configuration are correct. After completing the pre-check, it parses the test case and executes the task step by step, including: obtaining device information such as chip identification through PC-Proxy; then the test service cleans up the device status to provide a clean environment for testing; and the test service sends execution instructions to APP-Proxy or PC-Proxy according to the test case. APP-Proxy and PC-Proxy pass the instructions and return the execution results.

[0049] During testing, the testing service can simulate various operations, such as card activation, top-up, spending, and payment, to verify that business functions meet expectations. For use cases requiring multi-step interactions, the testing service can loop through instructions and execute them sequentially until the use case is complete. The results of each step in the process are recorded for subsequent analysis.

[0050] In actual applications, the test service's testing logic may include: first, obtaining global configuration and test plan configuration. Global configuration refers to parameters applicable to all test plans, such as the business service host, business service URI, and business service interface name. Test plan configuration refers to parameters applicable to all test execution tasks under the current test plan, such as the tested environment, product (bus service, car key service), OEM brand, city, and proxy configuration.

[0051] Then traverse the test cases in the test execution task and execute them in sequence (because the hardware device only supports opening one card at a time, they need to be executed in sequence).

[0052] And parse the test case to obtain the test case preconditions and operation steps. In actual applications, the test case includes preconditions and operation steps. The precondition format can be json format, and the operation steps can be json format in list form. Each step is a separate object.

[0053] And obtain device information. Specifically, call the business service according to the device (such as mobile phone) information to check whether the device status is available (whether there is any unfinished business, etc.). If it is not available, call the business service to reinitialize it and make it available.

[0054] The device is then processed according to the preconditions. For example, if a card is required on the device, the test service completes the card activation of the device through the preset precondition use cases.

[0055] When the device meets the preconditions, it traverses the step list and executes according to the step operation.

[0056] On this basis, the automated testing method for digital cards provided in this application also includes: sending a card reading instruction to the APP agent through the test service, so as to send the card reading instruction to the security chip of the device to be tested through the APP agent to obtain the final status of the security chip of the device to be tested; and sending a consumption instruction to the PC agent through the test service, so as to send the consumption instruction to the card reader through the PC agent to enable the card reader to perform a card swiping operation.

[0057] Specifically, after the above test is completed or partially completed, the test service can send an instruction to read the card information, communicate with the device through APP-Proxy, obtain the final card status, and the test service can issue a consumption instruction, complete the card swiping operation through PC-Proxy, and record all details of the consumption process, including instruction sending and execution results.

[0058] After all test cases are executed, the testing service automatically cleans up the device and releases the test environment. A test report is then generated, including the execution details and final results for each case. Test engineers can then review the report on the management page to assess the overall test progress and any issues identified.

[0059] In actual application, the automated testing method for digital cards provided by the present invention allows test engineers to first write automated test cases on the test platform and create a test plan. They can then drag the cases into the plan and select the cases that need to be executed to generate test execution tasks. According to the test requirements, if the case involves card reader and device transactions, the user needs to insert the card reader and place the mobile phone device to start the PC-Proxy. The PC-Proxy connects to the test service, maintains the connection after verification, checks the status of the card reader and mobile phone device, and feeds back the information to the test service. The test service pushes the device status to the user, and the user selects the connected PC-Proxy on the test plan management page, indicating that the Proxy will be used in subsequent tests. The user starts the APP-Proxy, connects to the test service, and after verification, selects the corresponding APP-Proxy identifier to ensure that the Proxy is used when subsequent tests are executed. After the device connection and Proxy selection are completed, the user can start the test.

[0060] Before formal execution, the test service performs a pre-check to confirm all preparatory steps are correct. It then executes each test case individually, ensuring each case completes before moving on to the next. Before each execution, the test service cleans the device to ensure test data is not corrupted. After cleaning, the test case is parsed and the request message is assembled. The business service is called to obtain instructions. Based on the test case, the request is then forwarded to the PC-Proxy or APP-Proxy. The proxy executes the request and returns the results to the test service. The request, response, and result are recorded at each step during the execution. After all test cases are completed, the device is cleaned again to ensure that it is clean and free of corrupted data. Finally, the test service generates a detailed test report based on the execution log.

[0061] Based on the same inventive concept, the present application also provides an automated testing system for a digital card, which is used to execute the above-mentioned testing method. Figure 3 FIG. 1 is a communication diagram of an automated testing method for a digital card provided by an embodiment of the present invention. Figure 3 As shown, the system includes: testing service, PC agent and APP agent.

[0062] Among them, the test service and PC agent communicate based on the websocke protocol; the test service and APP agent communicate based on the websocke protocol; the test service and the preset business service communicate based on the HTTP protocol; the PC agent and the card reader communicate based on the PC / CS protocol.

[0063] Regarding the system in the above embodiment, the specific manner in which each part performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0064] The present invention also provides an automated testing device for a digital card, which is used to implement the above method embodiment. Figure 4 FIG. 1 is a schematic diagram of the structure of an automated testing device for a digital card provided by an embodiment of the present invention. Figure 4 As shown, the automated testing device for digital cards of this embodiment includes a processor 11 and a memory 12, wherein the processor 11 is connected to the memory 12. The processor 11 is used to call and execute a program stored in the memory 12; the memory 22 is used to store a program, which is used to at least execute the automated testing method for digital cards of the above embodiment.

[0065] The specific implementation scheme of the automated testing equipment for digital cards provided in the embodiments of the present application can refer to the implementation scheme of the automated testing method for digital cards in any of the above embodiments, which will not be repeated here.

[0066] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0067] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" is at least two.

[0068] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.

[0069] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0070] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0071] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.

[0072] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0073] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0074] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. An automated testing method for a digital card, characterized in that: include: Determine test information for digital cards; Start the PC agent and the APP agent, so that both the PC agent and the APP agent are connected to the test service; wherein the PC agent is deployed on the computer side, and is used to receive the test instructions of the test service and forward them to the card reader; the APP agent is deployed on the device to be tested, and is used to receive the test instructions of the test service and forward them to the security chip of the device to be tested; Determine the target PC agent and target APP agent; Obtaining a test instruction through a business service based on the test information, and sending the test instruction to the card reader and the device to be tested through a target PC agent and a target APP agent to perform the test, and obtaining feedback data through the target PC agent and the target APP agent; A test report is generated based on the feedback data.

2. The automated testing method for a digital card according to claim 1, wherein: The determining of the test information for the digital card includes: Create a test plan; selecting target test cases for the test plan; A test execution task is generated based on the target test case.

3. The automated testing method for a digital card according to claim 2, wherein: The method of obtaining a test instruction through a business service based on the test information, sending the test instruction to a card reader and a device to be tested through a target PC agent and a target APP agent to perform the test, and obtaining feedback data through the target PC agent and the target APP agent includes: Parse the current target test case; Execute and record the test of the current target test case, including obtaining the test instructions corresponding to the current target test case through the business service, sending the test instructions corresponding to the current target test case to the card reader and the device under test through the target PC agent and the target APP agent, and obtaining feedback data through the target PC agent and the target APP agent; Parse the next target test case, execute and record the test of the next target test case, until the test of all target test cases is executed and recorded.

4. The automated testing method for a digital card according to claim 2, wherein: The target test case is used to simulate test operations, including card activation, recharging, and consumption.

5. The automated testing method for a digital card according to claim 3, wherein: After all target test cases are executed, it also includes: Sending a card reading instruction to the APP agent through the test service, so that the APP agent sends the card reading instruction to the security chip of the device under test to obtain the final status of the security chip of the device under test; A consumption instruction is sent to a PC agent through a test service, so that the consumption instruction is sent to a card reader through the PC agent, so that the card reader performs a card swiping operation.

6. An automated testing system for digital cards, characterized in that: include: The test service, PC agent and APP agent are used to execute the automated testing method of the digital card according to any one of claims 1 to 5.

7. The automated testing system for digital cards according to claim 6, wherein: The test service communicates with the PC agent based on the websocke protocol; the test service communicates with the APP agent based on the websocke protocol; the test service communicates with the preset business service based on the HTTP protocol; the PC agent communicates with the card reader based on the PC / CS protocol.

8. An automated testing device for digital cards, characterized in that: The device comprises a processor and a memory, wherein the processor is connected to the memory: The processor is configured to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the automated testing method for a digital card according to any one of claims 1 to 5.

Citation Information

Cited By

  • Bus card business automation test method and system

    CN116756038A

  • Bus card business automation test method and system

    CN116756038B