Big data testing and verification method, device, computer equipment and storage medium

Through automated verification methods, big data test results are obtained and matched, which solves the problem of low efficiency in the existing technology and achieves a fast and accurate verification process.

CN110781070BActive Publication Date: 2024-08-23PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910842164.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-06
Publication Date
2024-08-23
Estimated Expiration
2039-09-06

AI Technical Summary

Technical Problem

The existing technology is inefficient in big data testing and verification, resulting in manual inspection and verification that is time-consuming and costly, and the verification process is cumbersome.

Method used

By obtaining the execution instructions sent by the client, the target table is obtained based on the test interface, the interface is called to execute the script, the interface call result is judged, and the query results are obtained from the target table based on the query fields that responded successfully, matching the expected results, and using automation Verification method.

Benefits of technology

It reduces manual query steps, speeds up big data testing and verification, realizes automated verification, and improves verification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110781070B
    Figure CN110781070B
Patent Text Reader

Abstract

The present invention discloses a big data test verification method, device, computer equipment and storage medium, the method comprising: obtaining an execution instruction sent by a client, the execution instruction comprising a test requirement table, the test requirement table comprising a test interface and execution logic; based on the test interface, obtaining a target table corresponding to the test interface; calling the interface execution script, calling and judging each test interface according to the execution logic, and obtaining the interface call result; if the interface call result is a successful response, obtaining the query field carried by the test interface; based on the query field in the test interface, obtaining the query result corresponding to the query field from the target table; according to the matching method in the test requirement table, matching the query result with the expected result in the test requirement table, and obtaining the matching result. The method is adopted to realize automatic comparison and verification of the expected result and the test result, and improve the efficiency of big data test verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a big data testing and verification method, device, computer equipment and storage medium. Background Art

[0002] After the existing test system is tested, the test results need to be found from numerous data tables in the remote database, and then the developer needs to check and verify the test results with the expected results stored in the local server to determine whether the test process is correct. This inspection and verification process is cumbersome and time-consuming. Especially when the test system tests big data, the workload of developers for inspection and verification is huge, which is not only time-consuming but also has high labor costs. However, the inspection and verification task is an indispensable step to ensure the accuracy of the project. Therefore, how to improve the efficiency of big data testing and verification has become an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present invention provide a big data testing and verification method, apparatus, computer equipment and storage medium to solve the problem of low inspection and verification efficiency in big data testing.

[0004] A big data testing and verification method, comprising:

[0005] Obtaining an execution instruction sent by a client, wherein the execution instruction includes a test requirement table, and the test requirement table includes a test interface and an execution logic;

[0006] Based on the test interface, obtaining a target table corresponding to the test interface;

[0007] Call the interface execution script, perform call judgment on each test interface according to the execution logic, and obtain the interface call result;

[0008] If the result of the interface call is a successful response, the query field carried by the test interface is obtained,

[0009] Based on the query field in the test interface, obtaining the query result corresponding to the query field from the target table;

[0010] According to the matching method in the test requirement table, the query result is matched with the expected result in the test requirement table to obtain a matching result.

[0011] A big data testing and verification device, comprising:

[0012] An execution instruction acquisition module is used to acquire an execution instruction sent by a client, wherein the execution instruction includes a test requirement table, and the test requirement table includes a test interface and an execution logic;

[0013] A target table acquisition module, used for acquiring a target table corresponding to the test interface based on the test interface;

[0014] The interface call result acquisition module is used to call the interface execution script, perform call judgment on each test interface according to the execution logic, and obtain the interface call result;

[0015] A query field acquisition module, used for acquiring the query field carried by the test interface if the interface call result is a successful response;

[0016] A query result acquisition module, used for acquiring a query result corresponding to the query field from the target table based on the query field in the test interface;

[0017] The matching result acquisition module is used to match the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain the matching result.

[0018] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned big data testing and verification method when executing the computer program.

[0019] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned big data testing and verification method when executed by a processor.

[0020] The above-mentioned big data test verification method, device, computer equipment and storage medium obtain the execution instruction sent by the client to start verifying the test results, and based on the test interface, obtain the target table corresponding to the test interface, reduce the manual query steps, and speed up the big data test verification; call the interface execution script, and call and judge each test interface according to the execution logic to determine the test interface actually called during the test process; if the interface call result is a successful response, obtain the query field carried by the test interface, and based on the query field in the test interface, obtain the query result corresponding to the query field from the target table, so that the subsequent query results can be matched with the expected results, realize automatic verification, and speed up the big data test verification; according to the matching method in the test requirement table, match the query result with the expected result in the test requirement table, obtain the matching result, set different matching methods, ensure that the big data test results can be automatically verified, and improve the verification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0022] Figure 1 This is a schematic diagram of an application environment of a big data testing and verification method in one embodiment of the present invention;

