An automated testing method for on-demand card swiping using a metronome

By transforming the metronome and using Python scripts to control its start and stop, combined with data acquisition and result analysis, efficient and low-cost automated testing of card swiping equipment is achieved, solving the problem of traditional testing relying on labor and equipment costs, and significantly improving testing efficiency and accuracy.

CN119645847BActive Publication Date: 2025-06-27BEIJING FANGWEI ZHILIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411709306.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-06-27
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

Traditional card swiping tests rely on manual operation, are time-consuming and labor-intensive, and are susceptible to human factors. The high cost of high-end automated testing equipment limits its wide application, especially in small and medium-sized enterprises and the early stages of R&D.

Method used

By transforming the metronome, its power supply is connected to the output port of the auxiliary device, and using Python scripts to control the start and stop of the metronome, combining data acquisition and result analysis, automated card swiping test is realized.

Benefits of technology

It realizes efficient and low-cost automated testing of card swiping equipment, significantly improves testing efficiency and accuracy, reduces labor costs, and supports long-term intervention-free operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645847B_ABST
    Figure CN119645847B_ABST
Patent Text Reader

Abstract

The present invention discloses an automated testing method for on-demand card swiping using a metronome, belonging to the field of automated testing. Specifically, first, connect the negative pole of the metronome to the output port of the auxiliary device, and control the power on and off of the metronome through the auxiliary device. Then, develop a control script using the Python programming language to remotely control the status of the output port. Next, fix the NFC card on the metronome pointer to ensure that the card approaches or contacts the reading area of the card swiping device under test during the swinging process. Preset or input the key parameters required for the test through command line parameters in the control script, and start the control script. After initializing the connection of the auxiliary device and the card swiping device under test, control the metronome to perform simulated card swiping according to the predetermined card swiping frequency and number of times, and simultaneously monitor and record the test results. After the test is completed, the script automatically aggregates the test data and generates a test report. The present invention realizes the precise simulation of the card swiping process, greatly improving the flexibility and controllability of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of automated testing, in particular to an automated testing method for performing on-demand card swiping using a metronome. Background Art

[0002] In the context of rapid technological development, automated testing technology has become a key link in ensuring product quality and improving production efficiency, especially in the fields of electronic payment and access control. The accuracy and stability of card swiping equipment are directly related to the security of the system and user experience.

[0003] However, traditional card swipe tests mostly rely on manual operations, which is not only time-consuming and laborious, but also easily affected by human factors, making it difficult to ensure the consistency and reliability of test results. In addition, the use of high-end automated testing equipment, such as robotic arms with precision control systems, can improve test accuracy, but the high purchase and maintenance costs limit its widespread application, especially in small and medium-sized enterprises and in the early stages of R&D.

[0004] In view of this, it is urgent to find a card swipe testing solution that is both economical and efficient.

[0005] The metronome in the field of music is a simple and reliable mechanical device. It has the characteristics of regular swing, which provides inspiration for automated testing. The metronome can be transformed into a low-cost analog card swiping tool through appropriate modification. Its simple design and low cost bring new possibilities to the field of automated testing.

[0006] At the same time, with the popularization of programming technology, especially the widespread application of Python language in the field of automated control, it has become a reality to use scripts to control hardware equipment and process test data, providing technical support for the realization of intelligent and automated testing processes. Summary of the invention

[0007] In view of the problems of low efficiency, high cost and strong manual dependence in the testing process of existing card swiping equipment, the present invention proposes an automated testing method for on-demand card swiping using a metronome, which cleverly combines the physical movement characteristics of the metronome and the intelligent control capabilities of Python scripts to achieve efficient and low-cost card swiping testing.

[0008] The specific steps of the automated testing solution for on-demand card swiping using a metronome are as follows:

[0009] Step 1: Modify the power interface of the metronome to ensure that the negative pole of the metronome is connected to the output port of the auxiliary device, and control the power-on and power-off status of the metronome through the auxiliary device;

[0010] The auxiliary device is equipped with a network interface and an output interface. The network interface is connected to the PC or server, and the output interface is used to control the power connectivity of the metronome.

[0011] The device receives control instructions from the PC via an Ethernet cable and controls the switch state of the output port according to the instructions, thereby turning the metronome on or off.

[0012] Step 2: Develop a control script using the Python programming language.

[0013] The script should include the following functions:

[0014] 1) Power control module: Send instructions to the auxiliary device via a network protocol to precisely control the start and stop of the metronome.

[0015] Among them, the instruction statement to start the metronome is:

[0016] sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist_password'],'output1=OUT1_SOS');

[0017] The instruction statement to stop the metronome is:

[0018] sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist_password'],'output1=OUT1_CLR');

[0019] Where assist_ip is the IP of the auxiliary device, assist_user is the authentication name for the HTTP protocol used for communication, assist_password is the authentication password for the HTTP protocol used for communication, OUT1_SOS is the instruction ID for controlling the power-on of the metronome, and OUT1_CLR is the instruction ID for controlling the power-off of the metronome;

[0020] 2) Data collection and recording: The script needs to monitor the network interface or API of the device under test and automatically collect the feedback information after each simulated card swipe, including the card swipe time and status;

[0021] The statement for data collection is:

[0022] open_door_logs=getOpenDoorLogs('test_ip',test_user,test_password)

[0023] test_ip is the IP address of the test device; test_user is the HTTP authentication username of the test device, and test_password is the authentication password;

[0024] 3) Result analysis: The internal implementation logic of the script compares the expected number of card swipes of the metronome with the actually received card swipe records to evaluate the test success rate.

[0025] 4) Loop control: According to the number of tests set by the user, the script automatically manages the test process and controls the number of card swipes by repeatedly calling the power-on and power-off statements; it stops automatically after reaching the specified number of times.

[0026] Step 3: Fix the NFC card on the metronome pointer to ensure that the card approaches or touches the reading area of the card swiping device under test during the swinging process;

[0027] If the supported card swipe interval of the test device is less than 1.5 s, align the device reading area with the position where the metronome returns to the upright position, and complete two card swipes back and forth; if the supported card swipe interval of the test device is greater than or equal to 1.5 s, place the test device on one side of the metronome and complete one card swipe back and forth;

[0028] The swinging speed of the pointer can also be used to fine-tune the card swipe interval.

[0029] Step 4: Preset or input the key parameters required for the test in the control script through command-line parameters;

[0030] The key parameters include the IP address of the device under test, the output interface of the auxiliary device, and the number of test loops, etc.

[0031] Step 5: Start the control script. After initializing the connection of the auxiliary device and the card swiping device under test, control the metronome to perform simulated card swiping according to the predetermined card swipe frequency and number of times, and monitor and record the test results at the same time.

[0032] Step 6: After the test is completed, the script automatically summarizes the test data and generates a test report;

[0033] The test data includes the number of successful card swipes, the number of failures, the total number of tests, and the success rate.

[0034] The report should include an overview of the test process, a detailed record of each card swipe, the final test conclusion, and possible suggestions for fault analysis.

[0035] The advantages of the present invention are as follows:

[0036] The present invention provides an automated test method for on-demand card swiping using a metronome, which realizes the automated and intelligent testing of card swiping devices, significantly improves the test efficiency and accuracy, and at the same time greatly reduces the test cost.

[0037] An automated testing method for on-demand card swiping using a metronome according to the present invention does not require continuous monitoring by professionals and supports long-term operation without intervention, providing a simple and efficient testing means for card swiping device manufacturers, system integrators, and third-party testing institutions, and promoting the progress and application of automated testing technology in this field. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a flowchart of an automated testing method for on-demand card swiping using a metronome according to the present invention;

[0039] Figure 2 It is a scenario diagram of the automated testing for on-demand card swiping using a metronome according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] To facilitate the understanding and implementation of the present invention by those of ordinary skill in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0041] The present invention combines a metronome with a Python script to propose an automated card swiping testing method, innovatively improving traditional devices to achieve automated testing of the card swiping system; not only overcoming the limitations of traditional testing means and reducing the threshold of automated testing, but also significantly improving the efficiency and accuracy of testing through precise control and data analysis, meeting the market's demand for high-quality and low-cost testing solutions.

