Data row-level provenance method, apparatus, device, and medium

By extracting data row-level source information from the result table and generating the target query statement, the problem of the ambiguous relationship between the result table and the source data is solved, and the effect of accurately tracing the source data row-level records is achieved.

CN118964430BActive Publication Date: 2026-04-07CHINA MOBILE GRP FUJIAN CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, after data querying and statistics, the relationship between the result table and the source data becomes ambiguous, making it impossible to accurately obtain the row-level records of the source data.

Method used

By extracting data row-level tracing information from the result table, the source table name, field list, values ​​of logical primary key fields, and source table field names corresponding to logical primary key fields are determined. A target query statement is then generated to trace the source data row-level records related to the result table.

Benefits of technology

It enables accurate acquisition of source data row-level records related to the result table, improving the accuracy and efficiency of data tracing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964430B_ABST
    Figure CN118964430B_ABST
Patent Text Reader

Abstract

This disclosure proposes a data row-level tracing method, apparatus, device, and medium. The data row-level tracing method includes: extracting data row-level tracing information from a result table; determining the source table name, field list, logical primary key field value, and source table field name corresponding to the logical primary key field based on the data row-level tracing information, wherein the logical primary key field is used to locate one or more source data row-level records in the source table; generating a first part of the statement based on the source table name, a second part of the statement based on the source table name and field list, and a third part of the statement based on the logical primary key field value and source table field name; and generating a target query statement based on the first part, second part, and third part of the statement, wherein the target query statement is used to trace the source data row-level records related to the result table. This solves the technical problem in the prior art of being unable to obtain source data row-level records related to the result table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data query technology, and in particular to a data row-level tracing method, apparatus, device and medium. Background Technology

[0002] When using query statements to query and / or statistically analyze data, the relationship between the final result table and the source data becomes blurred after data transformation, merging, aggregation, and other processing.

[0003] In related technologies, data lineage is typically used to establish field-level relationships (column-level) between source data and result tables. However, this method cannot obtain the row-level records of the source data related to the result table. Summary of the Invention

[0004] This disclosure aims to at least partially address one of the technical problems in the related art.

[0005] Therefore, this disclosure provides a data row-level tracing method, apparatus, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product that can accurately obtain source data row-level records related to result tables.

[0006] The first aspect of this disclosure proposes a data row-level tracing method, comprising: extracting data row-level tracing information from a result table; determining, based on the data row-level tracing information, the source table name, a field list, the value of a logical primary key field, and the source table field name corresponding to the logical primary key field, wherein the logical primary key field is used to locate one or more source data row-level records in the source table; generating a first part statement based on the source table name, generating a second part statement based on the source table name and the field list, and generating a third part statement based on the value of the logical primary key field and the source table field name; and generating a target query statement based on the first part statement, the second part statement, and the third part statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

[0007] A second aspect of this disclosure provides a data row-level tracing device, comprising: an extraction module for extracting data row-level tracing information from a result table; a determination module for determining, based on the data row-level tracing information, a source table name, a field list, the value of a logical primary key field, and the source table field name corresponding to the logical primary key field, wherein the logical primary key field is used to locate one or more source data row-level records in the source table; a first generation module for generating a first part statement based on the source table name, a second part statement based on the source table name and the field list, and a third part statement based on the value of the logical primary key field and the source table field name; and a second generation module for generating a target query statement based on the first part statement, the second part statement, and the third part statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

[0008] A third aspect of this disclosure provides an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described above.

[0009] A fourth aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described above.

[0010] A fifth aspect of this disclosure provides a computer program product including a computer program that, when executed by a processor, implements the method described above.

[0011] The data row-level tracing method, apparatus, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product disclosed herein extract data row-level tracing information from a result table, and based on this information, determine the source table name, field list, value of the logical primary key field, and the source table field name corresponding to the logical primary key field. Based on the source table name, a first part of the statement is generated; based on the source table name and field list, a second part of the statement is generated; based on the value of the logical primary key field and the source table field name, a third part of the statement is generated; and based on the first, second, and third parts of the statement, a target query statement is generated. The target query statement is used to trace the source data row-level records related to the result table. This method can accurately obtain the source data row-level records related to the result table.