[0023] Figure 2 is a flow chart of a big data testing and verification method in one embodiment of the present invention;

[0024] Figure 3 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0025] Figure 4 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0026] Figure 5 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0027] Figure 6 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0028] Figure 7 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0029] Figure 8 is another flow chart of a big data testing and verification method in one embodiment of the present invention;

[0030] Fig. 9 This is a principle block diagram of a big data testing and verification device in one embodiment of the present invention;

[0031] Fig.10 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] The big data testing and verification method provided by the embodiment of the present invention can be applied as follows: Figure 1 Specifically, the big data test verification method is applied in a big data test verification system, and the big data test verification system includes: Figure 1 The client and server shown in the figure communicate with each other through the network to realize the automatic comparison and verification of expected results and test results, and improve the efficiency of big data test verification. Among them, the client, also known as the user end, refers to the program corresponding to the server and providing local services to customers. The client can be installed on but not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices. The server can be implemented as an independent server or a server cluster consisting of multiple servers.

[0034] In one embodiment, if Figure 2 As shown, a big data test verification method is provided, which is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:

[0035] S201: Obtaining an execution instruction sent by a client, where the execution instruction includes a test requirement table, and the test requirement table includes a test interface and execution logic.

[0036] Among them, the execution instruction refers to the instruction to check and verify the test results obtained after the test, so as to verify whether the test is correct. The test requirement table refers to a table that records the expected results corresponding to the test information and the test ID to determine whether the test results are correct. The test requirement table may specifically include but is not limited to the test ID, test interface, execution logic, query field and the table of expected results corresponding to each test ID mentioned in this embodiment. Among them, the test ID refers to the identification of the test project, which can be the name of the test project, such as the new user registration project, the loan application project and the loan approval result project. The test requirement refers to whether the data corresponding to the test project meets the requirements for testing. For example, when testing the new user registration account, it is set that the new user registration account should meet the requirements of not more than 10 characters and cannot be Chinese characters. The test requirement of the new user registration account is that the length does not exceed 10 and cannot be Chinese characters. The test interface is the interface called during the test process. The execution logic refers to the logic of calling the test interface during the test process. The test result refers to the result generated by the developer after testing the test ID. The expected result refers to the result that can be achieved by testing the test ID set in advance by the developer. The query field refers to the field corresponding to the test interface to find the test result.

[0037] Specifically, an operation key for performing a comparison check is provided in the big data test verification system. When the developer clicks the operation key, the execution instruction is triggered to compare and verify the test results with the expected results. It can be understood that the developer fills in the test ID, test interface, execution logic, query field and expected results corresponding to each test ID in a table in advance to form a test requirement table. In order to facilitate the subsequent maintenance of the test ID, this embodiment maintains a test ID and the expected results corresponding to the test ID in a sheet page in the test requirement table. The sheet page corresponding to each test ID will mark the matching method of the test results and the expected results.

[0038] S202: Based on the test interface, obtain a target table corresponding to the test interface.

[0039] Among them, the target table refers to a table that stores the test results corresponding to all projects. Specifically, the server first calls the test interface to test the test data, and then associates the test data, the corresponding test results and the corresponding at least one test interface and stores them in the target table. It can be understood that during the test process, due to the large amount of test data, the target table storing the test results is generally stored in a remote database to avoid too much test data affecting the running speed of the client. According to the test interface, the corresponding target table can be quickly obtained, the manual query steps can be reduced, and the speed of big data test verification can be accelerated. In this embodiment, the test data, the corresponding test interface and the corresponding test results of the same test ID are stored on the same sheet page, so that when the subsequent test results are wrong, the location of the test results can be determined and modified according to the test ID.

[0040] S203: Call the interface execution script, perform call judgment on each test interface according to the execution logic, and obtain the interface call result.

[0041] The interface execution script refers to a pre-written script for remotely calling the test interface during the test process, so as to call the test interface for testing. The interface call result refers to the result of calling the test interface, and it can be understood that the interface call result includes a successful response and an unsuccessful response.

[0042] Specifically, since there may be judgment statements such as if (a or b) then c in the execution logic, it is necessary to determine the test interface actually called during the test process. Therefore, when the execution instruction starts to execute, the server will start the interface execution script, and call and judge each test interface according to the execution logic in the test requirement table to determine the test interface actually called during the test process. In this embodiment, the interface execution script makes an http request call to each test interface according to the execution logic to obtain the interface call result, and determines whether the test process calls the test interface according to the interface call result; if the interface call result is a successful response, the test process calls the test interface; if the interface call result is an unsuccessful response, the test process does not call the test interface, so as to realize automated big data test verification.

