CN113760761A - Automatic testing method and device based on software and hardware stock market system - Google Patents

Automatic testing method and device based on software and hardware stock market system Download PDF

Info

Publication number
CN113760761A
CN113760761A CN202111043752.2A CN202111043752A CN113760761A CN 113760761 A CN113760761 A CN 113760761A CN 202111043752 A CN202111043752 A CN 202111043752A CN 113760761 A CN113760761 A CN 113760761A
Authority
CN
China
Prior art keywords
data
script
hardware
testing
automatic
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.)
Pending
Application number
CN202111043752.2A
Other languages
Chinese (zh)
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 Kingstar Fintech Co Ltd
Original Assignee
Shanghai Kingstar Fintech 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 Kingstar Fintech Co Ltd filed Critical Shanghai Kingstar Fintech Co Ltd
Priority to CN202111043752.2A priority Critical patent/CN113760761A/en
Publication of CN113760761A publication Critical patent/CN113760761A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • 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
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an automatic testing method and device based on a software and hardware stock market system, wherein an automatic Jenkins script comprising at least one testing script is preset, and the testing script is used for customizing the corresponding full-link automatic testing steps, and the method comprises the following steps: acquiring a message of a current software and hardware security market system, and testing the message based on a python automation script to obtain first data; acquiring second data analyzed by hardware based on a corresponding test script in the automatic Jenkins script; and comparing the first data with the second data, and generating a test report based on the comparison result. According to the process, the second data analyzed by the hardware are obtained based on the corresponding test script in the automatic Jenkins script, and the test script is used for customizing the corresponding full-link automatic test steps, so that operations such as hardware version firing, hardware version checking and the like are not needed, the test time is shortened, and the test efficiency is improved.

Description