[0012] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description

[0013] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:

[0014] Figure 1 This is a flowchart illustrating a data row-level tracing method proposed in an embodiment of this disclosure;

[0015] Figure 2 This is a flowchart illustrating a data row-level tracing method proposed in another embodiment of this disclosure;

[0016] Figure 3 This is a schematic diagram of the primary key of the source table in an embodiment of this disclosure;

[0017] Figure 4 This is a schematic diagram of the source data in the source table in an embodiment of this disclosure;

[0018] Figure 5 This is a schematic diagram illustrating the generation of row-level traceability information for intermediate statistical tables of payment records in this embodiment of the present disclosure;

[0019] Figure 6 This is a schematic diagram illustrating the generation of row-level traceability information for the payment record statistics table in this embodiment of the disclosure;

[0020] Figure 7 This is a schematic diagram illustrating the generation of data row-level tracing statements in an example payment statistics report of this disclosure;

[0021] Figure 8 This is a schematic diagram of the structure of a data row-level tracing device proposed in an embodiment of this disclosure;

[0022] Figure 9 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0023] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0024] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0025] Figure 1This is a flowchart illustrating a data row-level tracing method proposed in one embodiment of this disclosure.

[0026] This embodiment illustrates the example of configuring a data row-level tracing method within a data row-level tracing device. In this embodiment, the data row-level tracing method can be configured within a data row-level tracing device, which can be located in a server or an electronic device; there are no restrictions on this.

[0027] This embodiment uses a data row-level tracing method configured in an electronic device as an example. It should be noted that the execution entity of this embodiment can be, in hardware, for example, a server or a central processing unit (CPU) in an electronic device, and in software, for example, a related background service in a server or electronic device; there are no limitations on this.

[0028] like Figure 1 As shown, this data row-level tracing method includes:

[0029] S101: Extract data row-level traceability information from the result table.

[0030] When using query statements to query and / or statistically analyze data, the data, after being transformed, merged, and aggregated, results in a table that can be called a result table. The data contained in the result table can be called result data.

[0031] Among them, data row-level traceability information refers to the information that supports tracing back to the source data row-level records of the result table. The source data row-level records of the result table refer to the source data row-level records from which the result data in the result table is processed, that is, which row and / or several rows of source data in the source data table (which can be simply referred to as the source table) a certain or / or a certain row of result data in the result table comes from.

[0032] The data row-level traceability information in this embodiment can be dynamically generated during the process of converting, merging, aggregating, etc., a certain row and / or several rows of source data in the source data table. For specific generation methods, please refer to the following embodiments. After generating the data row-level traceability information, the data row-level traceability information can be marked in the result table to support quick tracing of the source data row-level records related to the result table based on the data row-level traceability information.

[0033] The data row-level tracing information in this embodiment can be used to support the generation of target query statements, which can be, for example, Structured Query Language (SQL) statements. The target query statements can be executed to retrieve the source data row-level records related to the result table.

[0034] Data row-level tracing information can include, for example, logical primary key fields, source table names, mapping relationships between logical primary key fields and source table fields, or any other information that supports tracing; there are no restrictions on this. The logical primary key field enables accurate location of one or more source data row-level records in the source data table. The source table name identifies the source data table from which the result data is generated. The mapping relationship between logical primary key fields and source table fields can be used to locate the source table field names, which can be used to support the generation of the target query statement.

[0035] In some embodiments, after obtaining the result table, data row-level traceability information can be directly extracted from the result table.

[0036] S102: Based on the data row-level tracing information, determine the source table name, field list, value of the logical primary key field, and the source table field name corresponding to the logical primary key field. The logical primary key field is used to locate one or more source data row-level records in the source table.

[0037] The source table name is used to identify the source table.

[0038] After obtaining the data row-level source information, the source table name, field list, logical primary key field value, and corresponding source table field name can be determined based on the data row-level source information to support the accurate generation of the target query statement.