[0043] S204: If the interface call result is a successful response, the query field carried by the test interface is obtained.

[0044] Specifically, if the result of the interface call is a successful response, it means that the test interface in the test requirement table successfully responds to the http request call, indicating that the test interface is the test interface actually called during the test process. At this time, the server obtains the query field corresponding to the test interface. It can be understood that the query field can be written according to the actual situation, including but not limited to the query field formed by the conditional statement, the query field formed by the query statement, or the query field formed by the nesting of the two. Such as "select*,1as(whereleft(field name,1)like'%[^0-9]%'))fromdatatablename", "select*,0as(where left(field name,1)like'not%[^0-9]%'))fromdatatablename", or "selectusernamefieldfromdatatablenamewhereregistrationtimefield='2018'".

[0045] S205: Based on the query field in the test interface, obtain the query result corresponding to the query field from the target table.

[0046] Specifically, after obtaining the query field carried by the test interface, the server obtains the query information corresponding to the query field from the target table based on the query field. After obtaining the query information, the query information is processed according to the preset processing rules to form a query result in a fixed format, so that subsequent query results can be matched with expected results, realizing automated verification and speeding up the big data test verification.

[0047] S206: Match the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain a matching result.

[0048] Among them, the matching method is a pre-set matching verification method. Since there are large differences in data in different projects, in order to better match the query results with the expected results, different matching methods are set to ensure that the big data test results can be automatically verified. Specifically, after obtaining the query results, the server matches the query results and the expected results according to the matching method marked in the test requirements table, and obtains the matching results of the two to determine whether the big data testing process is accurate. Among them, the matching result refers to the result of comparing whether the query results and the expected results are consistent.

[0049] In the big data test verification method provided in this embodiment, an execution instruction sent by the client is obtained to start verifying the test results. Based on the test interface, the target table corresponding to the test interface is obtained to reduce manual query steps and speed up the big data test verification; the interface execution script is called to make a call judgment on each test interface according to the execution logic to determine the test interface actually called during the test; if the interface call result is a successful response, the query field carried by the test interface is obtained, and based on the query field in the test interface, the query result corresponding to the query field is obtained from the target table, so that the subsequent query results can be matched with the expected results, so as to realize automatic verification and speed up the big data test verification; according to the matching method in the test requirement table, the query results and the expected results in the test requirement table are matched to obtain the matching results, and different matching methods are set to ensure that the big data test results can be automatically verified to improve the verification efficiency.

[0050] In one embodiment, if Figure 3 As shown, step S203, i.e. calling the interface execution script, calling and judging each test interface according to the execution logic, and obtaining the interface calling result, includes:

[0051] S301: Calling an interface execution script to read a test requirement table and obtain an interface list, which includes at least two test interfaces and execution logic.

[0052] Specifically, the server calls the interface execution script to read the test requirement table to quickly obtain the interface list in the test requirement table, which includes at least two test interfaces and execution logic, so that the interface execution script parses the keywords in the execution logic to determine at least two test interfaces called during the test and the corresponding calling order. The execution logic refers to the logic of calling at least two test interfaces for execution during the test process, which can be understood as the calling order between at least two test interfaces. For example, the execution logic can be to call interface a first, and only call interface b if the call to interface a is successful, otherwise call interface c. Specifically, the keywords in the keywords in the execution logic include but are not limited to if, and, or, and then.

[0053] S302: According to the execution logic, remote interface call judgment is performed on each test interface in sequence to obtain the interface call result.

[0054] Specifically, after obtaining the interface list, the interface execution script performs an http request call on each test interface according to the execution logic to obtain the test interface actually called during the test process, thereby improving the verification efficiency of the big data test results and helping to realize automated test verification based on at least two test interfaces called during the test process and the corresponding call sequence. Specifically, the interface call result includes a successful response and a failed response. If the response is successful, it means that the test interface has been called during the test process; if the response fails, it means that the test interface has not been called during the test process. In addition, a failed response includes two situations: no response information is received within a preset waiting period, or although a response information is received within a preset waiting period, the response information is a failure. Among them, an http request refers to a request message from a client to a server, and an http request includes: a request method for a resource, an identifier for the resource, and a protocol used.

[0055] In the big data test verification method provided in this embodiment, the interface execution script is called to read the test requirement table to quickly obtain the interface list in the test requirement table, and the remote interface call judgment is performed on each test interface in sequence according to the execution logic to obtain the interface call result to quickly determine the test interface actually called during the test process, so as to perform subsequent big data test result inspection and verification, thereby improving the verification efficiency of big data test results.