Automatic testing method and device based on software and hardware stock market system
Technical Field
The invention relates to the technical field of automatic testing, in particular to an automatic testing method and device based on a software and hardware stock market system.
Background
With the application of hardware technology in the financial industry, particularly the field of securities quotation, the securities quotation system combining software and hardware is generated.
The corresponding software and hardware securities quotation system is arranged for each exchange, when the software and hardware securities quotation system is tested, a manual testing mode is adopted in the prior art, and the manual execution testing steps are complicated: the method comprises the steps of testing a python automation script which is required to be operated by a message in a quotation data source, analyzing the quotation data source, burning a hardware version, checking the hardware version, checking a static file, modifying the date of the static file to be matched with the current test date, modifying hardware setting to be matched with the data source, starting a software system and starting a receiving end.
The manual test software and hardware stock market system is tedious and time-consuming, and when a plurality of market data sources are tested repeatedly, the above operations need to be executed repeatedly, so that a lot of time is spent, and the test efficiency is low.
Disclosure of Invention
In view of the above, the invention provides an automated testing method and device based on a software and hardware stock quotation system, which are used for solving the problems that the manual testing of the software and hardware stock quotation system is complicated and time-consuming, and when a plurality of quotation data sources are repeatedly tested, the operations need to be repeatedly executed, a large amount of time is spent, and the testing efficiency is low. The specific scheme is as follows:
an automatic testing method based on a software and hardware stock market system presets an automatic Jenkins script, wherein the automatic Jenkins script comprises at least one testing script, the testing script is used for customizing a corresponding full-link automatic testing step, and the testing method comprises the following steps:
under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data;
acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script;
comparing the first data with the second data to obtain a comparison result;
and generating a test report based on the comparison result.
Optionally, the method for testing the message based on the python automation script to obtain the first data includes:
acquiring a payload in the message;
splicing the effective loads based on the identifiers in the effective loads to obtain target effective loads;
and analyzing the market conditions of the target effective load to obtain first data.
Optionally, the method for obtaining second data analyzed by hardware in the current software and hardware securities market system based on the corresponding test script in the automatic Jenkins script includes:
acquiring a target test script corresponding to the front software and hardware stock market system;
and analyzing the message in the current software and hardware security market system based on the target test script to obtain second data.
The method optionally compares the first data with the second data, and includes:
classifying the first data based on the market situation category to obtain first target data;
classifying the second data based on the market situation category to obtain second target data;
and comparing corresponding items in the first target data and the second target data, and taking a difference item in the first target data and the second target data as a comparison result.
The above method, optionally, further includes: the python automation script is stored in the gitlab,
and in the case of receiving an update instruction to the python automation script, storing the updated python in the gitlab.
The utility model provides an automatic testing arrangement based on software and hardware securities market information system sets up automatic Jenkins script in advance, wherein, automatic Jenkins script contains at least one test script, test script is used for customizing the automatic test step of full link that corresponds, testing arrangement includes:
the system comprises a first testing module, a second testing module and a third testing module, wherein the first testing module is used for acquiring a message of a current software and hardware stock market system under the condition of receiving an automatic testing request of the current software and hardware stock market system, and testing the message based on a python automatic script to acquire first data;
the second testing module is used for acquiring second data analyzed by hardware in the current software and hardware stock quotation system based on a corresponding testing script in the automatic Jenkins script;
the comparison module is used for comparing the first data with the second data to obtain a comparison result;
and the generating module is used for generating a test report based on the comparison result.
The above apparatus, optionally, the first testing module includes:
a first obtaining unit, configured to obtain a payload in the message;
the splicing unit is used for splicing the effective loads based on the identifiers in the effective loads to obtain target effective loads;
and the analysis unit is used for carrying out market analysis on the target effective load to obtain first data.
The above apparatus, optionally, the second testing module includes:
the second acquisition unit is used for acquiring a target test script corresponding to the front software and hardware stock market system;
and the analysis unit is used for analyzing the message in the current software and hardware security market system based on the target test script to obtain second data.
The above apparatus, optionally, the comparison module includes:
the first classification unit is used for classifying the first data based on the market situation category to obtain first target data;
the second classification unit is used for classifying the second data based on the market situation category to obtain second target data;
and the comparison unit is used for comparing corresponding items in the first target data and the second target data, and taking a difference item in the first target data and the second target data as a comparison result.
Optionally, the apparatus described above, wherein the python automation script is stored in the gitlab, further comprising:
and the storage module is used for storing the updated python in the gitlab under the condition of receiving an updating instruction of the python automation script.
Compared with the prior art, the invention has the following advantages:
the invention discloses an automatic testing method and device based on a software and hardware stock market system, wherein an automatic Jenkins script is preset, the automatic Jenkins script comprises at least one testing script, the testing script is used for customizing a corresponding full-link automatic testing step, and the testing method comprises the following steps: under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data; acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script; comparing the first data with the second data to obtain a comparison result; and generating a test report based on the comparison result. According to the process, the second data analyzed by the hardware are obtained based on the corresponding test script in the automatic Jenkins script, and the test script is used for customizing the corresponding full-link automatic test steps, so that operations such as hardware version firing, hardware version checking and the like are not needed, the test time is shortened, and the test efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an automated testing method based on a software and hardware securities market system disclosed in an embodiment of the present application;
FIG. 2 is a diagram of a full link test architecture disclosed in an embodiment of the present application;
fig. 3 is a block diagram of an automated testing apparatus based on a software and hardware securities market system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The invention discloses an automatic test method and device based on a software and hardware stock quotation system, which are applied to the automatic test process of the software and hardware stock quotation system. The manual test software and hardware stock market system is tedious and time-consuming, and when a plurality of market data sources are tested repeatedly, the above operations need to be executed repeatedly, so that a lot of time is spent, and the test efficiency is low. In order to solve the above problems, the present invention provides an automated testing method based on a software and hardware securities market system, an execution flow of the testing method is shown in fig. 1, an automated Jenkins script is preset in the testing method, wherein the automated Jenkins script comprises at least one testing script, and the testing script is used for customizing a corresponding full link automated testing step.
The automatic Jenkins script is a full-link automatic Jenkins script, steps of manually executing full-link testing are customized according to Jenkins workflow framework Pipeline, the steps are converted into small tasks, the tasks are sequentially connected in series, and the automatic Jenkins script is the basis for achieving full-link automatic testing. The automatic Jenkins script is provided with a software and hardware version publishing directory, a software installation directory, a market data packet directory, a hardware resetting shell script directory, a hardware configuration script directory, a hardware analysis data directory, a python analysis data directory, a gitlab server address and the like.
The test method comprises the following steps:
s101, under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data;
in the embodiment of the invention, part of the code of the python automation script is as follows: wherein f is a source of stock exchange quotations.
Reading a data packet content code in the python analysis script: TCP (Transmission control protocol)
Figure BDA0003250433760000061
Figure BDA0003250433760000071
The python automation script is a core for verifying whether a full link is accurate, and comprises: a market analysis script, a data comparison script and a test report script. The market analysis script supports an exchange, a deep exchange, a gold exchange, a date and a gold exchange. The market analysis is divided into three parts: the method comprises the following steps of obtaining effective loads in messages, carrying out disorder recombination on the effective loads of the messages, and analyzing quotation, wherein the messages are obtained based on a quotation data source, and the specific process is as follows:
firstly, the process for acquiring the payload in the message is as follows: reading the data packet content through a dpkt library of python, wherein the dptk library is used for analyzing the messages, acquiring the message acquisition time of a data frame of each message physical layer, the effective load of a transmission layer and the message sequence number of a TCP message, and storing the message acquisition time, the effective load and the message sequence number into a data dictionary which takes the message sequence number and the message acquisition time as unique key values and takes the value as the effective load; for UDP messages, judging whether the messages are subpackaged or not according to flag bits (Flags) of an IP layer, if the messages are not subpackaged, directly obtaining the effective load of a transmission layer and storing the effective load into a list cache, and if the messages are subpackaged, obtaining an Identification number (Identification) of the IP layer of the UDP messages by using a dpkt library and storing the Identification number as a key value into a data dictionary with the value as the flag bits and the effective load;
then, the process of performing out-of-order reassembly on the payload of the message is as follows: circularly traversing the data dictionary, taking the message serial number in the data dictionary as an identifier, obtaining the next message serial number of the currently traversed message serial number for the TCP message according to the calculation rule of the next message serial number of the current message (the next message serial number is the current message serial number + the number of bytes of the current message payload), splicing the value payloads of the key, and placing the spliced payload character string into a large cache after traversing is completed; for the UDP packet, the packets of the same group of identification numbers are recombined and spliced according to the next flag calculation rule (the next flag bit is the current flag bit + the number of bytes of payload of the current packet/8), and are placed in the list cache;
finally, the processing process aiming at the analysis market is as follows: the analysis process in the embodiment of the present invention is exemplified by deep exchanges, gold exchanges, and dates, but is not limited to the exchanges. And analyzing the message into first data based on a market analysis processing process, wherein the first data is related to the selection of the exchange.
The resolving process for the deep crossing comprises the following steps: spot (stocks, funds, bonds and the like) centralized bidding transaction snapshot quotations, pledge type buyback transaction snapshot quotations, option centralized bidding transaction snapshot quotations, index snapshot quotations, volume statistics index snapshot quotations, national evidence index snapshot quotations, spot (stocks, funds, bonds and the like) centralized bidding transaction one-by-one consignation quotations, pledge type buyback transaction one-by-one consignation quotations, option centralized bidding transaction one-by-one consignation quotations, spot (stocks, funds, bonds and the like) centralized bidding transaction one-by-one consignation quotations, pledge type buyback transaction one-by-one consignation quotations and option centralized bidding transaction one-by-one consignation quotations.
The deep intersection parsing logic comprises: the effective load packet of each message of the deep crossing data packet is a service message of the deep crossing, the message structure of the deep crossing is a message head, a message body and a message tail, the message head defines the message type of the message, namely the market category and the message body length, the message body is service data of the market category, and the message tail is the checksum of the message. For a payload character string spliced by TCP messages, dividing the payload character string into complete messages according to message types, putting the complete messages into a queue, taking data from the queue when the number of data in the queue reaches a configured value, analyzing fields one by one according to a data structure defined by transaction if the market category in a message header is data needing analysis, putting the data into a result list cache, and finally landing the data to a file (first data); for the payload spliced by the UDP message, if the market type in the message header is the data to be analyzed, the traversal list carries out field-by-field analysis according to the data structure defined by the transaction, the data is put into the cache of the result list, and finally the data is landed on the file (first data).
The parsing process for the exchange includes: bid snapshot quotation, bid one-by-one consignment quotation, bid one-by-one deal quotation, index quotation, option quotation.
The logic resolved by the exchange includes: the method comprises the steps of encapsulating messages submitted by a Step protocol, wherein each Step message consists of a message header, a message body and a message tail, the message header defines the type and the length of the message, and each message body contains one or more pieces of fast data of the same message type. Reading the configured large and small payload caches each time, if the read payload cache length is greater than or equal to the length in the message header and the message type is the data required to be analyzed, analyzing the fields one by one according to the data structure defined by the transaction, putting the data into a result list cache, and finally landing the data to a file (first data).
The analysis for gold includes: analyzing all quotations;
the gold coin resolving logic comprises: the gold is a UDP message, which has four kinds of analysis methods, i.e., an anti-code method, an exclusive-or method, and an exclusive-or method at present, and after determining an analysis method according to an analyzed field value, the cache list is traversed, all data is analyzed, a data result is placed in a result list cache, and finally, the data file (first data) is landed on.
Resolving against a gold exchange includes: trading real-time quotations and delivering real-time quotations;
the gold exchange resolution logic comprises: the gold exchange is a TCP message, which is coded in a mode of key value and then sent, and the data is decoded by a Chinese character coding character set (GB2312) according to information exchange and then sent to a file (first data).
The analysis for the previous period comprises the following steps: energy market, option market;
the upper resolution logic comprises: the up-line trend is divided into TCP information and UDP information, the TCP information is firstly analyzed according to the structure and the field rule of the TCP information provided by the transaction, the analysis result is put into a cache, then the UDP information is analyzed according to the structure and the field rule of the UDP information provided by the transaction, the analysis result is put into the cache, finally, the analysis result of the TCP information and the analysis result of the UDP information are calculated according to the calculation rule provided by the transaction, the final energy quotation/option quotation is obtained and stored into a list cache, and finally, the file (first data) is landed.
S102, acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script;
in the embodiment of the invention, a target test script is selected from the automatic Jenkins scripts aiming at the message, wherein the selection process of the target test script can be to establish association between the type of the message and the corresponding test script in advance, when the corresponding test script is selected for the message based on the automatic Jenkins scripts, the message is analyzed, the type of the message is determined, the target test script matched with the type is selected aiming at the type, and the message in the current software and hardware market quotation system is analyzed based on the target test script to obtain second data.
S103, comparing the first data with the second data to obtain a comparison result;
in the embodiment of the present invention, comparing the first data with the second data can support comparing tens of millions of data, and obtain a difference item, and the specific process is as follows: all the data of the first data and the second data are mixed together, the first data are firstly traversed by using os and re libraries of python, meanwhile, the first data are classified according to different market categories, field values needing to be compared of each market category are obtained, and the field values are placed into corresponding market list caches according to a defined data format to obtain first target data.
Secondly, the os and re libraries of the python are used for traversing and hardening the second data, meanwhile, the data analyzed by the python are classified according to different market categories, the field value needing to be compared of each market category is obtained, and the field values are placed into corresponding market list caches according to the defined data format to obtain the second target data.
And finally, comparing corresponding items in the first target data and the second target data, removing the duplicate by using a set, obtaining a difference item of the first target data and the second target data according to the subtraction of the set after the duplicate removal, and taking the difference item as a comparison result, wherein if the first target data and the second target data are the same, the difference item is an empty set.
And S104, generating a test report based on the comparison result.
In the embodiment of the invention, the comparison result is converted into the test report in the html format defined in the test report script.
The invention discloses an automatic testing method based on a software and hardware stock market system, which presets an automatic Jenkins script, wherein the automatic Jenkins script comprises at least one testing script, the testing script is used for customizing the corresponding full-link automatic testing steps, and the testing method comprises the following steps: under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data; acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script; comparing the first data with the second data to obtain a comparison result; and generating a test report based on the comparison result. According to the process, the second data analyzed by the hardware are obtained based on the corresponding test script in the automatic Jenkins script, and the test script is used for customizing the corresponding full-link automatic test steps, so that operations such as hardware version firing, hardware version checking and the like are not needed, the test time is shortened, and the test efficiency is improved.
In the embodiment of the invention, the test method is based on Jenkins continuous integration and operation maintenance, preferably, the python automation script is stored in the gitlab, and the updated python is stored in the gitlab under the condition of receiving an update instruction of the python automation script.
In the embodiment of the present invention, the full link automatic test method is exemplified based on the above test method, and includes the following steps: constructing a full-link automatic project on a Jenkins platform, wherein the project script configuration address is a full-link automatic Jenkins script address, constructing a full-link automatic timing task under the project, and setting task parameters: the system comprises a trading exchange, a market software version, a hardware version, an operating server, a sending port and a receiving port (the receiving port and the sending port are related to a selected server), wherein when parameter setting is completed, a full-link automation task is executed, and customization of software and hardware configuration and full-link automation steps is realized according to set task parameters. And finally, the output test result is filed to a continuous integration platform server, and a test result data report is sent to related full-link automation project personnel.
The full link test scenario is: the market system is connected with market of a sending end (market MDGW/VDE) and a receiving end (SFC network card and FPGA), a data packet (market data) is sent to hardware and market software from a sending port, the hardware analyzes the market data by multicasting UDP analysis through the receiving port, the receiving end obtains the UDP analysis market data through the receiving port and analyzes the UDP analysis market data into a fixed data format to be landed to a file, wherein the sending end refers to a trading exchange market gateway, and the trading exchange market gateway is simulated by sending the data packet at the sending port during full-link test. The deployment architecture diagram is shown in fig. 2:
(1) constructing a full-link automatic timing task under a Jenkins continuous integration platform server full-link automatic project, and setting task parameters: the system comprises a trading exchange, a market software version, a hardware version, an operating server, a sending port and a receiving port (the receiving port and the sending port are related to a selected server), and when the parameter setting is finished, a full-link automation task is executed at regular time.
(2) According to the address of the gitlab server configured in the full-link automation Jenkins script, obtaining the latest python automation script from the gitlab
(3) Executing full link automation Jenkins scripts
Operating a server according to the task parameters configured in the step (1), and sequentially executing the following operations on the server:
modifying the maximum message length of the sending port according to the task parameter sending port configured in the step (1);
and (2) acquiring the tested software and hardware version, the hardware reset shell script and the hardware configuration script according to the task parameter software version and the hardware version configured in the step (1) and the software and hardware version publishing directory configured in the full link automation Jenkins script. And copying the hardware reset shell script and the hardware configuration script to a hardware reset shell script directory and a hardware configuration script directory configured in the full-link automation Jenkins script.
And (2) confirming the hardware version card according to the task parameter receiving port configured in the step (1), and burning the obtained tested hardware version to the hardware card.
And (2) modifying a receiving end, a transmitting end and an editing software receiving end in the market quotation software system configuration according to the task parameter transmitting port and the receiving port configured in the step (1) and the software installation catalog configured in the full link automation Jenkins script.
Modifying the date of the static file of the corresponding exchange on the server according to the task parameter exchange configured in the step (1) and the static file catalog and system time of the exchange configured in the full-link automation Jenkins script;
and (2) determining a market data source to be tested for the full-link automation task according to the task parameter exchange configured in the step (1) and the exchange market data source address configured in the full-link automation Jenkins script.
And (2) resetting the shell script directory according to the task parameter exchange configured in the step (1) and the exchange hardware configured in the full-link automation Jenkins script, acquiring a target address of an IP layer, a source address of the IP layer, a target port of a TCP layer, a source port of the TCP layer and Cyclic Redundancy Check (CRC) of a payload of the measured market data packet determined in the previous step, and modifying the exchange hardware to reset the shell script according to the information.
And deleting the log file of the market quotation software according to a software installation directory configured in the full-link automation Jenkins script, and starting the market quotation software. And judging whether the starting is finished or not according to the newly added log file. If the log file is written with the log related to the "exceptional _ acquire _ handle success" or the "FPGA initialization success" to show that the software is started, acquiring the process number of the running of the market software according to the name of the market software and storing the process number into the cache
And deleting the log file of the receiving terminal according to the software installation directory configured in the full-link automation Jenkins script, and starting the receiving terminal. And inputting the subscription parameters in the receiving terminal, obtaining the process number operated by the receiving terminal and storing the process number in a cache after the return information of successful subscription is obtained.
And (2) according to the task parameter exchange configured in the step (1) and the exchange hardware reset shell script directory configured in the full-link automation Jenkins script, executing the hardware reset shell script, writing the target address of the IP layer, the source address of the IP layer, the target port of the TCP layer, the source port of the TCP layer and Cyclic Redundancy Check (CRC) of the payload of the measured quotation data packet into a register of the hardware, ensuring that the hardware only analyzes the target address, the source address, the target port, the source port and the written message with the target address, the source address, the target port and the source port consistent with each other, and emptying message information cached by the hardware.
And playing back (tcdisplay) the tested quotation data packet at the sending port, and recording and playing back (tcdisplay) the process number of the tested quotation data packet into the cache. And meanwhile, acquiring a data file corresponding to the python analysis of the detected quotation data packet according to the name of the detected quotation data packet and a python analysis data directory configured in the full-link automatic Jenkins script, calling the python quotation analysis script to analyze if the analysis data file does not exist, recording a python analysis progress number into a cache, and detecting whether the python analysis progress number exists every 5 seconds.
And (2) according to the task parameter exchange configured in the step (1) and an exchange hardware configuration script directory configured in the full-link automation Jenkins script, executing a hardware configuration script, reading values of each register of the hardware, judging whether the hardware is normally analyzed according to the outlet data values of the hardware registers, if the outlet data values of the hardware registers are zero, closing a market situation software system and a receiving end according to the process number, starting to execute again from a starting market situation system, otherwise, waiting for the playback (tcp play) of the process of the tested market situation data packet to be ended, and detecting whether the process number of the tested market situation data packet exists every 5 seconds or not.
If the process number of the tested market data packet does not exist in the playback (tcdisplay), the market software system and the receiving end are closed according to the process number of the market software running and the process number of the receiving end running.
And if the python analysis process number does not exist, calling a python data comparison script according to a hardware analysis data directory configured in the full-link automatic Jenkins script and a python analysis data directory configured in the full-link automatic Jenkins script, comparing the two data, writing the result data into a file, and storing the result data into a comparison list configured in the full-link automatic Jenkins script.
And archiving test data, namely adding a file named by a tested market data packet under an archiving path configured in the full-link automatic Jenkins script, and archiving hardware analysis data, python analysis data and comparison result data under the file.
And repeating the operation of resetting the shell script from the hardware of the modified exchange to the filing of the test data until all tested market situation data packets are tested.
And calling the python test report script, and generating a test report according to a result file generated by the python comparison script.
And sending the generated test report, the archived test data path, the execution process and the execution result automatically generated by the Pipeline framework of Jenkins to a mailbox configured in the full-link automatic Jenkins script.
In the embodiment of the present invention, the overall processing flow of the above process includes: firstly, acquiring the latest code (python automation script) from gitlab, constructing a new project in Jenkins, wherein the project comprises a trading desk, a hardware version, a receiving port, a sending port, an operation server and a market information software version, generating a market information data source aiming at the trading desk, modifying hardware configuration stirring based on the market information data source, updating the modified hardware configuration script to a server, firing the hardware version to obtain corresponding hardware aiming at the hardware version, compiling the receiving end aiming at the receiving port and the sending port, sending the compiled hardware version to the receiving end of the server, and aiming at the server, the method comprises the following steps: a receiving end, modifying the static file, the quotation software system and the Python script of the static file date, updating the quotation software version aiming at the quotation software system, sending the updated quotation software version to the quotation software system, emptying a system log of the quotation software system before the quotation software system is started, waiting for the completion of the starting if the starting is not completed, executing a hardware configuration script (the modified hardware configuration script) if the starting is completed, playing a quotation data source, firstly judging whether the hardware analysis is normal, if not, closing the receiving end and the quotation software system, emptying the log of the quotation software system, if yes, judging whether the quotation data is played, if not, waiting for the playing is completed, judging whether the Python analysis data exists if yes, analyzing the quotation data source based on the Python, if yes, executing a comparison script, and outputting a test result, judging whether all market data sources are verified or not, if not, closing a receiving end, sending a test report by the market software system, and if so, finishing the test.
Based on the above-mentioned automated testing method based on software and hardware stock market system, in the embodiment of the present invention, an automated testing apparatus based on software and hardware stock market system is further provided, where an automated Jenkins script is preset in the testing apparatus, where the automated Jenkins script includes at least one testing script, the testing script is used to customize a corresponding full link automated testing step, and a structural block diagram of the testing apparatus is shown in fig. 3, and includes:
a first testing module 201, a second testing module 202, a comparison module 203 and a generation module 204.
Wherein the content of the first and second substances,
the first testing module 201 is configured to, in a case where an automated testing request for a current software and hardware stock quotation system is received, obtain a message of the current software and hardware stock quotation system, and test the message based on a python automated script to obtain first data;
the second testing module 202 is configured to obtain second data analyzed by hardware in the current software and hardware security market system based on a corresponding testing script in the automatic Jenkins script;
the comparison module 203 is configured to compare the first data with the second data to obtain a comparison result;
the generating module 204 is configured to generate a test report based on the comparison result.
The invention discloses an automatic testing device based on a software and hardware stock market system, which is preset with an automatic Jenkins script, wherein the automatic Jenkins script comprises at least one testing script, the testing script is used for customizing the corresponding full-link automatic testing steps, and the testing device comprises: under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data; acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script; comparing the first data with the second data to obtain a comparison result; and generating a test report based on the comparison result. According to the process, the second data analyzed by the hardware are obtained based on the corresponding test script in the automatic Jenkins script, and the test script is used for customizing the corresponding full-link automatic test steps, so that operations such as hardware version firing, hardware version checking and the like are not needed, the test time is shortened, and the test efficiency is improved.
In this embodiment of the present invention, the first testing module 201 includes:
a first acquisition unit 205, a concatenation unit 206 and an analysis unit 207.
Wherein the content of the first and second substances,
the first obtaining unit 205 is configured to obtain a payload in the message;
the splicing unit 206 is configured to splice the payloads based on the identifiers in the payloads to obtain target payloads;
the analysis unit 207 is configured to perform market analysis on the target payload to obtain first data.
In this embodiment of the present invention, the second testing module 202 includes:
a second acquisition unit 208 and an analysis unit 209.
Wherein the content of the first and second substances,
the second obtaining unit 208 is configured to obtain a target test script corresponding to the previous software and hardware stock market system;
the analysis unit 209 is configured to analyze the message in the current software and hardware stock market system based on the target test script to obtain second data.
In an embodiment of the present invention, the comparing module 203 includes:
a first classification unit 210, a second classification unit 211 and a comparison unit 212.
Wherein the content of the first and second substances,
the first classification unit 210 is configured to classify the first data based on a market category to obtain first target data;
the second classification unit 211 is configured to classify the second data based on the market situation category to obtain second target data;
the comparing unit 212 is configured to compare corresponding items in the first target data and the second target data, and use a difference item in the first target data and the second target data as a comparison result.
In an embodiment of the present invention, the python automation script is stored in a gitlab, and the testing apparatus further includes:
and the storage module is used for storing the updated python in the gitlab under the condition of receiving an updating instruction of the python automation script.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The automatic testing method and device based on the software and hardware security market system provided by the invention are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. The automatic testing method based on the software and hardware stock market system is characterized in that an automatic Jenkins script is preset, wherein the automatic Jenkins script comprises at least one testing script, the testing script is used for customizing a corresponding full-link automatic testing step, and the testing method comprises the following steps:
under the condition that an automatic test request for a current software and hardware stock quotation system is received, obtaining a message of the current software and hardware stock quotation system, and testing the message based on a python automatic script to obtain first data;
acquiring second data analyzed by hardware in the current software and hardware security market system based on a corresponding test script in the automatic Jenkins script;
comparing the first data with the second data to obtain a comparison result;
and generating a test report based on the comparison result.
2. The method of claim 1, wherein testing the message based on a python automation script to obtain first data comprises:
acquiring a payload in the message;
splicing the effective loads based on the identifiers in the effective loads to obtain target effective loads;
and analyzing the market conditions of the target effective load to obtain first data.
3. The method of claim 1, wherein obtaining second data parsed by hardware in the current software and hardware securities market system based on a corresponding test script in the automated Jenkins script comprises:
acquiring a target test script corresponding to the front software and hardware stock market system;
and analyzing the message in the current software and hardware security market system based on the target test script to obtain second data.
4. The method of claim 1, wherein comparing the first data and the second data comprises:
classifying the first data based on the market situation category to obtain first target data;
classifying the second data based on the market situation category to obtain second target data;
and comparing corresponding items in the first target data and the second target data, and taking a difference item in the first target data and the second target data as a comparison result.
5. The method of claim 1, further comprising: the python automation script is stored in the gitlab,
and in the case of receiving an update instruction to the python automation script, storing the updated python in the gitlab.
6. The utility model provides an automatic testing arrangement based on software and hardware securities market information system which characterized in that sets up automatic Jenkins script in advance, wherein, automatic Jenkins script contains at least one test script, test script is used for customizing the automatic test step of full link that corresponds, testing arrangement includes:
the system comprises a first testing module, a second testing module and a third testing module, wherein the first testing module is used for acquiring a message of a current software and hardware stock market system under the condition of receiving an automatic testing request of the current software and hardware stock market system, and testing the message based on a python automatic script to acquire first data;
the second testing module is used for acquiring second data analyzed by hardware in the current software and hardware stock quotation system based on a corresponding testing script in the automatic Jenkins script;
the comparison module is used for comparing the first data with the second data to obtain a comparison result;
and the generating module is used for generating a test report based on the comparison result.
7. The apparatus of claim 6, wherein the first testing module comprises:
a first obtaining unit, configured to obtain a payload in the message;
the splicing unit is used for splicing the effective loads based on the identifiers in the effective loads to obtain target effective loads;
and the analysis unit is used for carrying out market analysis on the target effective load to obtain first data.
8. The apparatus of claim 6, wherein the second testing module comprises:
the second acquisition unit is used for acquiring a target test script corresponding to the front software and hardware stock market system;
and the analysis unit is used for analyzing the message in the current software and hardware security market system based on the target test script to obtain second data.
9. The apparatus of claim 6, wherein the comparison module comprises:
the first classification unit is used for classifying the first data based on the market situation category to obtain first target data;
the second classification unit is used for classifying the second data based on the market situation category to obtain second target data;
and the comparison unit is used for comparing corresponding items in the first target data and the second target data, and taking a difference item in the first target data and the second target data as a comparison result.
10. The apparatus of claim 6, wherein the python automation script is stored in a gitlab, further comprising:
and the storage module is used for storing the updated python in the gitlab under the condition of receiving an updating instruction of the python automation script.
CN202111043752.2A 2021-09-07 2021-09-07 Automatic testing method and device based on software and hardware stock market system Pending CN113760761A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111043752.2A CN113760761A (en) 2021-09-07 2021-09-07 Automatic testing method and device based on software and hardware stock market system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111043752.2A CN113760761A (en) 2021-09-07 2021-09-07 Automatic testing method and device based on software and hardware stock market system