[0039] In some embodiments, the source table name, field list, logical primary key field value, and corresponding source table field name can be directly parsed from the row-level data tracing information. Alternatively, another data table can be obtained, which records the correspondence between the row-level data tracing information and each item (i.e., the source table name, field list, logical primary key field value, and corresponding source table field name). Then, the source table name, field list, logical primary key field value, and corresponding source table field name can be determined by combining the row-level data tracing information and the aforementioned correspondence. Alternatively, any other possible method can be used to determine the source table name, field list, logical primary key field value, and corresponding source table field name based on the row-level data tracing information, without any limitation.

[0040] In some implementations, the value of the logical primary key field is related to the query type. This allows for effective adaptation to personalized query types and significantly expands application scenarios.

[0041] In some embodiments, the value of the logical primary key field is pre-configured based on either of the following: when the query type is a non-aggregate query, the value of the logical primary key field is configured based on the value of the source table's primary key; when the query type is an aggregate query, the value of the logical primary key field is configured based on the value of the aggregate field. This improves the accuracy of row-level data tracing.

[0042] S103: Generate the first part of the statement based on the source table name, the second part of the statement based on the source table name and the field list, and the third part of the statement based on the value of the logical primary key field and the field name of the source table.

[0043] Based on the data row-level tracing information, the source table name, field list, logical primary key field value, and the source table field name corresponding to the logical primary key field are determined. The first part of the statement can be generated based on the source table name, the second part of the statement can be generated based on the source table name and field list, and the third part of the statement can be generated based on the logical primary key field value and source table field name.

[0044] The first part of the statement refers to the portion of the target query statement consisting of the source table name. The second part refers to the portion of the target query statement consisting of the source table name and the list of fields. The third part refers to the portion of the target query statement consisting of the logical primary key field and the field names of the source table.

[0045] In some embodiments, the syntax tags required to generate the first part of the statement, the second part of the statement, and the third part of the statement can be determined based on the syntax rules of the target query statement, and the corresponding syntax tags can be used to assist in generating the corresponding parts of the statement.

[0046] S104: Generate a target query statement based on the first part of the statement, the second part of the statement, and the third part of the statement. The target query statement is used to trace the source data row-level records related to the result table.

[0047] After generating the first, second, and third parts of the statement, these parts can be combined to obtain the target query statement.

[0048] In some embodiments, after generating the target query statement, a query can be performed based on the target query statement to obtain the source data row-level records related to the result table. For example, a query can be performed in the databases containing both the source data table and the result table based on the target query statement to determine the source data row-level records related to the result table.

[0049] In this embodiment, by extracting data row-level tracing information from the result table, and based on this information, determining the source table name, field list, value of the logical primary key field, and the corresponding source table field name, a first part of the statement is generated based on the source table name. A second part of the statement is generated based on the source table name and field list, and a third part of the statement is generated based on the value of the logical primary key field and the source table field name. Finally, a target query statement is generated based on the first, second, and third parts of the statement. The target query statement is used to trace the source data row-level records related to the result table. This method accurately obtains the source data row-level records related to the result table.

[0050] Figure 2 This is a flowchart illustrating a data row-level tracing method proposed in another embodiment of this disclosure.

[0051] like Figure 2 As shown, this data row-level tracing method includes:

[0052] S201: Extract data row-level traceability information from the result table.

[0053] For a detailed description of step S201, please refer to the above embodiments, which will not be repeated here.

[0054] S202: Determine the record code based on the data row-level traceability information.

[0055] S203: Determine the record information based on the record code.

[0056] The record code can be used to index the corresponding record information. This record information can include the source table name, field list, value of the logical primary key field, and the source table field name corresponding to the logical primary key field. The index relationship between the record code and the record information can be pre-configured in the coding table. Taking the target query statement as an example, the coding table can also be called the SQL coding table, and the record code can also be called the SQL code (the coding process can also be called SQL coding). The SQL coding table can contain the SQL code and its corresponding record information. This record information can directly contain the source table name, field list, value of the logical primary key field, and the source table field name corresponding to the logical primary key field; there are no restrictions on this.

