CN116701233B - Transaction system testing method, equipment and medium based on high concurrency report simulation - Google Patents

Transaction system testing method, equipment and medium based on high concurrency report simulation Download PDF

Info

Publication number
CN116701233B
CN116701233B CN202310961699.7A CN202310961699A CN116701233B CN 116701233 B CN116701233 B CN 116701233B CN 202310961699 A CN202310961699 A CN 202310961699A CN 116701233 B CN116701233 B CN 116701233B
Authority
CN
China
Prior art keywords
message
transaction system
sending
connection
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310961699.7A
Other languages
Chinese (zh)
Other versions
CN116701233A (en
Inventor
王有为
张笑虹
苗咏
邹胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Huarui Software Co ltd
Shenzhen Huarui Distributed Technology Co ltd
Original Assignee
Shanghai Huarui Software Co ltd
Shenzhen Huarui Distributed Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Huarui Software Co ltd, Shenzhen Huarui Distributed Technology Co ltd filed Critical Shanghai Huarui Software Co ltd
Priority to CN202310961699.7A priority Critical patent/CN116701233B/en
Publication of CN116701233A publication Critical patent/CN116701233A/en
Application granted granted Critical
Publication of CN116701233B publication Critical patent/CN116701233B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of big data, and provides a transaction system testing method, equipment and medium based on high concurrency report simulation.

Description

Transaction system testing method, equipment and medium based on high concurrency report simulation
Technical Field
The invention relates to the technical field of big data, in particular to a transaction system testing method, device and medium based on high concurrency report simulation.
Background
In practical application scenarios, there are often scenarios where a large number of orders are simultaneously reported in a high concurrence, for example, some dealer or customer may conduct a high frequency transaction in a certain time, and a large number of orders and inquiry messages may be reported in a short time.
For the high concurrency scene, the existing newspaper system cannot support the high concurrency scene, so that the bill issuing process under the high concurrency scene needs to be simulated in the test process.
Disclosure of Invention
In view of the above, it is necessary to provide a transaction system testing method, device and medium based on high concurrency report simulation, which aims to solve the problem of inaccurate transaction system testing caused by the fact that the existing report system cannot support under the high concurrency scene.
A transaction system testing method based on high concurrency report simulation, the transaction system testing method based on high concurrency report simulation comprises:
when receiving a test request for a transaction system in a high concurrency scene, initializing issuing list configuration information and initializing a message template;
constructing a message pool according to the message template and the issuing configuration information;
constructing a connection pool, and establishing connection with the transaction system according to the connection pool;
according to the ticket sending configuration information, sending the message objects in the message pool to the transaction system through the connection handles in the connection pool, and recording corresponding sending delay dotting information in each sent message object;
When receiving a response message of each message object returned by the transaction system, calling a service processing interface in a callback handle to process each message object corresponding to the response message, and recording response delay dotting information in each message object corresponding to the response message;
generating a time delay file according to the message objects in the message pool after the bill sending is finished;
and generating a test report for the transaction system according to the time delay file.
According to a preferred embodiment of the present invention, the initializing ticket issuing configuration information includes:
acquiring an incoming command line parameter;
analyzing the command line parameters to obtain a bill sending mode, the number of bill sending and the bill sending rate, and storing the bill sending mode, the number of bill sending and the bill sending rate into a single instance configuration class;
acquiring account information and securities information;
converting the account information and the securities information into a configuration data structure, and storing the converted account information and securities information into a cache in an array form;
wherein, the bill sending mode comprises a synchronous mode and an asynchronous mode; the single sending rate comprises uniform speed, pulse and variable speed; in the bill issuing process, combining the bill issuing mode with the bill issuing speed according to the bill issuing requirement;
The initializing message template comprises:
acquiring a pre-constructed message configuration file; the message configuration file records a key-value, wherein the key represents a message number, and the value represents a template object; the message configuration file is used for configuring default values of various message fields in the template object;
analyzing the message configuration file, acquiring a corresponding default value from the message configuration file based on the message number, and filling the default value into the message template to obtain each template object in the message template;
each template object is stored in the form of an array.
According to a preferred embodiment of the present invention, the constructing a message pool according to the message template and the order-issuing configuration information includes:
acquiring the number of the orders from the order configuration information;
polling from the message template to obtain the template object based on the number of orders;
calling the message construction method of the acquired template object to construct a corresponding message object;
storing the constructed message object in the form of an array to obtain the message pool;
wherein each message object in the message pool points to a message entity in the corresponding template object with each message pointer.
According to a preferred embodiment of the present invention, the constructing a connection pool, and establishing a connection with the transaction system according to the connection pool includes:
acquiring a plurality of connection configuration information; the connection configuration information comprises account information, IP information and port information;
creating a plurality of initial connections based on the plurality of connection information;
initiating a network connection to the transaction system based on the plurality of initial connections;
when any network connection is detected to be successfully responded by the transaction system, executing login to the transaction system to obtain a login result;
checking the login result;
and when the login result passes the verification, adding a connection handle of the initial connection corresponding to the arbitrary network connection to the connection pool.
According to a preferred embodiment of the present invention, the sending the message object in the message pool to the transaction system through the connection handle in the connection pool according to the issuing configuration information includes:
acquiring a bill sending mode and a bill sending rate from the bill sending configuration information;
traversing and polling the message objects in the message pool, and traversing and polling the connection handles in the connection pool;
calling a transmitting interface of the traversed connection handle;
Carrying out serialization processing on the traversed message object in the sending interface;
according to the order sending mode and the order sending rate, sending the message object after the serialization processing to the transaction system in a single-thread mode;
wherein, the order sending rate is controlled by a while circulation control instruction and a clock_gettime function.
According to a preferred embodiment of the present invention, the recording response delay dotting information in each message object corresponding to the response message includes:
executing time delay dotting when the response message is received, and obtaining the response time delay dotting information;
and storing the response time delay dotting information into each message object corresponding to the response message.
According to a preferred embodiment of the present invention, the generating a latency file according to the message objects in the message pool includes:
traversing the message pool to obtain the message object;
acquiring the sending delay dotting information and the response delay dotting information recorded in the message object and a delay characteristic value;
and persisting the sending delay dotting information, the response delay dotting information and the delay characteristic value into a file to obtain the delay file.
According to a preferred embodiment of the present invention, the generating a test report for the transaction system according to the time delay file includes:
calculating the time difference from the order sending time to the internal response of the transaction system after receiving the corresponding order according to the time delay file, and taking the time difference as the internal response time difference;
calculating the time difference from the time of sending the order to the time of response of the exchange after receiving the corresponding order according to the time delay file, and taking the time difference as the time difference of response of the exchange;
calculating single time delay of each order based on the designated tool and the time delay file;
determining the processing performance of the transaction system on orders according to the internal response time difference and the single time delay;
determining an order full-link time delay according to the exchange response time difference;
and generating the test report according to the processing performance of the transaction system on the order and the full-link time delay of the order.
A transaction system testing device based on high concurrency report simulation, the transaction system testing device based on high concurrency report simulation comprising:
the initialization unit is used for initializing the bill configuration information and initializing the message template when receiving a test request for the transaction system in a high concurrency scene;
The construction unit is used for constructing a message pool according to the message template and the issuing configuration information;
the connection unit is used for constructing a connection pool and establishing connection with the transaction system according to the connection pool;
the sending unit is used for sending the message objects in the message pool to the transaction system through the connection handle in the connection pool according to the ticket sending configuration information, and recording corresponding sending delay dotting information in each sent message object;
the processing unit is used for calling a business processing interface in a callback handle to process each message object corresponding to the response message when receiving the response message of each message object returned by the transaction system, and recording response delay dotting information in each message object corresponding to the response message;
the generating unit is used for generating a time delay file according to the message objects in the message pool after the bill sending is finished;
the generating unit is further configured to generate a test report for the transaction system according to the delay file.
A computer device, the computer device comprising:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the transaction system testing method based on the high concurrency report simulation.
A computer readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the high concurrency statement simulation based transaction system testing method.
According to the technical scheme, when a test request for the transaction system under the high concurrency scene is received, a message pool is constructed according to the initialized message template and the issuing configuration information so as to simulate the scene of high concurrency massive orders and simultaneously reporting the orders, connection is further established according to the constructed connection pool and the transaction system, a message object in the message pool is sent to the transaction system through a connection handle in the connection pool according to the issuing configuration information, so that the issuing simulation under the complex transaction scene with high throughput is realized by combining the message pool and the connection pool, sending delay dotting information and response delay dotting information are recorded in the message object so as to generate a delay file, and a test report for the transaction system is generated according to the delay file, thereby realizing performance test for the transaction system under the high concurrency scene.
Drawings
FIG. 1 is a flow chart of a transaction system testing method based on high concurrency report simulation according to a preferred embodiment of the present invention.
FIG. 2 is a functional block diagram of a transaction system testing device based on high concurrency report simulation according to a preferred embodiment of the present invention.
FIG. 3 is a schematic diagram of a computer device for implementing a transaction system testing method based on high concurrency report simulation according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a transaction system testing method based on high concurrency report simulation according to a preferred embodiment of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The transaction system testing method based on the high concurrency report simulation is applied to one or more computer devices, wherein the computer device is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device and the like.
The computer device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The computer device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
S10, initializing issuing list configuration information and initializing a message template when a test request for a transaction system under a high concurrency scene is received.
For example: when certain dealer or customer makes high frequency transactions for a period of time, a large number of orders and inquiry messages will appear in a short period of time, at which point the high concurrency scenario can be determined.
In this embodiment, the test request may be triggered by a tester or developer, and the present invention is not limited.
In this embodiment, the initializing ticket issuing configuration information includes:
acquiring an incoming command line parameter;
Analyzing the command line parameters to obtain a bill sending mode, the number of bill sending and the bill sending rate, and storing the bill sending mode, the number of bill sending and the bill sending rate into a single instance configuration class;
acquiring account information and securities information;
converting the account information and the securities information into a configuration data structure, and storing the converted account information and securities information into a cache in an array form; for example: the security information can comprise security codes and the like, and according to an actual language environment, account information and security information in a specific format can be read and analyzed through a C++ file, a specific data structure is configured according to the file format, and then a C++ array is used for storage and caching;
wherein, the bill sending mode comprises a synchronous mode and an asynchronous mode; the single sending rate comprises uniform speed, pulse and variable speed; and in the bill issuing process, combining the bill issuing mode with the bill issuing speed according to the bill issuing requirement. For example: according to the actual bill demand, the synchronous mode and the uniform speed can be combined, or the synchronous mode and the variable speed can be combined, so that various different combination modes between the bill mode and the bill speed can be realized, and the invention is not limited.
By analyzing the command line parameters, configuration information such as the order sending mode, the order sending quantity, the order sending rate and the like can be obtained, so that the order sending behavior can be effectively controlled.
The initializing message template comprises:
acquiring a pre-constructed message configuration file; the message configuration file records a key-value, wherein the key represents a message number, and the value represents a template object; the message configuration file is used for configuring default values of various message fields in the template object;
analyzing the message configuration file, acquiring a corresponding default value from the message configuration file based on the message number, and filling the default value into the message template to obtain each template object in the message template;
each template object is stored in the form of an array.
For example: the message configuration file can be in an xml file format, wherein default values of various service message fields are configured, a specific template object is obtained through a message number in the message configuration file, the message fields in the template object are initialized, and the initialized template object is stored by using an array.
And initializing the issuing list configuration information and the message template to provide a basis for constructing a large number of messages and simulating a high concurrency message issuing scene.
S11, constructing a message pool according to the message template and the order sending configuration information.
In this embodiment, the constructing a message pool according to the message template and the ticket issuing configuration information includes:
acquiring the number of the orders from the order configuration information;
polling from the message template to obtain the template object based on the number of orders;
calling the message construction method of the acquired template object to construct a corresponding message object;
storing the constructed message object in the form of an array to obtain the message pool;
wherein each message object in the message pool points to a message entity in the corresponding template object with each message pointer.
In the above embodiment, the service message only needs to be initialized once in the template object, and only has entity objects in the template object and occupies memory, and in the message object generated by the message template construction, only one message pointer is used to point to the message entity actually existing in the template object, so as to save memory occupation, ensure feasibility of constructing a large number of orders, and avoid problem of OOM killer (Out Of Memory killer) in the system.
S12, constructing a connection pool, and establishing connection with the transaction system according to the connection pool.
In this embodiment, the constructing a connection pool, and establishing a connection with the transaction system according to the connection pool includes:
acquiring a plurality of connection configuration information; wherein the connection configuration information includes account information, IP (Internet Protocol ) information, port information;
creating a plurality of initial connections based on the plurality of connection information;
initiating a network connection to the transaction system based on the plurality of initial connections;
when any network connection is detected to be successfully responded by the transaction system, executing login to the transaction system to obtain a login result;
checking the login result;
and when the login result passes the verification, adding a connection handle of the initial connection corresponding to the arbitrary network connection to the connection pool.
Specifically, a connection pool is initialized, the connection is logged in the transaction system, network connection is initiated to the transaction system, a callback message processing handle is registered, response and return returned in the bill reporting process are processed in the callback message processing handle, the login process of the transaction system is executed after connection, and relevant verification is carried out on login results, so that the connection and the login process are guaranteed to be correct. The connection handle which is successfully logged in is stored in the connection pool array, a plurality of network connections can be initiated by using different account information, IP information, port information and the like, and the network connections are stored in the connection pool array, so that a test scene under the multi-connection is simulated.
And S13, according to the issuing configuration information, sending the message objects in the message pool to the transaction system through the connection handle in the connection pool, and recording corresponding sending delay dotting information in each sent message object.
In this embodiment, the sending the message object in the message pool to the transaction system through the connection handle in the connection pool according to the ticket issuing configuration information includes:
acquiring a bill sending mode and a bill sending rate from the bill sending configuration information;
traversing and polling the message objects in the message pool, and traversing and polling the connection handles in the connection pool;
calling a transmitting interface of the traversed connection handle;
carrying out serialization processing on the traversed message object in the sending interface;
according to the order sending mode and the order sending rate, sending the message object after the serialization processing to the transaction system in a single-thread mode;
wherein, the order sending rate is controlled by a while circulation control instruction and a clock_gettime function. The delay is performed through a while cycle, and the clock_gettime provided by linux is used for guaranteeing the accuracy of the time delay of dotting, so that the accuracy of the time delay and the rate of issuing a bill is guaranteed.
Specifically, in the synchronous mode, the next message needs to be sent after the response of the last sent message is received, and in the asynchronous mode, the waiting is not needed; for the control of the sending rate, the sleep command is not used for controlling the sending interval so as to avoid the influence on the time delay and the sending rate caused by the dormancy of the CPU (Central Processing Unit ), the embodiment adopts a while cycle, waits for the time delay interval to reach the time delay interval set by the single sending rate, so that the CPU is ensured to run in the corresponding sending thread all the time, and the accuracy of the sending time delay interval and the sending rate is ensured. Through experimental study, in practical test, the transmission rate TPS (Transactions Per Second, the number of transactions transmitted per second) can reach more than 10 ten thousand in an asynchronous mode.
Before the message is sent, all the message objects and the connection objects are constructed in advance and are respectively stored in the message pool array and the connection pool array, and the message is only required to be sequenced by calling the related interfaces and sent through the network, so that the method has extremely low time delay occupation, the time delay of issuing a bill is prevented from being influenced by the construction process of the message in the sending process, the performance of issuing the bill is ensured, and the TPS of issuing the bill is improved.
In addition, the message object after the serialization processing is sent to the transaction system in a single-thread mode, the interaction with the callback thread is completed through an atomic variable without a locking process, and no I/O (Input/Output) processing is performed in the sending thread, so that the sending thread is ensured to monopolize one CPU, and the influence of frequent CPU switching on the sending time delay is avoided.
In this embodiment, the recording the corresponding transmission delay dotting information in each transmitted message object includes:
when the transmitting interface is called, the transmitting delay dotting is carried out on the transmitted message object, and the transmitting delay dotting information is stored in the corresponding message object so as to accurately record the message transmitting time.
S14, when receiving the response message of each message object returned by the transaction system, calling a service processing interface in a callback handle to process each message object corresponding to the response message, and recording response delay dotting information in each message object corresponding to the response message.
Specifically, a service processing interface in the callback handle is called to perform relevant service logic processing on each message object corresponding to the response message, and an actual transaction scene is restored.
In this embodiment, the recording the response delay dotting information in each message object corresponding to the response message includes:
executing time delay dotting when the response message is received, and obtaining the response time delay dotting information;
and storing the response time delay dotting information into each message object corresponding to the response message.
By the above embodiment, the response time can be accurately recorded by time delay dotting.
S15, after the order sending is finished, generating a time delay file according to the message objects in the message pool.
In this embodiment, the generating a latency file according to the message objects in the message pool includes:
traversing the message pool to obtain the message object;
acquiring the sending delay dotting information and the response delay dotting information recorded in the message object and a delay characteristic value;
and persisting the sending delay dotting information, the response delay dotting information and the delay characteristic value into a file to obtain the delay file.
The time delay characteristic value may include an order number, and an order sending time stamp is equal to a time delay related characteristic.
In the embodiment, the performance condition of the system can be accurately judged and analyzed through the lasting time delay file.
S16, generating a test report for the transaction system according to the time delay file.
In this embodiment, the generating the test report for the transaction system according to the time delay file includes:
calculating the time difference from the order sending time to the internal response of the transaction system after receiving the corresponding order according to the time delay file, and taking the time difference as the internal response time difference;
calculating the time difference from the time of sending the order to the time of response of the exchange after receiving the corresponding order according to the time delay file, and taking the time difference as the time difference of response of the exchange;
calculating single time delay of each order based on the designated tool and the time delay file;
determining the processing performance of the transaction system on orders according to the internal response time difference and the single time delay;
determining an order full-link time delay according to the exchange response time difference;
and generating the test report according to the processing performance of the transaction system on the order and the full-link time delay of the order.
Wherein the designated tool may be a python or the like processing tool.
By the above embodiment, analysis can be performed based on the time delay to reflect the processing performance level of the system.
According to the technical scheme, when a test request for the transaction system under the high concurrency scene is received, a message pool is constructed according to the initialized message template and the issuing configuration information so as to simulate the scene of high concurrency massive orders and simultaneously reporting the orders, connection is further established according to the constructed connection pool and the transaction system, a message object in the message pool is sent to the transaction system through a connection handle in the connection pool according to the issuing configuration information, so that the issuing simulation under the complex transaction scene with high throughput is realized by combining the message pool and the connection pool, sending delay dotting information and response delay dotting information are recorded in the message object so as to generate a delay file, and a test report for the transaction system is generated according to the delay file, thereby realizing performance test for the transaction system under the high concurrency scene.
FIG. 2 is a functional block diagram of a transaction system testing device based on high concurrency report simulation according to a preferred embodiment of the present invention. The transaction system testing device 11 based on the high concurrency report simulation comprises an initialization unit 110, a construction unit 111, a connection unit 112, a sending unit 113, a processing unit 114 and a generation unit 115. The module/unit referred to in the present invention refers to a series of computer program segments, which are stored in a memory, capable of being executed by a processor and of performing a fixed function. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
The initializing unit 110 is configured to initialize the issuing configuration information and initialize the message template when receiving a test request for the transaction system in a high concurrency scenario;
the construction unit 111 is configured to construct a message pool according to the message template and the order sending configuration information;
the connection unit 112 is configured to construct a connection pool, and establish a connection with the transaction system according to the connection pool;
the sending unit 113 is configured to send the message objects in the message pool to the transaction system through the connection handle in the connection pool according to the ticket sending configuration information, and record corresponding sending delay dotting information in each sent message object;
The processing unit 114 is configured to, when receiving a response message returned by the transaction system for each message object, invoke a service processing interface in a callback handle to process each message object corresponding to the response message, and record response delay dotting information in each message object corresponding to the response message;
the generating unit 115 is configured to generate a delay file according to the message objects in the message pool after the order sending is ended;
the generating unit 115 is further configured to generate a test report for the transaction system according to the time delay file.
According to the technical scheme, when a test request for the transaction system under the high concurrency scene is received, a message pool is constructed according to the initialized message template and the issuing configuration information so as to simulate the scene of high concurrency massive orders and simultaneously reporting the orders, connection is further established according to the constructed connection pool and the transaction system, a message object in the message pool is sent to the transaction system through a connection handle in the connection pool according to the issuing configuration information, so that the issuing simulation under the complex transaction scene with high throughput is realized by combining the message pool and the connection pool, sending delay dotting information and response delay dotting information are recorded in the message object so as to generate a delay file, and a test report for the transaction system is generated according to the delay file, thereby realizing performance test for the transaction system under the high concurrency scene.
Fig. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing a transaction system testing method based on high concurrency report simulation.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program stored in the memory 12 and executable on the processor 13, for example a transaction system test program based on a high concurrency report simulation.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation of the computer device 1, the computer device 1 may be a bus type structure, a star type structure, the computer device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the computer device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the computer device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, such as a removable hard disk of the computer device 1. The memory 12 may in other embodiments also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 may be used not only for storing application software installed in the computer device 1 and various types of data, such as codes of transaction system test programs based on high-concurrency report simulation, but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects the respective components of the entire computer device 1 using various interfaces and lines, executes or executes programs or modules stored in the memory 12 (for example, executes a transaction system test program based on a high concurrency report simulation, etc.), and invokes data stored in the memory 12 to perform various functions of the computer device 1 and process data.
The processor 13 executes the operating system of the computer device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the various embodiments of the transaction system testing method based on high concurrency report modeling described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the computer device 1. For example, the computer program may be divided into an initialization unit 110, a construction unit 111, a connection unit 112, a transmission unit 113, a processing unit 114, a generation unit 115.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute the portions of the transaction system testing method based on the high concurrency report sheet simulation according to the embodiments of the present invention.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one straight line is shown in fig. 3, but not only one bus or one type of bus. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the computer device 1 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 13 via a power management means, whereby the functions of charge management, discharge management, and power consumption management are achieved by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
Further, the computer device 1 may also comprise a network interface, optionally comprising a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer device 1 and other computer devices.
The computer device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only a computer device 1 with components 12-13, it being understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the computer device 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the computer device 1 stores a plurality of instructions to implement a transaction system testing method based on high concurrency report modeling, the processor 13 being executable to implement:
when receiving a test request for a transaction system in a high concurrency scene, initializing issuing list configuration information and initializing a message template;
constructing a message pool according to the message template and the issuing configuration information;
constructing a connection pool, and establishing connection with the transaction system according to the connection pool;
according to the ticket sending configuration information, sending the message objects in the message pool to the transaction system through the connection handles in the connection pool, and recording corresponding sending delay dotting information in each sent message object;
when receiving a response message of each message object returned by the transaction system, calling a service processing interface in a callback handle to process each message object corresponding to the response message, and recording response delay dotting information in each message object corresponding to the response message;
generating a time delay file according to the message objects in the message pool after the bill sending is finished;
And generating a test report for the transaction system according to the time delay file.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
The data in this case were obtained legally.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The invention is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. The transaction system testing method based on the high concurrency report simulation is characterized by comprising the following steps of:
when receiving a test request for a transaction system in a high concurrency scene, initializing issuing list configuration information and initializing a message template;
constructing a message pool according to the message template and the issuing configuration information;
constructing a connection pool, and establishing connection with the transaction system according to the connection pool;
According to the ticket sending configuration information, sending the message objects in the message pool to the transaction system through the connection handles in the connection pool, and recording corresponding sending delay dotting information in each sent message object;
when receiving a response message of each message object returned by the transaction system, calling a service processing interface in a callback handle to process each message object corresponding to the response message, and recording response delay dotting information in each message object corresponding to the response message;
generating a time delay file according to the message objects in the message pool after the bill sending is finished;
and generating a test report for the transaction system according to the time delay file.
2. The transaction system testing method based on high concurrency report sheet simulation as claimed in claim 1, wherein:
the initialization order configuration information comprises:
acquiring an incoming command line parameter;
analyzing the command line parameters to obtain a bill sending mode, the number of bill sending and the bill sending rate, and storing the bill sending mode, the number of bill sending and the bill sending rate into a single instance configuration class;
acquiring account information and securities information;
Converting the account information and the securities information into a configuration data structure, and storing the converted account information and securities information into a cache in an array form;
wherein, the bill sending mode comprises a synchronous mode and an asynchronous mode; the single sending rate comprises uniform speed, pulse and variable speed; in the bill issuing process, combining the bill issuing mode with the bill issuing speed according to the bill issuing requirement;
the initializing message template comprises:
acquiring a pre-constructed message configuration file; the message configuration file records a key-value, wherein the key represents a message number, and the value represents a template object; the message configuration file is used for configuring default values of various message fields in the template object;
analyzing the message configuration file, acquiring a corresponding default value from the message configuration file based on the message number, and filling the default value into the message template to obtain each template object in the message template;
each template object is stored in the form of an array.
3. The transaction system testing method based on high concurrency report sheet simulation of claim 2, wherein constructing a message pool according to the message template and the issue sheet configuration information comprises:
Acquiring the number of the orders from the order configuration information;
polling from the message template to obtain the template object based on the number of orders;
calling the message construction method of the acquired template object to construct a corresponding message object;
storing the constructed message object in the form of an array to obtain the message pool;
wherein each message object in the message pool points to a message entity in the corresponding template object with each message pointer.
4. The transaction system testing method based on high concurrency report sheet simulation of claim 1, wherein constructing a connection pool and establishing a connection with the transaction system according to the connection pool comprises:
acquiring a plurality of connection configuration information; the connection configuration information comprises account information, IP information and port information;
creating a plurality of initial connections based on the plurality of connection configuration information;
initiating a network connection to the transaction system based on the plurality of initial connections;
when any network connection is detected to be successfully responded by the transaction system, executing login to the transaction system to obtain a login result;
checking the login result;
And when the login result passes the verification, adding a connection handle of the initial connection corresponding to the arbitrary network connection to the connection pool.
5. The transaction system testing method based on high concurrency report modeling of claim 2, wherein the sending the message objects in the message pool to the transaction system through the connection handles in the connection pool according to the issue ticket configuration information includes:
acquiring a bill sending mode and a bill sending rate from the bill sending configuration information;
traversing and polling the message objects in the message pool, and traversing and polling the connection handles in the connection pool;
calling a transmitting interface of the traversed connection handle;
carrying out serialization processing on the traversed message object in the sending interface;
according to the order sending mode and the order sending rate, sending the message object after the serialization processing to the transaction system in a single-thread mode;
wherein, the order sending rate is controlled by a while circulation control instruction and a clock_gettime function.
6. The transaction system testing method based on high concurrency report ticket simulation according to claim 1, wherein the recording of response delay dotting information in each message object corresponding to the response message comprises:
Executing time delay dotting when the response message is received, and obtaining the response time delay dotting information;
and storing the response time delay dotting information into each message object corresponding to the response message.
7. The transaction system testing method based on high concurrency report sheet simulation of claim 1, wherein generating a latency file from message objects in the message pool comprises:
traversing the message pool to obtain the message object;
acquiring the sending delay dotting information and the response delay dotting information recorded in the message object and a delay characteristic value;
and persisting the sending delay dotting information, the response delay dotting information and the delay characteristic value into a file to obtain the delay file.
8. The transaction system testing method based on high concurrency report modeling of claim 1, wherein generating a test report for the transaction system based on the latency file includes:
calculating the time difference from the order sending time to the internal response of the transaction system after receiving the corresponding order according to the time delay file, and taking the time difference as the internal response time difference;
calculating the time difference from the time of sending the order to the time of response of the exchange after receiving the corresponding order according to the time delay file, and taking the time difference as the time difference of response of the exchange;
Calculating single time delay of each order based on the designated tool and the time delay file;
determining the processing performance of the transaction system on orders according to the internal response time difference and the single time delay;
determining an order full-link time delay according to the exchange response time difference;
and generating the test report according to the processing performance of the transaction system on the order and the full-link time delay of the order.
9. A computer device, the computer device comprising:
a memory storing at least one instruction; and
A processor executing instructions stored in the memory to implement the transaction system testing method based on high concurrency report sheet simulation of any one of claims 1 to 8.
10. A computer-readable storage medium, characterized by: the computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the high concurrency report sheet simulation based transaction system testing method of any one of claims 1 to 8.
CN202310961699.7A 2023-08-02 2023-08-02 Transaction system testing method, equipment and medium based on high concurrency report simulation Active CN116701233B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310961699.7A CN116701233B (en) 2023-08-02 2023-08-02 Transaction system testing method, equipment and medium based on high concurrency report simulation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310961699.7A CN116701233B (en) 2023-08-02 2023-08-02 Transaction system testing method, equipment and medium based on high concurrency report simulation

Publications (2)

Publication Number Publication Date
CN116701233A CN116701233A (en) 2023-09-05
CN116701233B true CN116701233B (en) 2024-02-06

Family

ID=87841839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310961699.7A Active CN116701233B (en) 2023-08-02 2023-08-02 Transaction system testing method, equipment and medium based on high concurrency report simulation

Country Status (1)

Country Link
CN (1) CN116701233B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009037519A (en) * 2007-08-03 2009-02-19 Toshiba Corp Test scenario creating apparatus, stock trading test system and computer program
CN113254894A (en) * 2021-04-30 2021-08-13 贵州小宝健康科技有限公司 Content management system oriented to high-concurrency access optimization
CN116501610A (en) * 2023-03-13 2023-07-28 深圳华锐分布式技术股份有限公司 Method, device, equipment and medium for testing market transaction system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009037519A (en) * 2007-08-03 2009-02-19 Toshiba Corp Test scenario creating apparatus, stock trading test system and computer program
CN113254894A (en) * 2021-04-30 2021-08-13 贵州小宝健康科技有限公司 Content management system oriented to high-concurrency access optimization
CN116501610A (en) * 2023-03-13 2023-07-28 深圳华锐分布式技术股份有限公司 Method, device, equipment and medium for testing market transaction system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
低延时期货交易系统的优化与测试;雷达;沈益明;;现代计算机(09);全文 *
雷达 ; 沈益明 ; .低延时期货交易系统的优化与测试.现代计算机.2020,(09),全文. *

Also Published As

Publication number Publication date
CN116701233A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
WO2023056943A1 (en) Internet of things rule engine-based terminal control method and apparatus, and device and medium
CN113806434B (en) Big data processing method, device, equipment and medium
CN113485685A (en) API interface creating method and device, electronic equipment and medium
CN116701233B (en) Transaction system testing method, equipment and medium based on high concurrency report simulation
CN115314570B (en) Data issuing method, device, equipment and medium based on protocol development framework
CN114816371B (en) Message processing method, device, equipment and medium
CN114268559B (en) Directional network detection method, device, equipment and medium based on TF-IDF algorithm
CN113032543B (en) Dialogue diagnosis method, device, equipment and medium based on stack structure
CN115119197A (en) Wireless network risk analysis method, device, equipment and medium based on big data
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN115277859B (en) Request scheduling method, device, equipment and medium
CN116662208B (en) Transaction testing method, device and medium based on distributed baffle
CN116934263B (en) Product batch admittance method, device, equipment and medium
CN115731047B (en) Batch order processing method, equipment and medium
CN116361753B (en) Authority authentication method, device, equipment and medium
CN116414699B (en) Operation and maintenance testing method, device, equipment and medium
CN114362968B (en) Method, device, equipment and medium for acquiring random number by block chain
CN116483747B (en) Quotation snapshot issuing method, device, equipment and medium
CN117316359B (en) Blood detection process tracking method, device, equipment and medium
CN116225971B (en) Transaction interface compatibility detection method, device, equipment and medium
CN115964307B (en) Automatic test method, device, equipment and medium for transaction data
CN113449037B (en) AI-based SQL engine calling method, device, equipment and medium
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium
CN115277469A (en) Weak network visualization control method and device, electronic equipment and readable storage medium
CN116414366A (en) Middleware interface generation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant