WO2021042914A1 - 测试数据生成方法、装置、计算机设备和存储介质 - Google Patents
测试数据生成方法、装置、计算机设备和存储介质 Download PDFInfo
- Publication number
- WO2021042914A1 WO2021042914A1 PCT/CN2020/105362 CN2020105362W WO2021042914A1 WO 2021042914 A1 WO2021042914 A1 WO 2021042914A1 CN 2020105362 W CN2020105362 W CN 2020105362W WO 2021042914 A1 WO2021042914 A1 WO 2021042914A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- message
- request message
- logic
- test
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/14—Arrangements for monitoring or testing data switching networks using software, i.e. software packages
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Definitions
- This application relates to the field of big data technology, and in particular to a method, device, computer equipment and storage medium for generating test data.
- test data usually exceed the scope of the data server database, and the data used in the test is usually manually modified.
- the test data is generated after the real data in the server, but this method of generating test data requires manual interaction with the data server. Once the manual operation is wrong, the test data is directly saved to the data server, which will cause the data server to be saved. The real data is lost, which reduces the security of the data server database.
- test data generation method device, computer equipment, and storage medium are provided.
- a method of generating test data includes:
- the data request message carries the data server identifier
- the test data message is sent to the terminal, so that the terminal performs a test according to the test data message.
- a test data generating device includes:
- the data receiving module is used to receive the data request message sent by the terminal, and the data request message carries the data server identifier;
- the data sending module is used to send the data request message to the data server according to the data server identification
- the data response module is used to receive the data response message corresponding to the data request message returned by the data server;
- the data change module is used to obtain the data change logic, query the data field corresponding to the data change logic in the data response message, query the original data contained in the data response message according to the data field, and change the original data to obtain the test data Message;
- the data return module is used to send the test data message to the terminal so that the terminal can perform the test according to the test data message.
- a computer device including a memory and one or more processors, the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the one or more processors execute The following steps:
- the data request message carries the data server identifier
- the test data message is sent to the terminal, so that the terminal performs a test according to the test data message.
- One or more computer storage media storing computer-readable instructions.
- the one or more processors perform the following steps:
- the data request message carries the data server identifier
- the test data message is sent to the terminal, so that the terminal performs a test according to the test data message.
- test data generation method, device, computer equipment and storage medium receive the data request message sent by the terminal, send the data request message to the data server, and obtain the data response message sent by the data server in the query data response message
- the original data is included, and the original data is changed to obtain a test data message, and then the test data message is sent to the data server.
- the test data generation process from receiving the response data message sent by the data server to changing the original data in the response data message to obtain the test data, there is no need to make changes through the data server, avoiding changes due to misoperations
- the latter data replaces the original real data, which can effectively prevent the database from being polluted and greatly improve the security of the database.
- Fig. 1 is an application scenario diagram of a test data generation method according to one or more embodiments
- FIG. 2 is a schematic flowchart of a method for generating test data according to one or more embodiments
- FIG. 3 is a schematic flowchart of a data change step according to one or more embodiments
- FIG. 4 is a schematic flowchart of a logic deletion step according to one or more embodiments.
- FIG. 5 is a schematic flowchart of an interface verification step according to one or more embodiments.
- FIG. 6 is a schematic flowchart of a step of verifying an abnormality in an interface according to one or more embodiments
- Fig. 7 is a block diagram of a test data generating device according to one or more embodiments.
- Figure 8 is a block diagram of a data change module according to one or more embodiments.
- Figure 9 is a block diagram of a computer device according to one or more embodiments.
- the test data generation method provided in this application can be applied to the application environment as shown in FIG. 1.
- a proxy server 104 is established between the terminal 102 and the data server 106, and the terminal 102, the proxy server 104, and the data server 106 communicate through a network.
- the data request message sent by the terminal 102 and the data response message returned by the data server 106 are both sent through the proxy server 104.
- the proxy server 104 can modify the data in different messages.
- the sent data request message is sent to the data server 106 according to the data server identification carried in the data request message, and then the proxy server 104 receives the data response message returned by the data server 106, obtains the data modification logic, and queries the data Respond to the data field corresponding to the data change logic in the response message, query the original data contained in the data response message according to the data field, and change the original data to obtain a test data message, and then send the test data message to the terminal 102 , So that the terminal 102 performs a test according to the test data message.
- the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
- the server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
- a method for generating test data is provided. Taking the method applied to the proxy server in FIG. 1 as an example, the method includes the following steps:
- Step 202 Receive a data request message sent by the terminal, where the data request message carries a data server identifier.
- the data request message refers to the data acquisition request information sent by the terminal to the data server.
- the data acquisition request information includes different fields and request data corresponding to the different fields, and carries the data server identifier.
- the data server identifier is a unique identifier used to instruct the proxy server to find the corresponding server. It can be understood that the data server identifier is the network address corresponding to the data server, or the interface identifier corresponding to the data server.
- the proxy server refers to the server added based on the proxy program between the terminal and the data server.
- the proxy server has the functions of parsing messages and modifying the content of messages based on rules.
- the proxy server contains data modification logic and pre-stored replacement. Data and target data.
- the terminal is connected to the proxy server through the network, and receives a data request message sent through the input device of the terminal.
- the data request message carries a data server identifier, and the data server identifier is used to instruct the proxy server to find Data server.
- a financial APP Application
- the amount data displayed by the APP in the terminal is two decimal places. This is to test whether the terminal can process data with more than two decimal places.
- the amount data is displayed on the corresponding interface of the APP, and the amount data that exceeds two decimal places is rounded.
- the scenario that needs to be simulated now is to send to the terminal where the financial APP is installed an amount data that exceeds two decimal places.
- the terminal is connected to the proxy server through the network, and the terminal generates a data request message.
- the data request message carries the data server identifier, the request field, and the request data corresponding to the request field, and carries the data server identifier of the data server.
- the terminal will The data request message is sent to the proxy server.
- Step 204 Send the data request message to the data server according to the data server identifier.
- a data server refers to a server for storing original real data, and the server is configured with a database for storing real data.
- the proxy server queries the data server according to the data server identifier in the data request message, and sends the data request message to the data server. It may be that the proxy server parses the data server identifier to query the receiving interface, and sends the data request message to the data server according to the receiving interface. For example, the proxy server queries the data server receiving interface according to the data server identifier, and sends the data request message to the data server, and the data server stores real amount data.
- Step 206 Receive a data response message corresponding to the data request message returned by the data server.
- the data response message refers to the response information sent by the data server after receiving the data request message sent by the terminal, and the response information includes different fields and original data corresponding to the fields.
- the proxy server sends the data request message to the data server
- the data server reads the data request message, and according to the data request in the data request message, queries the pre-stored data corresponding to the data request, and according to the pre-stored data
- the stored data generates a data response message, and returns the data response message to the proxy server, and the proxy server receives the data response message corresponding to the data request message returned by the data server.
- the data server sends a message containing the amount data stored in the data server to the proxy server.
- Step 208 Obtain the data modification logic, query the data field corresponding to the data modification logic in the data response message, query the original data contained in the data response message according to the data field, and change the original data to obtain a test data message.
- the data modification logic is a tampering rule pre-stored in the proxy server.
- the proxy server supports the configuration of multiple tampering rules to realize the simulation of multiple data scenarios.
- the data field refers to the unit that characterizes the content of the message in the data response message. Specifically, after the proxy server queries different fields in the data response message, it filters out the data fields corresponding to the data modification logic. It can be understood that the data fields match the corresponding tampering rules. For example, the data server returns a data response message after receiving a data request message, in which the data modification logic is to change the amount data of less than two decimal places to more than two decimal places, which is pre-stored in the proxy server by the tester Data tampering rules.
- the proxy server When the proxy server receives the data response message, it can query the data response message from the data response message according to the tampering rules in the proxy server to find the amount field corresponding to the data change logic.
- the amount field is the data field.
- the original data refers to data that has been stored in the data server database, such as user information, and amount data corresponding to the user information.
- a test data message refers to a message that contains data required for scene simulation, where the data required for scene simulation is generally data obtained after the proxy server changes the original data according to the data change logic.
- the proxy server receives the data response message returned by the data server, parses the data response message, queries the original data in the data response message, and queries whether the original data is preset data, and when the original data is preset When data, the data response message containing the original data is sent to the terminal as a test data message. When the original data is not the preset data, the original data is changed, and the data response message of the changed original data is changed.
- the proxy server parses the data response message. If the original data in the data response message is data with more than two decimal places, Then the proxy server directly sends the data response message as a test data message to the terminal. If the original data in the data response message is two-digit amount data, the proxy server will send the original data in the data response message, that is, The amount data with two decimal places is changed to the amount data with more than two decimal places, and the test data message is obtained.
- Step 210 Send a test data message to the terminal, so that the terminal performs a test according to the test data message.
- the proxy server changes the data response message, and after obtaining the test data message, sends the test data message to the terminal.
- the terminal receives the test data message and extracts the test data contained therein, thereby completing the relevant processing and the relevant scenario simulation test. For example, after the proxy server receives a test data message containing more than two decimal places of data, it returns the test data message to the terminal, and the terminal receives the test data message and parses the test data message, and then obtains the parsed test data From the extracted test data in the message, which is the amount data, the terminal queries whether the amount data exceeds two decimal places, modify the amount data exceeding two decimal places, and display the modified data on the display interface to complete Test accordingly.
- the entire test data generation process does not need to modify the database storing the original data in the data server, so as to ensure the security of the database in the data server.
- the data change step that is, the step of changing the original data to obtain a test data message, further includes:
- Step 302 Obtain replacement data corresponding to the data field according to the data modification logic and the original data.
- the original data refers to the detailed data in the data response message.
- the proxy server obtains the data response message, it extracts the original data corresponding to the data field, which is also the real data stored in the data server database.
- the original data is the real amount data stored in the data server, and the real amount data can be 10.1, 10.22, 10.333 or other decimal amount data. It can be understood that the real amount data corresponding to the data field in the data response message is 10.333.
- the specific original data can be arbitrarily set according to actual scenarios or needs, and this embodiment does not specifically limit it.
- the replacement data refers to the data corresponding to the original data in the data response message obtained by the proxy server.
- the replacement data is also the data obtained through the data modification logic, and the replacement data is also the target data required by the terminal to complete the scenario simulation test.
- the proxy server After extracting the original data in the data response message according to the data field, the proxy server obtains the replacement data corresponding to the original data through the data modification logic.
- the replacement data is that the proxy server changes the amount data with less than two decimal places to more than two decimal places according to the data change logic Decimal amount data, such as changing 10.1 to 10.100, 10.101, 10.107, or 10.109, etc.
- the replacement amount of 10.100, 10.101, 10.107 or 10.109 is the replacement data corresponding to the actual amount of 10.1.
- the specific replacement data can be arbitrarily set according to actual scenarios or needs, and this embodiment does not specifically limit it.
- Step 304 Change the original data to replacement data to obtain a test data message.
- the test data message refers to a data message obtained by changing the original data in the data response message to replacement data by the proxy server through the data modification logic, and the data message contains the data content required for the test.
- the proxy server obtains the replacement data, it changes the original data in the data response message to the replacement data, thereby obtaining the test data message from the data response message, and then sends the test data message to the terminal and completes the related test.
- the proxy server changes the actual amount data 10.1 in the data response message to the replacement amount data 10.101, obtains a test data message, and sends the test data message to the terminal.
- the terminal parses the test data message and extracts the test data, which is the amount data 10.101.
- the terminal queries 10.101 for the amount data exceeding two decimal places, and the amount data 10.10 obtained by rounding 10.10. , And display 10.10 on the display interface and complete related tests.
- the data modification logic is stored in the proxy server in advance, the replacement data corresponding to the original data is obtained through the data modification logic, the original data is changed into the replacement data in the proxy server, and the test data message is obtained. After sending to the terminal, the relevant test is completed, and the data response message is changed in the proxy server. Therefore, the database can be effectively prevented from being polluted when the simulation of the relevant scene can be completed, and manual modification is not required, which improves the efficiency of the test.
- a schematic flow diagram of the logic deletion step after the data change step is provided, and the logic deletion step includes:
- Step 402 Count the acquisition times of the data modification logic, and use the data modification logic whose acquisition times are lower than a preset value as the logic to be deleted.
- the number of times the data modification logic is acquired may be the number of times the data modification logic is accessed, which represents the number of times the data modification logic is hit. The more the times, the higher the probability of the data modification logic being hit, and vice versa.
- the preset value refers to the number of times the preset data modification logic is hit, and the preset number can be 1, 2, or 3 times, etc.
- the proxy server counts the number of acquisitions of the data change logic and acquires a preset value, and compares the number of acquisitions with the preset value. When the number of acquisitions is lower than the preset value, that is, the number of hits of the data change logic does not meet the expected test It means that the data modification logic is less likely to be hit, and the data modification logic can be used as the logic to be deleted.
- Step 404 Output a deletion prompt message corresponding to the logic to be deleted.
- the deletion prompt information is generated by the proxy server according to the logic to be deleted, and is used to prompt the information of the data change logic that can be deleted.
- the deletion prompt information may include the name of the logic to be deleted, the number of times the logic to be deleted is acquired, and the logic to be deleted. The last acquisition time of the deletion logic and the acquisition time distribution of the logic to be deleted, etc.
- the deletion prompt information may also include optional deletion instructions.
- the proxy server After filtering out the logic to be deleted, the proxy server generates a deletion prompt message corresponding to the logic to be deleted. Specifically, the proxy server guides the tester to choose whether to delete the logic to be deleted through the deletion prompt message.
- Step 406 Receive a deletion instruction, the deletion instruction is generated according to the deletion prompt information, and the logic to be deleted is deleted according to the deletion instruction.
- the delete instruction refers to a delete command, which may be a delete command obtained by the tester selecting the logic to be deleted according to the delete prompt information, wherein the delete command is generated by the logic to be deleted that is selected for deletion.
- the proxy server outputs a deletion prompt message, the tester receives the selective deletion logic to be deleted, and generates a deletion instruction, and then deletes the selected deletion logic to be deleted according to the deletion instruction.
- the proxy server outputs the deletion prompt information of the logic 1 to be deleted, the deletion prompt information of the logic 2 to be deleted, and the deletion prompt information of the logic 3 to be deleted.
- the tester chooses to delete the logic 1 to be deleted, and receives the waiting information selected by the tester. Delete the delete instruction generated by the delete prompt message of the logic 1, and then delete the logic 1 to be deleted according to the delete instruction.
- the proxy server counts the acquisition times of the data modification logic, selects the data modification logic whose acquisition times are lower than the preset value as the logic to be deleted, and outputs the deletion prompt information, so that it can flexibly choose to delete the acquisition times less than The data change logic of the preset value.
- This embodiment implements flexible control of the data change logic in the proxy server, and saves storage space.
- the interface verification step that is, the step of sending a data request message to the data server according to the data server identifier, includes:
- Step 502 Query the field to be queried in the data request message.
- the field to be queried refers to a field associated with the corresponding interface of the terminal in the data request message, that is, the field to be queried contains information about the sending interface of the terminal.
- the proxy server parses the fields in the data request message, queries the fields associated with the terminal sending interface, and uses the fields as the fields to be queried.
- Step 504 Extract request data corresponding to the field to be queried from the data request message, and obtain pre-stored target data corresponding to the field to be queried.
- the request data refers to the data associated with the field to be queried selected by the proxy server from the data request message.
- the target data refers to the standard data that is pre-stored by the proxy server and corresponds to the field to be queried. It can be the actual data associated with the field to be queried, that is, the expected data corresponding to the field to be queried.
- the proxy server obtains the field to be queried associated with the sending interface of the terminal, it extracts the request data corresponding to the field to be queried from the data request message, and obtains the target data from the data pre-stored in the proxy server according to the field to be queried.
- Step 506 When the requested data is the same as the target data, the data request message is sent to the data server according to the data server identifier.
- the proxy server After the proxy server obtains the request data and the target data, it compares the two. When the request data and the target data are the same, the proxy server obtains the data interface corresponding to the data server according to the second service identifier carried in the data request message. The data request message is sent to the data server through the data interface.
- the proxy server can also verify the sending interface of the data server according to the data response message.
- the proxy server receives the data response message returned by the data server, it queries the field to be queried in the data response message.
- the field to be queried is associated with the sending interface of the data server. Extract detailed data corresponding to the field to be queried from the data response message, and obtain pre-stored target data corresponding to the field to be queried.
- the terminal interface verification passes.
- the proxy server extracts the requested data or detailed data in the data request message or the data response message and obtains the pre-stored target data corresponding to the field to be queried.
- the requested data or detailed data is the same as the target data Send the data request message to the data server.
- This embodiment verifies the sending interface through the proxy server, omits the interface verification link of the terminal or the data server, improves the response efficiency of the data, and at the same time ensures the safety of the terminal or the data server to read the data.
- a flow diagram of the interface verification step is provided, that is, the request data corresponding to the field to be queried is extracted from the data request message, and the pre-stored and the to-be-queried field are obtained.
- the target data step corresponding to the field it also includes:
- Step 602 When the requested data is different from the target data, the sending interface of the terminal is queried from the data request message, and the sending interface is associated with the field to be queried.
- the proxy server After the proxy server obtains the request data and the target data, it compares the two. When the request data and the target data are different, it means that the verification of the data request packet in the proxy server fails, and the proxy server parses the data request packet. Fields in the text, and query the field to be queried associated with the terminal, where the field to be queried corresponds to the sending interface corresponding to the terminal.
- Step 604 Obtain the storage path of the operation log corresponding to the sending interface, and extract the operation log according to the storage path.
- the operation log refers to a log file that records data modification operations, and contains information about all operations from the sending of the request message to the return of the test data message.
- the operation log may include the terminal sending interface and the receiving interface.
- the proxy server queries the storage path of the operation log according to the sending interface of the terminal, the storage path of the operation log is stored in the proxy server, and the operation log is obtained according to the storage path of the operation log.
- Step 606 Obtain a detection model.
- the detection model is trained based on the sample parameters and sample results of the sample log, and the operation log is detected according to the detection model to obtain a detection result.
- the detection model refers to a model that can detect the operation log
- the detection model refers to a model obtained by training based on the sample parameters and sample results contained in the sample log.
- the proxy server can extract the parameters to be detected in the operation log, and input the parameters to be detected into the detection model to obtain a definite detection result.
- Step 608 Filter the abnormal log in the operation log based on the detection result, and store the abnormal log in the abnormal database.
- the proxy server when the proxy server outputs the detection result of the operation log, when the detection result indicates that there is an abnormal log in the operation log, the proxy server extracts the abnormal log and stores it in the abnormal database of the proxy server.
- the proxy server receives the data response message returned by the data server.
- the data response message can be used.
- the text queries the data server sending interface, obtains the storage path of the operation log corresponding to the sending interface, and extracts the operation log for query according to the storage path.
- the proxy server can detect the operation log corresponding to the data server through the detection model. When the detection result is displayed as an abnormal log , The exception log is stored in the exception database in the proxy server.
- the proxy server detects the operation log by using the detection model, and stores the abnormal operation log with the detection result To the abnormal database in the proxy server.
- the abnormal operation log that occurs for the first time is stored in the abnormal database in the proxy server to facilitate subsequent queries of the abnormal operation log.
- the proxy server when the proxy server receives the data request message, if the data request message fails to pass the verification, it can query whether the request message carries a change identifier, and when it carries the change identifier, it is based on the change identifier.
- the request change logic corresponding to the data request message is obtained, and the data request message is changed according to the request change logic.
- the change identifier refers to a field that represents a change request carried on the message.
- the request change logic is a tampering rule pre-stored in the proxy server, and the change identifier in the data request message can trigger the request change logic.
- the proxy server receives the data request message, it parses the fields in the data request message, queries the change identifier carried in the data request message, obtains the request change logic according to the change identifier, and queries the data request message with the request Change the request change field corresponding to the logic, and then extract the request change data corresponding to the request change field in the data request message, and obtain the change data corresponding to the requested change data in the proxy server.
- the change data is pre-stored in the proxy server. Data, change the requested change data to change data to obtain a change request message and send it to the data server.
- the data server analyzes the change request message and makes feedback to detect whether the data server can verify the data message to be received.
- the proxy server when the proxy server receives the data request message, it parses the fields in the data request message, and queries the change identifier carried in the request message as the interface change identifier. The proxy server obtains the request change logic according to the interface change identifier, queries the interface field corresponding to the request change logic in the request message, and then extracts the interface data corresponding to the interface field in the data request message, and obtains the interface data in the proxy server For the corresponding change data, the interface data is changed to change data to obtain a change request message, and the change data contained in the change request message is different from the interface data corresponding to the actual sending interface of the terminal. Send the change request message to the data server to check whether the data server can detect the changed interface in the change request message.
- the proxy server after the proxy server receives the data request message, it can query whether the request message carries a change identifier.
- the request change logic is obtained according to the change identifier, and the data is changed according to the request change logic.
- the request message is changed, and the proxy server obtains the test data message by changing the data request message carrying the change identifier, and sends the test data message to the data server, which can detect the identification and interception of the abnormal data request message by the data server , So as to ensure the accuracy of the data server's response to abnormal data requests.
- FIGS. 2 to 6 are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in FIGS. 2 to 6 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
- a test data generating device 700 including:
- the data receiving module 702 is configured to receive a data request message sent by the terminal, and the data request message carries a data server identifier.
- the data sending module 704 is configured to send the data request message to the data server according to the data server identifier.
- the data response module 706 is configured to receive the data response message corresponding to the data request message returned by the data server.
- the data change module 708 is used to obtain the data change logic, query the data field corresponding to the data change logic in the data response message, query the original data contained in the data response message according to the data field, and change the original data to obtain the test Data message.
- the data return module 710 is configured to send a test data message to the terminal, so that the terminal performs a test according to the test data message.
- the data modification module 708 includes:
- the obtaining unit 708A is configured to obtain replacement data corresponding to the data field according to the data modification logic and the original data;
- the replacement unit 708B is used to change the original data into replacement data to obtain a test data message.
- the data modification module 708 further includes:
- the statistical unit is used to count the acquisition times of the data change logic, and use the data change logic whose acquisition times are lower than a preset value as the logic to be deleted.
- the prompt unit is used to output the deletion prompt information corresponding to the logic to be deleted.
- the instruction unit is used to receive a deletion instruction, the deletion instruction is generated according to the deletion prompt information, and the logic to be deleted is deleted according to the deletion instruction.
- the data sending module 704 includes:
- the query unit is used to query the field to be queried in the data request message.
- the preparation unit is used to extract request data corresponding to the field to be queried from the data request message, and to obtain pre-stored target data corresponding to the field to be queried.
- the judging unit is configured to send the data request message to the data server according to the data server identifier when the requested data is the same as the target data.
- the data sending module 704 further includes:
- the sending interface query unit is used to query the sending interface of the terminal from the data request message when the requested data is different from the target data, and the sending interface is associated with the field to be queried.
- the storage log extraction unit is used to obtain the storage path of the operation log corresponding to the sending interface, and extract the operation log according to the storage path.
- the detection result acquisition unit is used to acquire a detection model, the detection model is trained according to the sample parameters and sample results of the sample log, and the operation log is detected according to the detection model to obtain the detection result.
- the abnormal log storage unit is used to filter the abnormal log in the operation log based on the detection result, and store the abnormal log in the abnormal database.
- the test data generating device 700 further includes:
- the parsing module is used to analyze the data response message and query the original data in the data response message.
- the data response message containing the original data is sent to the terminal as a test data message .
- the test data generating device 700 further includes:
- the request change module is used to obtain the request change logic corresponding to the data request message according to the change identifier when it is detected that the data request message carries a change identifier, and change the data request message according to the request change logic to obtain the change request Message, send a change request message to the data server.
- test data generating device For the specific limitation of the test data generating device, please refer to the above limitation of the test data generating method, which will not be repeated here.
- Each module in the above-mentioned test data generating device can be implemented in whole or in part by software, hardware, and a combination thereof.
- the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
- a computer device is provided.
- the computer device may be a server, and its internal structure diagram may be as shown in FIG. 9.
- the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus.
- the processor of the computer device is used to provide calculation and control capabilities.
- the memory of the computer device includes a non-volatile or volatile storage medium and internal memory.
- the non-volatile or volatile storage medium stores an operating system, computer readable instructions, and a database.
- the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
- the database of the computer equipment is used to store test data to generate data.
- the network interface of the computer device is used to communicate with an external terminal through a network connection.
- the computer readable instruction is executed by the processor to realize a test data generation method.
- FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
- the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
- a computer device includes a memory and one or more processors.
- the memory stores computer-readable instructions.
- the one or more processors perform the following steps:
- the data request message carries the data server identifier
- the test data message is sent to the terminal, so that the terminal performs a test according to the test data message.
- the processor further implements the following steps when executing the computer-readable instructions:
- the original data is changed to the replacement data, and the test data message is obtained.
- the processor further implements the following steps when executing the computer-readable instructions:
- the deletion instruction is received, and the deletion instruction is generated according to the deletion prompt message, and the logic to be deleted is deleted according to the deletion instruction.
- the processor further implements the following steps when executing the computer-readable instructions:
- the data request message is sent to the data server according to the data server identification.
- the processor further implements the following steps when executing the computer-readable instructions:
- the sending interface of the terminal is queried from the data request message, and the sending interface is associated with the field to be queried;
- Obtain a detection model which is trained based on the sample parameters and sample results of the sample log, and detects the operation log according to the detection model to obtain the detection result;
- the processor further implements the following steps when executing the computer-readable instructions:
- the data response message containing the original data is sent to the terminal as a test data message.
- the processor further implements the following steps when executing the computer-readable instructions:
- One or more computer storage media storing computer-readable instructions.
- the one or more processors perform the following steps:
- the data request message carries the data server identifier
- the test data message is sent to the terminal, so that the terminal performs a test according to the test data message.
- the computer storage medium may be non-volatile or volatile.
- the original data is changed to the replacement data, and the test data message is obtained.
- the deletion instruction is received, and the deletion instruction is generated according to the deletion prompt message, and the logic to be deleted is deleted according to the deletion instruction.
- the data request message is sent to the data server according to the data server identification.
- the sending interface of the terminal is queried from the data request message, and the sending interface is associated with the field to be queried;
- Obtain a detection model which is trained based on the sample parameters and sample results of the sample log, and detects the operation log according to the detection model to obtain the detection result;
- the data response message containing the original data is sent to the terminal as a test data message.
- Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory may include random access memory (RAM) or external cache memory.
- RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请为一种测试数据生成方法,涉及大数据技术领域,包括:接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;根据数据服务器标识,将数据请求报文发送至数据服务器;接收数据服务器返回的与数据请求报文对应的数据响应报文;获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
Description
相关申请的交叉引用
本申请要求于2019年9月2日提交中国专利局,申请号为2019108234471,申请名称为“测试数据生成方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及大数据技术领域,特别是涉及一种测试数据生成方法、装置、计算机设备和存储介质。
随着计算机技术的发展,计算机技术的普及给人们的工作及生活带来极大便利,基于使用者的需求,计算机相关软件的更新迭代速度越来越快。在计算机软件投入使用前,进行模拟相关场景的软件测试环节是必不可少的。
然而,发明人意识到,目前软件测试中,相关的场景模拟千变万化,所需求的测试数据也是多种多样的,这些测试数据通常会超出数据服务器数据库范围,测试时使用的数据通常为人工修改数据库服务器中的真实数据后产生的测试数据,但这种生成测试数据的方式,需要人工与数据服务器进行多次交互,一旦人工操作失误,将测试数据直接保存至数据服务器中,会导致数据服务器中的真实数据丢失,降低了数据服务器数据库的安全性。
发明内容
根据本申请公开的各种实施例,提供一种测试数据生成方法、装置、计算机设备和存储介质。
一种测试数据生成方法包括:
接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;
根据数据服务器标识,将数据请求报文发送至数据服务器;
接收数据服务器返回的与数据请求报文对应的数据响应报文;
获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
一种测试数据生成装置包括:
数据接收模块,用于接收终端发出的数据请求报文,数据请求报文中携带有数据服 务器标识;
数据发送模块,用于根据数据服务器标识,将数据请求报文发送至数据服务器;
数据响应模块,用于接收数据服务器返回的与数据请求报文对应的数据响应报文;
数据变更模块,用于获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
数据返回模块,用于将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;
根据数据服务器标识,将数据请求报文发送至数据服务器;
接收数据服务器返回的与数据请求报文对应的数据响应报文;
获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
一个或多个存储有计算机可读指令的计算机存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;
根据数据服务器标识,将数据请求报文发送至数据服务器;
接收数据服务器返回的与数据请求报文对应的数据响应报文;
获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
上述测试数据生成方法、装置、计算机设备和存储介质,通过接收终端发出的数据请求报文,将数据请求报文发送至数据服务器,并获取数据服务器发出的数据响应报文查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文,进而将测试数据报文发送至数据服务器。整个测试数据生成过程中,从接收到数据服务器发送的响应数据报文到对响应数据报文中的原始数据进行变更得到测试数据,都不用通过数据服务器来进行变更,避免了由于误操作导致变更后的数据替代原始的真实数据,能够有效防止数据库被污染,大大提高了数据库安全性。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和 优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中测试数据生成方法的应用场景图;
图2为根据一个或多个实施例中测试数据生成方法的流程示意图;
图3为根据一个或多个实施例中数据变更步骤的流程示意图;
图4为根据一个或多个实施例中逻辑删除步骤的流程示意图;
图5为根据一个或多个实施例中接口校验步骤的流程示意图;
图6为根据一个或多个实施例中接口校验异常步骤的流程示意图;
图7为根据一个或多个实施例中测试数据生成装置的框图;
图8为根据一个或多个实施例中数据变更模块的框图;
图9为根据一个或多个实施例中计算机设备的框图。
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的测试数据生成方法,可以应用于如图1所示的应用环境中。终端102与数据服务器106之间建立有代理服务器104,终端102、代理服务器104与数据服务器106通过网络进行通信。终端102发送的数据请求报文,以及数据服务器106返回的数据响应报文均经过代理服务器104进行发送,代理服务器104可以对不同报文中的数据进行更改操作,当代理服务器104接收到终端102发出的数据请求报文,则根据数据请求报文中携带有数据服务器标识将其发送至数据服务器106,进而代理服务器104接收到数据服务器106返回的数据响应报文,获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文,进而将测试数据报文发送至终端102,使得终端102根据测试数据报文进行测试。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在其中一个实施例中,如图2所示,提供了一种测试数据生成方法,以该方法应用于图1中的代理服务器为例进行说明,包括以下步骤:
步骤202,接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识。
具体地,数据请求报文是指终端向数据服务器发出的数据获取的请求信息,该数据获取的请求信息中包含不同的字段及不同的字段对应的请求数据,并携带有数据服务器标识。数据服务器标识是用于指示代理服务器查询到对应的服务器的唯一标志。可以理解的是,数据服务器标识是数据服务器所对应的网络地址,或者是数据服务器所对应的接口标识。其中,代理服务器是指在终端和数据服务器之间基于代理程序增设的服务器,该代理服务器具有解析报文、基于规则修改报文内容的功能,且代理服务器中包含数据更改逻辑、预存储的替换数据和目标数据。具体地,在测试过程中,终端通过网络与代理服务器连接,接收通过终端的输入设备发送的数据请求报文,数据请求报文中携带有数据服务器标识,该数据服务器标识用于指示代理服务器查找数据服务器。
例如,终端中安装有金融类APP(Application,应用程序),且该终端中通过APP显示的金额数据为两位小数,为测试终端是否能够对超过两位小数的数据进行处理,将进行处理的金额数据显示在APP对应的界面上,并对超过两位小数的金额数据进行四舍五入操作,现所需要模拟的场景为发送至安装该金融类APP的终端一个超过两位小数的金额数据。终端通过网络与代理服务器连接,终端生成数据请求报文,该数据请求报文中携带有数据服务器标识,请求字段以及与请求字段对应的请求数据,且携带有数据服务器的数据服务器标识,终端将该数据请求报文发送至代理服务器。
步骤204,根据数据服务器标识,将数据请求报文发送至数据服务器。
具体地,数据服务器是指用于存储原始的真实数据的服务器,该服务器配置了一个用于存放真实数据的数据库。具体地,代理服务器接收到由终端发出的数据请求报文后,根据数据请求报文中的数据服务器标识查询到数据服务器,并将数据请求报文发送至数据服务器。可以是,代理服务器解析数据服务器标识查询到接收接口,根据接收接口将数据请求报文发送至数据服务器。例如,代理服务器根据数据服务器标识查询到数据服务器接收接口,将数据请求报文发送至数据服务器,该数据服务器中存储有真实的金额数据。
步骤206,接收数据服务器返回的与数据请求报文对应的数据响应报文。
具体地,数据响应报文是指数据服务器接收到终端发出的数据请求报文后发送的应答信息,该应答信息中包含不同的字段及字段对应的原始数据。具体地,代理服务器将数据请求报文发送到数据服务器之后,数据服务器读取数据请求报文,根据数据请求报文中的数据请求,查询到与数据请求对应的预存储的数据,并根据预存储的数据,生成数据响应报文,并将数据响应报文返回代理服务器,代理服务器接收数据服务器返回的与数据请求报文对应的数据响应报文。例如,数据服务器接收到代理服务器发送的数据请求报文后,将包含存储在数据服务器中的金额数据的报文发送给代理服务器。
步骤208,获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文。
具体地,数据更改逻辑是一种预先存储至代理服务器的篡改规则。代理服务器支持配 置多个篡改规则,实现多种数据场景的模拟。数据字段是指数据响应报文中表征报文内容的单元。具体地,代理服务器查询数据响应报文中的不同字段后,筛选出与数据更改逻辑对应的数据字段,可以理解为,该数据字段与对应的篡改规则相匹配。例如,数据服务器接收到数据请求报文后返回数据响应报文,其中,数据更改逻辑即为通过测试人员预先存储至代理服务器中的将少于两位小数的金额数据变更为超过两位小数金额数据的篡改规则。代理服务器接收到数据响应报文时,能够根据代理服务器中的篡改规则从该数据响应报文中查询到与数据更改逻辑对应的金额字段,该金额字段即为数据字段,金额字段表征的是在数据响应报文中表示金额数据的信息。具体数据字段可根据实际场景或需要任意设置,本实施例并不做具体限定。
具体的,原始数据是指已存储至数据服务器数据库的数据,例如用户信息,以及与用户信息对应的金额数据等。测试数据报文是指包含场景模拟所需要数据的报文,其中,场景模拟所需要的数据一般为代理服务器将原始数据根据数据更改逻辑变更后得到的数据。具体地,代理服务器接收到数据服务器返回的数据响应报文,并对数据响应报文进行解析,查询数据响应报文中的原始数据,查询原始数据是否为预设数据,当原始数据为预设数据时,则将包含有原始数据的数据响应报文作为测试数据报文发送至终端,当原始数据不为预设数据时,则将原始数据进行变更,将变更的原始数据的数据响应报文作为测试数据报文发送至终端。例如,当数据服务器将包含存储在数据服务器中的金额数据的数据响应报文发送回代理服务器,代理服务器解析数据响应报文,如果数据响应报文中的原始数据为超过两位小数金额数据,则代理服务器直接将该数据响应报文作为测试数据报文发送至终端,若数据响应报文中的原始数据为两位小数的金额数据,则代理服务器将数据响应报文中原始数据,也即将两位小数的金额数据,更改为超过两位小数的金额数据,得到测试数据报文。
步骤210,将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
具体地,代理服务器对数据响应报文变更,得到测试数据报文后,将测试数据报文发送至终端。终端接收到测试数据报文提取到包含在其中的测试数据,从而完成相关处理及相关的场景模拟测试。例如,代理服务器接收到包含超过两位小数金额数据的测试数据报文后,将测试数据报文返回至终端,终端接收到测试数据报文并解析测试数据报文,进而从解析后的测试数据报文中从提取到测试数据,也即是金额数据,终端查询金额数据是否超过两位小数,将超过两位小数的金额数据进行修改,并将修改后的数据显示在显示界面上,从而完成相应测试。
在本实施例中,整个测试数据生成过程无需对数据服务器中存储原始数据的数据库进行修改,保证数据服务器中的数据库的安全性。
在其中一个实施例中,如图3所示,提供一种数据变更步骤的流程示意图,数据变更步骤,也即将原始数据进行变更,得到测试数据报文的步骤,还包括:
步骤302,根据数据更改逻辑和原始数据获取与数据字段对应的替换数据。
具体的,原始数据是指数据响应报文中的详细数据。本实施例中,当代理服务器获取数据响应报文时,提取与数据字段对应的原始数据,也是存储至数据服务器数据库中的真实数据。例如,原始数据为存储在数据服务器中的真实金额数据,这些真实金额数据可以10.1、10.22、10.333或其他位小数的金额数据。可以理解为,与数据响应报文中数据字段对应的真实金额数据为10.333。具体原始数据可根据实际场景或需要任意设置,本实施例并不做具体限定。
具体地,替换数据是指代理服务器获取的与数据响应报文中原始数据对应的数据,替换数据也是通过数据更改逻辑得出的数据,替换数据也是终端完成场景模拟测试所需的目标数据。具体地,当根据数据字段提取到数据响应报文中的原始数据后,代理服务器通过数据更改逻辑获取与原始数据对应的替换数据。例如,当数据更改逻辑为将少于两位小数的金额数据变更为超过两位小数金额数据时,替换数据就是代理服务器根据该数据更改逻辑将少于两位小数的金额数据变更为超过两位小数金额数据,如将10.1变更为10.100、10.101、10.107或10.109等。其中,替换金额10.100、10.101、10.107或10.109即为与实际金额10.1对应的替换数据。具体替换数据可根据实际场景或需要任意设置,本实施例并不做具体限定。
步骤304,将原始数据变更为替换数据,得到测试数据报文。
具体地,测试数据报文是指代理服务器通过数据更改逻辑将数据响应报文中的原始数据变更为替换数据而得到的数据报文,该数据报文中包含了测试所需的数据内容。具体地,代理服务器获取替换数据后,将数据响应报文中的原始数据变更为替换数据,从而由数据响应报文得到测试数据报文,进而将测试数据报文发送至终端并完成相关测试。例如,代理服务器将数据响应报文中的实际金额数据10.1变更为替换金额数据10.101,得到测试数据报文,并将该测试数据报文发送至终端。终端接收到该测试数据报文后,解析测试数据报文并提取到测试数据,也即是金额数据10.101,终端查询10.101为超过两位小数的金额数据,对10.101进行四舍五入操作得到的金额数据10.10,并将10.10显示在显示界面上并完成相关测试。
本实施例中,预先在代理服务器中存储数据更改逻辑,通过数据更改逻辑获取与原始数据对应的替换数据,在代理服务器中将原始数据变更为替换数据,得到测试数据报文,该数据报文发送至终端后完成相关测试,对数据响应报文的变更在代理服务器中完成,因而在能够完成相关场景模拟的情况下有效的防止数据库被污染,且无需人工进行修改,提高了测试的效率。
在其中一个实施例中,如图4所示,提供一种数据变更步骤之后的逻辑删除步骤的流程示意图,逻辑删除步骤包括:
步骤402,统计数据更改逻辑的获取次数,将获取次数低于预设值的数据更改逻辑作为待删除逻辑。
具体地,数据更改逻辑的获取次数可以为访问该数据更改逻辑的次数,表征的是该 数据更改逻辑被命中的次数,次数越多表示该数据更改逻辑被命中的几率越高,反之则越低。预设值是指预设的数据更改逻辑被命中的次数,预设次数可以是1次、2次或3次等。具体地,代理服务器统计数据更改逻辑的获取次数,并获取预设值,将获取次数与预设值进行对比,当获取次数低于预设值时,也就是数据更改逻辑命中次数未达到预期测试时,说明该数据更改逻辑被命中几率较低,可以将该数据更改逻辑作为待删除逻辑。
步骤404,输出与待删除逻辑对应的删除提示信息。
具体地,删除提示信息是代理服务器根据待删除逻辑生成的,用于提示可删除的数据更改逻辑的信息,可以是,删除提示信息可以包括待删除逻辑的名称、待删除逻辑的获取次数、待删除逻辑最近一次获取时间及待删除逻辑的获取时间分布等,该删除提示信息还可以包括可供选择的删除指令。筛选出待删除逻辑后,代理服务器生成与待删除逻辑对应的删除提示信息。具体地,代理服务器通过删除提示信息引导测试人员选择是否删除该待删除逻辑。
步骤406,接收删除指令,删除指令是根据删除提示信息生成的,根据删除指令对待删除逻辑进行删除。
具体地,删除指令是指删除命令,可以是,删除指令是通过测试人员根据删除提示信息对待删除逻辑进行的选择得到的删除命令,其中,删除命令由选择删除的待删除逻辑生成。具体地,代理服务器输出删除提示信息,通过测试人员接收到选择性删除待删除逻辑,并生成删除指令,进而根据删除指令删除选择删除的待删除逻辑。例如,代理服务器输出了待删除逻辑1的删除提示信息、待删除逻辑2的删除提示信息以及待删除逻辑3的删除提示信息,通过测试人员选择删除待删除逻辑1,接收由测试人员选择的待删除逻辑1的删除提示信息生成的删除指令,进而根据删除指令删除待删除逻辑1。
本实施例中,代理服务器统计数据更改逻辑的获取次数,选择出获取次数低于预设值的数据更改逻辑作为待删除逻辑,并输出删除提示信息,从而能够根据需求灵活选择删除获取次数低于预设值的数据更改逻辑。本实施例实现了对代理服务器中数据更改逻辑的灵活控制,节省了存储空间。
在其中一个实施例中,如图5所示,提供一种接口校验步骤的流程示意图,接口校验步骤,也即根据数据服务器标识,将数据请求报文发送至数据服务器的步骤,包括:
步骤502,查询数据请求报文中的待查询字段。
具体地,待查询字段是指数据请求报文中与终端对应接口相关联的字段,也即待查询字段包含了终端发送接口的信息。具体地,代理服务器接收数据请求报文后,解析数据请求报文中的字段,查询出与终端发送接口相关联的字段,将该字段作为待查询字段。
步骤504,从数据请求报文中提取与待查询字段对应的请求数据,并获取预存储的与待查询字段对应的目标数据。
具体地,请求数据是指代理服务器从数据请求报文中选取的与待查询字段关联的数据。目标数据是指代理服务器预存储的与待查询字段对应的标准数据,可以是,目标数据 是待查询字段相关联的实际数据,也即是待查询字段所对应的预期数据。具体地,代理服务器得到与终端发送接口相关联的待查询字段后,从数据请求报文中提取与待查询字段对应的请求数据,并根据待查询字段从代理服务器预存的数据中获取目标数据。
步骤506,当请求数据与目标数据相同时,根据数据服务器标识,将数据请求报文发送至数据服务器。
具体地,代理服务器得到请求数据和目标数据后,将两者进行对比,当请求数据和目标数据相同时,根据数据请求报文携带的第二服务标识获取数据服务器对应的数据接口,代理服务器将数据请求报文通过该数据接口发送至数据服务器。
需要说明的是,代理服务器还可以根据数据响应报文对数据服务器的发送接口进行校验,当代理服务器接收到数据服务器返回的数据响应报文时,则查询数据响应报文中的待查询字段,待查询字段与数据服务器发送接口相关联。从数据响应报文中提取与待查询字段对应的详细数据,并获取预存储的与待查询字段对应的目标数据。详细数据与目标数据相同时,则终端接口校验通过。
本实施例中,代理服务器通过提取数据请求报文或数据响应报文中的请求数据或详细数据以及获取预存储的与待查询字段对应的目标数据,当请求数据或详细数据与目标数据相同时将数据请求报文发送至数据服务器。本实施例通过代理服务器对发送接口进行校验,省略了终端或数据服务器的接口验证环节,提高了数据的响应效率,同时保证了终端或数据服务器读取数据的安全性。
在又一个实施例中,如图6所示,提供一种接口校验步骤的流程示意图,也即从数据请求报文中提取与待查询字段对应的请求数据,并获取预存储的与待查询字段对应的目标数据步骤之后,还包括:
步骤602,当请求数据与目标数据不同时,从数据请求报文中查询终端的发送接口,发送接口与待查询字段相关联。
具体地,代理服务器得到请求数据和目标数据后,将两者进行对比,当请求数据和目标数据不同时,即为数据请求报文在代理服务器中的校验未通过,代理服务器解析数据请求报文中的字段,并查询出与终端相关联的待查询字段查询,其中该待查询字段对应的是终端对应的发送接口。
步骤604,获取发送接口对应的操作日志的存储路径,根据存储路径提取操作日志。
具体地,操作日志是指记录数据的修改操作的日志文件,包含了从请求报文发出到测试数据报文返回过程全部操作的信息,可以是,操作日志可以包含终端发送接口及接收接口。代理服务器根据终端的发送接口查询到操作日志的存储路径,操作日志的存储路径存储于代理服务器中,根据操作日志的存储路径获取操作日志。
步骤606,获取检测模型,检测模型是根据样本日志的样本参数及样本结果训练得到的,根据检测模型对操作日志进行检测,得到检测结果。
具体地,检测模型是指可以对操作日志进行检测的模型,且该检测模型是指根据样 本日志中包含的样本参数以及样本结果进行训练得到的。具体地,代理服务器可以提取操作日志中的待检测参数,将待检测参数输入至检测模型中,则可以得到确定的检测结果。
步骤608,通过检测结果筛选操作日志中的异常日志,并将异常日志存储至异常数据库。
具体地,代理服务器输出操作日志的检测结果时,当检测结果表示操作日志中存在有异常日志时,则代理服务器提取异常日志,并存储至代理服务器的异常数据库中。
需要说明的是,代理服务器接收到数据服务器返回的数据响应报文,当详细数据与目标数据相比,两者不同时,即为数据响应报文校验不通过时,则可以采用数据响应报文查询数据服务器发送接口,获取发送接口对应的操作日志的存储路径,并根据存储路径提取操作日志进行查询,代理服务器可以通过检测模型检测数据服务器对应的操作日志,当检测结果显示为异常日志时,则将异常日志存储至代理服务器中的异常数据库。
在本实施例中,当请求数据或详细数据与目标数据不同时,即为报文中的接口校验不通过时,代理服务器通过利用检测模型检测操作日志,将检测结果为异常的操作日志存储至代理服务器中的异常数据库中。本实施例通过将首次出现的异常操作日志存储至代理服务器中的异常数据库,方便后续该异常操作日志的查询。
在其中一个实施例中,代理服务器接收到数据请求报文时,数据请求报文校验不通过时,可以查询请求报文上是否携带有更改标识,当携带有更改标识时,则根据更改标识获取到与数据请求报文对应的请求更改逻辑,根据请求更改逻辑对数据请求报文进行变更。
具体地,更改标识是指报文上携带的代表更改请求的字段。请求更改逻辑是预先存储至代理服务器的一种篡改规则,数据请求报文中的更改标识能够触发请求更改逻辑。具体地,代理服务器接收到数据请求报文时,解析数据请求报文中的字段,查询出数据请求报文携带的更改标识,根据更改标识获取到请求更改逻辑,查询数据请求报文中与请求更改逻辑对应的请求更改字段,进而提取数据请求报文中与该请求更改字段对应的请求更改数据,并获取代理服务器中与请求更改数据对应的更改数据,该更改数据为预存在代理服务器中的数据,将请求更改数据变更为更改数据得到更改请求报文,并发送至数据服务器,通过数据服务器解析更改请求报文及做出的反馈来检测数据服务器是否能够校验待接收的数据报文。
例如,代理服务器接收到数据请求报文时,解析数据请求报文中的字段,查询出请求报文携带的更改标识为接口更改标识。代理服务器根据接口更改标识获取请求更改逻辑,查询出请求报文中与请求更改逻辑对应的接口字段,进而提取与数据请求报文中与接口字段对应的接口数据,并获取代理服务器中与接口数据对应的更改数据,将接口数据变更为更改数据得到更改请求报文,该更改请求报文包含的更改数据是与终端实际发送接口对应的接口数据不同。将更改请求报文发送给数据服务器,从而检测数据服务器是否能够检测出更改请求报文中变更的接口。
本实施例中,代理服务器接收到数据请求报文后,可以查询请求报文上是否携带有更改标识,当携带有更改标识时,则根据更改标识获取到请求更改逻辑,根据请求更改逻辑对数据请求报文进行变更,代理服务器通过变更携带更改标识的数据请求报文,得到测试数据报文,并将测试数据报文发送给数据服务器,能够检测数据服务器对异常数据请求报文的识别与拦截,从而保证了数据服务器对异常数据请求反映的准确性。
应该理解的是,虽然图2至6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2至6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在其中一个实施例中,如图7所示,提供了一种测试数据生成装置700,包括:
数据接收模块702,用于接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识。
数据发送模块704,用于根据数据服务器标识,将数据请求报文发送至数据服务器。
数据响应模块706,用于接收数据服务器返回的与数据请求报文对应的数据响应报文。
数据变更模块708,用于获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文。
数据返回模块710,用于将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
在其中一个实施例中,如图8所示,提供一种数据变更模块708的结构框图,数据变更模块708,包括:
获取单元708A,用于根据数据更改逻辑和原始数据获取与数据字段对应的替换数据;
替换单元708B,用于将原始数据变更为替换数据,得到测试数据报文。
在其中一个实施例中,数据变更模块708还包括:
统计单元,用于统计数据更改逻辑的获取次数,将获取次数低于预设值的数据更改逻辑作为待删除逻辑。
提示单元,用于输出与待删除逻辑对应的删除提示信息。
指令单元,用于接收删除指令,删除指令是根据删除提示信息生成的,根据删除指令对待删除逻辑进行删除。
在其中一个实施例中,数据发送模块704,包括:
待查询单元,用于查询数据请求报文中的待查询字段。
准备单元,用于从数据请求报文中提取与待查询字段对应的请求数据,并获取预存储的与待查询字段对应的目标数据。
判断单元,用于当请求数据与目标数据相同时,根据数据服务器标识,将数据请求报文发送至数据服务器。
在其中一个实施例中,数据发送模块704还包括:
发送接口查询单元,用于当请求数据与目标数据不同时,从数据请求报文中查询终端的发送接口,发送接口与待查询字段相关联。
存储日志提取单元,用于获取发送接口对应的操作日志的存储路径,根据存储路径提取操作日志。
检测结果获取单元,用于获取检测模型,检测模型是根据样本日志的样本参数及样本结果训练得到的,根据检测模型对操作日志进行检测,得到检测结果。
异常日志存储单元,用于通过检测结果筛选操作日志中的异常日志,并将异常日志存储至异常数据库。
在其中一个实施例中,测试数据生成装置700还包括:
解析模块,用于对数据响应报文进行解析,查询数据响应报文中的原始数据,当原始数据为预设数据时,将包含有原始数据的数据响应报文作为测试数据报文发送至终端。
在其中一个实施例中,测试数据生成装置700还包括:
请求更改模块,用于当检测到数据请求报文上携带有更改标识时,根据更改标识获取与数据请求报文对应的请求更改逻辑,根据请求更改逻辑对数据请求报文进行变更,得到更改请求报文,发送更改请求报文至数据服务器。
关于测试数据生成装置的具体限定可以参见上文中对于测试数据生成方法的限定,在此不再赘述。上述测试数据生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在其中一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性或易失性存储介质、内存储器。该非易失性或易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储测试数据生成数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种测试数据生成方法。
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可 以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:
接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;
根据数据服务器标识,将数据请求报文发送至数据服务器;
接收数据服务器返回的与数据请求报文对应的数据响应报文;
获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
根据数据更改逻辑和原始数据获取与数据字段对应的替换数据;及
将原始数据变更为替换数据,得到测试数据报文。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
统计数据更改逻辑的获取次数,将获取次数低于预设值的数据更改逻辑作为待删除逻辑;
输出与待删除逻辑对应的删除提示信息;及
接收删除指令,删除指令是根据删除提示信息生成的,根据删除指令对待删除逻辑进行删除。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
查询数据请求报文中的待查询字段;
从数据请求报文中提取与待查询字段对应的请求数据,并获取预存储的与待查询字段对应的目标数据;及
当请求数据与目标数据相同时,根据数据服务器标识,将数据请求报文发送至数据服务器。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
当请求数据与目标数据不同时,从数据请求报文中查询终端的发送接口,发送接口与待查询字段相关联;
获取发送接口对应的操作日志的存储路径,根据存储路径提取操作日志;
获取检测模型,检测模型是根据样本日志的样本参数及样本结果训练得到的,根据检测模型对操作日志进行检测,得到检测结果;及
通过检测结果筛选操作日志中的异常日志,并将异常日志存储至异常数据库。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
对数据响应报文进行解析;
查询数据响应报文中的原始数据;及
当原始数据为预设数据时,将包含有原始数据的数据响应报文作为测试数据报文发送至终端。
在一个实施例中,处理器执行计算机可读指令时还实现以下步骤:
当检测到数据请求报文上携带有更改标识时,根据更改标识获取与数据请求报文对应的请求更改逻辑;
根据请求更改逻辑对数据请求报文进行变更,得到更改请求报文;及
发送更改请求报文至数据服务器。
一个或多个存储有计算机可读指令的计算机存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
接收终端发出的数据请求报文,数据请求报文中携带有数据服务器标识;
根据数据服务器标识,将数据请求报文发送至数据服务器;
接收数据服务器返回的与数据请求报文对应的数据响应报文;
获取数据更改逻辑,查询数据响应报文中与数据更改逻辑对应的数据字段,根据数据字段查询数据响应报文中包含的原始数据,并将原始数据进行变更,得到测试数据报文;及
将测试数据报文发送至终端,以使终端根据测试数据报文进行测试。
其中,该计算机存储介质可以是非易失性,也可以是易失性的。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
根据数据更改逻辑和原始数据获取与数据字段对应的替换数据;及
将原始数据变更为替换数据,得到测试数据报文。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
统计数据更改逻辑的获取次数,将获取次数低于预设值的数据更改逻辑作为待删除逻辑;
输出与待删除逻辑对应的删除提示信息;及
接收删除指令,删除指令是根据删除提示信息生成的,根据删除指令对待删除逻辑进行删除。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
查询数据请求报文中的待查询字段;
从数据请求报文中提取与待查询字段对应的请求数据,并获取预存储的与待查询字段对应的目标数据;及
当请求数据与目标数据相同时,根据数据服务器标识,将数据请求报文发送至数据服务器。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
当请求数据与目标数据不同时,从数据请求报文中查询终端的发送接口,发送接口与待查询字段相关联;
获取发送接口对应的操作日志的存储路径,根据存储路径提取操作日志;
获取检测模型,检测模型是根据样本日志的样本参数及样本结果训练得到的,根据检测模型对操作日志进行检测,得到检测结果;及
通过检测结果筛选操作日志中的异常日志,并将异常日志存储至异常数据库。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
对数据响应报文进行解析;
查询数据响应报文中的原始数据;及
当原始数据为预设数据时,将包含有原始数据的数据响应报文作为测试数据报文发送至终端。
在一个实施例中,计算机可读指令被处理器执行时还实现以下步骤:
当检测到数据请求报文上携带有更改标识时,根据更改标识获取与数据请求报文对应的请求更改逻辑;
根据请求更改逻辑对数据请求报文进行变更,得到更改请求报文;及
发送更改请求报文至数据服务器。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
Claims (20)
- 一种测试数据生成方法,包括:接收终端发出的数据请求报文,所述数据请求报文中携带有数据服务器标识;根据所述数据服务器标识,将所述数据请求报文发送至数据服务器;接收所述数据服务器返回的与所述数据请求报文对应的数据响应报文;获取数据更改逻辑,查询所述数据响应报文中与所述数据更改逻辑对应的数据字段,根据所述数据字段查询所述数据响应报文中包含的原始数据,并将所述原始数据进行变更,得到测试数据报文;及将所述测试数据报文发送至所述终端,以使所述终端根据所述测试数据报文进行测试。
- 根据权利要求1所述的方法,其中,所述将所述原始数据进行变更,得到测试数据报文,包括:根据所述数据更改逻辑和所述原始数据获取与所述数据字段对应的替换数据;及将所述原始数据变更为所述替换数据,得到测试数据报文。
- 根据权利要求2所述的方法,其中,还包括:统计所述数据更改逻辑的获取次数,将所述获取次数低于预设值的所述数据更改逻辑作为待删除逻辑;输出与所述待删除逻辑对应的删除提示信息;及接收删除指令,所述删除指令是根据所述删除提示信息生成的,根据所述删除指令对所述待删除逻辑进行删除。
- 根据权利要求1所述的方法,其中,所述根据所述数据服务器标识,将所述数据请求报文发送至数据服务器,包括:查询所述数据请求报文中的待查询字段;从所述数据请求报文中提取与所述待查询字段对应的请求数据,并获取预存储的与所述待查询字段对应的目标数据;及当所述请求数据与所述目标数据相同时,根据所述数据服务器标识,将所述数据请求报文发送至数据服务器。
- 根据权利要求4所述的方法,其中,在所述从所述数据请求报文中提取与所述待查询字段对应的请求数据,并获取预存储的与所述待查询字段对应的目标数据之后,所述方法还包括:当所述请求数据与所述目标数据不同时,从所述数据请求报文中查询所述终端的发送接口,所述发送接口与所述待查询字段相关联;获取所述发送接口对应的操作日志的存储路径,根据所述存储路径提取所述操作日志;获取检测模型,所述检测模型是根据样本日志的样本参数及样本结果训练得到的,根 据所述检测模型对所述操作日志进行检测,得到检测结果;及通过所述检测结果筛选所述操作日志中的异常日志,并将所述异常日志存储至异常数据库。
- 根据权利要求1所述的方法,其中,在所述接收所述数据服务器返回的与所述数据请求报文对应的数据响应报文之后,所述方法还包括:对所述数据响应报文进行解析;查询所述数据响应报文中的原始数据;及当所述原始数据为预设数据时,将包含有原始数据的数据响应报文作为测试数据报文发送至终端。
- 根据权利要求1所述的方法,其中,在所述接收终端发出的数据请求报文之后,所述方法还包括:当检测到所述数据请求报文上携带有更改标识时,根据所述更改标识获取与数据请求报文对应的请求更改逻辑;根据所述请求更改逻辑对数据请求报文进行变更,得到更改请求报文;及发送所述更改请求报文至数据服务器。
- 一种测试数据生成装置,包括:数据接收模块,用于接收终端发出的数据请求报文,所述数据请求报文中携带有数据服务器标识;数据发送模块,用于根据所述数据服务器标识,将所述数据请求报文发送至数据服务器;数据响应模块,用于接收所述数据服务器返回的与所述数据请求报文对应的数据响应报文;数据变更模块,用于获取数据更改逻辑,查询所述数据响应报文中与所述数据更改逻辑对应的数据字段,根据所述数据字段查询所述数据响应报文中包含的原始数据,并将所述原始数据进行变更,得到测试数据报文;及数据返回模块,用于将所述测试数据报文发送至所述终端,以使所述终端根据所述测试数据报文进行测试。
- 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:接收终端发出的数据请求报文,所述数据请求报文中携带有数据服务器标识;根据所述数据服务器标识,将所述数据请求报文发送至数据服务器;接收所述数据服务器返回的与所述数据请求报文对应的数据响应报文;获取数据更改逻辑,查询所述数据响应报文中与所述数据更改逻辑对应的数据字段,根据所述数据字段查询所述数据响应报文中包含的原始数据,并将所述原始数据进行变 更,得到测试数据报文;及将所述测试数据报文发送至所述终端,以使所述终端根据所述测试数据报文进行测试。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:根据所述数据更改逻辑和所述原始数据获取与所述数据字段对应的替换数据;及将所述原始数据变更为所述替换数据,得到测试数据报文。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:统计所述数据更改逻辑的获取次数,将所述获取次数低于预设值的所述数据更改逻辑作为待删除逻辑;输出与所述待删除逻辑对应的删除提示信息;及接收删除指令,所述删除指令是根据所述删除提示信息生成的,根据所述删除指令对所述待删除逻辑进行删除。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:查询所述数据请求报文中的待查询字段;从所述数据请求报文中提取与所述待查询字段对应的请求数据,并获取预存储的与所述待查询字段对应的目标数据;及当所述请求数据与所述目标数据相同时,根据所述数据服务器标识,将所述数据请求报文发送至数据服务器。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:当所述请求数据与所述目标数据不同时,从所述数据请求报文中查询所述终端的发送接口,所述发送接口与所述待查询字段相关联;获取所述发送接口对应的操作日志的存储路径,根据所述存储路径提取所述操作日志;获取检测模型,所述检测模型是根据样本日志的样本参数及样本结果训练得到的,根据所述检测模型对所述操作日志进行检测,得到检测结果;及通过所述检测结果筛选所述操作日志中的异常日志,并将所述异常日志存储至异常数据库。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:对所述数据响应报文进行解析;查询所述数据响应报文中的原始数据;及当所述原始数据为预设数据时,将包含有原始数据的数据响应报文作为测试数据报文发送至终端。
- 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机可读指令时还执行以下步骤:当检测到所述数据请求报文上携带有更改标识时,根据所述更改标识获取与数据请求报文对应的请求更改逻辑;根据所述请求更改逻辑对数据请求报文进行变更,得到更改请求报文;及发送所述更改请求报文至数据服务器。
- 一个或多个存储有计算机可读指令的计算机存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:接收终端发出的数据请求报文,所述数据请求报文中携带有数据服务器标识;根据所述数据服务器标识,将所述数据请求报文发送至数据服务器;接收所述数据服务器返回的与所述数据请求报文对应的数据响应报文;获取数据更改逻辑,查询所述数据响应报文中与所述数据更改逻辑对应的数据字段,根据所述数据字段查询所述数据响应报文中包含的原始数据,并将所述原始数据进行变更,得到测试数据报文;及将所述测试数据报文发送至所述终端,以使所述终端根据所述测试数据报文进行测试。
- 根据权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行时还执行以下步骤:根据所述数据更改逻辑和所述原始数据获取与所述数据字段对应的替换数据;及将所述原始数据变更为所述替换数据,得到测试数据报文。
- 根据权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行时还执行以下步骤:统计所述数据更改逻辑的获取次数,将所述获取次数低于预设值的所述数据更改逻辑作为待删除逻辑;输出与所述待删除逻辑对应的删除提示信息;及接收删除指令,所述删除指令是根据所述删除提示信息生成的,根据所述删除指令对所述待删除逻辑进行删除。
- 根据权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行时还执行以下步骤:查询所述数据请求报文中的待查询字段;从所述数据请求报文中提取与所述待查询字段对应的请求数据,并获取预存储的与所述待查询字段对应的目标数据;及当所述请求数据与所述目标数据相同时,根据所述数据服务器标识,将所述数据请求 报文发送至数据服务器。
- 根据权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行时还执行以下步骤:当所述请求数据与所述目标数据不同时,从所述数据请求报文中查询所述终端的发送接口,所述发送接口与所述待查询字段相关联;获取所述发送接口对应的操作日志的存储路径,根据所述存储路径提取所述操作日志;获取检测模型,所述检测模型是根据样本日志的样本参数及样本结果训练得到的,根据所述检测模型对所述操作日志进行检测,得到检测结果;及通过所述检测结果筛选所述操作日志中的异常日志,并将所述异常日志存储至异常数据库。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910823447.1 | 2019-09-02 | ||
CN201910823447.1A CN110730107B (zh) | 2019-09-02 | 2019-09-02 | 测试数据生成方法、装置、计算机设备和存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021042914A1 true WO2021042914A1 (zh) | 2021-03-11 |
Family
ID=69218814
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/105362 WO2021042914A1 (zh) | 2019-09-02 | 2020-07-29 | 测试数据生成方法、装置、计算机设备和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110730107B (zh) |
WO (1) | WO2021042914A1 (zh) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112861496A (zh) * | 2021-03-22 | 2021-05-28 | 平安商业保理有限公司 | 报表生成显示方法、装置、计算机设备和可读存储介质 |
CN113238945A (zh) * | 2021-05-17 | 2021-08-10 | 上海中通吉网络技术有限公司 | 一种bi系统图表查询自动化测试方法 |
CN113705184A (zh) * | 2021-09-01 | 2021-11-26 | 同盾科技有限公司 | 自定义报表的生成方法及装置、存储介质、电子设备 |
CN113722235A (zh) * | 2021-09-16 | 2021-11-30 | 中国银行股份有限公司 | 一种自动化测试方法及装置 |
CN113778879A (zh) * | 2021-09-13 | 2021-12-10 | 上海幻电信息科技有限公司 | 接口的模糊测试方法及装置 |
CN113938408A (zh) * | 2021-10-14 | 2022-01-14 | 平安银行股份有限公司 | 一种数据流量测试方法、装置、服务器及存储介质 |
CN115150259A (zh) * | 2022-06-16 | 2022-10-04 | 北京三快在线科技有限公司 | 一种故障定位的方法及装置 |
CN115865488A (zh) * | 2022-11-30 | 2023-03-28 | 中国人民财产保险股份有限公司 | 基于脱敏日志的流量回放测试方法、装置、设备及介质 |
CN116149969A (zh) * | 2023-04-04 | 2023-05-23 | 湖南中青能科技有限公司 | 一种数据库模型匹配异常监测处理方法 |
CN116453582A (zh) * | 2023-06-14 | 2023-07-18 | 合肥康芯威存储技术有限公司 | 一种存储器的信号测试系统及测试方法 |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110730107B (zh) * | 2019-09-02 | 2022-07-12 | 深圳壹账通智能科技有限公司 | 测试数据生成方法、装置、计算机设备和存储介质 |
CN111478941B (zh) * | 2020-03-05 | 2023-08-22 | 平安银行股份有限公司 | Mock自动化运行方法、装置、计算机设备及存储介质 |
CN111737133B (zh) * | 2020-06-24 | 2024-10-11 | 中国银行股份有限公司 | 测试方法及装置、计算机设备及计算机可读存储介质 |
CN113656282A (zh) * | 2021-07-19 | 2021-11-16 | 广州虎牙科技有限公司 | 一种无侵入测试方法和相关装置以及存储介质 |
CN115842716B (zh) * | 2021-09-14 | 2024-08-06 | 腾讯科技(深圳)有限公司 | 故障服务器的确定方法、装置、设备以及存储介质 |
CN114143240A (zh) * | 2021-11-19 | 2022-03-04 | 北京达佳互联信息技术有限公司 | 异常生成及测试方法及装置 |
CN117234949B (zh) * | 2023-11-13 | 2024-03-19 | 广州品唯软件有限公司 | 测试数据降噪方法、装置、存储介质、计算机设备 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160259713A1 (en) * | 2015-03-04 | 2016-09-08 | Vmware, Inc. | Method and system for determining functional tests to execute based on code coverage |
CN106528432A (zh) * | 2016-12-12 | 2017-03-22 | 北京三快在线科技有限公司 | 测试场景数据的构建方法及装置、埋点测试方法 |
CN109992500A (zh) * | 2017-12-29 | 2019-07-09 | 北京奇虎科技有限公司 | 应用的接口测试方法、装置和计算机可读存储介质 |
CN110069413A (zh) * | 2019-04-22 | 2019-07-30 | 苏州亿歌网络科技有限公司 | 测试数据通信、测试方法、装置、设备及存储介质 |
CN110134607A (zh) * | 2019-05-17 | 2019-08-16 | 广州品唯软件有限公司 | 一种app自动化测试方法及装置 |
CN110730107A (zh) * | 2019-09-02 | 2020-01-24 | 深圳壹账通智能科技有限公司 | 测试数据生成方法、装置、计算机设备和存储介质 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105183672B (zh) * | 2015-08-07 | 2018-09-11 | 北京思特奇信息技术股份有限公司 | 一种自适应的接口调用方法及系统 |
CN108573006B (zh) * | 2017-06-06 | 2021-03-26 | 北京金山云网络技术有限公司 | 跨机房数据同步系统、方法及装置、电子设备 |
CN109298997A (zh) * | 2018-08-08 | 2019-02-01 | 平安科技(深圳)有限公司 | 接口测试方法、系统、计算机设备和存储介质 |
CN109739815B (zh) * | 2019-01-10 | 2021-08-17 | 北京达佳互联信息技术有限公司 | 文件处理方法、系统、装置、设备及存储介质 |
CN110008118B (zh) * | 2019-03-13 | 2023-03-10 | 深圳壹账通智能科技有限公司 | 页面数据测试方法、装置、计算机设备和存储介质 |
-
2019
- 2019-09-02 CN CN201910823447.1A patent/CN110730107B/zh active Active
-
2020
- 2020-07-29 WO PCT/CN2020/105362 patent/WO2021042914A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160259713A1 (en) * | 2015-03-04 | 2016-09-08 | Vmware, Inc. | Method and system for determining functional tests to execute based on code coverage |
CN106528432A (zh) * | 2016-12-12 | 2017-03-22 | 北京三快在线科技有限公司 | 测试场景数据的构建方法及装置、埋点测试方法 |
CN109992500A (zh) * | 2017-12-29 | 2019-07-09 | 北京奇虎科技有限公司 | 应用的接口测试方法、装置和计算机可读存储介质 |
CN110069413A (zh) * | 2019-04-22 | 2019-07-30 | 苏州亿歌网络科技有限公司 | 测试数据通信、测试方法、装置、设备及存储介质 |
CN110134607A (zh) * | 2019-05-17 | 2019-08-16 | 广州品唯软件有限公司 | 一种app自动化测试方法及装置 |
CN110730107A (zh) * | 2019-09-02 | 2020-01-24 | 深圳壹账通智能科技有限公司 | 测试数据生成方法、装置、计算机设备和存储介质 |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112861496A (zh) * | 2021-03-22 | 2021-05-28 | 平安商业保理有限公司 | 报表生成显示方法、装置、计算机设备和可读存储介质 |
CN113238945A (zh) * | 2021-05-17 | 2021-08-10 | 上海中通吉网络技术有限公司 | 一种bi系统图表查询自动化测试方法 |
CN113705184A (zh) * | 2021-09-01 | 2021-11-26 | 同盾科技有限公司 | 自定义报表的生成方法及装置、存储介质、电子设备 |
CN113705184B (zh) * | 2021-09-01 | 2023-09-22 | 同盾科技有限公司 | 自定义报表的生成方法及装置、存储介质、电子设备 |
CN113778879A (zh) * | 2021-09-13 | 2021-12-10 | 上海幻电信息科技有限公司 | 接口的模糊测试方法及装置 |
CN113778879B (zh) * | 2021-09-13 | 2024-03-08 | 上海幻电信息科技有限公司 | 接口的模糊测试方法及装置 |
CN113722235A (zh) * | 2021-09-16 | 2021-11-30 | 中国银行股份有限公司 | 一种自动化测试方法及装置 |
CN113938408B (zh) * | 2021-10-14 | 2023-07-11 | 平安银行股份有限公司 | 一种数据流量测试方法、装置、服务器及存储介质 |
CN113938408A (zh) * | 2021-10-14 | 2022-01-14 | 平安银行股份有限公司 | 一种数据流量测试方法、装置、服务器及存储介质 |
CN115150259A (zh) * | 2022-06-16 | 2022-10-04 | 北京三快在线科技有限公司 | 一种故障定位的方法及装置 |
CN115865488A (zh) * | 2022-11-30 | 2023-03-28 | 中国人民财产保险股份有限公司 | 基于脱敏日志的流量回放测试方法、装置、设备及介质 |
CN116149969B (zh) * | 2023-04-04 | 2023-06-20 | 湖南中青能科技有限公司 | 一种数据库模型匹配异常监测处理方法 |
CN116149969A (zh) * | 2023-04-04 | 2023-05-23 | 湖南中青能科技有限公司 | 一种数据库模型匹配异常监测处理方法 |
CN116453582A (zh) * | 2023-06-14 | 2023-07-18 | 合肥康芯威存储技术有限公司 | 一种存储器的信号测试系统及测试方法 |
CN116453582B (zh) * | 2023-06-14 | 2023-09-22 | 合肥康芯威存储技术有限公司 | 一种存储器的信号测试系统及测试方法 |
Also Published As
Publication number | Publication date |
---|---|
CN110730107B (zh) | 2022-07-12 |
CN110730107A (zh) | 2020-01-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021042914A1 (zh) | 测试数据生成方法、装置、计算机设备和存储介质 | |
CN109446068B (zh) | 接口测试方法、装置、计算机设备和存储介质 | |
CN109474578B (zh) | 报文消息校验方法、装置、计算机设备和存储介质 | |
CN108319719B (zh) | 数据库数据校验方法、装置、计算机设备和存储介质 | |
WO2020181839A1 (zh) | 页面数据测试方法、装置、计算机设备和存储介质 | |
CN111026645B (zh) | 用户界面自动化测试方法、装置、存储介质及电子设备 | |
CN110781070B (zh) | 大数据测试验证方法、装置、计算机设备及存储介质 | |
CN108628743B (zh) | 应用程序测试方法、装置、设备及存储介质 | |
CN112363941A (zh) | 接口测试方法、装置、计算机设备及存储介质 | |
WO2018120721A1 (zh) | 用户界面的测试方法、系统、电子装置及计算机可读存储介质 | |
CN109800258B (zh) | 数据文件部署方法、装置、计算机设备及存储介质 | |
CN109308285A (zh) | 数据库脚本管理方法、装置、计算机设备及存储介质 | |
WO2020233091A1 (zh) | 业务数据回退方法、装置、计算机设备和存储介质 | |
CN110908778B (zh) | 任务部署方法、系统和存储介质 | |
CN113159737B (zh) | Rpa业务处理方法、rpa管理平台、设备及介质 | |
CN110134929A (zh) | 文档校验方法、装置、计算机设备和存储介质 | |
CN113176995B (zh) | 基于测试场景的接口测试方法、装置、设备及介质 | |
CN110750443A (zh) | 网页测试的方法、装置、计算机设备及存储介质 | |
CN109711124B (zh) | 管理移动设备方法、装置、计算机设备和存储介质 | |
CN110830500A (zh) | 网络攻击追踪方法、装置、电子设备及可读存储介质 | |
CN113938408A (zh) | 一种数据流量测试方法、装置、服务器及存储介质 | |
CN113419738A (zh) | 接口文档的生成方法、装置及接口管理设备 | |
WO2021036681A1 (zh) | 数据验证方法、装置、计算机设备和存储介质 | |
CN112181485A (zh) | 脚本执行方法、装置、电子设备及存储介质 | |
CN112631949B (zh) | 一种调试方法、装置、计算机设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20861577 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29/07/2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20861577 Country of ref document: EP Kind code of ref document: A1 |