[0056] In one embodiment, the test interface includes a database identifier and a table identifier. Figure 4 As shown, step S202, i.e., based on the test interface, obtaining a target table corresponding to the test interface, includes:

[0057] S401: Acquire a target database corresponding to a database identifier based on the database identifier.

[0058] The database identifier refers to an identifier used to identify a database. Specifically, the database identifier refers to an identifier corresponding to a database storing test results, so as to find a required database and speed up the automated test.

[0059] Specifically, after obtaining the test requirement table, the server obtains the target database corresponding to the database identifier according to the database identifier carried by the test interface. The target database refers to the database corresponding to the database identifier carried by the test interface. In this embodiment, the server can quickly locate the target database through the database identifier, reducing the processing volume of obtaining the target table in the subsequent steps.

[0060] S402: traverse the target database based on the table identifier, and obtain a target table corresponding to the table identifier from the target database.

[0061] The table identifier refers to the identifier corresponding to the table storing the test results, so as to facilitate searching for the required target table.

[0062] Specifically, after obtaining the test requirement table, the server traverses the target database according to the table identifier carried by the test interface, and obtains the target table corresponding to the table identifier from the target database. That is, the target database is traversed by the table identifier, so as to quickly locate the target table and improve the speed of obtaining the target table.

[0063] In the big data testing and verification method provided in this embodiment, the server quickly obtains the target database corresponding to the database identifier based on the database identifier, and then obtains the target table corresponding to the table identifier from the target database based on the table identifier. The process does not require human intervention. The server can obtain the corresponding target database and the corresponding target table according to the database identifier carried by the test interface, and can quickly locate the target table, realizing the function of automatically obtaining the target table, simplifying the operation process, and improving the efficiency of subsequent inspection and verification of the big data test results.

[0064] In one embodiment, if Figure 5 As shown, step S205, i.e., based on the query field in the test interface, obtaining the query result corresponding to the query field from the target table, includes:

[0065] S501: Based on the query field in the test interface, query information corresponding to the query field is obtained from the target table.

[0066] Among them, query information refers to the information obtained from the target table according to the query field. In this embodiment, the field corresponding to the expected result of each test interface is pre-set in the test requirement table as a query field, and the query field specifically includes but is not limited to characters and strings. Accordingly, the server queries the corresponding query information in the target table corresponding to any test interface based on the query field of the test interface to speed up the automated testing. In this embodiment, a fuzzy matching algorithm can be used to quickly query and obtain the corresponding query information according to the query field, and the fuzzy matching algorithm is used for query matching, which helps to improve the efficiency of checking and verifying the big data test results.

[0067] S502: Process the query information based on the processing rules in the test interface to obtain the query result.

