CN111708538B - Transaction circulation method, device, computer equipment and computer readable storage medium - Google Patents
Transaction circulation method, device, computer equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN111708538B CN111708538B CN202010473601.XA CN202010473601A CN111708538B CN 111708538 B CN111708538 B CN 111708538B CN 202010473601 A CN202010473601 A CN 202010473601A CN 111708538 B CN111708538 B CN 111708538B
- Authority
- CN
- China
- Prior art keywords
- numerical
- transaction
- conversion
- timestamp
- target transaction
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a transaction circulating method, a device, computer equipment and a computer readable storage medium, and relates to the technical field of Internet. The method comprises the following steps: acquiring time information corresponding to a preset target transaction; carrying out numerical conversion on the time information to generate a numerical timestamp of the time information; calling a preset data type conversion method, and carrying out format conversion on the numerical timestamp to obtain character type time data; and assigning the character type time data serving as random numbers to a plurality of transaction interfaces corresponding to the target transaction, and controlling the plurality of transaction interfaces to circularly operate the target transaction according to the random numbers.
Description
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a transaction circulation method, an apparatus, a computer device, and a computer-readable storage medium.
Background
At present, with the development of electronic and communication technologies, various intelligent devices appear, and more parameters need to be tested in order to ensure the normal operation of various intelligent devices in advanced and complex internet and networks. In the process of testing various platforms on the intelligent device, an ideal test environment should completely imitate an operation environment in every detail, but due to the limitation of capacity and scale, such a test environment is not practical, so that the test platform is generally required to be capable of establishing a transaction for testing, testing the processing capacity of the platform to be tested by circulating the processing process of the transaction, and judging whether the internal structure of the platform to be tested can meet the requirements of the transaction in the processing process.
In the related art, a random number is generally generated, a transaction is cycled according to the random number, and the cycle number of the transaction is indicated by the random number. The process of generating the random number is usually completed manually by a worker, that is, the worker inputs the random number to the association interface of the affair in the platform to be tested as the parameter value of the association interface, and continuously inputs different and unique random numbers to replace the parameter value when the affair is circulated each time, thereby realizing the test of the platform to be tested.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
the number of cycles of the affairs in the tested platform is large, each cycle needs to input a value which is different from and unique to the previous random number to replace the previous random number, and a worker needs to follow the test of the tested platform all the time, so that the workload of the worker is large, the test cost is high, and the test process is poor in intelligence.
Disclosure of Invention
In view of this, the present invention provides a transaction circulating method, a transaction circulating device, a computer device and a computer readable storage medium, and mainly aims to solve the problems of large workload of the current staff, high testing cost and poor intelligence of the testing process.
According to a first aspect of the present invention, there is provided a transaction looping method, the method comprising:
acquiring time information corresponding to a preset target transaction;
carrying out numerical conversion on the time information to generate a numerical timestamp of the time information;
calling a preset data type conversion method, and carrying out format conversion on the numerical timestamp to obtain character type time data;
and assigning the character type time data as random numbers to a plurality of transaction interfaces corresponding to the target transaction, and controlling the transaction interfaces to circularly operate the target transaction according to the random numbers.
In another embodiment, the numerically converting the time information to generate a numerical timestamp of the time information includes:
starting a numerical conversion script, wherein the numerical conversion script defines a numerical class for generating a unique numerical value;
counting a small-time value, a score and a second value of the time information based on a time conversion method in the numerical value class;
and combining the hour value, the score value and the second value, and taking the generated combined result as the numerical timestamp.
In another embodiment, before the starting the numerical conversion script, the method further comprises:
receiving a script creating instruction, creating the numerical conversion script in an editor, and defining the numerical class for the numerical conversion script;
and linking the numerical value class into a script of a preposed source code interpreter so that the numerical value class is allowed to be called.
In another embodiment, the invoking a preset data type conversion method to perform format conversion on the numeric timestamp to obtain character-type time data includes:
operating the preset data type conversion method, and determining a position to be converted in the numerical timestamp by using the preset data type conversion method;
determining data to be converted corresponding to the position to be converted in the numerical timestamp, and converting the data to be converted into a character string;
and filling the character string into the position indicated by the position to be converted in the numerical timestamp to generate the character type time data.
In another embodiment, the assigning the character-type time data as a random number to a plurality of transaction interfaces corresponding to the target transaction, and controlling the plurality of transaction interfaces to circularly operate the target transaction according to the random number includes:
acquiring a plurality of transaction interfaces of the target transaction in a cycle controller, and assigning the character-type time data to the transaction interfaces as the random number, wherein the cycle controller is used for controlling the cycle operation of the target transaction;
based on the cycle controller, operating the target transaction according to the plurality of transaction interfaces after being assigned;
when the target transaction is completely operated, recording an operation result, and executing the next operation of the target transaction until the operation times of the target transaction reach the preset times set in the circulation controller;
and sorting all operation results of the target transaction to obtain a result data packet, and outputting the result data packet.
In another embodiment, before the obtaining of the plurality of transaction interfaces of the target transaction in the cycle controller and the assigning of the symbolic time data as the random number to the plurality of transaction interfaces, the method further comprises:
newly building a thread group in the cycle controller, and accessing a plurality of transaction interfaces of the target transaction into the thread group;
and receiving the preset times, and setting the preset times in the thread group.
According to a second aspect of the present invention, there is provided a transaction cycling apparatus, the apparatus comprising:
the acquisition module is used for acquiring time information corresponding to a preset target transaction;
the generating module is used for carrying out numerical conversion on the time information and generating a numerical timestamp of the time information;
the conversion module is used for calling a preset data type conversion method and carrying out format conversion on the numerical timestamp to obtain character type time data;
and the assignment module is used for assigning the character-type time data serving as random numbers to a plurality of transaction interfaces corresponding to the target transaction and controlling the transaction interfaces to circularly operate the target transaction according to the random numbers.
In another embodiment, the generating module includes:
the system comprises a starting unit, a judging unit and a judging unit, wherein the starting unit is used for starting a numerical value conversion script, and the numerical value conversion script defines a numerical value class for generating a unique numerical value;
the counting unit is used for counting a small-time value, a score and a second value of the time information based on the time conversion method in the numerical value class;
and the combination unit is used for combining the hour value, the score and the second value and taking the generated combination result as the numerical timestamp.
In another embodiment, the generating module further includes:
the creating unit is used for receiving a script creating instruction, creating the numerical conversion script in an editor and defining the numerical class for the numerical conversion script;
and the linking unit is used for linking the numerical value class into a script of the preposed source code interpreter so as to enable the numerical value class to be called.
In another embodiment, the conversion module includes:
the operation unit is used for operating the preset data type conversion method and determining a position to be converted in the numerical timestamp by using the preset data type conversion method;
the determining unit is used for determining the data to be converted corresponding to the position to be converted in the numerical timestamp and converting the data to be converted into a character string;
and the generating unit is used for filling the character string into the position indicated by the position to be converted in the numerical timestamp to generate the character type time data.
In another embodiment, the assignment module includes:
an obtaining unit, configured to obtain multiple transaction interfaces of the target transaction in a cycle controller, and assign the character-type time data to the multiple transaction interfaces as the random number, where the cycle controller is configured to control the target transaction to run in a cycle;
the operation unit is used for operating the target transaction according to the plurality of transaction interfaces after being assigned based on the cycle controller;
the recording unit is used for recording an operation result when the target transaction is operated completely, and executing the next operation of the target transaction until the operation times of the target transaction reach the preset times set in the cycle controller;
and the arrangement unit is used for arranging all the operation results of the target transaction to obtain a result data packet and outputting the result data packet.
In another embodiment, the assignment module further includes:
the access unit is used for newly building a thread group in the cycle controller and accessing a plurality of transaction interfaces of the target transaction into the thread group;
and the setting unit is used for receiving the preset times and setting the preset times in the thread group.
According to a third aspect of the present invention, there is provided a computer device comprising a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the processor executes the computer program.
According to a fourth aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect described above.
By means of the technical scheme, the transaction circulating method, the transaction circulating device, the computer equipment and the computer readable storage medium are provided by the invention, time information is determined, numerical value conversion is carried out on the time information to generate the numerical value timestamp of the time information, a data type conversion method is called, format conversion is carried out on the numerical value timestamp to obtain character type time data, the character type time data is used as random numbers to be assigned to all transaction interfaces of a target transaction, all the transaction interfaces are controlled to circularly operate the target transaction according to the random numbers, so that the unique and different random numbers are automatically generated to execute transaction circulation by utilizing the uniqueness of time, a worker is not required to follow a test process, a large amount of workload is reduced, the test cost is reduced, and the intelligence is better.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart of a transaction loop method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a transaction loop method according to an embodiment of the present invention;
FIG. 3A is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
FIG. 3B is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
FIG. 3C is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
FIG. 3D is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
FIG. 3E is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
FIG. 3F is a schematic diagram illustrating a transaction cycle apparatus according to an embodiment of the present invention;
fig. 4 shows a schematic device structure diagram of a computer apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
An embodiment of the present invention provides a transaction loop method, as shown in fig. 1, the method includes:
101. and acquiring time information corresponding to a preset target transaction.
102. And carrying out numerical conversion on the time information to generate a numerical timestamp of the time information.
103. And calling a preset data type conversion method, and carrying out format conversion on the numerical timestamp to obtain character type time data.
104. And assigning the character type time data serving as random numbers to a plurality of transaction interfaces corresponding to the target transaction, and controlling the plurality of transaction interfaces to circularly operate the target transaction according to the random numbers.
According to the method provided by the embodiment of the invention, time information is determined, the time information is subjected to numerical value conversion to generate the numerical value timestamp of the time information, the data type conversion method is called, the format conversion is carried out on the numerical value timestamp to obtain the character type time data, the character type time data is further used as the random number to be assigned to all transaction interfaces of the target transaction, and all the transaction interfaces are controlled to circularly operate the target transaction according to the random number, so that the unique and different random numbers are automatically generated by utilizing the uniqueness of the time to execute the cycle of the transaction, a worker is not required to follow the test process, a large amount of workload is reduced, the test cost is reduced, and the intelligence is better.
An embodiment of the present invention provides a transaction loop method, as shown in fig. 2, the method includes:
201. and acquiring time information corresponding to a preset target transaction, and performing numerical conversion on the time information to generate a numerical timestamp of the time information.
The inventor realizes that when the operation of transaction circulation is carried out, a random number is generally generated, and the assignment is carried out on a transaction interface in the transaction according to the random number, so that the transaction can run according to the assignment, and the transaction can run under different values, thereby determining whether the transaction can run normally under different scenes. However, the existing tool in the current Jmeter (pressure test for software) cannot completely realize the function of automatic generation of random numbers, and one solution is to add a benshell (source code interpreter) and Jar (software package file format) package script into the Jmeter tool to realize the scenario, so as to meet the test requirement. Another solution is to configure a staff member, who continuously inputs random numbers following the transaction test, so that the transaction is continuously circulated. Therefore, the invention provides a transaction circulating method, which generates unique and different random numbers by utilizing the uniqueness of time, and circulates the target transaction according to the random numbers, thereby meeting the test requirement.
In a conventional transaction cycle, a random number is used to assign a value to a target transaction, the random number needs to be character-type data to meet the requirement of a test, for example, 1, 2, 3, 4, and so on, and the expression method of time is generally 13:46:16, where 13 is hour, 46 is minute, and 16 is second, and the expression manner of time does not meet the requirement of the character-type data, so that a numerical timestamp needs to be generated according to time information first, so as to perform format conversion on the numerical timestamp subsequently, thereby obtaining the character-type data which can be used in the test. Specifically, in order to generate the numerical timestamp, a numerical conversion script needs to be created in the editor in advance, a numerical class used for generating a unique numerical value is defined for the numerical conversion script, and the numerical class is linked into the script of the pre-source code interpreter so as to enable the numerical class to be called. For example, a Java script may be created in a Java (object oriented programming language) editor, a class that generates a unique value is defined for the Java, a random number is generated and obtained from the class, which may actually be GetRandomValue, so that the class may be called directly as a module package in the script of the pre-source interpreter.
After the above-mentioned content is set up, the numerical conversion of time information is started. Firstly, time information corresponding to a preset target transaction is obtained, and the numerical value conversion script is started. The time information is also the current time point. Then, the hour value, score value and second value of the time information are counted based on the time conversion method in the numerical class. And finally, combining the small value, the score and the second value, and taking the generated combined result as a numerical timestamp. It should be noted that, in the numerical class, more than one algorithm is provided, and in order to ensure that the random number generated each time subsequently is unique in the process of practical application, a system currenttimeMillis () method is used as a time conversion method, the system currenttimeMillis () method is a millisecond-level time method, and by calling the method, a numerical type and a millisecond-level thirteen-bit numerical type timestamp can be directly generated.
202. And operating a preset data type conversion method, detecting the numerical timestamp by using the preset data type conversion method, and determining a position to be converted.
In the embodiment of the invention, because the requirement of the test on the random number needs to be character-type data, the generated numerical timestamp is generally thirteen bits, the numerical timestamp is long, and when a transaction is circulated, if the numerical timestamp is directly assigned to a transaction interface to run, the running process of the transaction realized based on the long numerical timestamp is very long, the related calculation amount is very large, and the numerical timestamp is not suitable for actual operation, so that after the numerical timestamp is generated, the data type conversion needs to be performed on the numerical timestamp to generate the character-type data, and the requirement of the test on the random number is met. Specifically, when the data type of the numeric timestamp is converted, the numeric timestamp can be converted through a method string.value of (), the method is a data type conversion method preset in Java, and can be directly called and run, and the acquired numeric timestamp is converted into character type data, so that the generated unique character type data is used as a random number for testing. When the preset data type conversion method is operated, the numerical timestamp is detected, and the position to be converted is determined in the numerical timestamp so as to convert the data in a targeted manner.
203. And determining the data to be converted corresponding to the position to be converted in the numerical timestamp, converting the data to be converted into a character string, filling the character string into the position indicated by the position to be converted in the numerical timestamp, and generating character type time data.
In the embodiment of the invention, after the position to be converted is determined, the data type of the numerical timestamp can be converted according to the indication of the position to be converted. Specifically, first, data to be converted corresponding to the position to be converted in the numeric timestamp is determined, and the data to be converted is converted into a character string. Subsequently, the character string is filled in the position indicated in the numeric time stamp by the position to be converted, and character-type time data is generated.
In the process of practical application, all the methods and scripts related to the generation and conversion of the numerical timestamps described in the above steps 201 to 203 may be packaged into a Java file, the Java file is changed into a Jar package file, and the Jar package file is placed in the "\\ \ lib \ ext" path under the Jmeter tool, so as to introduce the Jar package file into the Jmeter tool, thereby ensuring the implementation of the above steps 201 to 203. The Jmeter tool is a JAVA-based stress test tool and is used for simulating huge loads for servers, networks or objects, testing the strength and analyzing the overall performance of the servers, the networks or the objects under different stress categories, and therefore JAR package files obtained by packaging methods and scripts can be placed under the Jmeter tool, and the Jmeter tool is used as a carrier to realize the running and calling of the methods and the scripts.
204. And assigning the character type time data as random numbers to a plurality of transaction interfaces of the target transaction, and controlling the plurality of transaction interfaces to circularly operate the target transaction according to the random numbers.
In the embodiment of the invention, after the character-type time data is generated, the character-type time data can be used as a random number to be applied to the subsequent test. It should be noted that, in order to enable a transaction to be executed circularly, and to implement a test on the transaction, all relevant transaction interfaces of the transaction need to be placed under a cycle controller, and the number of times that the transaction needs to be cycled is set in the cycle controller. Specifically, first, a thread group is newly created in the loop controller. And then, accessing a plurality of transaction interfaces of the target transaction into the thread group, receiving the set preset times, and setting the preset times in the thread group. It should be noted that the cycle controller is a scenario that can simulate a plurality of users repeatedly using the whole target transaction at the same time, and in order to enable the cycle controller to operate normally, a script of a pre-source code interpreter needs to be added to the cycle controller, where the script may be specifically a bean shell preprocessor. It should be noted that the script of the preposed source code interpreter must be placed under the first interface request under the loop controller, otherwise, the random numbers used by each loop are the same and cannot meet the uniqueness, and the purpose of adding the script of the preposed source code interpreter is to circularly call the script written in Java in the meter, thereby continuously generating the unique random numbers.
And after the setting of the circulation controller is finished, acquiring a plurality of transaction interfaces of a target transaction in the circulation controller, and assigning the character-type time data serving as random numbers to the plurality of transaction interfaces so as to control the plurality of transaction interfaces to operate the target transaction according to the random numbers. When assigning based on the random number, the assigning may be implemented by calling the value class GetRandomValue shown in step 201, that is, by calling the value class, the random number is assigned to a plurality of transaction interfaces for operation. And after the random number is assigned, operating the target transaction according to the assigned transaction interfaces based on the cycle controller. And when the target transaction is completely operated, recording an operation result, executing the next operation of the target transaction until the operation times of the target transaction reach the preset times set in the circulation controller, sorting all operation results of the target transaction to obtain a result data packet, and outputting the result data packet. For example, assuming that the generated character-type data is 20, and the preset number of times set in the cycle controller is 10, then multiple interfaces in the transaction are accessed into the newly created thread group, the assignments of the multiple transaction interfaces of the target transaction are all set to 20, and the cycle controller is operated, the cycle controller will call the multiple transaction interfaces to perform its own service processing according to the 20 number, receive the result numbers uploaded by all the transaction interfaces, merge and unify all the result numbers to obtain an operation result, and repeatedly execute the process of generating the operation result 10 times, and list the generation process and the obtained operation result. It should be noted that, in the present invention, the parameter values in each transaction interface are written in the form of variables, i.e., $ { variable name }, so that the output character-type data can be directly assigned as random numbers to the transaction interfaces for requesting.
According to the method provided by the embodiment of the invention, time information is determined, the time information is subjected to numerical value conversion to generate the numerical value timestamp of the time information, the data type conversion method is called, the format conversion is carried out on the numerical value timestamp to obtain the character type time data, the character type time data is further used as the random number to be assigned to all transaction interfaces of the target transaction, and all the transaction interfaces are controlled to circularly operate the target transaction according to the random number, so that the unique and different random numbers are automatically generated by utilizing the uniqueness of the time to execute the cycle of the transaction, a worker is not required to follow the test process, a large amount of workload is reduced, the test cost is reduced, and the intelligence is better.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present invention provides a transaction cycling apparatus, as shown in fig. 3A, where the apparatus includes: an acquisition module 301, a generation module 302, a conversion module 303 and an assignment module 304.
The obtaining module 301 is configured to obtain time information corresponding to a preset target transaction;
the generating module 302 is configured to perform numerical conversion on the time information to generate a numerical timestamp of the time information;
the conversion module 303 is configured to call a preset data type conversion method, perform format conversion on the numeric timestamp, and obtain character-type time data;
the assigning module 304 is configured to assign the character-type time data as a random number to multiple transaction interfaces corresponding to the target transaction, and control the multiple transaction interfaces to perform cyclic operation on the target transaction according to the random number.
In a specific application scenario, as shown in fig. 3B, the generating module 302 includes: a start-up unit 3021, a statistics unit 3022 and a combination unit 3023.
The starting unit 3021 is configured to start a numerical conversion script, where the numerical conversion script defines a numerical class for generating a unique numerical value;
the statistical unit 3022 is configured to perform statistics on a small-time value, a score, and a second value of the time information based on the time conversion method in the numerical value class;
the combining unit 3023 is configured to combine the hour value, the score value, and the second value, and use the generated combination result as the numerical timestamp.
In a specific application scenario, as shown in fig. 3C, the generating module 302 further includes a creating unit 3024 and a linking unit 3025.
The creating unit 3024 is configured to receive a script creating instruction, create the numerical conversion script in an editor, and define the numerical class for the numerical conversion script;
the linking unit 3025 is configured to link the value class into a script of a pre-source interpreter, so that the value class is allowed to be called.
In a specific application scenario, as shown in fig. 3D, the conversion module 303 includes: an operation unit 3031, a determination unit 3032 and a generation unit 3033.
The running unit 3031 is configured to run the preset data type conversion method, and determine a position to be converted in the numerical timestamp by using the preset data type conversion method;
the determining unit 3032 is configured to determine to-be-converted data corresponding to the to-be-converted position in the numeric timestamp, and convert the to-be-converted data into a character string;
the generating unit 3033 is configured to fill the character string in the position indicated by the position to be converted in the numeric timestamp, and generate the character-type time data.
In a specific application scenario, as shown in fig. 3E, the assigning module 304 includes: an acquiring unit 3041, a starting unit 3042, a recording unit 3043, and a sorting unit 3044.
The obtaining unit 3041 is configured to obtain multiple transaction interfaces of the target transaction in a cycle controller, and assign the character-type time data to the multiple transaction interfaces as the random number, where the cycle controller is configured to control the target transaction to run in a cycle;
the running unit 3042, configured to run, based on the cycle controller, the target transaction according to the multiple transaction interfaces after being assigned;
the recording unit 3043, configured to record an operation result when the target transaction is completed, and execute the next operation of the target transaction until the number of times of operation of the target transaction reaches a preset number of times set in the cycle controller;
the sorting unit 3044 is configured to sort all the operation results of the target transaction to obtain a result data packet, and output the result data packet.
In a specific application scenario, as shown in fig. 3F, the assigning module 304 further includes: an access unit 3045 and a setup unit 3046.
The accessing unit 3045 is configured to newly create a thread group in the cycle controller, and access a plurality of transaction interfaces of the target transaction to the thread group;
the setting unit 3046 is configured to receive the preset number of times, and set the preset number of times in the thread group.
According to the device provided by the embodiment of the invention, time information is determined, numerical conversion is carried out on the time information, the numerical timestamp of the time information is generated, the data type conversion method is called, the format conversion is carried out on the numerical timestamp, the character type time data is obtained, the character type time data is further used as random numbers to be assigned to all transaction interfaces of a target transaction, all the transaction interfaces are controlled to carry out cycle operation on the target transaction according to the random numbers, so that the unique and different random numbers are automatically generated by utilizing the uniqueness of time to execute the cycle of the transaction, a worker is not required to follow the test process, a large amount of workload is reduced, the test cost is reduced, and the intelligence is better.
It should be noted that other corresponding descriptions of the functional units involved in the transaction cycle apparatus provided in the embodiment of the present invention may refer to the corresponding descriptions in fig. 1 and fig. 2, and are not described again here.
In an exemplary embodiment, referring to fig. 4, there is further provided a device, where the device 400 includes a communication bus, a processor, a memory, and a communication interface, and may further include an input/output interface and a display device, where the functional units may communicate with each other through the bus. The memory stores computer programs, and the processor is used for executing the programs stored in the memory and executing the transaction cycle method in the embodiment.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the transaction round method.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by hardware, and also by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (10)
1. A transaction looping method, comprising:
acquiring time information corresponding to a preset target transaction;
carrying out numerical conversion on the time information to generate a numerical timestamp of the time information;
calling a preset data type conversion method, and carrying out format conversion on the numerical timestamp to obtain character type time data;
and assigning the character type time data as random numbers to a plurality of transaction interfaces corresponding to the target transaction, and controlling the transaction interfaces to circularly operate the target transaction according to the random numbers.
2. The method of claim 1, wherein numerically converting the time information to generate a numerical timestamp of the time information comprises:
starting a numerical conversion script, wherein the numerical conversion script defines a numerical class for generating a unique numerical value;
counting a small-time value, a score and a second value of the time information based on a time conversion method in the numerical value class;
and combining the hour value, the score value and the second value, and taking the generated combined result as the numerical timestamp.
3. The method of claim 2, wherein prior to initiating the numeric conversion script, the method further comprises:
receiving a script creating instruction, creating the numerical conversion script in an editor, and defining the numerical class for the numerical conversion script;
and linking the numerical value class into a script of a preposed source code interpreter so that the numerical value class is allowed to be called.
4. The method of claim 1, wherein the invoking a preset data type conversion method to format convert the numeric timestamp to obtain the character-type time data comprises:
operating the preset data type conversion method, and determining a position to be converted in the numerical timestamp by using the preset data type conversion method;
determining data to be converted corresponding to the position to be converted in the numerical timestamp, and converting the data to be converted into a character string;
and filling the character string into the position indicated by the position to be converted in the numerical timestamp to generate the character type time data.
5. The method according to claim 1, wherein assigning the character-type time data as random numbers to a plurality of transaction interfaces corresponding to the target transaction, and controlling the transaction interfaces to circularly run the target transaction according to the random numbers comprises:
acquiring a plurality of transaction interfaces of the target transaction in a cycle controller, and assigning the character-type time data to the transaction interfaces as the random number, wherein the cycle controller is used for controlling the cycle operation of the target transaction;
based on the cycle controller, operating the target transaction according to the plurality of transaction interfaces after being assigned;
when the target transaction is completely operated, recording an operation result, and executing the next operation of the target transaction until the operation times of the target transaction reach the preset times set in the circulation controller;
and sorting all operation results of the target transaction to obtain a result data packet, and outputting the result data packet.
6. The method of claim 5, wherein before obtaining the plurality of transaction interfaces of the target transaction in the cycle controller and assigning the symbolic time data as the random number to the plurality of transaction interfaces, the method further comprises:
newly building a thread group in the cycle controller, and accessing a plurality of transaction interfaces of the target transaction into the thread group;
and receiving the preset times, and setting the preset times in the thread group.
7. A transaction cycling apparatus, comprising:
the acquisition module is used for acquiring time information corresponding to a preset target transaction;
the generating module is used for carrying out numerical conversion on the time information and generating a numerical timestamp of the time information;
the conversion module is used for calling a preset data type conversion method and carrying out format conversion on the numerical timestamp to obtain character type time data;
and the assignment module is used for assigning the character-type time data serving as random numbers to a plurality of transaction interfaces corresponding to the target transaction and controlling the transaction interfaces to circularly operate the target transaction according to the random numbers.
8. The apparatus of claim 7, wherein the generating module comprises:
the system comprises a starting unit, a judging unit and a judging unit, wherein the starting unit is used for starting a numerical value conversion script, and the numerical value conversion script defines a numerical value class for generating a unique numerical value;
the counting unit is used for counting a small-time value, a score and a second value of the time information based on the time conversion method in the numerical value class;
and the combination unit is used for combining the hour value, the score and the second value and taking the generated combination result as the numerical timestamp.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010473601.XA CN111708538B (en) | 2020-05-29 | 2020-05-29 | Transaction circulation method, device, computer equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010473601.XA CN111708538B (en) | 2020-05-29 | 2020-05-29 | Transaction circulation method, device, computer equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111708538A CN111708538A (en) | 2020-09-25 |
CN111708538B true CN111708538B (en) | 2022-03-22 |
Family
ID=72538273
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010473601.XA Active CN111708538B (en) | 2020-05-29 | 2020-05-29 | Transaction circulation method, device, computer equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111708538B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113612864B (en) * | 2021-07-16 | 2023-09-26 | 济南浪潮数据技术有限公司 | Method, system, equipment and medium for generating IPv6 address |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2908441B1 (en) * | 1998-06-25 | 1999-06-21 | 中国日本電気ソフトウェア株式会社 | Identifier generation system in computer system |
US6671701B1 (en) * | 2000-06-05 | 2003-12-30 | Bentley Systems, Incorporated | System and method to maintain real-time synchronization of data in different formats |
CN101533414A (en) * | 2009-04-15 | 2009-09-16 | 阿里巴巴集团控股有限公司 | A method and a device for generating unique identifier of database record |
CN109981673A (en) * | 2019-04-04 | 2019-07-05 | 上海人行道网络信息技术有限公司 | Data based on block chain deposit card method, apparatus, equipment and storage medium |
CN110377268A (en) * | 2019-07-25 | 2019-10-25 | 中国工商银行股份有限公司 | Serial number generation method, device and storage medium |
EP3605944A1 (en) * | 2018-07-31 | 2020-02-05 | Siemens Healthcare GmbH | Documenting timestamps within a blockchain |
CN111143389A (en) * | 2019-12-27 | 2020-05-12 | 腾讯科技(深圳)有限公司 | Transaction execution method and device, computer equipment and storage medium |
CN111161072A (en) * | 2019-12-30 | 2020-05-15 | 山东爱城市网信息技术有限公司 | Block chain-based random number generation method, equipment and storage medium |
-
2020
- 2020-05-29 CN CN202010473601.XA patent/CN111708538B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2908441B1 (en) * | 1998-06-25 | 1999-06-21 | 中国日本電気ソフトウェア株式会社 | Identifier generation system in computer system |
US6671701B1 (en) * | 2000-06-05 | 2003-12-30 | Bentley Systems, Incorporated | System and method to maintain real-time synchronization of data in different formats |
CN101533414A (en) * | 2009-04-15 | 2009-09-16 | 阿里巴巴集团控股有限公司 | A method and a device for generating unique identifier of database record |
EP3605944A1 (en) * | 2018-07-31 | 2020-02-05 | Siemens Healthcare GmbH | Documenting timestamps within a blockchain |
CN109981673A (en) * | 2019-04-04 | 2019-07-05 | 上海人行道网络信息技术有限公司 | Data based on block chain deposit card method, apparatus, equipment and storage medium |
CN110377268A (en) * | 2019-07-25 | 2019-10-25 | 中国工商银行股份有限公司 | Serial number generation method, device and storage medium |
CN111143389A (en) * | 2019-12-27 | 2020-05-12 | 腾讯科技(深圳)有限公司 | Transaction execution method and device, computer equipment and storage medium |
CN111161072A (en) * | 2019-12-30 | 2020-05-15 | 山东爱城市网信息技术有限公司 | Block chain-based random number generation method, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111708538A (en) | 2020-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111124850A (en) | MQTT server performance testing method, system, computer equipment and storage medium | |
CN106776307A (en) | Method for testing software and system | |
JP6045134B2 (en) | Parallel workload simulation for application performance testing | |
CN111258290A (en) | Automatic test method and system for vehicle control unit | |
CN114328217B (en) | Applied testing methods, devices, equipment, media and computer program products | |
CN110532182B (en) | Automatic testing method and device for virtualization platform | |
CN104836713A (en) | Measurement and calibration method for vehicle electronic controller, device and system | |
CN108563579A (en) | White-box testing method, apparatus, system and storage medium | |
CN114201346A (en) | HIL (hardware-in-the-loop) testing method and device of CAN (controller area network) communication interface and electronic equipment | |
CN107733710A (en) | Construction method, device, computer equipment and the storage medium of link call relation | |
CN114416547A (en) | Test case-based testing method | |
CN115860143A (en) | Operator model generation method, device and equipment | |
CN114691529A (en) | gPRC interface performance test method and device | |
CN111708538B (en) | Transaction circulation method, device, computer equipment and computer readable storage medium | |
CN113806231A (en) | Code coverage rate analysis method, device, equipment and medium | |
CN113986733A (en) | Performance testing method, device, equipment and storage medium based on jar package | |
CN114416545B (en) | Method, device and electronic device for determining test code coverage | |
CN111078573A (en) | Test message generation method and device | |
CN113407441A (en) | Software testing method, device, equipment and storage medium | |
CN118051298A (en) | Method, device, equipment and medium for determining whether application program is containerized | |
CN116069334B (en) | Cloud-protogenesis-based online development and code hosting method and system | |
CN117857381A (en) | Method and device for automatic dial testing of distributed service | |
CN117520190A (en) | Cloud desktop client and test execution method thereof | |
CN116383055A (en) | Financial scene testing method and device, processor and electronic equipment | |
CN113656322B (en) | Data processing method, device, electronic equipment and computer 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220525 Address after: 518000 China Aviation Center 2901, No. 1018, Huafu Road, Huahang community, Huaqiang North Street, Futian District, Shenzhen, Guangdong Province Patentee after: Shenzhen Ping An medical and Health Technology Service Co.,Ltd. Address before: Room 12G, Area H, 666 Beijing East Road, Huangpu District, Shanghai 200001 Patentee before: PING AN MEDICAL AND HEALTHCARE MANAGEMENT Co.,Ltd. |
|
TR01 | Transfer of patent right |