Publications (1)

Publication Number Publication Date
CN113760761A true CN113760761A (en) 2021-12-07

Family

ID=78793452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111043752.2A Pending CN113760761A (en) 2021-09-07 2021-09-07 Automatic testing method and device based on software and hardware stock market system

Country Status (1)

Country Link
CN (1) CN113760761A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117555626A (en) * 2023-11-29 2024-02-13 沐曦集成电路(上海)有限公司 Jenkins-based hardware testing method, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933734A (en) * 2015-12-30 2017-07-07 中兴通讯股份有限公司 A kind of physical layer software automated testing method and device
CN109885488A (en) * 2019-01-30 2019-06-14 上海卫星工程研究所 The satellite orbit software for calculation automated testing method and system of use-case table- driven
CN111240921A (en) * 2020-01-19 2020-06-05 苏州浪潮智能科技有限公司 Method, equipment and readable medium for DUT function verification
CN111369359A (en) * 2020-02-10 2020-07-03 中科驭数(北京)科技有限公司 Method and device for testing security transaction risk control hardware
CN111625467A (en) * 2020-06-03 2020-09-04 深圳华锐金融技术股份有限公司 Automatic testing method and device, computer equipment and storage medium
CN112380143A (en) * 2020-12-15 2021-02-19 福建新大陆支付技术有限公司 POS product automatic testing method, system, equipment and computer storage medium
CN112650678A (en) * 2020-12-24 2021-04-13 北京睿芯高通量科技有限公司 Jenkins-based automatic test system and method for audio and video accelerator card product

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933734A (en) * 2015-12-30 2017-07-07 中兴通讯股份有限公司 A kind of physical layer software automated testing method and device
CN109885488A (en) * 2019-01-30 2019-06-14 上海卫星工程研究所 The satellite orbit software for calculation automated testing method and system of use-case table- driven
CN111240921A (en) * 2020-01-19 2020-06-05 苏州浪潮智能科技有限公司 Method, equipment and readable medium for DUT function verification
CN111369359A (en) * 2020-02-10 2020-07-03 中科驭数(北京)科技有限公司 Method and device for testing security transaction risk control hardware
CN111625467A (en) * 2020-06-03 2020-09-04 深圳华锐金融技术股份有限公司 Automatic testing method and device, computer equipment and storage medium
CN112380143A (en) * 2020-12-15 2021-02-19 福建新大陆支付技术有限公司 POS product automatic testing method, system, equipment and computer storage medium
CN112650678A (en) * 2020-12-24 2021-04-13 北京睿芯高通量科技有限公司 Jenkins-based automatic test system and method for audio and video accelerator card product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117555626A (en) * 2023-11-29 2024-02-13 沐曦集成电路(上海)有限公司 Jenkins-based hardware testing method, electronic equipment and medium