[0057] Optionally, in the process of determining record information based on record encoding, a coding table can be obtained. This table contains multiple candidate codes and corresponding candidate information for each candidate code. The candidate code that matches the record code is then determined from the multiple candidate codes, and the candidate information corresponding to the candidate code that matches the record code is used as the record information. This enables fast and accurate retrieval of record information and supports directly determining the source table name, field list, logical primary key field values, and the source table field names corresponding to the logical primary key fields based on the record information.

[0058] The coding table can be pre-configured with multiple candidate record codes. These candidate record codes are referred to as candidate codes, and the record information corresponding to each candidate code is referred to as candidate information. After determining the record code from the data row-level tracing information, the record information corresponding to that record code can be retrieved from the coding table.

[0059] In some embodiments, candidate information (the source table name, field list, value of logical primary key field, and source table field name corresponding to the logical primary key field, etc.) can be configured during the process of transforming, merging, aggregating, etc. of one or several rows of source data in the source data table. After configuration, each candidate information can be encoded to form a candidate code, and written into the coding table based on the correspondence between the candidate information and the candidate code.

[0060] S204: Parse the source table name, field list, logical primary key field value, and source table field name corresponding to the logical primary key field from the record information. The logical primary key field is used to locate one or more source data row-level records in the source table.

[0061] After determining the record information based on the record code, the source table name, field list, logical primary key field value, and the source table field name corresponding to the logical primary key field can be parsed from the record information.

[0062] Therefore, it is possible to quickly and conveniently parse the source table name, field list, logical primary key field value, and the source table field name corresponding to the logical primary key field.

[0063] S205: Generate the first part of the statement based on the source table name, the second part of the statement based on the source table name and the field list, and the third part of the statement based on the value of the logical primary key field and the field name of the source table.

[0064] Optionally, in some embodiments, in the process of generating the first part of the statement based on the source table name, the syntax rules corresponding to the target query statement may be determined, and the first syntax tags required to generate the first part of the statement may be determined according to the syntax rules. The source table name may then be processed according to the first syntax tags to obtain the first part of the statement. This achieves rapid generation of the first part of the statement.

[0065] For example, if the target query is an SQL query, the syntax rules could be, for example, SQL syntax rules, and the first part of the statement could be, for example, an SQL From clause. The first syntax tag could be, for example, the SQL keyword that generates the SQL From clause.

[0066] Optionally, in some embodiments, the process of generating the second part of the statement based on the source table name and field list may involve determining the syntax rules corresponding to the target query statement, determining the second syntax tags required to generate the second part of the statement based on the syntax rules, and processing the source table name and field list based on the second syntax tags to obtain the second part of the statement. This achieves rapid generation of the second part of the statement.

[0067] For example, if the target query is an SQL query, the syntax rules could be, for example, SQL syntax rules, and the second part of the statement could be, for example, an SQL Select clause. The second syntax tag could be, for example, an SQL keyword that generates the SQL Select clause.

[0068] Optionally, in some embodiments, in the process of generating the third part of the statement based on the value of the logical primary key field and the source table field name, the following steps may be taken: determining the syntax rules corresponding to the target query statement; determining the third syntax tags required to generate the third part of the statement based on the syntax rules; and processing the value of the logical primary key field and the source table field name based on the third syntax tags to obtain the third part of the statement. This achieves rapid generation of the second part of the statement.

[0069] For example, if the target query is an SQL query, the syntax rules could be, for example, SQL syntax rules, and the third part of the statement could be, for example, an SQL WHERE clause. The third syntax tag could be, for example, an SQL keyword that generates the SQLWHERE clause.

[0070] The example provided for this embodiment can be illustrated as follows:

[0071] At each step of data processing, the result table can record or point to the logical primary key (Note: In this embodiment of the disclosure, the logical primary key field refers to a set of information used to locate one or more source data row-level records in the source table), the source table name, the mapping relationship between the logical primary key field of the target table and the field of the source table, and other information required for data row-level tracing (hereinafter referred to as: data row-level tracing information). During data row-level tracing, a data row-level tracing SQL statement (an optional example of a target query statement) can be generated based on the data row-level tracing information. By executing the data row-level tracing SQL statement, the source data record corresponding to the result data record (an optional example of a source data row-level record related to the result table) can be obtained.

[0072] It should be noted that, in the embodiments disclosed herein, the data source table processed by the SQL statement can be referred to as the "source table", that is, the table in the SQL From clause, and the table that saves the SQL processing results is referred to as the "result table". During the execution of multiple SQL statements one by one, the "result table" of one SQL processing may be the "source table" of the next SQL.

[0073] As shown below, row-level data tracing can be achieved through three steps:

[0074] Step 1: Generation of row-level data traceability information;

[0075] Step 2: Generating SQL for row-level data tracing;

[0076] Step 3: Execute the row-level data tracing SQL to perform row-level data tracing.

[0077] Step 1: Generation of Row-Level Data Traceability Information

[0078] 1. You can add or point to a logical primary key in the target table. Specifically, in order to generate values ​​in the SQL WHERE clause of the subsequent row-level data tracing SQL statement, you can add or point to a logical primary key field in each record of the target table. Through the logical primary key field, you can accurately locate one or more source data row-level records in the source table.

[0079] In this embodiment, there are two methods for generating the value of the logical primary key field: (1) For non-aggregate queries, the value of the source table primary key is used to generate the value of the logical primary key field (an optional example of configuration). (2) For aggregate queries, the value of the aggregate field is used to generate the value of the logical primary key field (an optional example of configuration).

[0080] like Figure 3 As shown, Figure 3 This is a schematic diagram of the primary key of the source table in an embodiment of this disclosure. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of the source data in the source table in an embodiment of this disclosure. For example... Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the generation of row-level traceability information for the intermediate statistical table of payment records in this embodiment of the disclosure. For example... Figure 6 As shown, Figure 6 This is a schematic diagram illustrating the generation of row-level traceability information for the payment record statistics table in this embodiment. Figure 5 and Figure 6 Both can be considered as an optional example of a target table.

[0081] To better illustrate how row-level data traceability information is generated in this embodiment of the disclosure, a payment statistics report is used as an example. (Example illustration) Figure 4 , Figure 5 To enable tracing records from the payment statistics table (payment_report) back to the source tables (payment_record and account_order) (an optional example of data source row-level records), the following steps are taken: In the source table (payment_record), use "payment_rec_id" as the primary key, and in the account_order table, use "order_id" as the primary key. In the payment record list table (final_payment_record_591_04), add the fields "payment_rec_id_logic" and "order_id__logic," with values ​​that are the primary key values ​​from the source tables.

[0082] 2. Record the source table name, the mapping relationship between the logical primary key field of the target table and the field of the source table, etc.

[0083] Considering that the data in the target table may come from multiple tables, in order to generate the table name in the SQL FROM clause of the SQL query statement for row-level data tracing, the table name of the source table is recorded or points to in each record of the target table.

[0084] In order to generate the field names in the SQL WHERE clause of the SQL query statement for row-level data tracing, the source table fields corresponding to the logical primary key fields of the target table and their corresponding relationships are recorded or pointed to in each record of the target table.