[0068] The processing rules refer to the rules used to process the query information so as to subsequently match the query results with the expected results in the test requirement table. The processing rules include but are not limited to splicing processing rules and splitting processing rules. For example, the concatenation processing rule can concatenate [{"c"}, {"b"}] and [{"a"}{"c"}] of different columns into the same column [{"c",{"b","a"}], for example, c represents the ID card, b represents the name, and a represents the surname, then the name and the surname are concatenated into the same column according to the ID card; the splitting processing rule is the opposite of the concatenation processing rule. The splitting processing rule splits the same column [{"c",{"b","a"}] into different columns [{"c"}, {"b"}] and [{"a"}{"c"}], for example, c represents the ID card, b represents the name, and a represents the surname, then the name and the surname are split into different columns according to the ID card; it can be understood that setting processing rules to process the query information is conducive to the subsequent rapid matching of the query results with the expected results in the test requirements table.

[0069] It can be understood that when a fuzzy matching algorithm is used to quickly query the corresponding query information according to the query field, when the amount of query information is large, if the query results and the expected results in the test requirement table are directly matched one by one, the time for big data test verification will be delayed. Therefore, the query results obtained can be processed according to the processing rules in the test interface to extract the key characters in the query information and form a pre-set format string, that is, the key characters in the query information are extracted to form a format string corresponding to the expected result. For example, the format string can be a string such as {"flag":"1","message":"success"}. The obtained format string is used as the query result to improve the efficiency of subsequent matching of the query results and the expected results in the test requirement table.

[0070] The big data test verification method provided in this embodiment obtains query information corresponding to the query field from the target table based on the query field in the test interface to improve the efficiency of checking and verifying the big data test results, processes the query information based on the processing rules in the test interface, obtains the query results, and improves the efficiency of subsequent matching the query results with the expected results in the test requirement table.

[0071] In one embodiment, if Figure 6 As shown, step S206, that is, matching the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain the matching result, includes:

[0072] S601: When the matching mode is random matching, content matching is performed on the expected results and the query results in the test requirement table to obtain matching results.

[0073] Among them, out-of-order matching means that the test result is consistent with the expected result in content, but the order is inconsistent. For example, the expected result is: {"flag":"1","message":"success"}, and the matching method is out-of-order matching, which means that the interface return value is {"message":"success","flag":"1"}, which also means that the test is successful.

[0074] Specifically, when the matching method marked in the test requirement table is random matching, the expected results and query results are directly matched to obtain the matching results. Since the execution logic may include an or selection relationship, that is, when calling the test interface for testing according to the execution logic, you can choose to call test interface f or test interface g, which makes the query results of the test results have different contents in order. At this time, random matching is used to match the expected results and query results in the test requirement table to obtain the matching results.

[0075] Use random matching to match the expected results and query results in the test requirement table. If the query result and the expected result are consistent in content, the matching result is a successful match; if the query result and the expected result are inconsistent in content, the matching result is a failed match. For example, if the expected result in the test requirement table is {"flag":"1","message":"success"}, and the marked matching method is random matching, the query result only needs to contain the content corresponding to "flag":"1" and "message":"success", and the matching result of the two is a successful match. That is, random matching only requires that the characters in the expected result and the characters in the query result are completely consistent when matching, and the order of the characters is not required, so as to quickly obtain the matching result.

[0076] S602: If the matching mode is not random matching, the expected results and the query results in the test requirement table are matched in order and content to obtain matching results.

[0077] Specifically, when the matching method marked in the test requirement table is not random matching, it is necessary to match the query results with the expected results in terms of content and order respectively, and the matching methods include but are not limited to complete matching and partial matching.

[0078] Among them, full match means that the order and content of the test result are exactly the same as the expected result. Partial match means that the content of the test result is part of the expected result, but the order must be the same as the expected result. For example, the expected result: {"flag":"1","message":"success"}, if the matching method is full match, the test result can only be {"flag":"1","message":"success"}; if the matching method is partial match, the test result only needs to contain the fields flag and message and the order must be flag first and then message, and the corresponding values ​​of flag and message are 1 and success respectively.

[0079] Taking the matching method as complete matching as an example, when the query result is consistent with the expected result in content and the query result is consistent with the expected result in order, the matching result is a successful match; if the query result is inconsistent with the expected result in content and / or the query result is inconsistent with the expected result in order, the matching result is a failed match. For example, if the matching method marked in the test requirement table is complete matching and the expected result is {"flag":"1","message":"success"}, the matching can only be successful when the query result is {"flag":"1","message":"success"}. If the query content is not {"flag":"1","message":"success"}, or the query result is {"message":"success","flag":"1"} and the order is inconsistent with the expected result, the matching result is a failed match.

[0080] In the big data test verification method provided in this embodiment, when the matching method is random matching, the expected results and query results in the test requirement table are matched in content to obtain the matching results. If the matching method is not random matching, the expected results and query results in the test requirement table are matched in order and content to obtain the matching results. The random matching and non-random matching matching methods are used according to the execution logic to ensure that the big data test results can be automatically verified and the work efficiency can be improved.

[0081] In one embodiment, if Figure 7 As shown, the query result includes at least one query field and a query attribute value corresponding to the query field, and the query field corresponds to a first sequential sequence; the expected result includes expected fields and expected attribute values ​​corresponding to the expected fields, and at least one expected field corresponds to a second sequential sequence.

[0082] Accordingly, step S602, that is, if the matching mode is not random matching, the expected results and the query results in the test requirement table are matched in order and content to obtain the matching results, including:

[0083] S701: Match the first sequence and the second sequence to obtain a sequence matching result.

[0084] The first order sequence refers to the order of the query fields, and the query attribute value refers to the attribute value corresponding to the query field. For example, if the query fields are flag, message, and identity, and the query attribute values ​​are 1, success, and XXX, then the first order sequence is {"flag", "message", "identity"}, and the query result is {"flag": "1", "message": "success", "identity": "XXX"}. The second order sequence refers to the order of the expected fields, and the expected attribute value is the attribute value corresponding to the expected field. For example, if the expected fields are flag and message, and the expected attribute values ​​are 1 and success, then the second order sequence is {"flag", "message"}, and the expected result is {"flag": "1", "message": "success"}.

[0085] Specifically, a matching algorithm is used for the first sequence sequence and the second sequence sequence to quickly obtain a sequential matching result. For example, a regular matching algorithm is used to match the characters of the first sequence sequence and the second sequence sequence in turn to quickly obtain a sequential matching result and improve verification efficiency. When the sequential matching result is wrong, it can be determined that the matching result is wrong to improve verification efficiency. When the sequential matching result is accurate, it is necessary to match the query attribute value and the expected attribute value. In this embodiment, the matching method is a complete match, then the characters of the first sequence sequence and the second sequence are different, and the sequential matching result is wrong; if the characters of the first sequence sequence and the second sequence are completely consistent, the sequential matching result is accurate. If the matching method is partial matching, the first sequence and the second sequence are matched in turn. As long as the order of the same characters in the first sequence and the second sequence is consistent, the sequential matching result is accurate. For example, if the second sequence is {"flag", "identity", "message"} and the first sequence is {"flag", "message"}, the sequential matching result is accurate. If the second sequence is {"identity", "message", "flag"} and the first sequence is {"flag", "message"}, the sequential matching result is incorrect.

[0086] S702: If the sequence matching result is that the sequence is the same, matching processing is performed based on the query attribute value corresponding to the query field and the expected attribute value corresponding to the expected field that matches the query field.

[0087] Specifically, when the order matching result is the same, the matching algorithm is used to match the query attribute value corresponding to the query field and the expected attribute value corresponding to the expected field matching the query field in accordance with the first order sequence and the second order sequence in turn, so as to determine whether the matching result is accurate. For example, if the second order sequence is {"flag", "identity", "message"} and the first order sequence is {"flag", "message"}, the matching algorithm is used to first match the attribute value corresponding to the flag of the query field and the expected field, and then match the attribute value corresponding to the message of the query field and the expected field.

[0088] S703: If all query attribute values ​​match the expected attribute values, a successful matching result is obtained.

[0089] Specifically, when the query attribute value matches the expected attribute value, the matching result is a successful match, and a successful match link is generated from the successful match result and sent to the client, thereby realizing automatic verification of the test result and greatly simplifying the test result verification steps.

[0090] S704: If there is at least one query attribute value that does not match the expected attribute value, a matching result of a matching failure is obtained.

[0091] Specifically, when the query attribute value and the expected attribute value do not match, the matching result is a match failure, and a match failure link is generated for the matching result and sent to the client for subsequent inspection of the test result, thereby realizing automatic verification of the test result and speeding up the verification of the test result.

[0092] In the big data test verification method provided in this embodiment, the first sequence and the second sequence are matched. If the sequence matching result is an error, the matching result can be determined to be an error, thereby improving the verification efficiency. If the sequence matching result is that the sequences are the same, matching processing is performed based on the query attribute value corresponding to the query field and the expected attribute value corresponding to the expected field that matches the query field to determine whether the matching result is accurate. If all query attribute values ​​match the expected attribute value, a successful matching result is obtained. If there is at least one query attribute value that does not match the expected attribute value, a failed matching result is obtained, thereby realizing automatic verification of the test results and accelerating the verification speed of the test results.

[0093] In one embodiment, if Figure 8As shown, after step S206, that is, after matching the query result with the expected result in the test requirement table according to the matching method in the test requirement table, and obtaining the matching result, the big data test verification method further includes:

[0094] S801: If the matching result is successful, a test success notification message is sent to the corresponding client.

[0095] Specifically, if the matching result is a successful match, a test success notification message is sent to the corresponding client, so that the developer can be informed of the test status in time on the client. The test success notification message refers to information used to notify the developer that the data in the target table has been successfully tested.

[0096] S802: If the matching result is a matching failure, a query link is generated, and test failure notification information is generated based on the query link and sent to the corresponding client.

[0097] Specifically, if the matching result is a match failure, a query link is generated. The query link refers to a link generated based on the location of the query information that failed to match. After the query link is generated, the server generates a test failure notification message based on the query link and sends it to the corresponding client, so that the developer can quickly determine the location of the query information that failed to match according to the query link. The test failure notification message refers to information used to notify the developer that the data test in the target table failed and contains a query link, so that the developer can quickly locate the query information that failed to match according to the query link.

[0098] The big data test verification method provided in this embodiment, if the matching result is a successful match, the server sends a test success notification message to the corresponding client, so that the developer can promptly know the test result on the client; if the matching result is a failed match, a query link is generated, and a test failure notification message is generated based on the query link and sent to the client, so that the developer can quickly determine the location of the query information that failed to match according to the query link.

[0099] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0100] In one embodiment, a big data test verification device is provided, which corresponds one-to-one to the big data test verification method in the above embodiment. Fig. 9As shown, the big data test verification device includes an execution instruction acquisition module 901, a target table acquisition module 902, an interface call result acquisition module 903, a query field acquisition module 904, a query result acquisition module 905 and a matching result acquisition module 906. The functional modules are described in detail as follows:

[0101] The execution instruction acquisition module 901 is used to acquire the execution instruction sent by the client. The execution instruction includes a test requirement table, and the test requirement table includes a test interface and execution logic.

[0102] The target table acquisition module 902 is used to acquire the target table corresponding to the test interface based on the test interface.

[0103] The interface call result acquisition module 903 is used to call the interface execution script, perform call judgment on each test interface according to the execution logic, and obtain the interface call result.

[0104] The query field acquisition module 904 is used to acquire the query field carried by the test interface if the interface call result is a successful response.

[0105] The query result acquisition module 905 is used to acquire the query result corresponding to the query field from the target table based on the query field in the test interface.

[0106] The matching result acquisition module 906 is used to match the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain the matching result.

[0107] Preferably, the interface call result acquisition module 903 includes:

[0108] The interface list acquisition unit is used to call the interface execution script to read the test requirement table and obtain the interface list, which includes at least two test interfaces and execution logic.

[0109] The interface call result acquisition unit is used to perform remote interface call judgment on each test interface in sequence according to the execution logic to obtain the interface call result.

[0110] Preferably, the test interface includes a database identifier and a table identifier. The target table acquisition module 902 includes: a target database acquisition unit and a target database traversal unit.

[0111] The target database acquisition unit is used to acquire the target database corresponding to the database identifier based on the database identifier.

[0112] The target database traversal unit is used to traverse the target database based on the table identifier and obtain the target table corresponding to the table identifier from the target database.

[0113] Preferably, the query result acquisition module 905 includes: a query information acquisition unit and a query information processing unit.

[0114] The query information acquisition unit is used to acquire query information corresponding to the query field from the target table based on the query field in the test interface.

[0115] The query information processing unit is used to process the query information based on the processing rules in the test interface to obtain the query results.

[0116] Preferably, the matching result acquisition module 906 includes: a first matching unit and a second matching unit.

[0117] The first matching unit is used to perform content matching on the expected results and the query results in the test requirement table to obtain matching results when the matching mode is random matching.

[0118] The second matching unit is used to perform sequence and content matching on the expected results and query results in the test requirement table to obtain matching results if the matching mode is not random matching.

[0119] Preferably, the query result includes at least one query field and a query attribute value corresponding to each query field, and at least one query field corresponds to a first sequence; the expected result includes at least one expected field and an expected attribute value corresponding to the expected field, and at least one expected field corresponds to a second sequence;

[0120] The second matching unit includes: a sequential matching result obtaining subunit, an attribute value matching processing subunit, a matching success subunit and a matching failure subunit.

[0121] A sequential matching result obtaining subunit is used to match the first sequential sequence and the second sequential sequence to obtain a sequential matching result;

[0122] The attribute value matching processing subunit is used for performing matching processing based on the query attribute value corresponding to the query field and the expected attribute value corresponding to the expected field matching the query field if the sequence matching result is that the sequence is the same;

[0123] A successful matching subunit is used to obtain a successful matching result if all query attribute values ​​match the expected attribute values;

[0124] The match failure subunit is used to obtain a match failure result if at least one query attribute value does not match the expected attribute value.

[0125] Preferably, after the matching result acquisition module 906, the big data testing and verification device further includes: a matching success module and a matching failure module.

[0126] The matching success module is used to send a test success notification message to the corresponding client if the matching result is a successful match.

[0127] The matching failure module is used to generate a query link if the matching result is a matching failure, and generate test failure notification information based on the query link and send it to the corresponding client.

[0128] For the specific definition of the big data testing and verification device, please refer to the definition of the big data testing and verification method above, which will not be repeated here. Each module in the above-mentioned big data testing and verification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0129] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated in executing the above-mentioned big data test and verification method, such as a target table. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a big data test and verification method is implemented.