Similar Documents

Publication Publication Date Title
US8074204B2 (en) Test automation for business applications
CN110569159A (en) Baffle generation method, device, equipment and computer storage medium
CN112506771A (en) Message comparison method and device
CN114048129A (en) Automatic testing method, device, equipment and system for software function change
CN113778864A (en) Test case generation method and device, electronic equipment and storage medium
CN104899134A (en) Automatic domain name registration server testing system and method
CN113760761A (en) Automatic testing method and device based on software and hardware stock market system
CN116521512A (en) Accurate test method and device for codes, electronic equipment and computer readable medium
CN115543781A (en) Method and interactive system for automatically verifying automobile software model
CN111367531A (en) Code processing method and device
CN109408076A (en) A kind of APP batch hair version method, apparatus and system
CN113688418A (en) Engineering order settlement method and system based on block chain data storage
CN117111907A (en) Software development system
CN114338850B (en) Message checking method, device, terminal equipment and computer readable storage medium
CN113050925B (en) Block chain intelligent contract repairing method and device
CN115080401A (en) Automatic testing method and related device
CN114170006A (en) Information data acquisition method, device, equipment and medium based on state machine
CN114491184A (en) Data processing method and device, storage medium and electronic equipment
CN113919309A (en) Excel macro function-based field comparison method, device, equipment and storage medium
CN113297082A (en) Product quality evaluation method and device
CN111444108A (en) Behavior audit automatic testing method based on S7 industrial protocol
CN111159988A (en) Model processing method and device, computer equipment and storage medium
CN113760730B (en) Automatic test method and device
CN113419877B (en) Implementation method and device of decision service interface, electronic equipment and storage medium
CN114090419A (en) Program testing method, system, device, electronic equipment and storage 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