[0085] For example ( Figure 4 , Figure 5 In step one above, add a field “trace_info_logic” to the payment record list table (final_payment_record_591_04) to record the corresponding record in the SQL coding table (an optional example of record information). The SQL coding table records information such as the source table name, the mapping relationship between the logical primary key field of the target table and the field of the source table.

[0086] For example, the SQL number value in step one (an optional example of record encoding) is "F00001", which is stored in the "trace_info_logic" field of the payment record list table (final_payment_record_591_04). This corresponds to the record in the SQL encoding table with SQL encoding "F00001" (an optional example of record information). The record in the SQL encoding table with encoding "F00001" records information such as the source table name, the mapping relationship between the target table's logical primary key field and the source table's fields.

[0087] Step 2: Generation of row-level source SQL (an optional example of the target query statement).

[0088] Based on the row-level data tracing information generated in step one, row-level data tracing SQL can be further generated, and subsequent backtracking can be performed by executing the row-level data tracing SQL. For example... Figure 7 As shown, Figure 7 This is a schematic diagram illustrating the generation of data row-level tracing statements in an example payment statistics report of this disclosure.

[0089] (1) Generate a row-level source SQL Select clause (an optional example of the second part of the statement).

[0090] The corresponding source table is parsed from the row-level traceability information of the result table, and the required field list is extracted from the table definition to form a Select clause together with the SQL keywords.

[0091] For example ( Figure 7 Using the record with payment_amount as "9000" in the payment statistics result table (payment_report) of the target table, generate the corresponding data row-level tracing SQL. The example is to trace back to the payment record list table (final_payment_record_591_04) of the source table.

[0092] Specifically: From the payment statistics results table (payment_report), retrieve the record with payment_amount set to "9000" and the value "F00002" in the "trace_info_logic" field (an optional example of record encoding). From the SQL encoding table, retrieve the record with SQL encoding "F00002" (an optional example of record information). The "source_table" field retrieves the source table name, which is "final_payment_record_591_04". From the table definition, retrieve the field list "payment_rec_id, account_id, home_county, acctbk_item, payment_amount, payment_channel_seq, sysfunc_id, payment_rec_id__logic, order_id__logic, trace_info__logic", and combine it with the SQL keyword Select to construct the row-level data tracing SQL Select clause.

[0093] “Select

[0094] payment_rec_id,account_id,home_county,acctbk_item,payment_amount,payment_channel_seq,s ysfunc_id,payment_rec_id__logic,order_id__logic,trace_info__logic".

[0095] (2) Generate a row-level source SQL From clause (an optional example of the first part of the statement).

[0096] Extract the source table name from the row-level data tracing information and combine it with SQL keywords to form the SQL From clause.

[0097] For example ( Figure 7The following steps are performed: Extract the value "F00002" from the "trace_info_logic" field of the record with "payment_amount" of "9000" in the payment statistics table (payment_report). Extract the record with SQL encoding "F00002" from the SQL encoding table (an optional example of record information). The "source_table" field retrieves the source table name "final_payment_record_591_04". Combined with the SQL keyword "From", this forms the row-level traceability SQL From clause "From final_payment_record_591_04".

[0098] 3. Generate a row-level source SQL WHERE clause (an optional example of the statement in Part 3).

[0099] From the row-level traceability information generated in step one, the value of the logical primary key field is parsed out and concatenated with the source table field name corresponding to the logical primary key field. Together with the SQL keyword, they form the SQL Where clause.

[0100] For example ( Figure 5 The following steps are taken from the payment statistics results table (payment_report): Extract the value "F00002" from the "trace_info_logic" field of the record where payment_amount is "9000" in the target table (payment_report). Extract the record with SQL encoding "F00002" from the SQL encoding table. Parse the "target_column" field to find the logical primary key fields "home_county_logic", "acctbk_item__logic", and "sysfunc_id__logic". Then, extract the record from the payment statistics results table (payment_report). In the record where payment_amount is "9000" in t_report, the values ​​"102", "12", and "10508101" in "home_county_logic", "acctbk_item__logic", and "10508101" in "acctbk_item__logic" are parsed. From the "source_column" field, the corresponding fields "home_county", "acctbk_item", and "sysfunc_id" in the source table are parsed. These are then combined with the SQL keyword From to form the row-level source SQL Where clause "Where home_county=102and acctbk_item=12and sysfunc_id=10508101".

[0101] Assemble the above clauses to form a complete row-level source SQL statement (an optional example of a target query statement).

[0102] In other examples, the SQL keyword 'in' can also be used for concatenation, i.e. Figure 7 In the example, step two concatenates the SQL WHERE clause for row-level data tracing: "Where payment_rec_id in(200000000002,200000000006)".

[0103] For example ( Figure 5 The complete row-level data tracing SQL statement for step one in this example is as follows:

[0104] select payment_rec_id,account_id,home_county,acctbk_item,payment_amount,

[0105] payment_channel_seq,sysfunc_id,

[0106] payment_rec_id__logic,order_id__logic,trace_info__logic

[0107] from final_payment_record_591_04

[0108] where home_county=102

[0109] and acctbk_item=12

[0110] and sysfunc_id = 10508101.

[0111] Step 3: Execute row-level data tracing SQL to trace the data source.

[0112] The data row-level source tracing SQL generated in step two of the execution process is used to trace back step by step, and the query result is the source data record corresponding to the result data record.

[0113] For example ( Figure 7For the record with payment_amount of "9000" in the payment statistics report, a row-level traceability SQL statement was generated. The result shows that this record was generated from two records with payment_rec_id of "200000000002" and "200000000006" in the payment record list table (final_payment_record_591_04). The result shows that the record was generated from two records with payment_rec_id of "200000000002" and "200000000006" in the payment record list table (final_payment_record_591_04). The two records "000000006" are generated from the payment_rec_id records "200000000002" and "200000000006" in the payment record table (payment_record) and the order_id records "100000000002" and "100000000007" in the account order table (account_order). Finally, it can be seen that the record "9000" in the payment statistics result table (payment_report) is generated from the payment_rec_id records "200000000002" and "200000000006" in the payment record table (payment_record) and the order_id records "100000000002" and "100000000007" in the account order table (account_order).

[0114] S206: Generate a target query statement based on the first part of the statement, the second part of the statement, and the third part of the statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

[0115] For a detailed description of steps S205-S206, please refer to the above embodiments, which will not be repeated here.

[0116] In this embodiment, by extracting data row-level tracing information from the result table, and based on this information, determining the source table name, field list, logical primary key field value, and the corresponding source table field name, a first part of the statement is generated based on the source table name. A second part of the statement is generated based on the source table name and field list, and a third part of the statement is generated based on the logical primary key field value and the corresponding source table field name. Finally, a target query statement is generated based on the first, second, and third parts of the statement. The target query statement is used to trace the source data row-level records related to the result table. This allows for accurate acquisition of the source data row-level records related to the result table. After determining the record information based on the record encoding, the source table name, field list, logical primary key field value, and the corresponding source table field name can be parsed from the record information. Therefore, it is possible to quickly and conveniently parse the source table name, field list, logical primary key field value, and the corresponding source table field name.

[0117] Figure 8 This is a schematic diagram of the structure of a data row-level traceability device proposed in an embodiment of this disclosure.

[0118] like Figure 8 As shown, the data row-level traceability device 80 includes:

[0119] Extraction module 801 is used to extract data row-level traceability information from the result table.

[0120] The determination module 802 is used to determine the source table name, field list, value of logical primary key field, and source table field name corresponding to the logical primary key field based on the data row-level tracing information. The logical primary key field is used to locate one or more source data row-level records in the source table.

[0121] The first generation module 803 is used to generate the first part of the statement based on the source table name, the second part of the statement based on the source table name and the field list, and the third part of the statement based on the value of the logical primary key field and the field name of the source table.

[0122] The second generation module 804 is used to generate a target query statement based on the first part statement, the second part statement and the third part statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

[0123] It should be noted that the foregoing explanation of the data row-level tracing method also applies to the data row-level tracing device of this embodiment, and will not be repeated here.

[0124] In this embodiment, by extracting data row-level tracing information from the result table, and based on this information, determining the source table name, field list, value of the logical primary key field, and the corresponding source table field name, a first part of the statement is generated based on the source table name. A second part of the statement is generated based on the source table name and field list, and a third part of the statement is generated based on the value of the logical primary key field and the source table field name. Finally, a target query statement is generated based on the first, second, and third parts of the statement. The target query statement is used to trace the source data row-level records related to the result table. This method accurately obtains the source data row-level records related to the result table.

[0125] Figure 9 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 9 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0126] like Figure 9 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, memory 28, and bus 18 connecting different system components (including memory 28 and processing unit 16).

[0127] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0128] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0129] Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 9 Not shown; usually referred to as a "hard drive".

[0130] although Figure 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0131] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0132] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable human interaction with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0133] The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the data row-level tracing method mentioned in the foregoing embodiments.

