Data verification method and device, computer equipment, storage medium and program product
Through the automated data verification method, the interface parameter information and database query are used to detect the correctness of the data returned by the interface, solving the accuracy and consistency of manual verification and improving the accuracy and consistency of verification.
Patent Information
- Application Number
- CN202411885251.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, the verification of the data returned by the interface relies on manual verification, and the accuracy is affected by the professional level and experience of the tester, and is susceptible to human factors, resulting in reduced inconsistency and accuracy of the verification results.
By obtaining the interface parameter information, return data indicators and data determination rules, the target table and the first target data indicator are determined, and the target query statement is constructed based on the parameter information, the target data is queried from the database, the second target data indicator is determined, and finally check whether the two are the same to verify the correctness of the data returned by the interface.
Improve the verification accuracy and consistency of the interface return data, reduce the influence of human factors, and ensure the consistency of the verification process with the interface documents and business logic.
Smart Images

Figure CN119902977A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data verification technology, and in particular to a data verification method, device, computer equipment, storage medium and program product. Background Art
[0002] In the modern software development process, the interface serves as a bridge for communication between different modules or services. Its stability and accuracy are directly related to the performance and user experience of the entire system. Therefore, interface testing has become one of the key steps to ensure software quality and stability. The core of interface testing is to fully and accurately verify the data returned by the interface to ensure that it complies with the predefined business logic and data specifications.
[0003] Currently, the main way to verify the data returned by the interface is manual verification. This verification method relies on the professional knowledge and experience of the tester, who manually checks each field and each record of the response data to confirm whether it meets expectations. Manual verification usually includes the following steps: First, the tester formulates detailed test cases based on the interface documentation or business logic; second, calls the interface and captures its response data; finally, compares the response data with the expected results one by one to determine whether the interface is working properly.
[0004] However, the accuracy of manual verification is affected by the professional level and experience of the testers. Different testers may have different interpretations and judgments on the same response data, resulting in inconsistent verification results. In addition, manual verification is also susceptible to human factors such as fatigue and negligence, which reduces the accuracy of verification.
[0005] Therefore, how to improve the verification accuracy of the data returned by the interface becomes a problem that needs to be solved. Summary of the invention
[0006] In view of this, the present invention provides a data verification method, apparatus, computer equipment, storage medium and program product.
[0007] In a first aspect, the present invention provides a data verification method, the method comprising: obtaining parameter information, interface return data indicators and data determination rules; determining a target table corresponding to a preset interface document according to a preset interface document; determining a first target data indicator according to the target table; determining a target query statement according to the parameter information; querying target data from a database according to the target query statement, and determining a second target data indicator according to the target data; detecting whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, it represents that the interface return data indicator is correct.
[0008] The data verification method provided in this embodiment determines the target table and the first target data indicator by collecting all relevant information required for interface testing, including interface parameters, returned data indicators and data determination rules: according to the preset interface document, the target database table corresponding to the interface is determined, and the first target data indicator is determined based on the table, thereby ensuring the consistency of the verification process with the interface document and business logic.
[0009] At the same time, a target query statement is constructed based on the parameter information, the target data is queried from the database, and the second target data indicator is determined based on the query result. This step realizes the automatic extraction and comparison of the data returned by the interface. Finally, it is detected whether the first target data indicator and the second target data indicator are the same. If they are the same, it indicates that the data indicator returned by the interface is correct, otherwise it indicates that there is an error, thereby improving the accuracy and consistency of the data returned by the verification interface.
[0010] In one possible implementation, determining a first target data indicator based on a target table includes: determining a first target field corresponding to parameter information and a second target field corresponding to a data determination rule from the target table; and determining the first target data indicator based on the first target field and the second target field.
[0011] The data verification method provided in this embodiment can ensure that the fields used in the verification process are accurate and in line with expectations by accurately matching the first target field corresponding to the parameter information and the second target field corresponding to the data determination rule from the target table. This avoids the problem of inaccurate verification results caused by incorrect field selection. In addition, different interfaces may have different parameters and data rules. By dynamically determining the fields corresponding to the parameter information and the data determination rule from the target table, the method can adapt to the needs of different interfaces without the need for separate verification configuration for each interface.
[0012] In one possible implementation, determining a second target data indicator based on the target data includes: performing aggregation calculations on the target data to obtain a first value and a second value having a target number of digits; and determining the second target data indicator based on a ratio of the first value to the second value.
[0013] The data verification method provided in this embodiment can obtain more accurate first and second values by numerically processing the target data, such as retaining a specific number of decimal places or rounding. This refinement helps to reduce errors caused by data accuracy issues. In addition, as a data indicator, the ratio is usually highly sensitive to slight changes in the data. When a certain value in the target data changes slightly, its ratio may change significantly, thereby promptly reflecting the changing trend or abnormal situation of the data.
[0014] In one possible implementation, a second target data indicator is determined based on a ratio of a first value to a second value, including: detecting whether the target value meets a preset value; wherein the target value is a value used as a denominator; if the target value meets the preset value, determining the second target data indicator to be the preset value; if the target value does not meet the preset value, determining the second target data indicator based on a percentage of the ratio of the first value to the second value.
[0015] The data verification method provided in this embodiment determines the second target data indicator according to the ratio of the first value and the second value, and detects whether the target value as the denominator meets the preset value in the process. It has the advantages of improving the robustness of data processing, enhancing the reliability of data indicators, improving the flexibility of data processing, and facilitating data analysis and decision-making.
[0016] In a possible implementation, there are multiple parameter information and multiple first target data indicators; wherein the method further includes: associating the parameter information and the first target data indicators to obtain multiple groups of associated indicators; and displaying the associated indicators on a page.
[0017] The data verification method provided in this embodiment can reflect the first target data indicator corresponding to each parameter information by associating each parameter information with the corresponding first target data indicator, and then display the associated indicator on the page for users to view.
[0018] In a second aspect, the present invention provides a data verification device, which includes: an acquisition module for acquiring parameter information, interface return data indicators and data determination rules; a first determination module for determining a target table corresponding to a preset interface document according to a preset interface document; a second determination module for determining a first target data indicator according to the target table; a third determination module for determining a target query statement according to the parameter information; a fourth determination module for querying target data from a database according to the target query statement, and determining a second target data indicator according to the target data; a detection and determination module for detecting whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, it represents that the interface return data indicator is correct.
[0019] In one possible implementation, the second determination module includes: a first determination unit, used to determine from a target table a first target field corresponding to the parameter information and a second target field corresponding to the data determination rule; and a second determination unit, used to determine a first target data indicator based on the first target field and the second target field.
[0020] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data verification method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0021] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data verification method of the first aspect or any corresponding embodiment thereof.
[0022] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data verification method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flow chart of a data verification method according to an embodiment of the present invention;
[0025] Figure 2 is a structural block diagram of a data verification device according to an embodiment of the present invention;
[0026] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] Based on relevant technologies, in the modern software development process, the interface serves as a bridge for communication between different modules or services. Its stability and accuracy are directly related to the performance and user experience of the entire system. Therefore, interface testing has become one of the key steps to ensure software quality and stability. The core of interface testing is to fully and accurately verify the data returned by the interface to ensure that it complies with the predefined business logic and data specifications.
[0029] Currently, the main way to verify the data returned by the interface is manual verification. This verification method relies on the professional knowledge and experience of the tester, who manually checks each field and each record of the response data to confirm whether it meets expectations. Manual verification usually includes the following steps: First, the tester formulates detailed test cases based on the interface documentation or business logic; second, calls the interface and captures its response data; finally, compares the response data with the expected results one by one to determine whether the interface is working properly.
[0030] However, the accuracy of manual verification is affected by the professional level and experience of the testers. Different testers may have different interpretations and judgments on the same response data, resulting in inconsistent verification results. In addition, manual verification is also susceptible to human factors such as fatigue and negligence, which reduces the accuracy of verification.
[0031] Based on this, the present invention provides a data verification method, which determines the target table and the first target data indicator by collecting all relevant information required for interface testing, including interface parameters, returned data indicators and data determination rules: according to the preset interface document, the target database table corresponding to the interface is determined, and the first target data indicator is determined based on the table, thereby ensuring the consistency of the verification process with the interface document and business logic.
[0032] At the same time, a target query statement is constructed based on the parameter information, the target data is queried from the database, and the second target data indicator is determined based on the query result. This step realizes the automatic extraction and comparison of the data returned by the interface. Finally, it is detected whether the first target data indicator and the second target data indicator are the same. If they are the same, it indicates that the data indicator returned by the interface is correct, otherwise it indicates that there is an error, thereby improving the accuracy and consistency of the data returned by the verification interface.
[0033] According to an embodiment of the present invention, a data verification method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] In this embodiment, a data verification method is provided, which can be used in computer devices, such as computers, servers, etc. Figure 1 is a flow chart of a data verification method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0035] Step S101, obtaining parameter information, interface return data indicators and data determination rules.
[0036] The parameter information can represent the input parameters required when executing a query or calling an interface. Among them, the parameter information can be all merchant identifiers in the database, or other information, which is not specifically limited here. The interface return data indicators can represent the indicators that need to be tested. Among them, the interface return data indicators can be the proportion of the merchant's completed order amount, etc., which can be set by the project situation and are not specifically limited here. The data determination rules can represent the rules for calculating the interface return data indicators. Among them, the data determination rules can be multiplication, division, etc., which are not specifically limited here and can be implemented by technical personnel in this field.
[0037] It should be noted that the parameter information, the interface return data indicator, and the data determination rule may be present in the requirement document. The requirement document may be set by the user independently or obtained by other means, which is not specifically limited here. Specifically, the computer device may determine the parameter information, the interface return data indicator, and the data determination rule from the requirement document.
[0038] Step S102: According to the preset interface document, determine the target table corresponding to the preset interface document.
[0039] The preset interface document may be a document that describes the interface functions, parameters, return values and other information in detail, and is a contract between the developer and the user. The preset interface document may be set manually and autonomously. After determining the preset interface document, the target table of the database to be operated may be determined based on the interface functions, parameters, return values and other information described in the preset interface document. The target table of the database to be operated may also be manually specified in the preset interface document, which is not specifically limited here and may be implemented by those skilled in the art.
[0040] Step S103: determine the first target data indicator according to the target table.
[0041] The target table may represent a table storing specific data in a database, and the data table to be queried or operated is determined according to a preset interface document. The first target data index may represent a data index determined by the target table.
[0042] As an example, the required data fields can be marked in the target table, such as determining the fields of the data indicator returned by the interface and the fields of the data determination rule, and then determining the first target data indicator according to the fields, etc., which is not specifically limited here and can be implemented by those skilled in the art.
[0043] Step S104: determining the target query statement according to the parameter information.
[0044] The target query statement may represent an SQL query statement constructed according to parameter information and data determination rules, and is used to extract target data from a database. Specifically, an SQL construction tool or a handwritten SQL statement may be used, which is not specifically limited here and can be implemented by those skilled in the art.
[0045] Step S105, querying target data from the database according to the target query statement, and determining a second target data indicator according to the target data.
[0046] Execute query statements to extract target data from the database and determine data indicators based on the extracted target data. Specifically, you can use a database client to execute SQL statements and parse the returned data.
[0047] As an example, use a database management system (such as MySQL, PostgreSQL, Oracle, etc.) or a database access interface (such as JDBC, ODBC, Python's SQLAlchemy, etc.) to execute the previously constructed target query statement. After the database management system executes the query statement, it will return a result set containing the data rows that meet the query conditions. These data rows are usually presented in a tabular form, and each row contains one or more fields (i.e., columns), which correspond to the columns in the database table. Traverse each row of data in the query result set and extract the required data indicators according to business requirements or interface documents. These data indicators may be the values of a single field, or they may be a combination or calculation result of multiple field values. Determine the second target data indicator based on the parsed query results. The second target data indicator is extracted from the actual query result and is used to compare with the first target data indicator (a data indicator pre-determined in the target table according to the interface document or business requirements).
[0048] Step S106, detecting whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, the data indicator returned by the representation interface is correct.
[0049] Compare the first target data indicator and the second target data indicator to determine whether the data returned by the interface is correct.
[0050] As an example, there is an interface for querying the basic information of users. The requirement document describes the user ID that needs to be input and the user name, age, gender and other information that should be returned. The user ID is obtained as a parameter. The data indicators that the interface should return are user name, age, and gender. The data determination rule is that these fields cannot be empty and conform to a specific format. Determine the target table as the user information table. In the target table, determine the data indicators that need to be extracted as user name, age, and gender. Construct an SQL query statement based on the user ID, such as SELECT user name, age, gender FROM user information table WHERE user ID =? Execute the query statement, extract data from the database, and determine the extracted data indicators. Compare whether the data indicators determined from the interface document and the data indicators queried from the database are consistent. If they are consistent, the data returned by the interface is correct.
[0051] The data verification method provided in this embodiment determines the target table and the first target data indicator by collecting all relevant information required for interface testing, including interface parameters, returned data indicators and data determination rules: according to the preset interface document, the target database table corresponding to the interface is determined, and the first target data indicator is determined based on the table, thereby ensuring the consistency of the verification process with the interface document and business logic.
[0052] At the same time, a target query statement is constructed based on the parameter information, the target data is queried from the database, and the second target data indicator is determined based on the query result. This step realizes the automatic extraction and comparison of the data returned by the interface. Finally, it is detected whether the first target data indicator and the second target data indicator are the same. If they are the same, it indicates that the data indicator returned by the interface is correct, otherwise it indicates that there is an error, thereby improving the accuracy and consistency of the data returned by the verification interface.
[0053] In a possible implementation, the above step S103 includes:
[0054] Step a1, determining a first target field corresponding to the parameter information and a second target field corresponding to the data determination rule from a target table.
[0055] According to the parameter information, find the corresponding fields in the target table. These fields can be query conditions or fields used to filter data. For example, if the parameter information is a user ID, the corresponding field in the target table can be user_id. According to the data determination rules, find the relevant fields in the target table. These fields are usually data indicators that need to be extracted, verified, or processed.
[0056] As an example, if the data validation rule requires verifying that the user's age is between 18 and 60, the corresponding field in the target table might be age.
[0057] As an example, a field or combination of fields should be able to represent the total amount of all successfully paid orders. For example, in the order table there may be an order_amount field representing the order amount, and an order_status field representing the order status (such as "paid", "refunded", etc.). To calculate the total amount of successfully paid orders, we need to filter out the records with order_status as "paid" and sum the order_amount.
[0058] (Paid + Refunded) Order Total Amount: This field or field combination should be able to represent the total amount of all successfully paid and refunded orders. Similarly, you can use the order_amount field, but this time you need to filter out records with order_status of "paid" or "refunded" and sum the order_amount.
[0059] Step a2: determining a first target data indicator according to the first target field and the second target field.
[0060] In step a1, the fields corresponding to the parameter information and data determination rules have been determined. Next, the first target data indicator needs to be calculated based on these fields. Calculation is performed based on the fields corresponding to the data determination rules. For example: merchant completed order amount ratio = total amount of all successfully paid orders / total amount of all (successfully paid + refunded) orders * 100, etc.
[0061] The data verification method provided in this embodiment can ensure that the fields used in the verification process are accurate and in line with expectations by accurately matching the first target field corresponding to the parameter information and the second target field corresponding to the data determination rule from the target table. This avoids the problem of inaccurate verification results caused by incorrect field selection. In addition, different interfaces may have different parameters and data rules. By dynamically determining the fields corresponding to the parameter information and the data determination rule from the target table, the method can adapt to the needs of different interfaces without the need for separate verification configuration for each interface.
[0062] In a possible implementation, determining the second target data indicator according to the target data in step S103 includes:
[0063] Step b1, performing aggregation calculation on the target data to obtain a first value and a second value having a target number of digits.
[0064] The target data is the data set that needs to be analyzed and processed, which may contain multiple records or data points. For example: order ID, user_id (order user ID), business_id (merchant ID), price (total order amount), coupon (coupon amount), gmt_create (order creation time: format: 2023-12-0312:00:00), gmt_modified (update time after each status change: format: 2023-12-03 12:00:00), payState (current order status): 0 pending payment, 1 successful payment, 2 failed payment, 3 refunded, etc.
[0065] After numerical processing, two numerical values with the target number of digits are obtained, which are recorded as the first numerical value and the second numerical value. These two numerical values will be used for subsequent ratio calculations. Among them, the target number of digits can be 6 decimal places, or other decimal places, etc., which are not specifically limited here. Select the appropriate aggregation function according to business needs or analysis goals. Common aggregation functions include sum (SUM), average (AVG), maximum (MAX), minimum (MIN), etc. Apply the selected aggregation function to the target data to calculate a single summary value or statistic. Format the numerical value obtained by the aggregation calculation into a form with the target number of digits. This may involve operations such as rounding, truncating decimal places, or retaining a specific number of decimal places.
[0066] For example, the target data are two floating point numbers, 123.456789 and 987.6543219. If the target number of digits is two decimal places, after rounding, the first value is 123.45679 and the second value is 987.654322.
[0067] Step b2, determining a second target data indicator according to the ratio of the first value to the second value.
[0068] Divide the first value by the second value to get their ratio. According to business requirements or interface documents, use this ratio as the second target data indicator. The second target data indicator can be data with two decimal places. For example: the first value is 123.46 and the second value is 987.65. Then their ratio is 123.46 / 987.65×100%≈12.48% (rounded to four decimal places). This ratio is the second target data indicator.
[0069] The data verification method provided in this embodiment can obtain more accurate first and second values by numerically processing the target data, such as retaining a specific number of decimal places or rounding. This refinement helps to reduce errors caused by data accuracy issues. In addition, as a data indicator, the ratio is usually highly sensitive to slight changes in the data. When a certain value in the target data changes slightly, its ratio may change significantly, thereby promptly reflecting the changing trend or abnormal situation of the data.
[0070] In a possible implementation, the above step b2 includes:
[0071] Step b21, detecting whether the target value satisfies a preset value; wherein the target value is the value used as the denominator.
[0072] Step b22: if the target value satisfies the preset value, determine the second target data indicator as the preset value.
[0073] The preset value can represent a value with a denominator of zero, etc., which is not specifically limited here. The target value is the value of the denominator, wherein the target value can be a first value or a second value, which is not specifically limited here. Among them, when the first value is the value used as the denominator, the first value is the target value, and similarly, when the second value is the value used as the denominator, the second value is the target value. Compare the target value with the preset value. That is, determine whether the target value and the preset value are the same. If the target value and the preset value are the same (satisfy the preset value), the second target data indicator is determined to be the preset value.
[0074] As an example, the first value is a value used as a denominator, and the first value is zero, which is the same as the preset value. Then when the denominator is zero, the corresponding ratio is zero, and the second target data indicator is also zero.
[0075] Step b23: If the target value does not meet the preset value, determine the second target data indicator according to the percentage of the ratio of the first value to the second value.
[0076] If the target value does not meet the preset value, that is, the denominator is not zero, then the first value can be divided by the second value to get their ratio. According to business requirements or interface documents, this ratio is used as the second target data indicator. Among them, the second target data indicator can be data with two decimal places. For example: the first value is 123.46 and the second value is 987.65. Then their ratio is 123.46 / 987.65×100%≈12.48% (rounded to four decimal places). This ratio is the second target data indicator.
[0077] The data verification method provided in this embodiment determines the second target data indicator according to the ratio of the first value and the second value, and detects whether the target value as the denominator meets the preset value in the process. It has the advantages of improving the robustness of data processing, enhancing the reliability of data indicators, improving the flexibility of data processing, and facilitating data analysis and decision-making.
[0078] In a possible implementation, the number of parameter information is multiple, and the number of first target data indicators is multiple; wherein the method further includes:
[0079] Step c1, associating the parameter information with the first target data indicator to obtain multiple groups of associated indicators.
[0080] There are multiple parameter information, that is, there are multiple merchant parameter information (such as merchant ID, etc.) in the database. After determining each first target data indicator, it is necessary to associate the first target data indicator with the corresponding merchant to obtain multiple sets of associated indicators. For example: Merchant A—80.35%, Merchant B—95.37%, etc.
[0081] Step c2: display the associated indicators on the page.
[0082] After determining the associated indicators, display them on the page.
[0083] As an example, design the overall layout and style of the page, determine the position, size and display method of the associated indicators on the page, and use front-end technology (such as HTML, CSS, JavaScript, etc.) or back-end technology (such as template engine, rendering framework, etc.) to embed the associated indicators into the page.
[0084] The data verification method provided in this embodiment can reflect the first target data indicator corresponding to each parameter information by associating each parameter information with the corresponding first target data indicator, and then display the associated indicator on the page for users to view.
[0085] In the present embodiment, a data verification device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0086] This embodiment provides a data verification device, such as Figure 2As shown, it includes: an acquisition module 201, which is used to acquire parameter information, interface return data indicators and data determination rules; a first determination module 202, which is used to determine the target table corresponding to the preset interface document according to the preset interface document; a second determination module 203, which is used to determine the first target data indicator according to the target table; a third determination module 204, which is used to determine the target query statement according to the parameter information; a fourth determination module 205, which is used to query the target data from the database according to the target query statement, and determine the second target data indicator according to the target data; a detection determination module 206, which is used to detect whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, it represents that the interface return data indicator is correct.
[0087] In one possible implementation, the second determination module 203 includes: a first determination unit, used to determine a first target field corresponding to the parameter information and a second target field corresponding to the data determination rule from the target table; a second determination unit, used to determine the first target data indicator based on the first target field and the second target field.
[0088] In one possible implementation, the third determination module 204 includes: an aggregation calculation unit, used to perform aggregation calculation on the target data to obtain a first value and a second value with a target number of digits; a third determination unit, used to determine the second target data indicator based on the ratio of the first value and the second value.
[0089] In one possible implementation, the third determination unit includes: a detection subunit, used to detect whether the target value meets a preset value; wherein the target value is a value used as a denominator; a first determination subunit, used to determine that the second target data indicator is a preset value if the target value meets the preset value; and a second determination subunit, used to determine the second target data indicator based on the percentage of the ratio of the first value to the second value if the target value does not meet the preset value.
[0090] In one possible implementation, there are multiple parameter information and multiple first target data indicators; wherein the device further includes: an association module for associating the parameter information and the first target data indicators to obtain multiple groups of associated indicators; and a page display module for displaying the associated indicators on a page.
[0091] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0092] The data verification device in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0093] The embodiment of the present invention also provides a computer device having the above Figure 2 The data verification device shown.
[0094] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.
[0095] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0096] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0097] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0099] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0100] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0101] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0102] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data verification method, characterized in that: The method comprises: Obtain parameter information, interface return data indicators and data determination rules; According to the preset interface document, determining the target table corresponding to the preset interface document; Determining a first target data indicator according to the target table; Determining a target query statement according to the parameter information; Querying target data from a database according to the target query statement, and determining a second target data indicator according to the target data; Detect whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, it indicates that the data indicator returned by the interface is correct.
2. The data verification method according to claim 1, characterized in that: Determining a first target data indicator according to the target table includes: Determine from the target table a first target field corresponding to the parameter information and a second target field corresponding to the data determination rule; A first target data indicator is determined according to the first target field and the second target field.
3. The data verification method according to claim 1, wherein: Determining a second target data indicator according to the target data includes: Performing aggregation calculation on the target data to obtain a first value and a second value having a target number of digits; A second target data indicator is determined according to a ratio of the first value to the second value.
4. The data verification method according to claim 3, wherein: Determining a second target data indicator according to a ratio of the first value to the second value includes: Detecting whether a target value satisfies a preset value; wherein the target value is a value used as a denominator; If the target value satisfies the preset value, determining that the second target data indicator is the preset value; If the target value does not meet the preset value, a second target data indicator is determined according to the percentage of the ratio of the first value to the second value.
5. The data verification method according to claim 1, wherein: There are multiple parameter information and multiple first target data indicators; wherein the method further includes: Associating the parameter information with the first target data indicator to obtain multiple groups of associated indicators; The associated indicators are displayed on a page.
6. A data verification device, characterized in that: The device comprises: The acquisition module is used to obtain parameter information, interface return data indicators and data determination rules; A first determining module is configured to determine, based on a preset interface document, a target table corresponding to the preset interface document; A second determining module, configured to determine a first target data indicator according to the target table; A third determining module is used to determine a target query statement according to the parameter information; a fourth determining module, configured to query target data from a database according to the target query statement, and determine a second target data indicator according to the target data; The detection and determination module is used to detect whether the first target data indicator and the second target data indicator are the same; wherein, if the first target data indicator and the second target data indicator are the same, it indicates that the data indicator returned by the interface is correct.
7. The data verification device according to claim 6, characterized in that: The second determining module includes: a first determining unit, configured to determine, from the target table, a first target field corresponding to the parameter information and a second target field corresponding to the data determination rule; The second determining unit is configured to determine a first target data indicator according to the first target field and the second target field.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the data verification method according to any one of claims 1 to 5 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data verification method according to any one of claims 1 to 5.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the data verification method according to any one of claims 1 to 5.