[0130] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the big data test verification method in the above embodiment are implemented, such as Figure 2 Steps S201-S206 shown, or Figures 3 to 8 To avoid repetition, the steps shown in are not described here. Alternatively, when the processor executes the computer program, the functions of each module / unit in this embodiment of the big data testing and verification device are realized, for example Fig. 9 The functions of the execution instruction acquisition module 901, the target table acquisition module 902, the interface call result acquisition module 903, the query field acquisition module 904, the query result acquisition module 905 and the matching result acquisition module 906 are not described here in detail to avoid repetition.

[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the big data test verification method in the above embodiment are implemented, such as Figure 2 Steps S201-S206 shown, or Figures 3 to 8 To avoid repetition, the steps shown in are not described here. Alternatively, when the processor executes the computer program, the functions of each module / unit in this embodiment of the big data testing and verification device are realized, for example Fig. 9 The functions of the execution instruction acquisition module 901, the target table acquisition module 902, the interface call result acquisition module 903, the query field acquisition module 904, the query result acquisition module 905 and the matching result acquisition module 906 are not described here in detail to avoid repetition.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, 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 link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0133] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0134] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A big data testing and verification method, characterized in that: include: Obtaining an execution instruction sent by the client, wherein the execution instruction includes a test requirement table, wherein the test requirement table includes a test ID, a test interface, an execution logic, a query field, and an expected result corresponding to each test ID; Based on the test interface, obtaining a target table corresponding to the test interface, wherein the target table refers to a table that associates and stores test data, corresponding test results, and corresponding at least one test interface of the same test ID; Calling an interface execution script to read the test requirement table and obtain an interface list, wherein the interface list includes at least two of the test interfaces and execution logic; According to the execution logic, a remote interface call judgment is performed on each of the test interfaces in sequence to obtain an interface call result; the execution logic refers to the logic of calling at least two test interfaces for execution during the test process, including the calling sequence between at least two test interfaces; If the interface call result is a successful response, obtaining the query field carried by the test interface; Based on the query field in the test interface, acquiring query information corresponding to the query field from the target table; Processing the query information based on the processing rules in the test interface to obtain query results; the processing rules refer to rules used to process the query information so as to subsequently match the query results with expected results in the test requirement table, and the processing rules include splicing processing rules or splitting processing rules; According to the matching method in the test requirement table, the query result is matched with the expected result in the test requirement table to obtain a matching result.