[0134] To implement the above embodiments, this disclosure also proposes an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0135] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.

[0136] To implement the above embodiments, this disclosure also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.

[0137] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0138] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.

[0139] This disclosure is intended to provide implementation schemes for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.

[0140] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0141] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0142] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.

[0143] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0144] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0145] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0146] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0147] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A data row-level tracing method, characterized in that, The method includes: Extract data row-level source information from the results table; The record code is determined based on the data row-level tracing information, the record information is determined based on the record code, and the record information is parsed to determine the source table name, field list, value of logical primary key field, and source table field name corresponding to the logical primary key field; wherein, the value of logical primary key field is related to the query type, and logical primary key field is used to locate one or more source data row-level records in the source table; Based on the source table name, a first part of the statement is generated; based on the source table name and the field list, a second part of the statement is generated; and based on the value of the logical primary key field and the source table field name, a third part of the statement is generated. A target query statement is generated based on the first part of the statement, the second part of the statement, and the third part of the statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

2. The method according to claim 1, characterized in that, The step of determining the record information based on the record code includes: Obtain a coding table, wherein the coding table contains multiple candidate codes and candidate information corresponding to each candidate code; From the plurality of candidate codes, determine a candidate code that is the same as the record code; The candidate information corresponding to the candidate code that is the same as the record code is used as the record information.

