Data detection method and device based on data table, electronic device and storage medium
By obtaining a backup of the transaction data table as the assertion data table, converting it into a transaction data file in a preset format, and comparing the fields, the problem of low data detection efficiency and low accuracy in the existing technology is solved, and efficient and accurate data detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-03-15
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, data detection is inefficient and inaccurate, requiring manual comparison of file size and number of lines, which wastes manpower and time, and cannot achieve field-level data comparison.
By obtaining a backup of the transaction data table as the assertion data table, the transaction data table is converted into a transaction data file in a preset format, and the fields are compared with the assertion data table to determine the detection result of the transaction data file.
It improves the efficiency and accuracy of data detection, avoids the process of manually comparing file sizes, saves time and manpower, and achieves accurate comparison at the field level.
Smart Images

Figure CN116383184B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to big data technology, and particularly relates to a data detection method and device based on a data table, an electronic device and a storage medium. BACKGROUND
[0002] With the development of digital transactions, a large amount of data generated when people transact will be written into a data table, and the data in the data table needs to be automatically registered. When the data is registered, the system needs to convert the data in the data table into a file for storage. If the data in the file is incorrect, the correctness of the transaction will be reduced, and the user's transaction experience will be affected.
[0003] At present, when testing the accuracy of the data in the file, the data table to be tested needs to be converted into a source file, and the correctness of the source file is detected manually. Then the data table is converted into a test file, and the file sizes of the source file and the test file are compared. If the sizes are the same, it is considered that the test is passed. However, this method wastes a lot of manpower and time, and the detection accuracy and efficiency are low. SUMMARY
[0004] The present application provides a data detection method and device based on a data table, an electronic device and a storage medium to improve the efficiency of data detection.
[0005] In a first aspect, the present application provides a data detection method based on a data table, comprising:
[0006] obtaining a transaction data table of a user, and determining an assertion data table corresponding to the transaction data table; wherein the transaction data table is used to represent a data table including transaction data of the user, and the assertion data table is used to represent a backup of the transaction data table;
[0007] converting the transaction data table into a transaction data file in a preset format; wherein the transaction data file includes field contents of each field in the transaction data table;
[0008] detecting the field contents of the fields in the transaction data file according to the assertion data table, to obtain a detection result of the transaction data file.
[0009] In a second aspect, the present application provides a data detection device based on a data table, comprising:
[0010] a data table obtaining module, configured to obtain a transaction data table of a user, and determine an assertion data table corresponding to the transaction data table; wherein the transaction data table is used to represent a data table including transaction data of the user, and the assertion data table is used to represent a backup of the transaction data table;
[0011] The file obtaining module is configured to convert the transaction data table into a transaction data file in a preset format, wherein the transaction data file includes field contents of each field in the transaction data table.
[0012] The content detecting module is configured to detect the field contents of the fields in the transaction data file according to the assertion data table to obtain a detection result of the transaction data file.
[0013] In a third aspect, the present application provides an electronic device, comprising a processor and a memory connected with the processor in communication;
[0014] The memory stores computer execution instructions.
[0015] The processor executes the computer execution instructions stored in the memory to implement the data table-based data detection method according to the first aspect of the present application.
[0016] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the data table-based data detection method according to the first aspect of the present application.
[0017] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the data table-based data detection method according to the first aspect of the present application.
[0018] The data table-based data detection method, device, electronic device and storage medium provided by the present application obtain a transaction data table to obtain a backup of the transaction data table, i.e., an assertion data table. The transaction data table is converted into a transaction data file in a preset format, and the assertion data table is compared with the transaction data file in terms of fields to determine whether the transaction data file passes the detection. This avoids the process in the prior art of manually determining a correct source file and then comparing the source file with a transaction data file converted from the source file in terms of file size. This solves the problem of low detection accuracy caused by file size comparison only, saves manpower and time, and improves the efficiency of data detection. By comparing the fields, the accuracy of data detection is improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and serve to explain the principles of the present application together with the specification.
[0020] Figure 1 A flowchart of a data table-based data detection method provided by an embodiment of the present application is shown in the figure.
[0021] Figure 2 A flowchart of a data detection method based on a data table provided by an embodiment of the present application is shown in FIG. 1.
[0022] Figure 3 A structural block diagram of a data detection device based on a data table provided by an embodiment of the present application is shown in FIG. 2.
[0023] Figure 4 A structural block diagram of a data detection device based on a data table provided by an embodiment of the present application is shown in FIG. 2.
[0024] Figure 5 A structural block diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 3.
[0025] Figure 6 A structural block diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 3.
[0026] The specific embodiments of the present application have been shown and described in the above drawings and text, and will be described in more detail in the following. These drawings and text are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the drawings.
[0028] It should be clear that the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts, fall within the scope of protection of the present application.
[0029] The following description relates to the drawings, and the same numerals in different drawings represent the same or similar elements unless otherwise indicated. The implementation described in the following exemplary embodiments does not represent all the implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0030] In the description of the present application, it should be understood that the terms "first", "second", "third" and the like are only used to distinguish similar objects, and do not necessarily describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "a plurality of" means two or more, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0031] It should be noted that due to the limitation of the length of the specification, all optional embodiments are not enumerated in the present application, and those skilled in the art should be able to think of any combination of technical features as long as the technical features do not contradict each other, which can constitute an optional embodiment after reading the specification. The embodiments are described in detail below.
[0032] When a user makes a transaction, transaction data is generated and stored in a transaction data table, but in order to process the transaction data subsequently, the transaction data table needs to be converted into a file format. If there is a data error in the file conversion process, it will affect the accuracy of subsequent data processing. In the automated testing work of the new generation of transaction information registration system, it is necessary to check and assert the fields in the transaction data file generated after batch execution of transactions, which is a very important part of the testing process. In system applications, the data volume of business transaction confirmation is large, and the data is very complex, which greatly increases the difficulty of data assertion in automated testing.
[0033] Currently, automated data assertion cannot achieve full-field assertion of data tables in the database, affecting the comprehensiveness and accuracy of automated assertion. When the original test personnel performs batch file automated assertion comparison, they can only first convert the data table into a source file, manually determine that the data in the source file is consistent with the data in the data table. Then convert the data table into a file to be tested, and determine whether the number of data rows in the source file and the number of rows in the file to be tested are consistent, and whether the file sizes are equal, so as to determine whether the data in the file to be tested and the data in the data table are the same, which wastes a lot of manpower and time. And this way cannot realize the field level comparison of data, greatly reducing the effectiveness of automated assertion. That is, when comparing file data, only file size and file data row number can be compared, and the fields in the file may have errors, and the data detection accuracy is low.
[0034] The data detection method and device based on a data table, electronic equipment and storage medium provided by the present application aim to solve the above technical problems of the prior art.
[0035] The technical solutions of the present application and how the technical solutions solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0036] Figure 1 is a flow diagram of a data table-based data detection method according to an embodiment of the present application. The method can be executed by a data table-based data detection device. As shown in Figure 1 , the method comprises the following steps:
[0037] S101, obtaining a transaction data table of a user and determining an assertion data table corresponding to the transaction data table; wherein the transaction data table is used to represent a data table including transaction data of the user, and the assertion data table is used to represent a backup of the transaction data table.
[0038] Illustratively, when a user performs a transaction, transaction data can be generated, which can be used to represent the transaction situation, for example, the transaction data can include user information, amount information, transaction time and business type, etc. The transaction data table can include the transaction data of the user, i.e. the generated transaction data can be filled in the transaction data table. The transaction data table can be obtained from a predetermined storage location in real time or at a predetermined time, and the transaction data table can include multiple fields, for example, the fields can include user name, amount, business type and transaction date, etc., and each field has corresponding field content, i.e. specific user name and amount, etc.
[0039] The transaction data in the obtained transaction data table is the original transaction data, i.e. the transaction data in the transaction data table is correct. The transaction data table is backed up to obtain a data table consistent with the transaction data table as an assertion data table. The fields represented by each row in the assertion data table and the specific field content under the field are the same as the transaction data table. The assertion data table is stored at a predetermined location.
[0040] In this embodiment, obtaining a transaction data table of a user comprises: obtaining transaction data of a user, and obtaining a transaction data table corresponding to the transaction data of the user according to a predetermined data table generation rule.
[0041] Specifically, when a user performs a transaction, transaction data can be generated for storage. The transaction data of the user is obtained in real time or at a predetermined time to generate a data table containing the transaction data as a transaction data table. For example, a blank data table can be predetermined, and the transaction data can be filled in the data table to obtain a complete transaction data table.
[0042] Data table generation rules can be pre-defined. These rules specify how transaction data is converted into transaction data tables, ensuring that all generated tables have a consistent format for easier subsequent data inspection. For example, the rules might include specifying the row and column positions for each transaction data point, the number of rows and columns, and the types and quantities of fields in each row or column. Based on these rules, the corresponding fields for each row or column in the transaction data table are determined, and the transaction data content for each field is placed in its corresponding position.
[0043] The advantage of this setup is that it can automatically generate transaction data tables, reducing user operations and improving the efficiency of data detection.
[0044] In this embodiment, determining the assertion data table corresponding to the transaction data table includes: copying the contents of each field in the transaction data table to a blank data table in the order of arrangement to obtain the assertion data table corresponding to the transaction data table.
[0045] Specifically, the transaction data table is backed up, and the resulting table becomes the assertion data table. This can be achieved by copying the transaction data table, or by pre-setting a blank data table and copying the field contents of each field from the transaction data table sequentially into the pre-set blank data table. The content of each row and column in the transaction data table is then determined, and the field contents are filled into the blank data table in the order of rows and columns in the transaction data table, ensuring consistency between the fields and their contents in both the transaction data table and the assertion data table. For example, if the first row of the first column in the transaction data table contains the field name "User ID," and the second row contains the actual user IDs, then the first row of the first column in the assertion data table will also contain the field name "User ID," and the second row of the first column will also contain the actual user IDs.
[0046] The advantage of this setup is that it automatically generates an assertion data table, which facilitates data testing and ensures consistency between the assertion data table and the transaction data table, effectively improving the efficiency and accuracy of data testing.
[0047] S102. Convert the transaction data table into a transaction data file in a preset format; wherein, the transaction data file includes the field content of each field in the transaction data table.
[0048] For example, a pre-defined format for transaction data files is used, where the transaction data is represented in a pre-defined format. Based on this pre-defined format, the transaction data is converted from a tabular format to a file format. The pre-defined format may include the fields that each row of data in the transaction data file needs to represent; for example, the first row in the transaction data file might contain the user ID and user address, and the second row might contain the transaction amount and transaction date. Following the pre-defined format, the field content corresponding to each field in the transaction data table is mapped to the transaction data file, ensuring that the transaction data file can include the field content from the transaction data table, and that the format of different transaction data files is consistent.
[0049] In this embodiment, the preset format can be to transfer the field content of each field in the transaction data table to the transaction data file according to its row and column position. The transaction data file consists of the content of each field, for example, each field content is separated by a space or a preset delimiter. Specifically, if the first row and first column of the transaction data table is the field name "Amount", and the first row, second column, and first row, third column are the actual amounts, then the first data in the first row of the transaction data file could be the actual amount in the first row and second column of the transaction data table, and the second data in the first row could be the actual amount in the first row and second column of the transaction data table. Alternatively, the transaction data file can be the file obtained by removing the table lines from the transaction data table.
[0050] The preset format also allows you to pre-set one or more field names as fields to be filtered out. This determines the field content corresponding to the fields to be filtered out in the transaction data table. The field content of the fields to be filtered out can still be transferred to the transaction data file in row and column order. However, a preset filtering identifier is added to these data in the transaction data file. This makes it easier to avoid comparing the field content of the fields to be filtered when performing data comparison later, thereby improving the efficiency and accuracy of data detection and meeting the actual needs of data detection.
[0051] S103. Based on the assertion data table, perform field content checks on the fields in the transaction data file to obtain the check results of the transaction data file.
[0052] For example, after obtaining the assertion data table and the transaction data file, the transaction data in each row of the transaction data file is compared sequentially with the field content of the corresponding row in the assertion data table. This determines whether the transaction data in the assertion data table and the transaction data file correspond one-to-one within the same row. For instance, it determines whether the first transaction data in the first row of the transaction data table matches the first field content of the first row of the assertion data table. If the transaction data in each row of the transaction data file corresponds one-to-one with the field content of the same row in the assertion data table, then the detection result of the transaction data file is determined to be successful, meaning the transaction data in the transaction data file is the same as the transaction data in the transaction data table. If there is transaction data in the transaction data file that does not match the field content at the corresponding row and column position in the assertion data table, then the detection result of the transaction data file is determined to be unsuccessful.
[0053] If the transaction data in the transaction data file contains a filtering flag, then there is no need to compare that transaction data. For example, if the first transaction data in the second row of the transaction data file has a filtering flag, then there is no need to compare the first transaction data in the second row of the transaction data file with the content of the first field in the second row of the assertion data table. This avoids data comparison errors and improves the accuracy and efficiency of data detection.
[0054] This application provides a data detection method based on a data table. It obtains a backup of the transaction data table, i.e., an assertion data table, by acquiring the transaction data table. The transaction data table is converted into a transaction data file in a preset format. The assertion data table and the transaction data file are compared field-by-field to determine whether the transaction data file passes the detection. This avoids the process in existing technologies where a correct source file needs to be manually determined and then compared in size with the converted transaction data file. It solves the problem of low detection accuracy caused by only comparing file size, saves manpower and time, and improves the efficiency of data detection. By comparing fields, the accuracy of data detection is improved.
[0055] Figure 2 This is a flowchart illustrating a data detection method based on a data table, which is an optional embodiment based on the above embodiments.
[0056] In this embodiment, the field content of the fields in the transaction data file is detected according to the assertion data table to obtain the detection result of the transaction data file. This can be further refined as follows: the transaction data file is split according to the index of each row in the transaction data file to obtain the field content of each row in the transaction data file; wherein, each row in the transaction data file corresponds to one index; the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file.
[0057] like Figure 2 The method includes the following steps:
[0058] S201. Obtain the user's transaction data table and determine the assertion data table corresponding to the transaction data table; wherein, the transaction data table is used to represent a data table including the user's transaction data, and the assertion data table is used to represent a backup of the transaction data table.
[0059] For example, this step can refer to step S101 above, and will not be repeated here.
[0060] S202. Convert the transaction data table into a transaction data file in a preset format; wherein, the transaction data file includes the field content of each field in the transaction data table.
[0061] For example, this step can refer to step S102 above, and will not be repeated here.
[0062] S203. Based on the index of each row in the transaction data file, split the transaction data file and determine the field content of each row in the transaction data file.
[0063] For example, a transaction data file includes multiple rows, each row may contain multiple transaction data points, and each transaction data point may correspond to a field in a transaction data table. The transaction data file is split by row, with each row divided into a part. For example, if the transaction data file has ten rows, it can be split into ten parts. The transaction data points in each row are determined, with each transaction data point representing a single field; that is, the field content of each row is determined. When generating the transaction data file, an index is assigned to each row, with each row corresponding to a unique index. The transaction data file is then split based on the index, i.e., the transaction data file is split by row to obtain the transaction data in each row.
[0064] Each line can contain multiple fields, which can be separated by preset delimiters, such as spaces. After splitting the transaction data file, the transaction data before and after the delimiter in each line is determined to obtain the field content of that line.
[0065] S204. Compare the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file.
[0066] For example, the rows in the assertion data table that correspond to the rows in the transaction data file are determined. The row order of each row in the assertion data table and the row order of each row in the transaction data file can be determined, and two rows with the same row order are identified as corresponding rows. For example, the first row in the transaction data file corresponds to the first row in the assertion data table; the second row in the transaction data file corresponds to the second row in the assertion data table.
[0067] The process compares the field content of each row in the transaction data file with the corresponding field content in the assertion data table. Based on the comparison results, the detection result of the transaction data file is determined. If the field content of each row in the transaction data file matches the corresponding field content in the assertion data table, the detection result is determined to be successful. If at least one row in the transaction data file has a field content that does not match the corresponding field content in the assertion data table, the detection result is determined to be unsuccessful. For example, if the transaction data file has ten rows, and the field content of the first nine rows matches the field content of the first nine rows in the assertion data table, but the field content of the tenth row does not match, the detection result is determined to be unsuccessful.
[0068] If a row contains multiple fields, the order of these fields is determined. Based on this order, the corresponding fields in the assertion data table are identified and matched with those in the transaction data file. For example, for the fields in the first row, the first field in the assertion data table is matched with the first field in the transaction data file; the second field in the assertion data table is matched with the second field in the transaction data file. Each field in each row is compared sequentially. If both corresponding fields in the transaction data file and the assertion data table match, the detection is considered successful; otherwise, it is considered unsuccessful.
[0069] In this embodiment, the transaction data file has corresponding attribute information, which is used to represent the number of rows in the transaction data file. The method further includes: if it is determined from the attribute information that the number of rows in the transaction data file is the same as the number of rows in the assertion data table, then the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table.
[0070] Specifically, the transaction data file is split line by line, and the number of the resulting parts represents the number of lines in the transaction data file. When generating the transaction data file, attribute information can be generated, including the number of lines. This attribute information can be used to determine the number of lines in the transaction data file and the number of lines in the assertion table. Before comparing field content, it is first determined whether the number of lines in the transaction data file and the number of lines in the assertion table are the same. If they are the same, the field content of each line in the transaction data file is retrieved and compared with the corresponding field content in the assertion table to obtain the detection result of the transaction data file. If they are different, no field content comparison is needed, and the detection result is directly determined as a failure. For example, if the assertion table has ten lines and the transaction data file has nine lines, it is considered that there is an omission during data conversion, and the detection result is a failure.
[0071] The advantage of this setup is that it first determines whether the number of rows in the transaction data file and the assertion data table are consistent, promptly identifies transaction data files that fail the test, avoids comparing field content when the number of rows is inconsistent, and improves the efficiency of data testing.
[0072] In this embodiment, the method further includes: determining the field identifier of each row in the transaction data file; wherein the field identifier is used to represent the name of the field; if it is determined that there is at least one row in the transaction data file whose field identifier is different from the field identifier of the corresponding row in the assertion data table, then sorting the rows in the transaction data file according to the row arrangement order in the assertion data table; and, according to the sorting result of the rows in the transaction data file, comparing the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table.
[0073] Specifically, each field in the transaction data file can be accompanied by a field identifier to indicate the field name. For example, if the field content is 500, and an identifier "a" is appended after 500, it indicates that the field name is "Amount". Similarly, each field in the assertion table also has a corresponding field name; for example, if the field name is "Amount", the field content following that name is the actual amount.
[0074] Each row in the assertion table can have a corresponding field identifier or field name. Determine the field identifier associated with each row's field content in the transaction data file, and compare this identifier with the corresponding field identifier in the assertion table. Check if the field identifiers in the transaction data file and the assertion table are the same. If they are, compare the field content of each row in the transaction data file with the corresponding field content in the assertion table. If at least one row in the transaction data file has a field identifier different from the corresponding field identifier in the assertion table, then the field content of that row in the transaction data file and the corresponding field content in the assertion table are not from the same field, and the rows in the transaction data file need to be sorted. This can be done by finding the corresponding rows in the transaction data file based on the field identifiers in the assertion table, and then sorting the rows in the transaction data file according to the row order in the assertion table, ensuring that the row order of field identifiers in the transaction data file matches the row order of field identifiers in the assertion table. For example, if the rows in the assertion table are arranged from top to bottom as "Username", "Amount", and "Transaction Time", then the rows in the sorted transaction data file representing the fields will also be arranged from top to bottom as "Username", "Amount", and "Transaction Time". You can determine whether to reorder the rows in the transaction data file after confirming that the number of rows in the transaction data file is the same as that in the assertion table.
[0075] Based on the row sorting results in the transaction data file, determine the corresponding row in the assertion data table for each row in the transaction data file. Compare the field contents of each row in the transaction data file with the field contents of the corresponding row in the assertion data table to obtain the detection results.
[0076] The advantage of this setup is that by sorting the rows in the transaction data file, it can be ensured that the sorting of fields in the transaction data file is consistent with the sorting of fields in the assertion data table, avoiding errors when comparing field content and improving the accuracy of data detection.
[0077] In this embodiment, the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file. This includes: if it is determined that the field content of each row in the transaction data file is consistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a successful detection; if it is determined that there is data in each row of the transaction data file that is inconsistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a failed detection.
[0078] Specifically, each line of data in the transaction data file is checked sequentially. If every line of data in the transaction data file passes the check, the transaction data file passes the check; if one or more lines in the transaction data file fail the check, the transaction data file fails the check.
[0079] For each row of data in the transaction data file, determine the corresponding row in the assertion data table. The row order can be used to determine the corresponding row; the order of the rows in the transaction data file must match the order of the corresponding rows in the assertion data table. Then, verify that the field content of each row in the transaction data file matches the field content of the corresponding row in the assertion data table. If all rows match, the transaction data file is considered to have passed the test. If any row in the transaction data file contains fields whose field content does not match the corresponding row in the assertion data table, the transaction data file is considered to have failed the test.
[0080] The advantage of this setup is that it allows for data inspection of each line in the transaction data file, preventing data omissions and improving the accuracy of data inspection.
[0081] In this embodiment, the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file. This includes: determining the target field according to preset field configuration information; wherein the field configuration information includes the identifier of the target field; and traversing the rows in the transaction data file based on a preset traversal algorithm, comparing the field content of the target field in the transaction data file with the field content of the target field in the assertion data table to obtain the detection result of the transaction data file.
[0082] Specifically, field configuration information can be pre-stored. This information includes the field identifier of the target field, which is a pre-determined field that needs to be inspected. For example, if there is a large amount of transaction data, inspecting each transaction would increase inspection time. Therefore, the transaction data to be inspected can be selected from the large dataset, and the corresponding field identifiers can be written into the field configuration information for storage. When data inspection is required, the written field identifier is determined from the field configuration information and used as the target field. A pre-set traversal algorithm is used to traverse the transaction data file and determine the corresponding field content of the target field. Alternatively, the assertion data table can be traversed to determine the field content of the target field.
[0083] The content of the same target field in the transaction data file is compared with the content of the field in the assertion data table. If the content of each target field is consistent in both sets of data, the transaction data file is determined to pass the test. If at least one target field is inconsistent between the content of the target field in the transaction data file and the content of the target field in the assertion data table, the transaction data file is determined to fail the test.
[0084] The advantage of this setup is that after obtaining the transaction data file, you can select specific fields for testing, avoiding the need to test a large amount of data and effectively improving data testing efficiency.
[0085] This application provides a data detection method based on a data table. It obtains a backup of the transaction data table, i.e., an assertion data table, by acquiring the transaction data table. The transaction data table is converted into a transaction data file in a preset format. The assertion data table and the transaction data file are compared field-by-field to determine whether the transaction data file passes the detection. This avoids the process in existing technologies where a correct source file needs to be manually determined and then compared in size with the converted transaction data file. It solves the problem of low detection accuracy caused by only comparing file size, saves manpower and time, and improves the efficiency of data detection. By comparing fields, the accuracy of data detection is improved.
[0086] Figure 3 This is a structural block diagram of a data detection device based on a data table, provided as an embodiment of this application. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 3 The device includes: a data table acquisition module 301, a file acquisition module 302, and a content detection module 303.
[0087] The data table acquisition module 301 is used to acquire the user's transaction data table and determine the assertion data table corresponding to the transaction data table; wherein, the transaction data table is used to represent a data table including the user's transaction data, and the assertion data table is used to represent a backup of the transaction data table;
[0088] The file acquisition module 302 is used to convert the transaction data table into a transaction data file in a preset format; wherein the transaction data file includes the field content of each field in the transaction data table;
[0089] The content detection module 303 is used to detect the field content of the fields in the transaction data file according to the assertion data table, and obtain the detection result of the transaction data file.
[0090] Figure 4 This application provides a structural block diagram of a data detection device based on a data table, in which... Figure 3Based on the illustrated embodiments, as Figure 4 As shown, the content detection module 303 includes a splitting unit 3031 and a result acquisition unit 3032.
[0091] The splitting unit 3031 is used to split the transaction data file according to the index of each row in the transaction data file to obtain the field content of each row in the transaction data file; wherein, in the transaction data file, each row corresponds to one index;
[0092] The result acquisition unit 3032 is used to compare the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file.
[0093] In one example, the transaction data file has corresponding attribute information, which is used to indicate the number of rows in the transaction data file;
[0094] The device also includes:
[0095] The row count comparison module is used to compare the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table if the number of rows in the transaction data file is determined to be the same as the number of rows in the assertion data table based on the attribute information.
[0096] In one example, the device also includes:
[0097] An identifier determination module is used to determine the field identifier of each line in the transaction data file; wherein the field identifier is used to represent the name of the field;
[0098] The identifier determination module is used to sort the rows in the transaction data file according to the row arrangement order in the assertion data table if it is determined that at least one row in the transaction data file has a field identifier that is different from the field identifier of the corresponding row in the assertion data table.
[0099] The content comparison module is used to compare the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table, based on the sorting result of the rows in the transaction data file.
[0100] In one example, the result is obtained from unit 3032, which is specifically used for:
[0101] If it is determined that the field content of each row in the transaction data file is consistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a successful detection.
[0102] If it is determined that there is data in each row of the transaction data file that is inconsistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a failure.
[0103] In one example, the result is obtained from unit 3032, which is specifically used for:
[0104] The target field is determined based on the preset field configuration information; wherein the field configuration information includes the identifier of the target field;
[0105] Based on a preset traversal algorithm, the rows in the transaction data file are traversed, and the field content of the target field in the transaction data file is compared with the field content of the target field in the assertion data table to obtain the detection result of the transaction data file.
[0106] In one example, the data table retrieval module 301 is specifically used for:
[0107] Obtain the user's transaction data and, based on the preset data table generation rules, obtain the transaction data table corresponding to the user's transaction data.
[0108] In one example, the data table retrieval module 301 is specifically used for:
[0109] The contents of each field in the transaction data table are copied to a blank data table in the order they are arranged to obtain the assertion data table corresponding to the transaction data table.
[0110] Figure 5 A structural block diagram of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, the electronic device includes: a memory 51 and a processor 52; the memory 51 is a memory used to store instructions executable by the processor 52.
[0111] The processor 52 is configured to perform the methods provided in the above embodiments.
[0112] The electronic device also includes a receiver 53 and a transmitter 54. The receiver 53 is used to receive instructions and data sent by other devices, and the transmitter 54 is used to send instructions and data to external devices.
[0113] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. The device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0114] Device 600 may include one or more of the following components: processing component 602, memory 604, power supply component 606, multimedia component 608, audio component 610, input / output (I / O) interface 612, sensor component 614, and communication component 616.
[0115] Processing component 602 typically controls the overall operation of device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0116] Memory 604 is configured to store various types of data to support the operation of device 600. Examples of this data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0117] Power supply component 606 provides power to various components of device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.
[0118] Multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0119] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0120] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0121] Sensor assembly 614 includes one or more sensors for providing status assessments of various aspects of device 600. For example, sensor assembly 614 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or a component of device 600, the presence or absence of user contact with device 600, the orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0122] Communication component 616 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0123] In an exemplary embodiment, device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0124] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0125] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a terminal device, enables the terminal device to execute the data table-based data detection method of the aforementioned electronic device.
[0126] This application also discloses a computer program product, including a computer program that, when executed by a processor, implements the method described in this embodiment.
[0127] Various embodiments of the systems and technologies described above in this application can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0128] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or electronic device.
[0129] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0130] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0131] The systems and technologies described herein can be implemented in computing systems that include back-end components (e.g., as data electronic devices), or computing systems that include middleware components (e.g., application electronic devices), or computing systems that include front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0132] Computer systems can include client and electronic devices. Clients and electronic devices are generally geographically separated and typically interact via communication networks. The client-electronic device relationship is created by computer programs running on the respective computers and having a client-electronic device relationship with each other. The electronic device can be a cloud electronic device, also known as a cloud computing electronic device or cloud host, a host product within the cloud computing service system, addressing the shortcomings of traditional physical hosts and VPS services ("Virtual Private Server," or simply "VPS") in terms of management difficulty and weak business scalability. The electronic device can also be an electronic device in a distributed system or an electronic device incorporating blockchain technology. It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application is achieved, and this is not limited herein.
[0133] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0134] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data detection method based on a data table, characterized in that, include: Obtain the user's transaction data table and determine the assertion data table corresponding to the transaction data table; wherein, the transaction data table is used to represent a data table including the user's transaction data, and the assertion data table is obtained by copying the contents of each field in the transaction data table in the sorted order to a blank data table, and is used to represent a backup of the transaction data table; The transaction data table is converted into a transaction data file in a preset format; wherein the transaction data file includes the field content of each field in the transaction data table; wherein the preset format also includes one or more fields to be filtered out; when converting the transaction data table into a transaction data file in a preset format, the field content corresponding to the fields to be filtered out is transferred into the transaction data file in row and column order, and preset filtering identifiers are added to these field contents; Based on the assertion data table, the field content of the fields in the transaction data file is detected to obtain the detection result of the transaction data file; wherein, if the transaction data in the transaction data file contains the filter identifier, then it is not necessary to compare the transaction data. The content of fields in the transaction data file is inspected to obtain the inspection results of the transaction data file, including: The transaction data file is split according to the index of each row in the transaction data file to obtain the field content of each row in the transaction data file; wherein, each row in the transaction data file corresponds to one index; The transaction data file has corresponding attribute information, which is used to indicate the number of rows in the transaction data file; If, based on the attribute information, it is determined that the number of rows in the transaction data file is the same as the number of rows in the assertion data table, then the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file.
2. The method according to claim 1, characterized in that, The method further includes: Determine the field identifier for each row in the transaction data file; wherein the field identifier is used to represent the name of the field; If it is determined that at least one row in the transaction data file has a field identifier that is different from the field identifier of the corresponding row in the assertion data table, then the rows in the transaction data file are sorted according to the row arrangement order in the assertion data table; Based on the sorting result of the rows in the transaction data file, the process of comparing the field content of each row in the transaction data file with the field content of the corresponding row in the assertion data table is performed.
3. The method according to claim 2, characterized in that, The detection results of the transaction data file are obtained by comparing the field contents of each row in the transaction data file with the field contents of the corresponding row in the assertion data table, including: If it is determined that the field content of each row in the transaction data file is consistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a successful detection. If it is determined that there is data in each row of the transaction data file that is inconsistent with the field content of the corresponding row in the assertion data table, then the detection result of the transaction data file is determined to be a failure.
4. The method according to claim 3, characterized in that, The detection results of the transaction data file are obtained by comparing the field contents of each row in the transaction data file with the field contents of the corresponding row in the assertion data table, including: The target field is determined based on the preset field configuration information; wherein the field configuration information includes the identifier of the target field; Based on a preset traversal algorithm, the rows in the transaction data file are traversed, and the field content of the target field in the transaction data file is compared with the field content of the target field in the assertion data table to obtain the detection result of the transaction data file.
5. The method according to claim 1, characterized in that, Obtain the user's transaction data table, including: Obtain the user's transaction data and, based on the preset data table generation rules, obtain the transaction data table corresponding to the user's transaction data.
6. A data detection device based on a data table, characterized in that, include: The data table acquisition module is used to acquire the user's transaction data table and determine the assertion data table corresponding to the transaction data table; wherein, the transaction data table is used to represent a data table including the user's transaction data, and the assertion data table is obtained by copying the contents of each field in the transaction data table in the sorted order to a blank data table, and is used to represent a backup of the transaction data table; The file acquisition module is used to convert the transaction data table into a transaction data file of a preset format; wherein the transaction data file includes the field content of each field in the transaction data table; wherein the preset format also includes one or more fields to be filtered out; when converting the transaction data table into a transaction data file of the preset format, the field content corresponding to the fields to be filtered out is transferred into the transaction data file in row and column order, and preset filtering identifiers are added to these field contents; The content detection module is used to detect the field content of the fields in the transaction data file according to the assertion data table, and obtain the detection result of the transaction data file; wherein, if the transaction data in the transaction data file contains the filter identifier, then it is not necessary to compare the transaction data. The content detection module is specifically used to split the transaction data file according to the index of each row in the transaction data file to obtain the field content of each row in the transaction data file; wherein, each row in the transaction data file corresponds to one index; the transaction data file has corresponding attribute information, which is used to indicate the number of rows in the transaction data file; if it is determined according to the attribute information that the number of rows in the transaction data file is the same as the number of rows in the assertion data table, then the field content of each row in the transaction data file is compared with the field content of the corresponding row in the assertion data table to obtain the detection result of the transaction data file.
7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the data detection method based on a data table as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data detection method based on a data table as described in any one of claims 1-5.
9. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data detection method based on a data table as described in any one of claims 1-5.
Citation Information
Patent Citations
Data processing method and device, equipment and storage medium
CN115455007A