2. The big data testing and verification method according to claim 1, characterized in that: The test interface includes a database identifier and a table identifier; The acquiring, based on the test interface, a target table corresponding to the test interface includes: Acquire a target database corresponding to the database identifier based on the database identifier; The target database is traversed based on the table identifier, and a target table corresponding to the table identifier is acquired from the target database.

3. The big data testing and verification method according to claim 1, characterized in that: The step of matching the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain the matching result includes: When the matching method is random matching, content matching is performed on the expected results in the test requirement table and the query results to obtain matching results; If the matching method is not a random match, the expected result in the test requirement table and the query result are matched in order and content to obtain a matching result.

4. The big data testing and verification method according to claim 3, characterized in that: The query result includes at least one query field and a query attribute value corresponding to each query field, and at least one query field corresponds to a first sequence; the expected result includes at least one expected field and an expected attribute value corresponding to the expected field, and at least one expected field corresponds to a second sequence; If the matching mode is not a random match, the expected result in the test requirement table and the query result are matched in order and content to obtain a matching result, including: Matching the first sequence and the second sequence to obtain a sequence matching result; If the order matching result is that the order is the same, matching processing is performed based on the query attribute value corresponding to the query field and the expected attribute value corresponding to the expected field that matches the query field; If all the query attribute values ​​match the expected attribute values, a successful matching result is obtained; If there is at least one of the query attribute values ​​that does not match the expected attribute value, a matching result of failed matching is obtained.