[0042] The automated testing method for on-demand card swiping using a metronome, as Figure 1 shown, the specific steps are as follows:

[0043] Step 1: Modify the power interface of the metronome to ensure that the negative pole of the metronome is connected to the output port of the auxiliary device, and control the power-on and power-off states of the metronome through the auxiliary device;

[0044] The auxiliary device is an industrial product of Fanvil, which has a network interface and an output interface. The network interface is connected to the PC or server; the output interface is used to control the power connectivity of the metronome.

[0045] This device receives control instructions from the PC through an Ethernet cable and controls the switch state of the output port according to the instructions, thereby turning on or off the metronome.

[0046] Step 2: Develop a control script using the Python programming language;

[0047] The script shall include the following functions:

[0048] 1) Power control module: Send instructions to auxiliary devices through network protocols to accurately control the start and stop of the metronome.

[0049] Among them, the instruction statement to start the metronome is:

[0050] sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist_password'],'output1=OUT1_SOS');

[0051] The instruction statement to stop the metronome is:

[0052] sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist_password'],'output1=OUT1_CLR');

[0053] Where assist_ip is the IP of the auxiliary device, assist_user is the authentication name of the HTTP protocol for communication, assist_password is the authentication password of the HTTP protocol for communication, OUT1_SOS is the power-on instruction ID for controlling the metronome, and OUT1_CLR is the power-off instruction ID for controlling the metronome;

[0054] Between each power-on and power-off of the metronome, set a card-swipe time. The setting statement is: time.sleep(2); By controlling the card-swipe time, further control the number of times the metronome is powered on. This number is related to the pointer swing frequency of the metronome.

[0055] For example: After the metronome is powered on, the pointer starts to work. The minimum swing of the metronome pointer is once every 1.5s. Assuming the card-swipe time is set to 3 seconds, that is, it is powered off after 3s, then the pointer swings twice. If it is set to 6s, the pointer swings 4 times.

[0056] Then, after each power-off of the metronome, wait for a time to complete door opening and save the door opening log: time.sleep(5); By adjusting the waiting time, control the interval of the power-on / power-off cycle.

[0057] 2) Data collection and recording: The script actively collects the results after each simulated card-swipe through the HTTP API interface opened by the test device, including the card-swipe time and status;

[0058] The statement for data collection is as follows:

[0059] open_door_logs = getOpenDoorLogs('test_ip', test_user, test_password)

[0060] test_ip is the IP address of the test device; test_user is the HTTP authentication username of the test device, and test_password is the authentication password;

[0061] First, initialize the set number of card swipes and the actual number of successful card swipes: test_count, open_success_count = 1000, 0; different test requirements can be achieved by adjusting the set number of card swipes.

[0062] Then, save the expected number of card swipes and configuration information in a txt file, specifically including: the IP of the test device, the authentication username, the authentication password, the IP of the auxiliary device for controlling the power-on and power-off of the metronome, the authentication username, the authentication password, and the number of card swipes.

[0063] 3) Result analysis: The internal implementation logic of the script compares the set number of card swipes of the metronome with the actually received card swipe records to evaluate the test success rate.

[0064] Obtain the latest door opening record. open_door_logs[0][1] represents the door opening status, 0 indicates successful door opening, and 1 indicates failed door opening;

[0065] 4) Loop control: According to the number of tests set by the user, the script automatically manages the test process. By looping and calling the power-on and power-off statements, the number of card swipes is controlled, and it automatically stops after reaching the specified number.

[0066] The number of card swipes performed each time power is supplied and cut off is set to n, the number of times the power-on / power-off loop is executed is recorded as m, and the total number of card swipes is n * m;

[0067] Step 3: Fix the NFC card on the metronome pointer to ensure that the card approaches or touches the reading area of the test card swiping device during the swing;

[0068] If the supported card swipe interval of the test device is less than 1.5s, place the device reading area facing the position where the metronome returns to the upright position, and complete two card swipes back and forth; if the supported card swipe interval of the test device is greater than or equal to 1.5s, place the test device on one side of the metronome and complete one card swipe back and forth;

[0069] The speed of the pointer swing can also be used to fine-tune the card swipe interval.

