Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The automatic testing method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a first server 102 and a second server 104, wherein the first server 102 communicates with the second server 104 over a network. The second server 104 is the server where the target resource transmission system is located. The target resource transmission system may be a market information forwarding system, and the resource-related data may be market information. The target resource transmission system may be a distributed system, such as a new generation of very fast moving systems.
Specifically, the first server 102 may obtain a resource data simulation instruction carrying a target resource type identifier, and in response to the resource data simulation instruction, obtain a target service rule corresponding to the target resource type identifier, determine, according to the target service rule, a target field set corresponding to the target resource type identifier and a field value limitation condition corresponding to each target field in the target field set, obtain a field value satisfying the field value limitation condition corresponding to the target field, as a target field value corresponding to the target field, generate, according to each target field and a target field value corresponding to each target field, target resource related data corresponding to the target resource type, and transmit the target resource related data to the second server 104, that is, to the target resource transmission system, so as to test the target resource transmission system. The server 104 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers. The test may include at least one of a functional test or a performance test.
In some embodiments, as shown in fig. 2, an automated testing method is provided, which is described by taking the method as an example applied to the first server 102 in fig. 1, and includes the following steps:
s202, a resource data simulation instruction is obtained, the resource data simulation instruction carries a target resource type identifier, and a target business rule corresponding to the target resource type identifier is obtained in response to the resource data simulation instruction.
In particular, the resource data simulation instruction is for indicating simulation resource-related data. Where the resource may be electronic data, such as a virtual item or a physical item, such as stock, transferable over the internet. The resource-related data refers to data related to a resource, the resource-related data changing with time, the resource-related data being, for example, market data of a stock market, and the market data may include at least one of opening price, closing price, maximum price, minimum price, previous closing price, volume of trade, hand-change rate, amount of rise and fall, or amplitude of rise and fall for each trading day. The resource type refers to a type of resource, which may be a type of market data. The resource type identifier is used to uniquely identify the resource type. The target resource type identification may be set as desired. The business rules may be rules related to market data as specified by the transaction. For the same type of market data, the business rules corresponding to different exchanges may be the same or different. The target business rule may include at least one business rule. The business rule can comprise a field set corresponding to various resource types and a field value restriction condition set corresponding to the field value set. Wherein a field set may include a variety of fields. The field value restriction condition set may include field value restriction conditions respectively corresponding to the fields in the field set.
In some embodiments, the first server includes a function module for simulating resource-related data, and when the resource-related data needs to be simulated, a user of the simulated data may trigger the resource-data simulation instruction by accessing the function module for simulating the resource-related data in the first server.
In some embodiments, when the target business rule includes a plurality of business rules, the first server may generate the resource-related data according to the plurality of business rules included in the target business rule, respectively. For example, when the target business rule includes a business rule a and a business rule B, the first server may generate corresponding resource-related data according to the business rule a and generate corresponding resource-related data according to the business rule B.
S204, according to the target business rule, determining a target field set corresponding to the target resource type identifier and a field value limiting condition corresponding to each target field in the target field set.
Specifically, the field value restriction condition is used to specify a value range of a field. And when the field value corresponding to the field meets the field value limiting condition, the value of the field accords with the content of the real resource related data. The value of one field may have at least one of a linear relationship or a non-linear relationship with the value of another field. For example, the field types of the field a and the field B are both integer types, the value of the field a is 2 times that of the field B, and if the value range of the field B is [1,2], when the value of the field B is 1, the value of the field B is 2.
In some embodiments, the first server may use a field set corresponding to the target business rule as a target field set corresponding to the target resource type identifier, and use a field value limitation condition corresponding to a field in the target business rule as a field value limitation condition of a corresponding target field in the target field set. For example, if the field set corresponding to the target business rule is { a, b, c }, and the field value limitation condition corresponding to the field a is greater than 0 and less than 10, the target field set corresponding to the target resource type identifier is { a, b, c }, and the field value limitation condition of the target field a is greater than 0 and less than 10.
S206, acquiring the field value meeting the field value limiting condition corresponding to the target field as the target field value corresponding to the target field.
Specifically, there may be a plurality of field values meeting the field value limitation condition, and the first server may obtain each field value meeting the field value limitation condition corresponding to the target field to obtain a candidate field value set corresponding to the target field, and select a field value from the candidate field value set corresponding to the target field as the target field value corresponding to the target field.
In some embodiments, the first server may select the target field value from the candidate field value set corresponding to the target field by using a random selection method. Of course, the first server may also select the target field value from the candidate field value set corresponding to the target field by using other selection methods. For example, the first server may determine a field value of a field according to time information of the simulated (generated) data. Specifically, the field values in the candidate field value set may correspond to different time information, for example, the candidate field value set corresponding to the target field includes {1,2,3}, where 1 corresponds to the morning, 2 corresponds to the afternoon, and 3 corresponds to the evening, and when the resource-related data simulated by the first server is the data of the morning, 1 may be selected as the target field value corresponding to the target field.
And S208, generating target resource related data corresponding to the target resource type according to each target field and the target field value corresponding to each target field.
Specifically, the target resource-related data refers to resource-related data to be simulated (generated), and the target resource-related data is used as test data for testing the target resource transmission system. The first server can establish an association relationship between each target field and a corresponding target field value, combine each target field with the association relationship and the corresponding target field value to obtain initial resource related data, and generate target resource related data corresponding to the target resource type according to the initial resource related data. The target resource-related data is, for example, { a ═ 1, b ═ 2}, where the association between the field and the field value is established by equal sign "{ }", and is combined by curly brackets "{ }".
In some embodiments, the first server may encode the initial resource-related data by using a preset encoding method to obtain encoded resource-related data, and use the encoded resource-related data as the target resource-related data. The preset encoding method may include an encoding method corresponding to the market data, and the encoding method corresponding to the market data may include at least one of Binary, fast, fix, and step. The first server can concurrently generate corresponding data related to the coding resources according to a plurality of coding modes.
In some embodiments, the first server may include a market gateway system simulation module corresponding to the plurality of exchanges, and the market gateway system simulation module may simulate market data. As shown in fig. 3A, the first server includes a market gateway system simulation module of the exchange a and a market gateway system simulation module of the exchange B. The market gateway system simulation module of the exchange A is used for simulating (generating) market data of the exchange A, and the market gateway system simulation module of the exchange B is used for simulating (generating) market data of the exchange B. The market gateway system simulation module of the exchange A can transmit market data to the market forwarding system through the transmission channel 1 and the transmission channel 2. The market data can be transmitted to the market forwarding system by the market gateway system simulation module of the exchange B through the transmission channel 3 and the transmission channel 4. Wherein the market data may include at least one of homologous data or nonhomologous data. Wherein the homologous data can be data generated by the same exchange gateway by using the same encoding mode (or protocol). The non-homologous data may be data generated by different exchange gateways or data generated by the same exchange using different encoding schemes (or protocols). The homologous data may comprise homologous multiplex data and the non-homologous data may comprise non-homologous multiplex data, wherein a multiplex may refer to multiple transmission channels.
In some embodiments, the target resource data transmission system is a market forwarding system, where the market forwarding system may include at least one of a market access module, an original forwarding module, and a transcoding forwarding module, as shown in fig. 3A, the market access module is configured to obtain data transmitted by each transmission channel, the original forwarding module is configured to directly forward the data obtained from the transmission channel to market equipment of a market consuming user, and the transcoding forwarding module is configured to transcode the data obtained from the transmission channel and forward the transcoded data to the market equipment of the market consuming user. The transcoding forwarding module can transcode through a transcoding market pushing component (UDF, User Data Feeder) or a market API (Application Programming Interface) to obtain transcoded Data. The quotation consumption users are, for example, dealer, and the quotation devices of the quotation consumption users are, for example, a quotation gateway system of the dealer.
S210, transmitting the data related to the target resource to a target resource transmission system so as to test the target resource transmission system.
Specifically, the first server may transmit the target resource-related data to the target resource transmission system, and the target resource transmission system may transmit the resource-related data acquired from the first server to a device of the resource consuming user, where the device of the resource consuming user is, for example, a market equipment of the market consuming user, that is, the target resource transmission system performs a data forwarding function. The first server may transmit the target resource related data to the target resource transmission system to test a function of forwarding data of the target resource transmission system, for example, may test whether the target resource transmission system can correctly process the repeated data and the network delay data, and may test whether a sequence order correction function of the target resource transmission system is normal. The sequence order correction function refers to a function of correcting the arrangement order of data in a sequence.
In some embodiments, the target resource transmission system may directly forward the acquired target resource-related data, or may transcode the target resource-related data and forward the transcoded data. Specifically, the encoding method used by the device of the resource consumption user may be different from that of the first server, the device of the resource consumption user cannot successfully decode the encoded resource related data generated by the first server, the target resource transmission system may transcode the encoded resource related data by using a transcoding method to obtain transcoded resource related data that the device of the resource consumption user can successfully decode, and transmit the transcoded resource related data to the target resource transmission system, so as to test the target resource transmission system.
In some embodiments, as shown in fig. 3B, the first server may include a resource-related data generation module, a resource encoding module, an internal resource transcoding module, a resource sending module, a resource consumption module, and a comparison module. The target resource transmission system comprises an external resource transcoding module. The resource related data generation module comprises a business rule base and a random generation module. The business rules library may include business rules corresponding to different resource types. And the random generation module is used for generating resource related data according to the business rule. The resource coding module is used for coding the data generated by the resource related data generation module. The internal resource transcoding module is configured to transcode the data generated by the resource-related data generating module, and as shown in fig. 3C, the internal resource transcoding module transcodes the resource-related data a1 to obtain resource-related data B1. The external resource transcoding module is configured to transcode the resource-related data sent by the resource sending module, as shown in fig. 3C, the external resource transcoding module transcodes the resource-related data a1 to obtain resource-related data B2, and the resource sending module is configured to transmit the data generated by the resource transcoding module to the target resource transmission system. The resource consumption module simulates equipment of a resource consumption user for the first server. The external resource transcoding module is used for transcoding the resource related data sent by the resource sending module, the target resource transmission system sends the data transcoded by the external resource transcoding module to the resource consuming module, and the resource consuming module processes the transcoded data to obtain a transfer-out result. And the comparison module compares the output result with the original data obtained by the internal resource transcoding module, and determines that the target resource transmission system is correct in data transmission when the comparison is consistent. As shown in FIG. 3C, the comparison module 1 compares the resource-related data A1 with the resource-related data A2, and the comparison module 2 compares the resource-related data B1 with the resource-related data B2.
In some embodiments, the target resource transmission system may further include at least one of a resource access module, such as a market access module, a multicast transmission module, or a resource client for directly transmitting the resource-related data. As shown in fig. 3C, the multicast sending module is configured to perform multicast sending on the data acquired by the resource access module.
In some embodiments, the first server may obtain check resource-related data corresponding to the target resource-related data from the device of the resource consuming user, where the check resource-related data and the target resource-related data represent the same identifier. The first server may compare the target resource related data with the check resource related data, and determine a test result of the target resource transmission system according to the comparison result. For example, when the comparison result is consistent, the test result of the target resource transmission system can be determined as correct data content transmission. When the comparison result is inconsistent, the test result of the target resource transmission system can be determined to be a data transmission error, so that the function of the target resource transmission system is tested. For example, in fig. 3B, the comparison module compares the original data with the roll-out result, and determines that the target resource transmission system is correct for data transmission when the comparison is consistent.
The method comprises the steps of obtaining a resource data simulation instruction, wherein the resource data simulation instruction carries a target resource type identifier, responding to the resource data simulation instruction, obtaining a target service rule corresponding to the target resource type identifier, determining a target field set corresponding to the target resource type identifier and a field value limiting condition corresponding to each target field in the target field set according to the target service rule, obtaining a field value meeting the field value limiting condition corresponding to the target field, using the field value as a target field value corresponding to the target field, generating target resource related data corresponding to the target resource type according to each target field and the target field value corresponding to each target field, and transmitting the target resource related data to a target resource transmission system so as to test the target resource transmission system. The target field set and the field value limiting conditions corresponding to each target field in the target field set are determined according to the target service rule, so that the generated target resource related data are resource related data meeting the service rule, namely the generated target resource related data meet the requirement of real resource related data, the authenticity of the simulated target resource related data is improved, the target resource related data are adopted to test a target resource transmission system, and the test accuracy is improved.
In some embodiments, as shown in fig. 3D, the step S210 of transmitting the data related to the target resource transmission system to test the target resource transmission system includes:
s302, the field value which does not meet the field value limiting condition corresponding to the target field is obtained and used as the modified field value corresponding to the target field.
Specifically, the modified field value does not satisfy the field value restriction condition corresponding to the target field, and there may be a plurality of field values that do not satisfy the field value restriction condition corresponding to the target field. The first server may select from a plurality of field values that do not satisfy the field value restriction condition corresponding to the target field, to obtain a modified field value corresponding to the target field.
S304, modifying the target field value corresponding to the target field in the target resource related data by utilizing the modified field value to obtain modified resource related data corresponding to the target resource type.
Specifically, the first server may replace a target field value corresponding to a target field in the target resource related data with a modification field value, and use the replaced target resource related data as modified resource related data corresponding to the target resource type.
In some embodiments, the first server may modify the target field in the target resource-related data, for example, the first server may obtain a field outside the target field set as a modified field, and replace the target field in the target resource-related data with the modified field to obtain the modified resource-related data. Of course, the first server may add or delete the content in the target resource-related data, and use the target resource-related data after the content is added or deleted as the modified resource-related data.
S306, the data related to the modified resources are transmitted to the target resource transmission system, so that the target resource transmission system is tested.
Specifically, since the modified field value does not satisfy the field value limitation condition corresponding to the target field, the modified field value is used to modify the target field value corresponding to the target field in the intermediate resource-related data, the obtained modified resource-related data does not match the real resource-related data, and the target resource transmission system should refuse to forward the modified resource-related data. The first server may transmit the modified resource-related data to the target resource transmission system for testing the target resource transmission system.
In some embodiments, when the target resource transmission system acquires the modified resource-related data, the target resource transmission system may analyze the modified resource-related data, and when the modified resource-related data is found to be inconsistent with the real resource-related data, may return a data error prompt message to the first server. When the first server acquires the data error prompt information returned by the target resource transmission system, the target resource transmission system can be determined to be capable of correctly processing data which is not in accordance with the real resource-related data. Otherwise, when the first server does not receive the data error prompt message returned by the target resource transmission system, it is determined that the target resource transmission system cannot correctly process the data which is not in accordance with the real resource-related data.
In the embodiment, since the modified resource related data is not consistent with the real resource related data, the modified resource related data is transmitted to the target resource transmission system, so that the processing condition of the target resource transmission system on the data which is not consistent with the real resource related data can be tested, and the test richness is improved. In addition, in the real data transmission process, the transmitted data is usually tampered in the transmission process to obtain tampered data, and in the embodiment, the modified resource related data is obtained by modifying the target resource related data, so that the obtained modified resource related data meets the real condition, and the accuracy of testing the target resource transmission system by modifying the resource related data is high.
In some embodiments, the field value restriction condition includes a data type restriction condition, and as shown in fig. 4, the step S302 of obtaining a field value that does not satisfy the field value restriction condition corresponding to the target field as the modified field value corresponding to the target field includes:
s402, determining a preset data type corresponding to the target field according to the data type limiting condition corresponding to the target field.
Specifically, the preset data type is a data type satisfying a data type restriction condition. The data type limitation condition is used for limiting the type of data, and the type of data may include at least one of an integer type, a floating point type, a character type, or the like. The first server may obtain the data type limitation condition corresponding to the target field from the field value limitation condition corresponding to the target field, and determine the preset data type corresponding to the target field according to the data type limitation condition corresponding to the target field. For example, when the data type restriction condition corresponding to the target field is that the data type corresponding to the target field is an integer type, it is determined that the preset data type corresponding to the target field is an integer type.
S404, acquiring a field value corresponding to the non-preset data type as a modified field value corresponding to the target field.
Specifically, the modified field value does not satisfy the data type restriction condition corresponding to the target field. The non-preset data type refers to a data type different from the preset data type. The first server may obtain data corresponding to the non-preset data type as a modified field value corresponding to the target field. For example, when the preset data type is an integer type, the non-preset data type may include at least one of a floating point type and a character type, and the first server may use the floating point type data as a field value corresponding to the non-preset data type as a modified field value corresponding to the target field.
In the embodiment, the field value corresponding to the non-preset data type is obtained and used as the modification field value corresponding to the target field, so that the modification field value can be quickly obtained, and the generation efficiency of the data related to the modification resource is improved.
In some embodiments, as shown in fig. 5, the step S210 of transmitting the data related to the target resource transmission system to test the target resource transmission system includes:
and S502, respectively transmitting the target resource related data to a target resource transmission system through a plurality of transmission channels, wherein the target resource transmission system is used for transmitting the resource related data to third-party equipment, and the target resource related data carries a target resource identifier.
In particular, the third party device may be a market device of a market consuming user. The resource identification is used to uniquely identify the resource-related data. The target resource identification refers to an identification of target resource related data.
In some embodiments, the first server may transmit the same target resource related data to the target resource transmission system through a plurality of transmission channels, respectively, and the target resource transmission system may acquire the target resource transmission system transmitted by the plurality of transmission channels. Since the correlation numbers of the target resources transmitted by the transmission channels are the same, the target resource transmission system acquires a plurality of the same correlation numbers of the target resources.
S504, resource related data corresponding to the target resource identification are obtained from the third-party equipment and are used as a comparison resource related data set.
Specifically, the compared resource-related data is resource-related data corresponding to the target resource identifier in the third-party device. The set of comparative resource-related data can include greater than or equal to 0 comparative resource-related data.
In some embodiments, the first server may obtain, from the third-party device, each resource-related data corresponding to the target resource identifier according to the target resource identifier, as each comparison resource-related data in the comparison resource-related data set.
S506, determining the target number of copies of the resource related data contained in the comparative resource related data set, and determining the transmission test result of the target resource transmission system according to the target number of copies.
Specifically, the target number of copies refers to the number of resource-related data in the comparative resource-related data set. When the target resource transmission system obtains a plurality of same target resource correlation numbers, that is, when the target resource transmission system obtains the repeated data, in order to avoid repeated data transmission, it may be specified that the target resource transmission system should transmit only one target resource correlation number, that is, the repeated data transmission is not performed. In this case, the first server may calculate the target number of copies and compare with 1, but when the comparison is consistent, it is determined that the transmission test result of the target resource transmission system is that the duplicate data processing is normal, and otherwise, it is determined that the transmission test result of the target resource transmission system is that the duplicate data processing is abnormal.
In some embodiments, when the target resource transmission system obtains a plurality of identical target resource correlation numbers, the target resource transmission system may be specified to transmit a preset number of target resource correlation numbers. Wherein, the preset number of copies can be set according to the requirement.
In some embodiments, the first server may determine to compare a target number of copies of the resource-related data included in the resource-related data set, compare the target number of copies with a preset number of copies, determine that the transmission test result of the target resource transmission system is correct for transmission when the comparison is consistent, calculate a difference between the preset number of copies and the target number of copies to obtain a difference number of copies, and determine that the transmission test result of the target resource transmission system is the resource-related data of the difference number of more transmissions or less transmissions.
In the above embodiment, the target resource related data is transmitted to the target resource transmission system through the plurality of transmission channels, a scene in which the target resource transmission system acquires the repeated data may be simulated, and the transmission test result of the target resource transmission system may be determined according to the target number of copies by determining and comparing the target number of copies of the resource related data included in the resource related data set.
With the rapid development of economy, a new generation of extremely fast-running system appears. The new generation of extreme-speed system adopts a distributed architecture scheme, has the priority of reducing hardware cost and improving data reliability, and obviously improves the complexity of the system. However, since the new generation of very fast-acting system adopts a distributed architecture scheme, it is tested under complex scenarios such as repeated data merging, homologous multi-path data merging, non-homologous multi-path data merging, and the like, and the traditional test scheme cannot simulate these complex scenarios. According to the embodiment of the application, the combination of the repeated data can be simulated, namely when the target resource transmission system obtains the repeated data, the repeated sending of the same data to the third-party equipment is avoided, and the accurate test on the distributed market situation system can be realized.
In some embodiments, the first server may transmit the same resource-related data to the target resource transmission system at different times, so as to determine whether the target resource transmission system can normally handle the repeated transmission of data caused by network delay. In the actual data transmission process, the situation that the repeated data transmission is caused by network delay, multicast data packet loss and delay exists, and the scene of data retransmission caused by network delay can be simulated by transmitting the related data of the same resource to the target resource transmission system at different times, so that the function of the target resource transmission system is accurately tested. When the first server determines that the target resource transmission system does not repeatedly forward the repeated data, it may be determined that the network delay processing function of the target resource transmission system is normal. Certainly, the first server can also simulate other complex service scenarios, so that the complex service scenarios are covered.
In some embodiments, as shown in fig. 6, the step S210 of transmitting the data related to the target resource transmission system to test the target resource transmission system includes:
s602, forming a target resource related data sequence by the plurality of target resource related data according to the time corresponding to the target resource related data.
In particular, the resource-related data may comprise time information, which may comprise a time field and a corresponding time field value. The first server may generate a plurality of target resource-related data different in time information. Specifically, when generating different target resource related data, the first server may adopt different time field values, thereby obtaining a plurality of target resource related data with different time information.
In some embodiments, the first server may combine the plurality of target resource-related data into a target resource-related data sequence according to the time corresponding to the target resource-related data, that is, sort the target resource-related data according to the time information, to obtain the target resource-related data sequence. The target resource related data in the target resource related data sequence may be sorted according to time from front to back, or sorted according to time from back to front.
S604, updating the arrangement sequence of the target resource related data in the target resource related data sequence to obtain an updated resource related data sequence.
Specifically, the first server may adjust an arrangement order of each target resource related data in the target resource related data sequence to update the arrangement order of each target resource related data in the target resource related data sequence, so as to obtain an updated resource related data sequence. And updating the resource related data with the inconsistent arrangement sequence between the resource related data sequence and the target resource related data sequence.
And S606, transmitting the updated resource related data sequence to a target resource transmission system, wherein the target resource transmission system is used for transmitting the resource related data to third-party equipment, and the updated resource related data sequence carries an updated sequence identifier.
In particular, the first server may transmit the updated resource-related data sequence to the target resource transmission system. The target resource transmission system may check an arrangement order of the resource-related data in the updated resource-related data sequence, and when the check result is that the arrangement order of the resource-related data in the updated resource-related data sequence is not time-ordered, may correct the arrangement order in the updated resource-related data sequence to obtain a corrected resource-related data sequence, so that the corrected resource-related data sequence is consistent with the arrangement order of the resource-related data in the target resource-related data sequence, and transmit the corrected resource-related data sequence. It should be noted that it is unknown whether the target resource transmission system actually corrects the permutation order in the updated resource-related data sequence.
S608, the resource related data sequence corresponding to the update sequence identification is obtained from the third-party device and is used as a comparison resource related data sequence.
Specifically, the comparison resource-related data sequence is a resource-related data sequence corresponding to the update sequence identifier in the third-party device. The first server may obtain the resource-related data sequence corresponding to the update sequence identification from the third-party device as a comparison resource-related data sequence.
S610, comparing the arrangement sequence of the resource related data in the compared resource related data sequence and the resource related data in the target resource related data sequence, and determining the sequence correction test result of the target resource transmission system according to the comparison result.
Specifically, the first server may compare the sequence of the resource-related data in the resource-related data sequence and the sequence of the resource-related data in the target resource-related data sequence, and when the comparison is consistent, determine that the target resource transmission system corrects the sequence of the updated resource-related data sequence, may determine that the sequence correction test result of the target resource transmission system is that the sequence correction function is normal, and otherwise, determine that the sequence correction test result of the target resource transmission system is that the sequence correction function is abnormal.
In the above embodiment, the sequence order of the resource-related data in the resource-related data sequence and the sequence order of the resource-related data in the target resource-related data sequence are compared, and the sequence order correction test result of the target resource transmission system is determined according to the comparison result, if the comparison result is consistent, it may be determined that the target resource transmission system has corrected the sequence order in the updated resource-related data sequence, otherwise, it may be determined that the target resource transmission system has not corrected the sequence order in the updated resource-related data sequence or has failed to correct the sequence order in the updated resource-related data sequence. Therefore, the sequence correction function of the target resource transmission system is accurately tested.
Because the resource-related data are changed along with the change of time, the data in the resource-related data sequence are sequenced according to the time sequence to meet the actual requirement, and the sequence correction function of the target resource transmission system is tested to meet the actual requirement.
In some embodiments, as shown in fig. 7, the step S210 of transmitting the data related to the target resource transmission system to test the target resource transmission system includes:
s702, a target rate sequence corresponding to the target resource type identifier is obtained, and the target rate sequence comprises a plurality of target rates corresponding to the target time information respectively.
Specifically, the target rate sequence is obtained according to the transmission rate of the real resource-related data. The target time information may be a time range, and the target rate refers to a transmission rate of data in the time range corresponding to the standard time information. The target time information may include at least one of a start time point interval or an end time point interval. The target time information with the most advanced time is taken as the first target time information, and the starting time point interval of the target time information refers to the time difference between the starting time point of the target time information and the starting time point of the first target time information. The end time point interval of the target time information refers to a time difference between the end time point of the target time information and the start time point of the first target time information. For example, if the start time of the first target time information is T and the start time of the target time information is T + T1, the start time interval of the target time information is T1. Where T may be set as needed, for example, may be set to 0.
And S704, calculating according to the target time information and the corresponding target rate respectively to obtain target data volume corresponding to the target time information respectively.
Specifically, the first server may calculate a time length corresponding to the target time information, and calculate a product of the corresponding time length and the corresponding target rate as the target data amount corresponding to the target time information. The first server may calculate a time difference between the ending time interval and the starting time interval of the target time information as a time length corresponding to the target time information.
S706, combining the target resource related data of the target data volume to obtain a target resource related data set corresponding to the target time information.
In particular, the target resource-related data of the target data amount may comprise at least one target resource-related data, i.e. the target resource-related data set comprises at least one target resource-related data.
And S708, transmitting the target resource related data sets corresponding to the target time information to the target resource transmission system according to the target time information, so as to test the target resource transmission system.
Specifically, the first server may determine, according to the target time information, transmission time information of the target resource-related data set, and transmit the combined resource-related data at the corresponding target rate according to the transmission time information of the target resource-related data set. Wherein the transmission time information may include a start transmission time point.
In some embodiments, the first server may record an initial sending time point of a target resource related data set corresponding to a first target time information, as a first initial sending time point, calculate a time interval between a current time point and the first initial sending time point, as a current time interval, compare the current time interval with an initial time interval in each target time information, respectively, when the comparison is consistent, use the current time as an initial sending time point of the target resource related data set corresponding to the target time information when the comparison is consistent, and send, at the initial sending time point, the target resource related data set of the target time information corresponding to the target time information when the comparison is consistent according to a corresponding target rate.
In the above embodiment, since the target rate sequence corresponding to the target resource type identifier conforms to the sending rate of the real resource-related data, the target resource-related data sets corresponding to the target time information are respectively transmitted to the target resource transmission system according to the target time information to test the target resource transmission system, so that the sending scene of the real resource-related data can be simulated, the sending process of the data is more real, the testing accuracy is improved, and the value of the testing result of the target resource transmission system is improved.
It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In some embodiments, as shown in fig. 8, there is provided an automated testing apparatus comprising: a target business rule obtaining module 802, a field value limiting condition determining module 804, a target field value obtaining module 806, a target resource related data generating module 808 and a testing module 810, wherein:
and a target service rule obtaining module 802, configured to obtain a resource data simulation instruction, where the resource data simulation instruction carries a target resource type identifier, and obtain a target service rule corresponding to the target resource type identifier in response to the resource data simulation instruction.
A field value restriction condition determining module 804, configured to determine, according to the target service rule, a target field set corresponding to the target resource type identifier and a field value restriction condition corresponding to each target field in the target field set.
A target field value obtaining module 806, configured to obtain a field value that meets a field value constraint condition corresponding to the target field, as a target field value corresponding to the target field.
And a target resource related data generating module 808, configured to generate target resource related data corresponding to the type of the target resource according to each target field and the target field value corresponding to each target field.
The testing module 810 is configured to transmit the data related to the target resource transmission system, so as to test the target resource transmission system.
In some embodiments, the test module 808 includes:
and a modified field value obtaining unit, configured to obtain a field value that does not satisfy a field value restriction condition corresponding to the target field, as a modified field value corresponding to the target field.
And the modified resource related data obtaining unit is used for modifying the target field value corresponding to the target field in the target resource related data by utilizing the modified field value to obtain modified resource related data corresponding to the target resource type.
And the modified resource related data transmission unit is used for transmitting the modified resource related data to the target resource transmission system so as to test the target resource transmission system.
In some embodiments, the field value limitation condition includes a data type limitation condition, the modified field value obtaining unit is further configured to determine a preset data type corresponding to the target field according to the data type limitation condition corresponding to the target field; and acquiring a field value corresponding to the non-preset data type as a modified field value corresponding to the target field.
In some embodiments, the test module 810 includes:
and the resource related data transmission unit is used for respectively transmitting the target resource related data to the target resource transmission system through the plurality of transmission channels, the target resource transmission system is used for transmitting the resource related data to the third-party equipment, and the target resource related data carries the target resource identifier.
And the comparison resource related data set obtaining unit is used for obtaining resource related data corresponding to the target resource identifier from the third-party equipment and taking the resource related data as a comparison resource related data set.
And the transmission test result determining unit is used for determining and comparing the target number of the resource related data contained in the resource related data set and determining the transmission test result of the target resource transmission system according to the target number.
In some embodiments, the test module 810 includes:
and the target resource related data sequence forming unit is used for forming the target resource related data sequence by the plurality of target resource related data according to the time corresponding to the target resource related data.
And the updated resource related data sequence obtaining unit is used for updating the arrangement sequence of each target resource related data in the target resource related data sequence to obtain an updated resource related data sequence.
And the update resource related data sequence transmission unit is used for transmitting the update resource related data sequence to a target resource transmission system, the target resource transmission system is used for transmitting the resource related data to third-party equipment, and the update resource related data sequence carries an update sequence identifier.
And the comparison resource related data sequence obtaining unit is used for obtaining the resource related data sequence corresponding to the target resource identifier from the third-party equipment as the comparison resource related data sequence.
And the sequence order correction test result determining unit is used for comparing the arrangement orders of the resource related data in the compared resource related data sequence and the resource related data in the target resource related data sequence and determining the sequence order correction test result of the target resource transmission system according to the comparison result.
In some embodiments, the test module 810 includes:
and the target rate sequence acquiring unit is used for acquiring a target rate sequence corresponding to the target resource type identifier, and the target rate sequence comprises a plurality of target rates corresponding to the target time information respectively.
And the target data volume obtaining unit is used for calculating according to each target time information and the corresponding target rate respectively to obtain the target data volume corresponding to each target time information respectively.
And the target resource related data set obtaining unit is used for combining the target resource related data of the target data volume to obtain a target resource related data set corresponding to the target time information.
And the testing unit is used for transmitting the target resource related data sets corresponding to the target time information to the target resource transmission system according to the target time information so as to test the target resource transmission system.
For the specific definition of the automated testing device, reference may be made to the above definition of the automated testing method, which is not described herein again. The modules in the automatic testing device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In some embodiments, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an automated testing method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In some embodiments, a computer device is provided, comprising a memory in which a computer program is stored and a processor which, when executing the computer program, carries out the steps of the above-described automated testing method.
In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned automated testing method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.