5. The big data testing and verification method according to claim 1, characterized in that: After matching the query result with the expected result in the test requirement table according to the matching method in the test requirement table and obtaining the matching result, the big data test verification method further includes: If the matching result is successful, a test success notification message is sent to the corresponding client; If the matching result is a matching failure, a query link is generated, and test failure notification information is generated based on the query link and sent to the corresponding client.

6. A big data testing and verification device, characterized in that: include: An execution instruction acquisition module is used to acquire an execution instruction sent by a client, wherein the execution instruction includes a test requirement table, and the test requirement table includes a test ID, a test interface, an execution logic, a query field, and an expected result corresponding to each test ID; A target table acquisition module, used to acquire a target table corresponding to the test interface based on the test interface, wherein the target table refers to a table that associates and stores test data, corresponding test results, and corresponding at least one test interface of the same test ID; The interface call result acquisition module is used to call the interface execution script to read the test requirement table and obtain an interface list, wherein the interface list includes at least two test interfaces and execution logic; according to the execution logic, remote interface call judgment is performed on each test interface in sequence to obtain the interface call result; the execution logic refers to the logic of calling at least two test interfaces for execution during the test process, including the calling order between at least two test interfaces; A query field acquisition module, used for acquiring the query field carried by the test interface if the interface call result is a successful response; A query result acquisition module, used for acquiring query information corresponding to the query field from the target table based on the query field in the test interface; Processing the query information based on the processing rules in the test interface to obtain query results; the processing rules refer to rules used to process the query information so as to subsequently match the query results with expected results in the test requirement table, and the processing rules include splicing processing rules or splitting processing rules; The matching result acquisition module is used to match the query result with the expected result in the test requirement table according to the matching method in the test requirement table to obtain the matching result.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the big data testing and verification method as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the big data testing and verification method as described in any one of claims 1 to 5 are implemented.