[0070] Step 4: Preset or input the key parameters required for testing in the control script through command-line arguments;

[0071] The key parameters include the IP address of the device under test, the output interface of the auxiliary device, the number of test cycles, etc.

[0072] Step 5: Start the control script. After initializing the connection between the auxiliary device and the card-swipe device under test, control the metronome to simulate card swiping according to the predetermined card-swipe frequency and number of times, and simultaneously monitor and record the test results.

[0073] Step 6: After the test is completed, the script automatically aggregates the test data and generates a test report;

[0074] The test data includes the number of successful card swipes, the number of failures, the total number of tests, and the success rate.

[0075] The report should include an overview of the test process, a detailed record of each card swipe, the final test conclusion, and possible suggestions for fault analysis.

[0076] The present invention has the following innovative features:

[0077] 1. Innovative transformation of the metronome: The present invention first makes a clever transformation of the traditional metronome. Through circuit design, its power supply is connected to the output port of an auxiliary control device. This design allows the metronome to be started and stopped by software rather than physical operation, providing a basis for automated testing.

[0078] 2. Intelligent control with Python script as the core: This script can not only remotely control the output port status of the auxiliary device to achieve precise switching control of the metronome, but also adjust the card-swipe frequency and number of times according to the preset test plan, greatly improving the flexibility and controllability of the test.

[0079] 3. Simulated card-swipe mechanism: By fixing the NFC card on the swinging pointer of the metronome, the regular swinging of the metronome is used to simulate the real card-swipe action. This physical simulation method is both economical and efficient, and can achieve precise simulation of the card-swipe process without introducing complex mechanical structures.

[0080] 4. Automated data collection and analysis: The script is further responsible for collecting the card-swipe records of the device under test and comparing them with the start and stop times of the metronome controlled by the script. Through data comparison, the success rate of the test is automatically evaluated, thus eliminating the cumbersome steps of manual verification and improving the accuracy and efficiency of the test.

[0081] 5. Parameter Configuration and Test Flexibility: The system supports highly parameterized configuration, including network information of test devices, control parameters of auxiliary devices, and the number of test cycles, etc., enabling the present invention to adapt to different test environments and requirements, and enhancing the universality and practicality of the application.

[0082] Embodiment:

[0083] As Figure 2 shown, it is an automated test simulation scenario for on-demand card swiping using a metronome. The specific process is as follows:

[0084] 1. Modify the metronome and design auxiliary devices:

[0085] Modification of the metronome power interface: First, modify the common metronome on the market and add an external control interface to its power line. During the modification, ensure that the negative pole of the metronome is connected to the output port of an auxiliary device to control the power-on and power-off states of the metronome through the auxiliary device.

[0086] 2. Python script development and deployment:

[0087] Develop a control script using the Python programming language, including but not limited to the following functions:

[0088] Power control module: Send instructions to the auxiliary device through the network protocol to accurately control the start and stop of the metronome.

[0089] Data monitoring and recording: The script needs to monitor the network interface or API of the device under test and automatically collect the feedback information after each simulated card swipe, including but not limited to the card swipe time and status (success / failure).

[0090] Result analysis: Implement the internal logic of the script, compare the expected number of card swipes of the metronome with the actually received card swipe records, and evaluate the test success rate.

[0091] Loop control: According to the number of tests set by the user, the script automatically manages the test process and stops automatically after reaching the specified number of times.

[0092] 3. Fix the NFC card and simulate card swiping

[0093] Select a standard NFC card and firmly bind it to the metronome pointer to ensure that the card can reliably approach or contact the reading area of the card swiping device under test during the swing of the metronome.

[0094] 4. Test parameter configuration and operation

[0095] Parameter setting: Key parameters required for testing are preset in the script or input through command-line arguments, such as the IP address of the device under test, the control port number of the auxiliary device, the number of test loops, etc.

[0096] Test execution: Start the Python script. The script first initializes the connections with the auxiliary device and the device under test, and then controls the metronome to simulate swiping cards according to the preset swiping frequency and number of times, while monitoring and recording the test results.

[0097] 5. Data processing and report generation

[0098] Report output: Generate a detailed test report based on the collected data. The report should include an overview of the test process, detailed records of each card swipe, the final test conclusion, and possible suggestions for fault analysis.

