Multi-table linkage data processing method and device, equipment and storage medium
By introducing a first tag and a second tag into the data table, the problem of asynchronous updates between the master and child tables during the ETL process is solved, achieving data timeliness and consistency and improving data processing quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GREAT WALL COMP SOFTWARE & SYST CO LTD
- Filing Date
- 2023-09-19
- Publication Date
- 2026-05-19
AI Technical Summary
During the ETL process, incremental extraction can easily lead to the failure of the master and child tables to be updated synchronously, resulting in untimely or inconsistent data from the master or child tables in the data processing results.
By introducing a first tag and a second tag in the first data table, the first and second data are associated according to the storage order of the data, and the second tag is stored in the first data table using the associated field, ensuring the timeliness and consistency of the data.
This enables the simultaneous extraction of data from the first and second data tables during data processing, ensuring data timeliness and consistency and improving data processing quality.
Smart Images

Figure CN117171252B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a data processing method, apparatus, device, and storage medium for multi-table linkage. Background Technology
[0002] In the process of building a data warehouse, Extract, Transform, and Load (ETL) describes the process of extracting, transforming, and loading data from the source to the target. The purpose is to integrate scattered, disorganized, and inconsistent data in an enterprise to provide analytical support for enterprise decision-making.
[0003] In ETL implementation, data extraction typically employs two methods: full extraction and incremental extraction. Full extraction extracts all data from the entire table in each execution. While simple to implement and easy to ensure completeness, it handles large volumes of data, putting pressure on the business system's database, resulting in long processing times and low efficiency. Incremental extraction, on the other hand, extracts only newly added and updated data in each execution, handling smaller amounts of data and offering high efficiency. However, because incremental extraction only extracts a portion of the data, in scenarios involving related master and child tables, failure to synchronize updates between the master and child tables can easily lead to untimely or inconsistent data from either table in the processing results. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and storage medium for multi-table linkage, so as to at least solve the technical problem of low quality of multi-table data processing results.
[0005] According to a first aspect of the embodiments of this application, a data processing method for multi-table linkage is provided, applied to a first data table, wherein the first data table is associated with a second data table, the method comprising:
[0006] In response to a data processing signal, first data is extracted from the first data table according to a first tag in the first data table, wherein each piece of first data corresponds to the first tag, and the first tag is related to the storage order of the first data;
[0007] When the extracted first data corresponds to a second tag, the second data in the second data table is extracted according to the second tag, wherein each second data corresponds to the second tag, and the second tag is related to the storage order of the second data.
[0008] Optionally, the method further includes:
[0009] In response to the data increment signal of the second data table, obtain the second tag corresponding to the incremented second data and the associated field corresponding to the incremented second data;
[0010] The second tag is stored in the first data that has the same associated field.
[0011] Optionally, the incremental second data refers to newly added second data and / or updated second data.
[0012] Optionally, the associated field is the primary key of the first data table and the foreign key of the second data table.
[0013] Optionally, before extracting the first data from the first data table based on the first tag in the first data table, the method further includes:
[0014] In response to the data increment signal of the second data table, determine whether the first data table has been synchronously updated with first data corresponding to the second data increment of the second data table;
[0015] If the update is asynchronous, determine whether the first data table contains a second tag storage bit;
[0016] If not included, a second tag storage bit is added to the first data table, wherein the second tag storage bit is used to enable the first data to include the second tag.
[0017] Optionally, the first data table is associated with multiple second data tables;
[0018] The multiple second data tables share the second tag storage bit.
[0019] Optionally, the method further includes:
[0020] When the first data table is associated with multiple second data tables, the second tag contained in the first data table is associated with a table tag.
[0021] Optionally, extracting the first data from the first data table based on the first tag in the first data table includes:
[0022] Based on the time interval associated with the data processing signal, the first marker is determined according to the start and end times of the time interval, and the first data corresponding to the determined first marker is extracted.
[0023] The step of extracting the second data from the second data table based on the second marker includes:
[0024] Extract the second data corresponding to the second tag from the second data table.
[0025] Optionally, the data processing refers to performing data extraction, transformation, and loading processing on the first data in the first data table.
[0026] Optionally, the first marker is the timestamp field of the first data, and the second marker is the timestamp field of the second data.
[0027] According to a second aspect of the embodiments of this application, a data table update method is provided, including a first data table and a second data table, wherein the first data table is associated with the second data table, the method comprising:
[0028] When the second data table extracts data, a second tag storage bit is added to the first data table;
[0029] Based on the associated fields contained in the second data extracted from the second data table, find the first data in the first data table that contains the same associated fields;
[0030] The second tag associated with the extracted second data is recorded in the second tag storage bit of the found first data.
[0031] According to a third aspect of the embodiments of this application, a multi-table linkage data processing apparatus is provided, applied to a first data table, the first data table being associated with a second data table. The apparatus includes a first extraction module, configured to extract first data from the first data table according to a first tag in response to a data processing signal, wherein each piece of first data corresponds to the first tag, and the first tag is related to the storage order of the first data.
[0032] The second extraction module is used to extract second data from the second data table according to the second tag when the extracted first data corresponds to the second tag, wherein each second data corresponds to the second tag and the second tag is related to the storage order of the second data.
[0033] Optionally, the device further includes an association module, configured to, in response to a data increment signal of the second data table, obtain a second tag corresponding to the incremented second data and an association field corresponding to the incremented second data;
[0034] A storage module is used to store the second tag into the first data that has the same associated field.
[0035] Optionally, the incremental second data refers to newly added second data and / or updated second data.
[0036] Optionally, the associated field is the primary key of the first data table and the foreign key of the second data table.
[0037] Optionally, the device further includes a determination module, configured to determine, in response to the data increment signal of the second data table, whether the first data table is synchronously updated with first data corresponding to the second data increment of the second data table;
[0038] If the update is asynchronous, determine whether the first data table contains a second tag storage bit;
[0039] If not included, a second tag storage bit is added to the first data table, wherein the second tag storage bit is used to enable the first data to include the second tag.
[0040] Optionally, the first data table is associated with multiple second data tables;
[0041] The multiple second data tables share the second tag storage bit.
[0042] Optionally, the device further includes a table module, configured to associate a second tag contained in the first data with a table tag when the first data table is associated with multiple second data tables.
[0043] Optionally, the first extraction module includes a first extraction unit, configured to determine the first marker based on the start and end times of the time interval associated with the data processing signal and extract the first data corresponding to the determined first marker.
[0044] The second extraction module includes a second extraction unit, used to extract the second data corresponding to the second tag in the second data table.
[0045] Optionally, the data processing refers to performing data extraction, transformation, and loading processing on the first data in the first data table.
[0046] Optionally, the first marker is the timestamp field of the first data, and the second marker is the timestamp field of the second data.
[0047] According to a fourth aspect of the present application, an electronic device is provided, including a memory and a processor. The memory stores a data processing method for multi-table linkage, and the processor is used to employ the multi-table linkage data processing method described above when executing the multi-table linkage data processing method.
[0048] According to a fifth aspect of the embodiments of this application, a computer-readable storage medium is provided, storing a computer program that can be loaded by a processor and execute the methods described above.
[0049] In this embodiment, when data extraction from a data table is required, firstly, first data is extracted from the first data table based on a first marker; then, if the first data corresponds to a second marker, second data corresponding to the second marker is extracted from the second data table. This ensures that related data in the first and second data tables can be extracted together, guaranteeing data timeliness and consistency, and improving data processing quality. Attached Figure Description
[0050] Figure 1 This is a flowchart of a data processing method involving multiple tables in one embodiment.
[0051] Figure 2 This is a schematic diagram of a data table update method in one embodiment. Detailed Implementation
[0052] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0053] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0054] According to an embodiment of this application, an embodiment of a data processing method involving multiple tables is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0055] like Figure 1As shown, this method is applied to a first data table, which is associated with a second data table. For ease of understanding, the application scenarios of the first and second data tables are explained. In the database, both the first and second data tables are used to store data. This data can be generated during the company's operations, such as sales revenue, personnel information, and attendance records; it can also be data that the company needs to use, such as order forms and invoice details. The relationship between the first and second data tables is a master-child relationship. That is, one of the first and second data tables is the master table, and the other is the child table. For ease of understanding, the explanation is based on the scenario where the first data table is the master table and the second data table is the child table.
[0056] For example, in one embodiment, the first data table is the credit card information table in a bank's credit card system, storing data such as credit card numbers and usernames. The second data table is the card usage record table, storing the usage records of each credit card. When a new card swipe record is added, the balance in the first data table is updated, and simultaneously, a new usage record is generated in the second data table. In this case, the first and second data tables are updated synchronously.
[0057] In another embodiment, the first data table is a personnel information table, storing data such as name, gender, ID number, and position. The second data table is a attendance record table, used to store each person's attendance data. When a new attendance record is added, the data in the first data table does not change, but the data in the second data table has been added. This situation occurs because the first and second data tables are not updated synchronously.
[0058] The first and second data tables are usually linked using primary keys and foreign keys, as shown in the table below, which represents the first data table:
[0059]
[0060]
[0061] The following table is the second data table:
[0062] Check-in time Name Update time 7:01 AM, July 1, 2023 A 7:02 AM, July 1, 2023 7:01 AM, July 1, 2023 B 7:02 AM, July 1, 2023 7:02 AM, July 1, 2023 C 7:03 AM, July 1, 2023 18:10 on July 1, 2023 A 18:11 on July 1, 2023
[0063] As can be seen, both the first and second data tables consist of n columns and n rows. The column name represents the meaning of the data in that column. Except for the row containing the column name, each row represents one data point, and each data point contains multiple fields. For example, the second row of the first data table contains three fields: name, occupation, and timestamp. The second data table follows the same logic and will not be elaborated further.
[0064] In this table, the "Names" column in the first data table is the primary key, and the "Names" column in the second data table is a foreign key in the second data table related to the first data table; the two have a corresponding relationship. That is, given the primary key "A" in the first data table, the corresponding foreign key "A" can be found in the second data table. Conversely, the same applies. The difference is that the primary key value cannot be null, while the foreign key value can be null.
[0065] The method includes:
[0066] S101, in response to the data processing signal, extract the first data from the first data table according to the first tag in the first data table, wherein each piece of the first data corresponds to the first tag, and the first tag is related to the storage order of the first data.
[0067] In one embodiment, the data stored in the first data table is collectively referred to as first data, and the quantity of first data is not limited in this embodiment. Using the table mentioned earlier, first data refers to the data in each row of the first data table except for the first row. When data processing is required, the following explanation uses ETL processing as an example, which requires extracting first data from the first data table. During extraction, extraction is performed based on a first marker. Since the first marker is related to the storage order of the first data, and each piece of first data corresponds to a first marker, once a time period is determined, the first data stored in the first data table within that time period can be determined based on the first marker, thus allowing these data to be extracted.
[0068] The form of the first marker is not specifically limited in this embodiment. It can be a timestamp in the first data table or a custom field in the first data table. The first marker can be included in the first data or it can be a marker outside the first data table.
[0069] S102, when the extracted first data corresponds to a second tag, the second data in the second data table is extracted according to the second tag, wherein each second data corresponds to the second tag, and the second tag is related to the storage order of the second data.
[0070] In one embodiment, the second marker is set using the same principle as the first marker, and this embodiment does not impose any specific limitations on this. Each piece of second data corresponds to a second marker, so knowing the second marker allows for the extraction of the corresponding second data from the second data table.
[0071] It should be noted that the first tags corresponding to different first data can be the same or different. Similarly, the second tags corresponding to different second data can be the same or different. The goal is to be able to distinguish the storage order of the first data based on the first tags and the storage order of the second data based on the second tags.
[0072] For example, using timestamps as markers, since timestamps are accurate to milliseconds, each record in the first data table will have a unique timestamp, meaning each first marker will be different. Another example is using custom symbols as markers. Records stored in the first data table on the same day or at the same time on the same day will correspond to the same symbol. For instance, the first record stored on October 5th, 2023, will all have a "#" marker, while the first record stored on October 6th, 2023, will all have an "!" marker. This proves that the first record with the "#" marker was stored earlier than the first record with the "!" marker. The second marker works similarly and will not be elaborated further.
[0073] It should be noted that when extracting the first data, the decision to extract the second data is made based on whether the first data corresponds to a second tag. Specifically, if the first data corresponds to a second tag, the corresponding second data in the second data table is extracted. This ensures that during ETL, because the first data can correspond to the second tag, even if the first and second data tables are not updated synchronously, the second data can still be extracted in a timely manner when performing ETL on the first data table, guaranteeing the timeliness and completeness of data processing.
[0074] By following the steps described above, when data needs to be extracted from a data table, the first data in the first data table is extracted based on the first label. Then, if the first data corresponds to a second label, the second data corresponding to the second label is extracted from the second data table. This ensures that related data in the first and second data tables can be extracted together, guaranteeing data timeliness and consistency, and improving data processing quality.
[0075] In another embodiment of this application, the method further includes:
[0076] S201, in response to the data increment signal of the second data table, obtain the second tag corresponding to the incremented second data and the associated field corresponding to the incremented second data.
[0077] In one embodiment, the data increment signal is triggered when there is a data increment in the second data table. It can be triggered immediately when the second data table is updated, or it can be triggered when the second data table is ETLed. This embodiment does not make specific limitations on this.
[0078] In one embodiment, data increment refers to the presence of new second data storage in the second data table or the updating of second data in the second data table.
[0079] In one embodiment, the related field refers to a field in the second data table that establishes a relationship with the first data table. Using the two tables mentioned earlier as examples, the related field is the name field in the second data table. For example, if the name is C, then by using C, we can find the first data table containing the C field. In other words, the related field is actually a foreign key field in the second data table related to the first data table; based on the foreign key field, we can find the corresponding primary key field in the first data table.
[0080] S202, the second tag is stored in the first data that has the same associated field.
[0081] In one embodiment, the first data further includes a second tag field for storing the second tag. Using the table corresponding to the first data table mentioned earlier as an example, this means adding a new column to the table, with the column name being "Second Tag" and the corresponding value being the value of the second tag.
[0082] By following the steps above, the first data that needs to be stored as the second tag can be found using the associated fields. This method is convenient, fast, and less likely to cause data loss or data confusion.
[0083] In another embodiment of this application, the incremental second data refers to newly added second data and / or updated second data.
[0084] In another embodiment of this application, the associated field is the primary key of the first data table and the foreign key of the second data table.
[0085] In another embodiment of this application, before extracting the first data from the first data table according to the first tag in the first data table, the method further includes:
[0086] In response to the data increment signal of the second data table, determine whether the first data table has been synchronously updated with first data corresponding to the second data increment of the second data table;
[0087] If the update is asynchronous, determine whether the first data table contains a second tag storage bit;
[0088] If not included, a second tag storage bit is added to the first data table, wherein the second tag storage bit is used to enable the first data to include the second tag.
[0089] In one embodiment, it is first determined whether there is a location in the first data table to store the second tag. If not, a second tag storage position is added so that the second tag storage position is a separate column. After the second tag is stored in this column, the first data in the corresponding row will contain the second tag.
[0090] The above steps facilitate the creation of a second tag storage location in the first data table, enabling the first data to contain the second tag, thus allowing for more accurate and faster extraction of the second data.
[0091] In another embodiment of this application, the first data table is associated with multiple second data tables;
[0092] The multiple second data tables share the second tag storage bit.
[0093] In another embodiment of this application, the method further includes:
[0094] When the first data table is associated with multiple second data tables, the second tag contained in the first data table is associated with a table tag.
[0095] In one embodiment, table tags are used to distinguish tables. For example, the first data table is table x, and the second data table includes tables k and j. When a second tag corresponding to the name "A" needs to be stored in the first data table, the second tag in the first data table containing the field "A" is stored as "k-second tag, j-second tag"; where k and j are the table tags. Of course, the table tags may not use the name of the second data table, and may also use unique symbols, numbers, etc., as long as the corresponding second data table can be found.
[0096] By using the above steps, multiple second tags corresponding to the same first data are distinguished by using table tags, which makes it easier to ensure the accuracy of extracting the second data.
[0097] In another embodiment of this application, the step of extracting the first data from the first data table according to the first tag in the first data table includes:
[0098] Based on the time interval associated with the data processing signal, the first marker is determined according to the start and end times of the time interval, and the first data corresponding to the determined first marker is extracted.
[0099] The step of extracting the second data from the second data table based on the second marker includes:
[0100] Extract the second data corresponding to the second tag from the second data table.
[0101] In one embodiment, the time interval is, for example, from January 1, 2023 to January 5, 2023, where January 1, 2023 is the start time of the time interval and January 5, 2023 is the end time of the time interval. When extracting the first data, the first marker itself is a time or can represent time. Therefore, the first marker can be determined based on the start and end times of the time interval, and the corresponding first data can be extracted based on the determined first marker.
[0102] For ease of understanding, the first data table is shown below:
[0103]
[0104]
[0105] Since the first labels "January 2, 2023" and "January 4, 2023" are within the time interval, the first data "B, 22, January 2, 2023, January 5, 2023" and "C, 33, January 4, 2023" are extracted.
[0106] Since the first data "B, 22, January 2, 2023, January 5, 2023" contains the second marker, the second data corresponding to "January 5, 2023" is retrieved from the second data table. "January 5, 2023" is the second marker.
[0107] By following the steps above, the first data to be extracted is determined according to the time interval, which reduces the risk of data loss and makes it easy to set the time as a unique value, thus preventing data confusion.
[0108] In another embodiment of this application, the data processing refers to performing data extraction, transformation, and loading processing on the first data in the first data table.
[0109] In one embodiment, data extraction, transformation, and loading refers to ETL, which is an abbreviation for Extract, Transform, and Load.
[0110] In another embodiment of this application, the first marker is a timestamp field of the first data, and the second marker is a timestamp field of the second data.
[0111] In one embodiment, the timestamp is unique, and each timestamp has a unique value, which can be accurate to the second or the millisecond.
[0112] By using the above steps, timestamps can help avoid duplicate first markers, as can duplicate second markers, and also reduce the space occupied by the database.
[0113] This application embodiment also provides a data table update method, including a first data table and a second data table, wherein the first data table is associated with the second data table, and the method includes:
[0114] When the second data table extracts data, a second tag storage bit is added to the first data table;
[0115] Based on the associated fields contained in the second data extracted from the second data table, find the first data in the first data table that contains the same associated fields;
[0116] The second tag associated with the extracted second data is recorded in the second tag storage bit of the found first data.
[0117] For ease of understanding, such as Figure 2 As shown, the first data table is the base area's main table, "Order Forms," where "Order Form ID" is the primary key. The second data table is the base area's sub-table, "Invoice Details," where "Invoice Details" is the primary key, and "Order Form ID" is a foreign key in the second data table relative to the first data table. The subject area's "Order Form Details" is the wide table obtained after performing ETL on the first and second data tables; it can also be called the target table, representing the ETL processing result.
[0118] When performing ETL extraction on the second data table, a second tag storage bit, namely `sub_upt_time`, is added to the first data table. Then, the second tag corresponding to the second data extracted from the second data table is stored in the corresponding position in the first data table. Here, the second tag is the value of the `sub_upt_time` field.
[0119] It should be noted that when performing ETL, if a full extraction method is used, there will be no issues with data delays or inconsistencies because the wide table (target table) includes all the first and second data. Therefore, only by using an incremental extraction method, by adding a second tag storage bit to the first data table, can data timeliness and consistency be guaranteed.
[0120] This application embodiment also provides a multi-table linkage data processing device applied to a first data table, the first data table being associated with a second data table. The device includes a first extraction module, used to extract first data from the first data table according to a first tag in response to a data processing signal, wherein each piece of first data corresponds to the first tag, and the first tag is related to the storage order of the first data.
[0121] The second extraction module is used to extract second data from the second data table according to the second tag when the extracted first data corresponds to the second tag, wherein each second data corresponds to the second tag and the second tag is related to the storage order of the second data.
[0122] Optionally, the device further includes an association module, configured to, in response to a data increment signal of the second data table, obtain a second tag corresponding to the incremented second data and an association field corresponding to the incremented second data;
[0123] A storage module is used to store the second tag into the first data that has the same associated field.
[0124] Optionally, the incremental second data refers to newly added second data and / or updated second data.
[0125] Optionally, the associated field is the primary key of the first data table and the foreign key of the second data table.
[0126] Optionally, the device further includes a determination module, configured to determine, in response to the data increment signal of the second data table, whether the first data table is synchronously updated with first data corresponding to the second data increment of the second data table;
[0127] If the update is asynchronous, determine whether the first data table contains a second tag storage bit;
[0128] If not included, a second tag storage bit is added to the first data table, wherein the second tag storage bit is used to enable the first data to include the second tag.
[0129] Optionally, the first data table is associated with multiple second data tables;
[0130] The multiple second data tables share the second tag storage bit.
[0131] Optionally, the device further includes a table module, which is used to associate a second tag contained in the first data with a table tag when the first data table is associated with multiple second data tables.
[0132] Optionally, the first extraction module includes a first extraction unit, configured to determine the first marker based on the start and end times of the time interval associated with the data processing signal and extract the first data corresponding to the determined first marker.
[0133] The second extraction module includes a second extraction unit, used to extract the second data corresponding to the second tag in the second data table.
[0134] Optionally, the data processing refers to performing data extraction, transformation, and loading processing on the first data in the first data table.
[0135] Optionally, the first marker is the timestamp field of the first data, and the second marker is the timestamp field of the second data.
[0136] This application also provides an electronic device, including a memory and a processor. The memory stores a data processing method for multi-table linkage, and the processor is used to employ the aforementioned multi-table linkage data processing method when executing the multi-table linkage data processing method.
[0137] This application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the methods described above.
[0138] The above description of the embodiments applied to electronic devices and storage media is similar to the description of the method embodiments described above, and has similar beneficial effects. For technical details not disclosed in the embodiments of electronic devices and storage media of this application, please refer to the description of the method embodiments of this application for understanding.
[0139] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0140] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0142] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0143] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0144] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0145] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data processing method involving multiple tables, characterized in that, Applied to a first data table, which is associated with a second data table, the method includes: In response to a data processing signal, first data is extracted from the first data table according to a first tag in the first data table, wherein each piece of first data corresponds to the first tag, and the first tag is related to the storage order of the first data; When the extracted first data corresponds to a second tag, the second data in the second data table is extracted according to the second tag, wherein each piece of second data corresponds to the second tag, and the second tag is related to the storage order of the second data; The first marker is the timestamp field of the first data, and the second marker is the timestamp field of the second data.
2. The data processing method for multi-table linkage according to claim 1, characterized in that, The method further includes: In response to the data increment signal of the second data table, obtain the second tag corresponding to the incremented second data and the associated field corresponding to the incremented second data; The second tag is stored in the first data that has the same associated field.
3. The data processing method for multi-table linkage according to claim 2, characterized in that, The incremental second data refers to newly added second data and / or updated second data.
4. The data processing method for multi-table linkage according to claim 2, characterized in that, The related fields are the primary key of the first data table and the foreign key of the second data table.
5. The data processing method for multi-table linkage according to claim 1, characterized in that, Before extracting the first data from the first data table based on the first tag in the first data table, the method further includes: In response to the data increment signal of the second data table, determine whether the first data table has been synchronously updated with first data corresponding to the second data increment of the second data table; If the update is asynchronous, determine whether the first data table contains a second tag storage bit; If not included, a second tag storage bit is added to the first data table, wherein the second tag storage bit is used to enable the first data to include the second tag.
6. The data processing method for multi-table linkage according to claim 5, characterized in that, The first data table is associated with multiple second data tables; The multiple second data tables share the second tag storage bit.
7. The data processing method for multi-table linkage according to claim 6, characterized in that, The method further includes: When the first data table is associated with multiple second data tables, the second tag contained in the first data table is associated with a table tag.
8. The data processing method for multi-table linkage according to any one of claims 1-7, characterized in that, The step of extracting the first data from the first data table based on the first tag in the first data table includes: Based on the time interval associated with the data processing signal, the first marker is determined according to the start and end times of the time interval, and the first data corresponding to the determined first marker is extracted. The step of extracting the second data from the second data table based on the second marker includes: Extract the second data corresponding to the second tag from the second data table.
9. The data processing method for multi-table linkage according to any one of claims 1-7, characterized in that, The data processing refers to the data extraction, transformation, and loading process performed on the first data in the first data table.
10. A method for updating a data table, characterized in that, The method includes a first data table and a second data table, wherein the first data table is associated with the second data table, and the method includes: In response to a data processing signal, first data is extracted from the first data table according to a first tag in the first data table; when the extracted first data corresponds to a second tag, second data is extracted from the second data table according to the second tag, wherein the second tag is related to the storage order of the second data. When the second data table extracts data, a second tag storage bit is added to the first data table. The second tag storage bit is used to enable the first data to contain a second tag, which is the timestamp field of the second data. Based on the associated fields contained in the second data extracted from the second data table, find the first data in the first data table that contains the same associated fields; The second tag associated with the extracted second data is recorded in the second tag storage bit of the found first data.
11. A data processing device for multi-table linkage, characterized in that, The device is applied to a first data table, which is associated with a second data table. The device includes a first extraction module, which is used to extract first data from the first data table according to a first tag in response to a data processing signal. Each piece of first data corresponds to the first tag, and the first tag is related to the storage order of the first data. The second extraction module is used to extract second data from the second data table according to the second tag when the extracted first data corresponds to the second tag, wherein each piece of second data corresponds to the second tag, and the second tag is related to the storage order of the second data; The first marker is the timestamp field of the first data, and the second marker is the timestamp field of the second data.
12. An electronic device, characterized in that, The device includes a memory and a processor. The memory stores a data processing method for multi-table linkage, and the processor is used to employ the data processing method for multi-table linkage as described in any one of claims 1-9 when executing the data processing method for multi-table linkage.
13. A computer-readable storage medium, characterized in that, The storage contains a data processing method for multi-table linkage as described in any one of claims 1-9, which can be loaded by a processor and executed.