3. The method according to claim 1, characterized in that, The step of generating the first part of the statement based on the source table name includes: Determine the syntax rules corresponding to the target query statement; Based on the grammar rules, determine the first grammar tag required to generate the first part of the statement; The source table name is processed according to the first syntax tag to obtain the first part of the statement.

4. The method according to claim 1, characterized in that, The second part of the statement is generated based on the source table name and the field list, including: Determine the syntax rules corresponding to the target query statement; Based on the grammar rules, determine the second grammar tag required to generate the second part of the statement; The source table name and the field list are processed according to the second syntax tag to obtain the second part of the statement.

5. The method according to claim 1, characterized in that, The step of generating the third part of the statement based on the value of the logical primary key field and the field name of the source table includes: Determine the syntax rules corresponding to the target query statement; Based on the grammar rules, determine the third grammar tag required to generate the third part of the statement; The third part of the statement is obtained by processing the value of the logical primary key field and the field name of the source table according to the third syntax tag.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Perform a query based on the target query statement to obtain the source data row-level records related to the result table.

7. The method according to any one of claims 1-6, characterized in that, The value of the logical primary key field is pre-configured based on any of the following: When the query type is a non-aggregate query, configure the value of the logical primary key field based on the value of the primary key in the source table; When the query type is an aggregation query, the value of the logical primary key field is configured based on the value of the aggregation field.

8. A data row-level traceability device, characterized in that, The device includes: The extraction module is used to extract row-level traceability information from the result table; The determination module is used to determine the record code based on the data row-level tracing information, determine the record information based on the record code, and parse the record information to determine the source table name, field list, value of logical primary key field, and source table field name corresponding to the logical primary key field; wherein, the value of the logical primary key field is related to the query type, and the logical primary key field is used to locate one or more source data row-level records in the source table; The first generation module is configured to generate a first part of the statement based on the source table name, a second part of the statement based on the source table name and the field list, and a third part of the statement based on the value of the logical primary key field and the field name of the source table; and The second generation module is used to generate a target query statement based on the first part of the statement, the second part of the statement and the third part of the statement, wherein the target query statement is used to trace the source data row-level records related to the result table.

9. 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 method as described in any one of claims 1-7.

10. 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 method as described in any one of claims 1-7.

11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Data checking method and device, storage medium, electronic equipment and product

    CN116975029A