Subway AFC system pressure test method and system based on protocol-level virtual signal injection
By generating high-concurrency virtual signals at the protocol level, the problem of manual and hardware dependence in the stress testing of the subway AFC system is solved, realizing efficient and automated system performance testing, supporting new payment methods, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202511511336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-09
AI Technical Summary
Existing stress testing methods for subway AFC systems rely on manual or hardware simulation, which are complex, time-consuming, labor-intensive, and difficult to control test parameters accurately. They also lack the ability to dynamically simulate complex passenger flow patterns, have poor system scalability, are difficult to adapt to new payment methods, and have high hardware costs.
By constructing a dynamically configurable virtual passenger behavior model, high-concurrency virtual signals are generated directly at the protocol level to achieve pressure injection on the AFC gate controller. A multi-protocol template library is used to generate protocol instructions that conform to the AFC system communication specifications, dynamically adjust the test load intensity and passenger flow pattern, and collect multi-dimensional data for performance analysis.
It enables efficient and automated system performance testing, accurately reproduces complex operational scenarios, reduces testing time and economic costs, supports new payment methods, improves testing efficiency and accuracy, and shortens fault location time.
Smart Images

Figure CN121309710A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban transportation technology, and in particular to a stress testing method and system for a subway AFC system based on protocol-level virtual signal injection. Background Technology
[0002] During stress testing of automated fare collection (AFC) systems in subways before their operation, traditional testing methods primarily rely on manual simulation or hardware simulation equipment. These methods suffer from numerous technical bottlenecks and practical limitations, severely restricting testing efficiency and the comprehensiveness of system verification. Current mainstream manual testing methods are not only complex and time-consuming, but also struggle to accurately control test parameters, such as peak-hour passenger flow, abnormal transaction ratios, and concurrent use of mixed ticket types. Furthermore, manual recording of test data is prone to errors, making real-time monitoring and analysis of system dynamic performance impossible; key indicators such as transaction response time, system throughput, and data processing latency are difficult to obtain accurately. Hardware simulation testing methods have significantly improved upon the problems of manual testing by employing devices such as robotic arms, card-issuing modules, or mobile devices to simulate card-swiping behavior. While these methods replace manual labor to some extent, they still have significant drawbacks. These methods typically rely on physical media and pre-set sample databases, lacking the ability to dynamically simulate complex passenger flow patterns. Moreover, their system scalability is poor, making it difficult to quickly adapt to new payment methods such as digital RMB and virtual tickets. Furthermore, the high cost of purchasing and maintaining hardware equipment, coupled with the long troubleshooting cycle, further increases the time and economic cost of system testing. To address these technical issues, Chinese patent application CN104914330A provides a ticket gate stress testing system. By collecting and replaying pre-stored gate-passing behavior sample data and ticket sample data, it achieves a certain degree of automated testing. However, its testing scenarios still heavily rely on pre-collected real data and lack real-time dynamic configuration and load adjustment capabilities.
[0003] Therefore, providing a solution to enable dynamic and flexible stress testing of a subway AFC system is a technical problem that needs to be solved. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a stress testing method and system for a subway AFC system based on protocol-level virtual signal injection. By constructing a dynamically configurable virtual passenger behavior model and directly generating high-concurrency virtual signals at the protocol level, direct stress injection is achieved on the AFC gate controller. This allows for in-depth, comprehensive, and efficient testing of the system's overall performance without relying on physical equipment and real data.
[0005] The objective of this invention can be achieved through the following technical solutions: According to a first aspect of the present invention, a stress testing method for a subway AFC system based on protocol-level virtual signal injection is provided, the method comprising: Based on different situations in actual application scenarios, multiple passenger flow modes are preset, including peak mode, stable mode, emergency event mode and mixed ticket mode. For each passenger flow model, dynamic parameters and load intensity are configured. The dynamic parameters include virtual passenger flow, distribution of entry and exit gates, proportion of ticket types, and abnormal behavior injection parameters. Based on the dynamic parameters, a virtual passenger behavior sequence that conforms to statistical laws is generated in real time. The virtual passenger behavior sequence is parsed into discrete events with time-series labels. Using a multi-protocol template library, each event is mapped to a protocol instruction that conforms to the AFC system communication specification. Based on the aforementioned protocol instructions, a high-concurrency signal is generated and injected into the actual AFC central server. The test load intensity and passenger flow pattern are dynamically adjusted to conduct stress tests. Collect multi-dimensional data during the stress test and perform performance analysis.
[0006] As a preferred technical solution, in the peak mode, a passenger flow time distribution model conforming to a Poisson distribution is used to generate virtual passenger flow; in the stable mode, a passenger flow time distribution model conforming to a uniform distribution is used to generate virtual passenger flow; and in the sudden mode, a passenger flow time distribution model conforming to a negative binomial distribution is used to generate virtual passenger flow.
[0007] As a preferred technical solution, the distribution of the entrance and exit gates conforms to a sinusoidal distribution or a uniform distribution.
[0008] As a preferred technical solution, the method for generating the virtual passenger behavior sequence is as follows: Select the load intensity and randomly select the passenger flow mode to generate the corresponding normal virtual passenger flow curve, and allocate the entrance and exit gates based on the normal virtual passenger flow curve. Each gate corresponds to a normal virtual passenger flow sub-curve. For each normal virtual passenger flow sub-curve, an injection rule is constructed according to a preset abnormal behavior ratio. The insertion frequency of the abnormal behavior injection parameter is determined, and the abnormal behavior injection parameter is inserted into the normal virtual passenger flow sub-curve according to the insertion frequency to obtain the initial virtual passenger behavior sequence. The initial virtual passenger behavior sequence is validated. If it conforms to statistical laws, it is used as the virtual passenger behavior sequence; otherwise, the injection rules are reconstructed.
[0009] As a preferred technical solution, the multi-protocol template library includes protocol templates for various ticket types, including: For IC cards, the mapping process follows the ISO / IEC 14443 protocol, which includes APDU instruction structure, CLA / INS / P1 / P2 instruction header, data field, Le / Lc length, and checksum. For QR codes, during mapping, the interaction between the mobile terminal and the server is simulated, and protocol instructions including request headers, session ID, and payment token are generated using HTTP / HTTPS requests. For NFC mobile payments, the EMV Contactless specification is followed during mapping, and the protocol instructions include a series of transaction process instructions; For magnetic tickets or magnetic cards, the mapping process follows the ISO 7811 standard. The protocol instructions include second track analog data information and third track analog data cell information. The second track analog data information includes the ticket number, validity period, and ticket type. The third track analog data cell information includes the balance, entry / exit station location markers, and number of transactions.
[0010] As a preferred technical solution, the dynamic adjustment method is as follows: using an intelligent load adjustment algorithm, with key performance indicators as feedback signals, to dynamically adjust the request injection rate and concurrency of the high-concurrency signal in the next stage.
[0011] As a preferred technical solution, the key performance indicators include: average response time and error rate.
[0012] According to a second aspect of the present invention, a stress testing system for a subway AFC system based on protocol-level virtual signal injection is provided, the system comprising: The control layer presets multiple passenger flow modes according to different situations in actual application scenarios. For each passenger flow model, dynamic parameters and load intensity are configured, and virtual passenger behavior sequences that conform to statistical laws are generated in real time based on the dynamic parameters. The passenger flow modes include peak mode, stable mode, sudden event mode and mixed ticket mode. The dynamic parameters include virtual passenger flow, gate distribution, ticket type ratio and abnormal behavior injection parameters. The simulation layer is used to parse the virtual passenger behavior sequence into discrete events with time-series labels. Using a multi-protocol template library, each event is mapped to a protocol instruction conforming to the AFC system communication specification. Based on the protocol instruction, a high-concurrency signal is generated and injected into the real AFC central server. The simulation layer has an embedded response simulator, which is used to simulate the response behavior of all gates in the AFC central server to the high-concurrency signal. The execution layer is used to dynamically adjust the test load intensity and passenger flow pattern during stress testing; The analysis layer is used to collect multi-dimensional data during the stress test and perform performance analysis. The multi-dimensional data includes gate transaction logs, server resource monitoring, network device status, and database performance indicators.
[0013] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described thereon.
[0014] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1) This invention deeply analyzes the AFC system communication protocol and directly generates and injects high-fidelity virtual signals, including card swiping and response, at the protocol layer, completely eliminating the dependence on physical hardware and manual labor. At the same time, the multi-protocol template library covers various ticket types such as IC cards, QR codes, NFC, and magnetic tickets, which can quickly adapt to new payment methods. It avoids the high cost and failure risk of hardware equipment and solves the defects of complex organization and time-consuming labor in manual testing, greatly reducing the time and economic cost of testing.
[0016] 2) This invention presets multiple passenger flow modes such as peak, stable, and sudden events, and generates virtual passenger behavior sequences that conform to statistical laws in real time by configuring dynamic parameters such as virtual passenger flow, gate distribution, and abnormal behavior injection parameters. At the same time, through an intelligent load adjustment algorithm, the injection rate and concurrency of high-concurrency signals are dynamically adjusted based on key indicators such as average response time and error rate, accurately reproducing complex operation scenarios and solving the limitations of difficult manual parameter control, weak hardware dynamic simulation, and reliance on pre-stored data. Attached Figure Description
[0017] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0019] To address the shortcomings of existing technologies, this invention provides a stress testing method for a subway AFC system based on protocol-level virtual signal injection, the process of which is as follows: Figure 1 As shown, it includes: S1. Multiple passenger flow modes are preset according to different situations in actual application scenarios.
[0020] In this invention, passenger flow patterns include peak mode, stable mode, sudden event mode, and mixed ticketing mode. Specifically, in peak mode, a passenger flow time distribution model conforming to a Poisson distribution is used to generate virtual passenger flow, and peak mode corresponds to scenarios where virtual passengers have high flow and high density. In stable mode, a passenger flow time distribution model conforming to a uniform distribution is used to generate virtual passenger flow, and stable mode corresponds to scenarios where virtual passengers have low flow and density. In sudden event mode, a passenger flow time distribution model conforming to a negative binomial distribution is used to generate virtual passenger flow, which corresponds to scenarios such as sudden bursts of virtual passenger flow and mixed ticketing mode.
[0021] S2. Configure dynamic parameters and load intensity for each passenger flow model, and generate virtual passenger behavior sequences that conform to statistical laws (such as Poisson distribution) in real time based on the dynamic parameters.
[0022] Detailed dynamic parameters include virtual passenger flow, gate distribution, ticket type ratio, and abnormal behavior injection parameters. Virtual passenger flow includes total volume and time distribution curves; gate distribution conforms to a sine wave distribution or a uniform distribution; ticket type ratio is preset to 20% for single-journey tickets, 30% for QR codes, and 50% for NFC; abnormal behavior injection parameters include various parameters injected according to preset ratios, such as an invalid card swipe rate of 5% and a concurrent conflict rate of 3%.
[0023] Virtual passenger behavior sequences are the core data carrier for test scenarios. They accurately distinguish different passenger flow patterns through different sequence generation strategies and simulate real-world faults through controlled anomaly injection. The method for generating virtual passenger behavior sequences is as follows: S21. Select the load intensity and randomly select the passenger flow mode to generate the corresponding normal virtual passenger flow curve. Based on the normal virtual passenger flow curve, allocate the entrance and exit gates. Each gate corresponds to a normal virtual passenger flow sub-curve.
[0024] Specifically, testers activate a corresponding generation strategy based on randomly selected passenger flow patterns, thereby using the strategy to produce behavioral sequences with specific patterns in terms of time density and spatial distribution.
[0025] S22. For each normal virtual passenger flow sub-curve, construct injection rules according to the preset abnormal behavior ratio, determine the insertion frequency of abnormal behavior injection parameters, and insert the abnormal behavior injection parameters into the normal virtual passenger flow sub-curve according to the insertion frequency to obtain the initial virtual passenger behavior sequence.
[0026] Abnormal behaviors are not generated randomly, but rather, through pre-screening rules, while generating a sequence of normal behaviors, behavioral units with abnormal markers and erroneous protocol data are precisely inserted at specific positions in the sequence based on a preset abnormality ratio (e.g., setting an invalid card swipe rate of 5%). For example, for every 100 normal behaviors generated, 5 behaviors with invalid card number fields are inserted, thereby constructing a highly controllable sequence of virtual passenger behaviors that includes both normal traffic pressure and a specific abnormality ratio.
[0027] S23. Validate the initial virtual passenger behavior sequence. If it conforms to statistical laws, it is used as the virtual passenger behavior sequence; otherwise, reconstruct the injection rules.
[0028] S3. Parse the virtual passenger behavior sequence into discrete events with time-series labels, and use a multi-protocol template library to map each event into a protocol instruction that conforms to the AFC system communication specification.
[0029] Specifically, the generated sequence of virtual passenger behaviors, such as passenger P001 using an NFC card to pass through gate G01 at time T, is parsed into discrete events with time-series tags. Subsequently, each event is mapped to a protocol instruction conforming to the AFC system communication specification through a multi-protocol template library.
[0030] For IC cards, the mapping process follows the ISO / IEC 14443 protocol, which includes APDU instruction structure, CLA / INS / P1 / P2 instruction header, data field, Le / Lc length, and checksum.
[0031] For QR codes, during mapping, the interaction between the mobile terminal and the server is simulated, and protocol instructions including request headers (User-Agent, Content-Type), session ID, and payment token are generated using HTTP or HTTPS requests.
[0032] For NFC mobile payments, the mapping process follows the EMV Contactless specification, and the protocol instructions include a series of transaction process instructions, such as SELECT PPSE, SELECT AID, GPO, and read record.
[0033] For magnetic tickets or magnetic cards, the mapping process follows the ISO 7811 standard. The protocol instructions include analog data information for the second track and analog data information for the third track. The analog data information for the second track includes the ticket number, validity period, and ticket type. The analog data information for the third track includes the balance, entry / exit location markers, and number of transactions.
[0034] S4. Generate high-concurrency signals based on protocol instructions, inject the high-concurrency signals into the real AFC central server, and dynamically adjust the test load intensity and passenger flow pattern to conduct stress tests.
[0035] This invention employs an event-driven architecture and coroutine pool technology, encapsulating the protocol instructions corresponding to each virtual passenger card swipe as an independent lightweight signal task. The task is scheduled in user space through its coroutine, resulting in extremely low context switching overhead. This allows for the easy creation and management of tens of thousands or even hundreds of thousands of concurrent tasks, accurately simulating large-scale concurrent passenger flow.
[0036] Specifically, the process is as follows: S41. Based on the ticket type and behavior parameters, a complete protocol frame is dynamically assembled from the protocol template library as a protocol instruction. To improve efficiency, the instruction assembly process is optimized by pipeline, and the steps of instruction construction, data filling, verification and calculation are processed in parallel, reducing the delay of single signal generation.
[0037] S42. By using a high-precision timer (based on HPET or TSC) combined with an adaptive flow shaping algorithm, the timing and frequency of signal injection are strictly controlled. This algorithm can not only simulate the random distribution of real passenger flow, but also achieve smooth injection of instantaneous high-concurrency signals in extreme scenarios (such as morning and evening peak hours), avoiding blockage, packet loss or service crashes of the underlying communication ports of the AFC system due to instantaneous large-scale traffic, thus truly reflecting the system's stress resistance.
[0038] S43. The generated high-concurrency signals are directly injected into the real AFC central server through the TCP / IP Socket standard interface. By simulating the low-level communication behavior of the real card reader, the AFC system cannot distinguish whether the signal comes from real hardware or virtual signal.
[0039] S44. During the testing process, adjust the test load intensity in real time and smoothly, for example, gradually increasing it linearly / stepwise from 1000 times / minute to 5000 times / minute, triggering and observing the system performance inflection point and critical state; use intelligent load adjustment algorithms with key performance indicators as feedback signals to dynamically adjust the request injection rate and concurrency in the next stage, realizing the automation from breaking through the system bottleneck to continuous pressure verification. Key performance indicators include: average response time (<100ms is healthy, >500ms is congestion) and error rate (<0.1% is healthy).
[0040] S45. Randomly adjust the passenger flow mode, for example, first run the 10-minute peak mode, seamlessly switch to the 5-minute stable mode, and then trigger the sudden large passenger flow mode to simulate the scene changes in real operation.
[0041] S5. Collect multi-dimensional data during the stress test and perform performance analysis.
[0042] S51. Real-time collection of multi-dimensional data sources, including: obtaining success or failure status and response time from gate transaction logs; monitoring server resources, including CPU, memory, and disk I / O utilization; monitoring network device status, including latency and packet loss rate; and monitoring database performance metrics, including query time and connection count.
[0043] S52. Perform real-time aggregation and calculation on the collected data to automatically generate a core performance report, which includes pass rate, average / maximum / minimum transaction response time, throughput curve, fault type distribution statistics, and resource bottleneck heatmap.
[0044] S53. Based on preset rules and correlation analysis, automatically locate performance bottlenecks or root causes of failures. For example, if a sharp increase in transaction response time is detected, accompanied by a surge in database CPU, it indicates a database processing bottleneck; if high network latency is accompanied by transaction failures, it indicates a network link problem, thus resolving the stability bottleneck of the subway AFC system under high concurrency pressure.
[0045] The above is an introduction to the method embodiments. The following is a further description of the solution of the present invention through system embodiments. The system includes: The control layer presets multiple passenger flow modes according to different situations in actual application scenarios. For each passenger flow model, dynamic parameters and load intensity are configured, and virtual passenger behavior sequences that conform to statistical laws are generated in real time based on dynamic parameters. Passenger flow modes include peak mode, stable mode, sudden event mode and mixed ticket mode. Dynamic parameters include virtual passenger flow, distribution of entry and exit gates, ticket type ratio and abnormal behavior injection parameters.
[0046] The simulation layer is used to parse the virtual passenger behavior sequence into discrete events with time-series labels. Using a multi-protocol template library, each event is mapped to a protocol instruction that conforms to the AFC system communication specification. Based on the protocol instruction, a high-concurrency signal is generated and injected into the real AFC central server. The simulation layer has an embedded response simulator, which is used to simulate the response behavior of all gates in the AFC central server to the high-concurrency signal.
[0047] The execution layer is used to dynamically adjust the test load intensity and passenger flow pattern during stress testing.
[0048] The analysis layer is used to collect multi-dimensional data during the stress test and perform performance analysis. The multi-dimensional data includes gate transaction logs, server resource monitoring, network device status, and database performance indicators.
[0049] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0050] In summary, this invention provides a stress testing method and system for a metro AFC system based on protocol-level virtual signal injection, which has the following advantages: 1) It reduces the single stress test cycle from more than 4 hours in the traditional manual mode to less than 30 minutes, improving efficiency by more than 8 times, and the automated execution eliminates human interference; 2) It provides precise parameter control, allowing for accurate setting of key parameters such as peak passenger flow and abnormal ratio; 3) It easily simulates various complex and extreme scenarios, such as full load of all station turnstiles with a high abnormality rate; 4) The root cause analysis module reduces fault location time from hours to minutes, improving the speed of operation and maintenance response; 5) It eliminates the need for hardware procurement of robotic arms and card issuers, eliminating maintenance costs, maintenance time, and large-scale manual organization costs, reducing testing investment by more than 60%; 6) It supports new types of tickets, such as digital RMB payment, through software upgrades.
[0051] Furthermore, the present invention provides an electronic device including a central processing unit (CPU) that can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0052] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0053] The processing unit executes the various methods and processes described above, such as methods S1 to S5. For example, in some embodiments, methods S1 to S5 may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of methods S1 to S5 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S5 by any other suitable means (e.g., by means of firmware).
[0054] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0055] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0056] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0057] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A stress testing method for a subway AFC system based on protocol-level virtual signal injection, characterized in that, The method includes: Based on different situations in actual application scenarios, multiple passenger flow modes are preset, including peak mode, stable mode, emergency event mode and mixed ticket mode. For each passenger flow model, dynamic parameters and load intensity are configured. The dynamic parameters include virtual passenger flow, distribution of entry and exit gates, proportion of ticket types, and abnormal behavior injection parameters. Based on the dynamic parameters, a virtual passenger behavior sequence that conforms to statistical laws is generated in real time. The virtual passenger behavior sequence is parsed into discrete events with time-series labels. Using a multi-protocol template library, each event is mapped to a protocol instruction that conforms to the AFC system communication specification. Based on the aforementioned protocol instructions, a high-concurrency signal is generated and injected into the actual AFC central server. The test load intensity and passenger flow pattern are dynamically adjusted to conduct stress tests. Collect multi-dimensional data during the stress test and perform performance analysis.
2. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 1, characterized in that, During peak hours, a passenger flow time distribution model conforming to a Poisson distribution is used to generate virtual passenger flow; during stable hours, a passenger flow time distribution model conforming to a uniform distribution is used to generate virtual passenger flow; and during sudden events, a passenger flow time distribution model conforming to a negative binomial distribution is used to generate virtual passenger flow.
3. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 1, characterized in that, The distribution of the entrance and exit gates conforms to a sinusoidal distribution or a uniform distribution.
4. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 1, characterized in that, The method for generating the aforementioned virtual passenger behavior sequence is as follows: Select the load intensity and randomly select the passenger flow mode to generate the corresponding normal virtual passenger flow curve, and allocate the entrance and exit gates based on the normal virtual passenger flow curve. Each gate corresponds to a normal virtual passenger flow sub-curve. For each normal virtual passenger flow sub-curve, an injection rule is constructed according to a preset abnormal behavior ratio. The insertion frequency of the abnormal behavior injection parameter is determined, and the abnormal behavior injection parameter is inserted into the normal virtual passenger flow sub-curve according to the insertion frequency to obtain the initial virtual passenger behavior sequence. The initial virtual passenger behavior sequence is verified. If it conforms to statistical laws, it is taken as the virtual passenger behavior sequence. Conversely, rebuild the injection rules.
5. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 1, characterized in that, The aforementioned multi-protocol template library includes protocol templates for various ticket types, including: For IC cards, the mapping process follows the ISO / IEC 14443 protocol, which includes APDU instruction structure, CLA / INS / P1 / P2 instruction header, data field, Le / Lc length, and checksum. For QR codes, during mapping, the interaction between the mobile terminal and the server is simulated, and protocol instructions including request headers, session ID, and payment token are generated using HTTP / HTTPS requests. For NFC mobile payments, the EMV Contactless specification is followed during mapping, and the protocol instructions include a series of transaction process instructions; For magnetic tickets or magnetic cards, the mapping process follows the ISO 7811 standard. The protocol instructions include second track analog data information and third track analog data cell information. The second track analog data information includes the ticket number, validity period, and ticket type. The third track analog data cell information includes the balance, entry / exit station location markers, and number of transactions.
6. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 1, characterized in that, The dynamic adjustment method is as follows: using an intelligent load adjustment algorithm, with key performance indicators as feedback signals, to dynamically adjust the request injection rate and concurrency of the high-concurrency signal in the next stage.
7. The method for stress testing a subway AFC system based on protocol-level virtual signal injection according to claim 6, characterized in that, The key performance indicators include: average response time and error rate.
8. A stress testing system for a subway AFC system based on protocol-level virtual signal injection, characterized in that, The system includes: The control layer presets multiple passenger flow modes according to different situations in actual application scenarios. For each passenger flow model, dynamic parameters and load intensity are configured, and virtual passenger behavior sequences that conform to statistical laws are generated in real time based on the dynamic parameters. The passenger flow modes include peak mode, stable mode, sudden event mode and mixed ticket mode. The dynamic parameters include virtual passenger flow, gate distribution, ticket type ratio and abnormal behavior injection parameters. The simulation layer is used to parse the virtual passenger behavior sequence into discrete events with time-series labels. Using a multi-protocol template library, each event is mapped to a protocol instruction conforming to the AFC system communication specification. Based on the protocol instruction, a high-concurrency signal is generated and injected into the real AFC central server. The simulation layer has an embedded response simulator, which is used to simulate the response behavior of all gates in the AFC central server to the high-concurrency signal. The execution layer is used to dynamically adjust the test load intensity and passenger flow pattern during stress testing; The analysis layer is used to collect multi-dimensional data during the stress test and perform performance analysis. The multi-dimensional data includes gate transaction logs, server resource monitoring, network device status, and database performance indicators.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Ticket checking machine pressure testing system
CN104914330A