[0099] Through the above specific implementation manners, the present invention realizes the automated and precise testing of card swiping devices, greatly improves the testing efficiency, reduces the labor cost, and at the same time ensures the accuracy and repeatability of the test results.

Claims

1. An automated testing method for on-demand card swiping using a metronome, characterized in that: The specific steps are as follows: Step 1: Modify the power interface of the metronome and connect the negative pole of the metronome to the output port of the auxiliary device; Step 2: Use Python programming language to develop control scripts to remotely control the output port status; The script contains the following functions: 1) Power control module: sends instructions to auxiliary equipment through network protocol to control the start and stop of the metronome; Among them, the command statement to start the metronome is: sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist _password'], output1=OUT1_SOS'); The command statement to stop the metronome is: sendKeys(config_dict['assist_ip'],config_dict['assist_user'],config_dict['assist_password'], output1=OUT1_CLR'); Where assist_ip is the IP of the auxiliary device, assist_user is the HTTP protocol authentication name for communication, assist_password is the HTTP protocol authentication password for communication, OUT1_SOS is the control metronome power-on command ID, and OUT1_CLR is the control metronome power-off command ID; 2) Data collection and recording: The script needs to monitor the network interface or API of the device under test and automatically collect feedback information after each simulated card swipe, including the swipe time and status; The statement for data collection is: open_door_logs = getOpenDoorLogs('test_ip', test_user, test_password) test_ip is the IP address of the test device; test_user is the HTTP authentication user name of the test device, and test_password is the authentication password; 3) Result analysis: The script implements logic internally, compares the number of card swipes predicted by the metronome with the actual card swipe records received, and evaluates the test success rate; 4) Loop control: According to the number of tests set by the user, the script automatically manages the test process and controls the number of card swipes by cyclically calling power-on and power-off statements; it automatically stops after reaching the specified number of times; Step 3: Fix the NFC card on the metronome pointer and ensure that the card is close to or in contact with the reading area of ​​the card swiping device under test during the swinging process; Step 4: Preset the key parameters required for the test in the control script or enter them through command line parameters; Step 5: Start the control script, initialize the connection between the auxiliary device and the card swiping device under test, control the metronome to simulate the card swiping according to the predetermined card swiping frequency and number, and monitor and record the test results at the same time; Step 6. After the test is completed, the script automatically summarizes the test data and generates a test report.

2. The automated testing method for on-demand card swiping using a metronome as claimed in claim 1, characterized in that: In the step 1, the auxiliary device has a network interface and an output interface, wherein the network interface is connected to the PC or the server; the output interface is used to control the power connectivity of the metronome, and the power-on and power-off states of the metronome are controlled by the auxiliary device; The auxiliary device receives control instructions from the PC via an Ethernet cable, and controls the switch state of the output port according to the instructions, thereby turning the metronome on or off.

3. The automated testing method for on-demand card swiping using a metronome as claimed in claim 1, characterized in that: In step three, if the card swiping interval supported by the test device is less than 1.5 seconds, place the device reading area opposite the metronome to the normal position, and swipe the card twice back and forth; if the card swiping interval supported by the test device is greater than or equal to 1.5 seconds, place the test device on one side of the metronome, and swipe the card once back and forth.

4. The automated testing method for on-demand card swiping using a metronome as claimed in claim 1, characterized in that: In step three, the speed of the pointer swinging is used to fine-tune the card swiping interval.

5. The automated testing method for on-demand card swiping using a metronome as claimed in claim 1, characterized in that: In step 4, the key parameters include the IP address of the device under test, the output interface of the auxiliary device and the number of test cycles.

6. The automated testing method for on-demand card swiping using a metronome as claimed in claim 1, characterized in that: In step 6, the test data includes the number of successful card swipes, the number of failures, the total number of tests and the success rate; The report includes an overview of the test process, detailed records of each card swipe, the final test conclusions and possible fault analysis suggestions.

Citation Information

Patent Citations

  • Project research and development demand-based human resource determination method, device and equipment

    CN116757430A

  • Banking system controlled responsive to data bearing records

    US9224273B1