Data table control method and device, storage medium and program product
By obtaining the event time and writing progress of the data table, and pausing the data acquisition of the data table-related jobs, the dirty data problem caused by the data table writing delay is solved, and the accuracy of the data and the disaster recovery capability are improved.
Patent Information
- Application Number
- CN202410812160.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-06
Smart Images

Figure CN118606322A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a data table control method, device, storage medium and program product. Background Art
[0002] Currently, with the continuous development of big data technology, data table writing jobs can store the generated event data in data tables, and any data table association job can obtain the required event data from the data table for subsequent processing. For example, when a user accesses an online service on a client (including but not limited to mobile applications (Application, APP), browsers and other devices), the server database is updated accordingly (for example, the anchor updates the listing of goods), and event data is generated at the same time. The event data generated at this time will be written into the data table by the data table writing job. Due to business needs, the data table association job queries the data table data to obtain event data for data processing, and outputs the results of the data table association to the downstream for data analysis, etc.
[0003] However, when a data table write job fails or encounters performance problems, it will cause a delay in writing event data. At this time, if the data table association job queries the data table data in the data table, due to the data delay of the data table write job, it may query the data table data that has not been updated, or even no data table data can be queried. In this case, the data table data queried by the data table association job will be dirty data, resulting in low accuracy of the data table data queried by the data table association job. Summary of the invention
[0004] The embodiments of the present invention provide a data table control method, a device, a storage medium and a program product, which can improve the accuracy of target data table data obtained by a data table association operation.
[0005] In a first aspect, an embodiment of the present invention provides a data table control method, the method comprising:
[0006] Acquire the event time of the target data table data in the target data table to be associated in the data table association operation; wherein the event time refers to the generation time of the target data table data;
[0007] Obtaining a write progress of a target field in the target data table for filling the target data table data; wherein the write progress refers to a watermark of a data table write operation for writing data table data to the target field, and the watermark is used to indicate a maximum event time among event times of at least one data table data written by the data table write operation;
[0008] If the writing progress is earlier than the event time of the target data table data, suspending the acquisition of the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the target data table acquired most recently is later than the event time of the target data table data; wherein, the first computer device is used to store the target data table, and the target data table includes at least one field, any one of which is used to fill in data table data.
[0009] In one embodiment, obtaining the writing progress of the target field in the target data table for filling the target data table data includes:
[0010] Acquire a data table identifier of the target data table and a field identifier of a target field for filling data in the target data table;
[0011] Obtaining the data table identifier and the writing progress associated with the field identifier;
[0012] The acquired writing progress is used as the writing progress of the target field.
[0013] In one embodiment, obtaining the data table identifier and the writing progress associated with the field identifier includes:
[0014] Obtaining a first update time of a first write progress of a target field in the target data table stored locally; wherein the first update time refers to the update time when the data table write job updates the write progress of the target field in the target data table to the first write progress;
[0015] If the difference between the current system time and the first update time is less than or equal to the first preset duration, the writing progress associated with the data table identifier and the field identifier is obtained locally; wherein the writing progress associated with the data table identifier and the field identifier is the first writing progress.
[0016] In one embodiment, the method further comprises:
[0017] If the difference between the current system time and the first update time is greater than the first preset time, obtaining the data table identifier and the second writing progress associated with the field identifier from the first computer device;
[0018] Determine the second writing progress as the writing progress associated with the data table identifier and the field identifier;
[0019] The writing progress associated with the locally stored data table identifier and the field identifier is updated from the first writing progress to the second writing progress.
[0020] In one embodiment, if the writing progress is earlier than the event time of the target data table data, pausing obtaining the target data table data in the target field of the target data table from the first computer device includes:
[0021] If the number of writing progresses of the target field in the target data table is multiple, determining a job identifier of a data table writing job for writing data in the target data table;
[0022] If the writing progress of the data table writing job corresponding to the job identifier to write the data table data to the target field in the target data table is earlier than the event time of the target data table data, then the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended.
[0023] In one embodiment, obtaining the writing progress of the target field in the target data table for filling the target data table data includes:
[0024] Acquire data content of the target data table, wherein the data content includes data table data of at least one field of the target data table and write progress metadata of any field;
[0025] Acquire the write progress metadata of the target field from the data content of the target data table;
[0026] The writing progress of the target field in the target data table is obtained from the writing progress metadata of the target field in the target data table.
[0027] In one embodiment, the step of acquiring the write progress metadata of the target field from the data content of the target data table includes:
[0028] Acquire at least one write progress metadata including a metadata identifier from the data content of the target data table; wherein the metadata identifier is used to indicate that the data is write progress metadata;
[0029] The write progress metadata of the target field is searched from the at least one write progress metadata.
[0030] In one embodiment, the method further comprises:
[0031] Acquire configuration information, where the configuration information is used to indicate whether to enable a data table control function;
[0032] If the configuration information indicates to enable the data table control function, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
[0033] In one embodiment, the method further comprises:
[0034] Determine whether the target data table data exists in a preset cache; wherein the preset cache includes the data table data obtained by the data table association operation from at least one first computer device that executes a data table writing operation;
[0035] If the target data table data exists in the preset cache, acquiring the target data table data from the preset cache;
[0036] If the target data table data does not exist in the preset cache, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
[0037] In one embodiment, the method further comprises:
[0038] If the writing progress is earlier than the event time of the target data table data, the heartbeat time of the target data table is obtained; wherein the heartbeat time of the target data table is sent every preset period of the data table writing operation, and the heartbeat time of the target data table refers to the system time when the data table writing operation reaches the preset period;
[0039] If the difference between the current system time and the heartbeat time is greater than a second preset duration, the step of pausing the acquisition of the target data table data in the target field of the target data table from the first computer device is triggered.
[0040] In one embodiment, the method further comprises:
[0041] If the difference between the current system time and the heartbeat time is less than or equal to the second preset duration, the target data table data in the target field of the target data table is obtained from the first computer device.
[0042] In a second aspect, an embodiment of the present application provides a data table control method, the method comprising:
[0043] In the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data;
[0044] If the event time of the target data table data is higher than the watermark of the target data table associated job, the watermark of the target data table write job is updated to the event time of the target data table data, and the write progress of the target field of the target data table is updated to the watermark of the target data table write job; wherein the target data table write job refers to a data table write job for writing data table data to the target field of the target data table;
[0045] The updated writing progress of the target field of the target data table and the target data table data are sent to the first computer device, so that the first computer device stores the target data table data and the writing progress of the target field of the target data table.
[0046] In one embodiment, sending the updated writing progress of the target field of the target data table to the first computer device includes:
[0047] Acquire a data table identifier of the target data table, a field identifier of the target field, and a write progress of the target field of the target data table after the update;
[0048] The data table identifier, field identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and field identifier to the updated write progress of the target field of the target data table.
[0049] In one embodiment, sending the data table identifier, the field identifier, and the writing progress of the updated target field of the target data table to the first computer device includes:
[0050] Acquire the write progress metadata of the target field, the write progress metadata including a metadata identifier, the data table identifier, a field identifier, and the updated target field of the target data table; the metadata identifier is used to indicate that the data is write progress metadata;
[0051] The write progress metadata is sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the updated write progress of the target field of the target data table based on the metadata identifier in the write progress metadata.
[0052] In one embodiment, sending the updated writing progress of the target field of the target data table and the target data table data to the first computer device includes:
[0053] If there are multiple data table writing jobs writing data table data to the target field of the target data table, then for the target data table writing job, obtaining the data table identifier of the target data table, the field identifier of the target field, the job identifier of the target data table writing job, and the writing progress of the target field of the target data table after the update;
[0054] The data table identifier, field identifier, job identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier, field identifier and job identifier to the updated write progress of the target field of the target data table.
[0055] In one embodiment, in the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data includes:
[0056] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0057] If the write progress update strategy is a continuous update strategy, the event time of the target data table data is obtained.
[0058] In one embodiment, in the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data includes:
[0059] In the process of writing the target data table data into the target field of the target data table, obtaining a second update time of the writing progress of the target field that was most recently updated;
[0060] If the difference between the current system time and the second update time is greater than a third preset time length, the event time of the target data table data is obtained.
[0061] In one embodiment, in the process of writing the target data table data into the target field of the target data table, obtaining the second update time of the writing progress of the target field that was most recently updated includes:
[0062] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0063] If the writing progress update strategy is a periodic update strategy, the second update time of the writing progress of the target field that was most recently updated is obtained.
[0064] In one embodiment, the method further comprises:
[0065] Acquire the current system time every preset period, and update the heartbeat time of the target data table to the current heartbeat time;
[0066] The updated heartbeat time of the target data table is sent to the first computer device, so that the first computer device updates the heartbeat time of the target data table to the updated heartbeat time of the target data table.
[0067] In a third aspect, an embodiment of the present application provides a data table control device, the data table control device comprising:
[0068] An acquiring unit, configured to acquire an event time of target data table data in a target data table to be associated by a data table association operation; wherein the event time refers to a generation time of the target data table data;
[0069] The acquisition unit is further used to acquire a write progress of a target field in the target data table for filling the target data table data; wherein the write progress refers to a watermark of a data table write operation for writing data table data to the target field, and the watermark is used to indicate a maximum event time among event times of at least one data table data written by the data table write operation;
[0070] A processing unit, for suspending the acquisition of the target data table data in the target field of the target data table from the first computer device if the write progress is earlier than the event time of the target data table data, until the write progress of the target field of the target data table acquired most recently is later than the event time of the target data table data; wherein, the first computer device is used to store the target data table, and the target data table includes at least one field, any field being used to fill in data table data.
[0071] In a fourth aspect, an embodiment of the present application provides a computer device, including a processor, a storage device, and a communication interface, wherein the processor, the storage device, and the communication interface are interconnected, wherein the storage device is used to store a computer program that supports the computer device to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the following steps:
[0072] Acquire the event time of the target data table data in the target data table to be associated in the data table association operation; wherein the event time refers to the generation time of the target data table data;
[0073] Obtaining a write progress of a target field in the target data table for filling the target data table data; wherein the write progress refers to a watermark of a data table write operation for writing data table data to the target field, and the watermark is used to indicate a maximum event time among event times of at least one data table data written by the data table write operation;
[0074] If the writing progress is earlier than the event time of the target data table data, suspending the acquisition of the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the target data table acquired most recently is later than the event time of the target data table data; wherein, the first computer device is used to store the target data table, and the target data table includes at least one field, any one of which is used to fill in data table data.
[0075] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the data table control method described in the first aspect above.
[0076] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the data table control method described in the first aspect above.
[0077] In a seventh aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and the computer program is suitable for being loaded by a processor and executing the data table control method described in the first aspect above.
[0078] In an eighth aspect, an embodiment of the present application provides a data table control device, the data table control device comprising:
[0079] an acquisition unit, configured to acquire the event time of the target data table data during the process of writing the target data table data into the target field of the target data table;
[0080] A processing unit, configured to update the watermark of the target data table associated operation to the event time of the target data table data, and update the writing progress of the target field of the target data table to the watermark of the target data table associated operation if the event time of the target data table data is higher than the watermark of the target data table associated operation; wherein the target data table associated operation refers to a data table writing operation for writing data table data to the target field of the target data table;
[0081] The sending unit is used to send the updated writing progress of the target field of the target data table and the target data table data to the first computer device, so that the first computer device stores the target data table data and the writing progress of the target field of the target data table.
[0082] In a ninth aspect, an embodiment of the present application provides a computer device, including a processor, a storage device, and a communication interface, wherein the processor, the storage device, and the communication interface are interconnected, wherein the storage device is used to store a computer program that supports the computer device to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the following steps:
[0083] In the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data;
[0084] If the event time of the target data table data is higher than the watermark of the target data table associated operation, then the watermark of the target data table associated operation is updated to the event time of the target data table data, and the writing progress of the target field of the target data table is updated to the watermark of the target data table associated operation; wherein the target data table associated operation refers to a data table writing operation for writing data table data to the target field of the target data table;
[0085] The updated writing progress of the target field of the target data table and the target data table data are sent to the first computer device, so that the first computer device stores the target data table data and the writing progress of the target field of the target data table.
[0086] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the data table control method described in the second aspect above.
[0087] In an eleventh aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and the computer program is suitable for being loaded by a processor and executing the data table control method described in the second aspect above.
[0088] In an embodiment of the present invention, if the writing progress of the target field in the target data table used to fill the target data table data is earlier than the event time of the target data table data, the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended until the writing progress of the target field of the target data table acquired the latest is later than the event time of the target data table data. In other words, the embodiment of the present application can automatically block the data table association behavior in the event of a data table failure or delay, that is, suspend the data table association job to obtain the target data table data from the first computer device; when the writing progress of the target field of the target data table acquired the latest is later than the event time of the target data table data, it indicates that the target data table data has been successfully written into the data table, then the data table association job can successfully obtain the target data table data from the first computer device, thereby achieving the accuracy of the target data table data acquired by the data table association job, and at the same time enabling the data table association job to perceive and resist data table failures to achieve disaster recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0090] Figure 1 This is a schematic diagram of an application scenario of a data table control method provided in an embodiment of the present application;
[0091] Figure 2 It is a flow chart of a data table control method provided in an embodiment of the present application;
[0092] Figure 3 This is a schematic diagram of the relationship between an event time, a processing time, and a water level provided in an embodiment of the present application;
[0093] Figure 4 It is a schematic diagram of a storage structure of writing progress metadata provided by an embodiment of the present application;
[0094] Figure 5 is a schematic diagram of a metadata transfer model provided in an embodiment of the present application;
[0095] Figure 6 It is a flowchart of another data table control method provided in an embodiment of the present application;
[0096] Figure 7 is a schematic diagram of a real-time computing engine based on Apache Flink provided in an embodiment of the present application;
[0097] Figure 8 It is a structural schematic diagram of a data table control device provided in an embodiment of the present application;
[0098] Fig. 9 is a structural schematic diagram of a computer device provided in an embodiment of the present application;
[0099] Fig.10 It is a structural schematic diagram of another data table control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0100] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0101] like Figure 1 As shown, Figure 1 This is a schematic diagram of an application scenario of a data table control method provided in an embodiment of the present application. When a user accesses an online service on a client (including but not limited to mobile APP, browser and other devices), the server database is updated accordingly (for example, the anchor updates the listing of products), and event data is generated at the same time. The event data generated at this time will be written into the job subscription (i.e. Figure 1 Step 1 in the above example) is updated in real time to the data table storage medium (i.e. Figure 1 Step 2 in the above example.
[0102] Due to business needs, the data table association job can query the data table data in the data table storage medium (i.e. Figure 1 Step 6 in the data table) to obtain more data information from the data table data for data processing, and output the results of the data table association to the downstream (i.e. Figure 1 Step 7 in the above example) for a series of products such as data analysis (e.g., dashboards, reports, etc.) (i.e. Figure 1 8 in the previous step).
[0103] Before using the data table control method proposed in the present application, the data table writing operation and the data table association operation are not aware of each other. When the data table writing operation is delayed or fails, the data table association operation may fail to query the data table data, or the data may not be the expected value (for example, due to the data writing delay of the data table writing operation, the data table data that has not been updated may be queried). This part of the unexpected dirty data will cause deviations in the downstream data analysis results, and then lead to unsatisfactory subsequent processing results, such as customer complaints or report distortion, and even affect decision-making.
[0104] This application updates the writing progress of the current data table writing operation to the data table storage medium after the data table writing operation updates the data table (ie Figure 1 In addition, before executing the data table association (i.e. querying the target data table data), the data table association job first checks the corresponding writing progress in the metadata (i.e. Figure 1 In step 4 of the above, when it is found that the writing progress is not as expected (i.e., the writing progress of the target field in the data table used to fill the target data table data is earlier than the event time of the target data table data), the data table association is blocked (i.e., the acquisition of the target data table data in the target field of the data table from the data table storage medium is suspended), and metadata is updated (i.e., Figure 1 The data table query is not performed until the data table writing progress in the metadata meets the expectation (that is, the writing progress of the target field in the data table used to fill the target data table data is later than the event time of the target data table data). Figure 1 to ensure that the query results are as expected.
[0105] For example, the data table control method provided in this application can be applied to the order channel attribution scenario. In the order channel attribution scenario, the business logic can be divided into two parts: the processing of the user behavior log data stream (hereinafter referred to as the exposure stream, that is, the data table writing job mentioned in this application) and the order data stream (hereinafter referred to as the order stream, that is, the data table association job mentioned in this application). Through this business logic, the user's order can be attributed to specific user behavior (for example, browsing product details, adding to shopping carts, etc.), and analysts can analyze the reasons for the user's ordering behavior based on this. R&D personnel can optimize the product recommendation strategy based on this to better promote the platform's order volume.
[0106] In this scenario, the processing of the user behavior log data stream and the processing of the order data stream are two completely independent jobs. There may be data delays between these two jobs due to various reasons such as failures and performance issues. In the process of associating orders with user behavior logs, the order stream job can query the user's most recent behavior data in Redis A (i.e., the data table) at the current moment.
[0107] However, when the exposure flow job fails or has performance problems, data will be delayed. At this time, when the user's order arrives at the order flow job, the order flow job will query the user's recent behavior log in Redis A. However, due to the data delay of the exposure flow job, the user's very early behavior information may be queried at this time, or even no user behavior information may be queried, which will cause the order flow job to generate erroneous dirty data and seriously reduce data quality. This may mislead analysts to make wrong decisions, and may also lead to problems such as degradation of the product recommendation algorithm and reduced recommendation effect, thereby affecting order volume.
[0108] Based on this, the embodiment of the present application provides a data table control method, which transforms the exposure flow job that writes the data table so that it updates the current writing progress as metadata to Redis A in real time during the process of writing data to Redis A. At the same time, all jobs associated with the data table are transformed (order flow jobs). Before querying Redis A, the order flow job first accesses the metadata, and compares the writing progress of the target field of the target data table in the metadata with the event time of the target data table data currently queried by the order flow job. When it is found that the writing progress is earlier than the event time of the target data table data, it is considered that there is data delay in the data table. At this time, the query is temporarily stopped, and the metadata is continuously checked until the writing progress of the target field of the target data table in the latest metadata is later than the event time of the target data table data, and then the query of the order flow job is resumed.
[0109] The data table storage medium provided in the embodiment of the present application can be run in a first computer device or a cloud server, and the data table storage medium can be used to store data table data of at least one data table and the writing progress of each field of each data table. Any data table includes at least one field, and any field is used to fill in data table data.
[0110] The data table in the embodiment of the present application may include a dimension table or a fact table, etc. The fact table mainly stores data of fact records, such as sales records, system logs, etc. The dimension table is also called a dimension table, which refers to an auxiliary table describing the fact table, and it contains dimension information related to the fact table. In a data warehouse, a dimension refers to an angle of analyzing data, such as time, region, product, etc. The role of the dimension table is to provide more descriptions and information about the fact table to help analysts better understand the data. When the data table includes a dimension table, the target data table may include a target dimension table, the target data table data in the target data table may refer to the target dimension table data in the target dimension table, the data table association job may include a dimension table association job, and the data table write job may include a dimension table write job. When the data table includes a fact table, the target data table may include a target fact table, the target data table data in the target data table may refer to the target fact table data in the target fact table, the data table association job may include a fact table association job, and the data table write job may include a fact table write job.
[0111] The data table control method provided in the embodiment of the present application can be applied to a second computer device that performs a data table writing operation or a third computer device that performs a data table association operation. The first computer device, the second computer device or the third computer device mentioned above includes but is not limited to a smart phone, a camera, a wearable device or a computer.
[0112] In the specific implementation of this application, user-related data, such as data table data, is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with local laws, regulations and standards.
[0113] Based on the above description, the present application embodiment proposes a method as follows Figure 2 The data table control method shown in the figure may include the following steps S201-S208:
[0114] S201. In a data table writing operation, during the process of writing target data table data into a target field of a target data table, an event time of the target data table data is obtained.
[0115] It can be understood that the data table control method provided in the embodiment of the present application can be applied to a first computer device, a second computer device, and a third computer device. Among them, a data table storage medium is running in the first computer device, and the data table storage medium is used to store data table data of at least one data table, and the writing progress of each field of each data table. The second computer device runs at least one data table write job, and the third computer device runs at least one data table association job. The embodiment of the present application may involve at least one second computer device and at least one third computer device. The data table write job involved in the embodiment of the present application refers to any data table write job that writes data table data to a data table, and the data table write job runs in the second computer device. The data table association job involved in the embodiment of the present application refers to any data table association job that queries data table data, and the data table association job runs in the third computer device.
[0116] Specifically, for any data table writing job, if the data table writing job detects the generation of target data table data, then the data table writing job can write the target data table writing data into the target field of the target data table. The target data table data refers to the data table data that needs to be written by the data table writing job, the target data table refers to the data table that needs to be written by the data table writing job, and the target field refers to the field in the target data table used to fill in the target data table data. Specifically, if a data table writing job detects the generation of target data table data, then the data table writing job can determine the data table identifier of the target data table into which the target data table data needs to be written, and the field identifier of the target field in the target data table into which the target data table data needs to be written. The data table writing job can send the data table identifier, the field identifier, and the target data table data to the first computer device, so that the first computer device searches the data table storage medium for whether the data table data associated with the data table identifier and the field identifier exists. If so, the data table writing job can update the data table data associated with the data table identifier and the field identifier in the data table storage medium to the target data table data, so as to establish an association relationship between the data table identifier and the field identifier and the target data table data; if not, the data table writing job can store the data table identifier and the field identifier in association with the target data table data in the data table storage medium.
[0117] In addition, the event time involved in the embodiments of the present application is explained. The time when the data is generated is the event time (Event Time). For example, a user clicks on an advertisement and generates a click event data, then the time when the user clicks the advertisement is called the event time. The time when the data is actually processed by the program is the processing time (Processing Time). For example, at 10:00, a user clicks on an advertisement and generates a click event data. Due to delays caused by various situations such as the network, the time when the data processing program is actually entered is 10:01. Then the processing time of the data is 10:01, and the event time is 10:00.
[0118] It is not difficult to imagine that in the most ideal case, assuming there is no delay caused by network or other reasons, if the data can be processed by the program immediately after it is generated, then the event time and the processing time are exactly the same. However, due to the existence of data transmission such as the network, the event time is usually earlier than the processing time. At the same time, the gap between them increases as the data delay increases. Similarly, when there are performance problems in the program, the gap between event time and processing events will also increase.
[0119] In one embodiment, during the process of writing the target data table data into the target field of the target data table, the data table writing job may obtain configuration information, where the configuration information is used to indicate whether the data table control function is enabled. If the configuration information indicates that the data table control function is enabled, the step of obtaining the event time of the target data table data is triggered.
[0120] For example, after receiving the target data table data, the data table writing operation writes the target data table data into the target data table. After the target data table data is written, it can be checked whether the data table association alignment function involved in the embodiment of the present application is enabled (i.e., it can be determined whether the configuration information indicates that the data table control function is enabled). If it is not enabled, the process is directly exited. It can be seen that when this function is not enabled, the writing process of the data table writing operation does not change relative to the traditional writing method.
[0121] When the data table write job checks and finds that the function is enabled, the data table write job further checks the metadata update strategy configured by the data table write job. The embodiment of the present application provides two different metadata update strategies: continuous update (Per Record) and periodic update (Per Interval). Among them, the continuous update strategy means that every time a data table data is written, the metadata corresponding to the written field will be updated. In the periodic update strategy mode, when the data table write job writes a data table data, the difference between the time of the last metadata update and the current system time will be checked first, and the metadata update will be performed only when and only when the difference is greater than the threshold configured by the user. On the contrary, if the difference is less than the threshold configured by the user, the data table write job does not update the metadata. Among them, the continuous update strategy can ensure that the write progress stored in the metadata is kept up to date, but when the amount of data written is large, it may cause the metadata to be updated too frequently, which has a certain impact on the performance of the data table write job. The periodic update strategy has a certain delay relative to the continuous update strategy, but because it is a periodic update, it will not be affected by the amount of data written, and is only associated with the update interval configured by the user. In a large traffic scenario, it can significantly reduce the performance loss caused by updating metadata.
[0122] Among them, the metadata update strategies of different data table writing operations may be the same or different. In addition, for different data table writing operations configured with periodic update strategies, the configured update intervals may be the same or different. The metadata update strategy of any data table writing operation and the update interval when the metadata update strategy is a periodic update strategy can be configured according to the needs of the application scenario, and are not specifically limited by the embodiments of the present application.
[0123] Optionally, when writing the target data table data to the target field of the target data table, the data table writing job can obtain a writing progress update strategy (i.e., the metadata update strategy mentioned in the above embodiment). If the writing progress update strategy is a continuous update strategy, the event time of the target data table data is obtained in real time. In other words, the data table writing job can update the writing progress of the target field of the target data table in real time.
[0124] Optionally, the data table writing job can obtain the second update time of the writing progress of the target field that was most recently updated during the process of writing the target data table data into the target field of the target data table, and if the difference between the current system time and the second update time is greater than a third preset time, the event time of the target data table data is obtained. In other words, the data table writing job can periodically update the writing progress of the target field of the target data table.
[0125] Optionally, the data table writing job may obtain a writing progress update strategy during the process of writing the target data table data into the target field of the target data table. If the writing progress update strategy is a periodic update strategy, the step of obtaining the second update time of the writing progress of the last update of the target field is triggered.
[0126] S202: If the event time of the target data table data is higher than the watermark of the data table writing operation, the data table writing operation updates the watermark of the data table writing operation to the event time of the target data table data.
[0127] The data table writing operation refers to a data table writing operation for writing data in a data table to a target field in a target data table.
[0128] Based on the above event time, the watermark can be defined as follows: the maximum event time among the event times of the data table data written in the history of the data table write job is the watermark of the data table write job. It is not difficult to imagine that the watermark will be advanced if and only if the event time of the data currently processed by the data processing program is greater than the current watermark (it can be imagined as: if the current wave is not as high as the previous wave, then the watermark is considered unchanged. If a wave higher than the watermark suddenly comes, then the watermark can be advanced to the latest wave height). The relationship diagram between event time (Event Time), processing time (Processing Time) and watermark can be shown as follows Figure 3 As shown in the figure, Actual watermark can represent the actual watermark, Ideal watermark can represent the theoretical watermark, and Event Time Skew can represent the event time offset.
[0129] Based on the definition of the watermark, the write progress of the target field of the target data table can be the watermark of the data table write job used to write the data table data to the target field of the target data table. For example, if the data table write job is processing data with an event time of 10:00 at 10:05, then the event time of the target data table data written to the target field of the target data table at this time is 10:00, and the watermark of the data table write job is also 10:00, then the write progress of the target field of the target data table at this time is 10:00. In other words, it can be considered that the data table data before 10:00 has been written into the target data table, that is, the data before the write progress (10:00) of the target field of the target data table is in place, and the data table association job can query all data before the write progress (10:00) of the target field of the target data table, while the data with event time after 10:00 cannot be queried for the time being.
[0130] The concept of write progress enables the evaluation of the write status of a data table: when the write progress of the target field of a data table is less than the event time of the data table data that currently needs to be queried, we consider the data table to be delayed (because the data table data in the target field still needs a certain amount of time to be written, or because the data table write job fails, resulting in a delay in writing the data table data in the target field). The target field refers to the field used to fill in the data table data that currently needs to be queried. At this point, the corresponding data table associated job can be controlled to temporarily stop querying to ensure that the data quality queried by the data table associated job meets expectations. The corresponding data table associated job refers to the data table associated job that currently needs to query the data table data of the target field of the data table.
[0131] Based on the above description, after obtaining the event time of the target data table data, the data table write job can detect whether the event time of the target data table data is higher than the watermark of the data table write job. If the event time of the target data table data is higher than the watermark of the data table write job, the data table write job will update the watermark of the data table write job to the event time of the target data table data; if the event time of the target data table data is lower than or equal to the watermark of the data table write job, the watermark of the data table write job remains unchanged, and the writing progress of the target field of the target data table also remains unchanged.
[0132] Among them, the event time of the target data table data is higher than the watermark of the data table write operation means: the event time of the target data table data is later than the event time corresponding to the watermark of the data table write operation, that is, the event time of the target data table data is after the event time corresponding to the watermark of the data table write operation. For example, assuming that the data table write operation is processing data with an event time of 10:00 at 10:05, then the event time of the target data table data of the target field written to the target data table at this time is 10:00, assuming that the current watermark of the data table write operation is 9:50, then the watermark of the data table write operation needs to be updated at this time, that is, the watermark of the data table write operation is updated from 9:50 to 10:00; assuming that the current watermark of the data table write operation is 10:00, then the watermark of the data table write operation does not need to be updated at this time, that is, the watermark of the data table write operation remains unchanged at 10:00.
[0133] S203: The data table writing operation updates the writing progress of the target field of the target data table as the watermark of the data table writing operation.
[0134] In the specific implementation, the writing progress of the target field of the target data table is consistent with the watermark of the data table writing operation. If the watermark of the data table writing operation is updated, the writing progress of the target field of the target data table will also be updated; if the watermark of the data table writing operation remains unchanged, the writing progress of the target field of the target data table does not need to be updated, that is, it remains unchanged. For example, assuming that the watermark of the data table writing operation is updated from 9:50 to 10:00, the writing progress of the target field of the target data table is also updated from 9:50 to 10:00; assuming that the watermark of the data table writing operation remains unchanged at 10:00, the writing progress of the target field of the target data table also remains unchanged at 10:00.
[0135] S204: The data table writing operation sends the writing progress of the target field of the updated target data table and the target data table data to the first computer device.
[0136] In a specific implementation, the target data table data to be written to the target field of the target data table and the writing progress of the target field of the updated target data table can be written to the target data table at the same time, that is, the writing progress of the target field of the updated target data table and the target data table data can be sent to the first computer device at the same time. Optionally, the target data table data to be written to the target field of the target data table and the writing progress of the target field of the updated target data table can also be stored separately, that is, after the target data table data is obtained, the target data table data is sent to the first computer device; after the writing progress of the target field of the updated target data table is obtained, the writing progress of the target field of the updated target data table is sent to the first computer device, and the first computer device can store the writing progress of the target field of the updated target data table and the target data table data in different storage areas of the data table storage medium.
[0137] In one implementation, a data table write job sends the write progress of the target field of the updated target data table to a first computer device, which can be understood as: obtaining the data table identifier of the target data table, the field identifier of the target field, and the write progress of the target field of the updated target data table, and sending the data table identifier, the field identifier, and the updated write progress of the target field of the target data table to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the write progress of the target field of the updated target data table.
[0138] In one implementation, a data table write job sends a data table identifier, a field identifier, and the write progress of a target field of an updated target data table to a first computer device, and may include: obtaining write progress metadata of the target field, the write progress metadata including a metadata identifier, a data table identifier, a field identifier, and the target field of the updated target data table, the metadata identifier being used to indicate that the data belongs to the write progress metadata; sending the write progress metadata to the first computer device so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the write progress of the target field of the updated target data table based on the metadata identifier in the write progress metadata.
[0139] The embodiment of the present application provides a storage structure for write progress metadata at a field granularity, the size of which is controllable and can support write progress awareness at a field granularity.
[0140] A data table usually consists of one or more fields, and a field is the smallest distinguishing granularity in a data table. In other words, when we query a data table, we need to specify the query key (KEY) and the field to be queried. For example, if we need to query the age of a user with a user ID of 1, then the value 1 of the user ID is the key (KEY), and the age of the user is the field to be queried. At the same time, multiple fields of a data table may be written by different data table writing jobs, so different fields may have different writing progress.
[0141] In addition to the field name, the location where the data table is stored is also very important. For example, the user's name field may exist in both the "user data table" and the "order data table". The fields with the same name in different data tables have completely different writing schedules. Therefore, each data table needs to be distinguished by a unique identifier (i.e., data table identifier). A field can be uniquely identified by a data table unique identifier and field name (i.e., field identifier).
[0142] Based on this feature of the data table, the following storage structure can be defined to store the writing progress of each field in the data table. This data structure is called writing progress metadata.
[0143] Specifically, the write progress of a data table field can be defined in the format of a key-value pair (KV), where the key (KEY) is the unique identifier of the data table + the field name, and the value (VALUE) is the ID (i.e., the job identifier) of the data table write job for the field and the corresponding watermark. In addition, in order to avoid polluting the data in the data table, the data table write job can define a special prefix (DIM_META_DATA) for the write progress metadata to distinguish between the data table data and the metadata.
[0144] by Figure 4 Taking the schematic diagram of the storage structure of the write progress metadata as an example, each write progress metadata consists of two parts: key and value. The key (KEY) consists of a fixed prefix (Prefix), a unique identifier of the data table (Identifier) and a field name (FieldName). The value consists of the job ID written to the field and its current latest write progress.
[0145] It is understandable that the write progress metadata can be stored in the data table or stored independently of the data table. If the write progress metadata is stored in the data table, the key (KEY) of the write progress metadata can be composed of a fixed prefix (Prefix) and a field name (FieldName). If the write progress metadata is stored independently of the data table, the key (KEY) of the write progress metadata can be composed of a fixed prefix (Prefix), a unique identifier (Identifier) of the data table, and a field name (FieldName).
[0146] In one implementation, a data table write job sends the write progress of the target field of the updated target data table and the target data table data to a first computer device, which may include: if there are multiple data table write jobs that write data table data to the target field of the target data table, then for the data table write job, obtaining the data table identifier of the target data table, the field identifier of the target field, the job identifier of the data table write job, and the write progress of the target field of the updated target data table; sending the data table identifier, the field identifier, the job identifier, and the write progress of the target field of the updated target data table to the first computer device, so that the first computer device updates the write progress associated with the data table identifier, the field identifier, and the job identifier to the updated write progress of the target field of the target data table.
[0147] Specifically, when a field is written by multiple data table writing jobs, the field corresponds to multiple writing progress. Figure 4 The field c1 shown in the figure has data written by two operations, data table write operation 22977 and data table write operation 22774. Therefore, the write progress metadata corresponding to the c1 field contains two write progresses ts1 and ts2. Similarly, fields c3 and c4 have data written by only one data table write operation 22779. Therefore, the write progress metadata corresponding to the c3 and c4 fields are the same, and the write progress is the water level of the data table write operation 22779, that is, ts3.
[0148] Through the write progress metadata defined above, we can observe the write progress of different fields in the data table. Through the write progress metadata, we can determine whether the field currently required to be queried has been delayed, and then choose whether to block the query request or allow the query.
[0149] It can be understood that there is at least one data table in the embodiment of the present application, and each data table includes at least one field. The same field can be written by multiple data table writing jobs. The data table data written by different data table writing jobs are different. Therefore, the event time of the data table data written by different data table writing jobs can be different. Therefore, a water level is defined for each data table writing job. Then, when a field is written by multiple data table writing jobs, the field corresponds to multiple writing progress. The different writing progress refers to the water level of the corresponding data table writing job.
[0150] In addition, even if the same field exists in different data tables, the data table data in the same field of different data tables are written by different data table writing jobs, and the writing progress of different data table writing jobs may be different. Therefore, the data table data and writing progress of the same field of different data tables are independent of each other and do not affect each other.
[0151] S205: The first computer device stores the target data table data and the writing progress of the target field of the updated target data table.
[0152] The first computer device may store the target data table data and the writing progress of the target field of the updated target data table in the data table storage medium. For example, before the first computer device stores the writing progress of the target field of the updated target data table in the data table storage medium, if there is no water level line of the data table writing operation for writing the target data table data in the data table storage medium, it indicates that the data table writing operation has not written the data table data into the target field of the target data table before, that is, the data table data written by the data table writing operation does not exist in the target field of the target data table before, then the first computer device may directly store the target data table data and the writing progress of the target field of the updated target data table in the data table storage medium. For another example, before the first computer device stores the write progress of the target field of the updated target data table to the data table storage medium, if there is a water level line of a data table write operation for writing the target data table data in the data table storage medium, it indicates that the data table write operation has previously written the data table data to the target field of the target data table, that is, the data table data written by the data table write operation has previously existed in the target field of the target data table. Then, the first computer device can update the data table data written by the data table write operation in the target field of the target data table in the data table storage medium to the target data table data, and update the write progress of the target field of the target data table in the data table storage medium to the write progress of the target field of the updated target data table.
[0153] Optionally, the first computer device may store the writing progress of the target field of the updated target data table and the target data table data in different storage areas of the data table storage medium, or may write the writing progress of the target field of the updated target data table and the target data table data into the data table, i.e., store them in the same storage area of the data table storage medium.
[0154] S206: The data table association operation obtains the event time of the target data table data in the target data table to be associated with the data table association operation.
[0155] The event time refers to the time when the data in the target data table is generated.
[0156] In one implementation, the data table association job can first obtain configuration information, where the configuration information is used to indicate whether the data table control function is enabled; if the configuration information indicates that the data table control function is enabled, then the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association job is triggered.
[0157] For example, before querying the data table data, the data table association job can first check whether the data table association alignment capability is enabled (i.e., determine whether the configuration information indicates whether the data table control function is enabled). If it is not enabled, the data table is directly queried and the process is exited afterwards. At this time, the data table association job does not perceive the state of the data table. If the data table write job is delayed or fails, the data table association job is not aware of it, which may cause data association failure, and then cause the data quality of the data table association job processing result to be seriously degraded, and dirty data is written to the downstream. If the data table association job detects that the data table association alignment capability is enabled, the data table association job can obtain the event time of the target data table data in the target data table to be associated with the data table association job, and obtain the write progress of the target field in the target data table used to fill the target data table data. If the write progress is earlier than the event time of the target data table data, the data table association job suspends the acquisition of the target data table data in the target field of the target data table from the first computer device until the write progress of the target field of the latest acquired target data table is later than the event time of the target data table data.
[0158] In one implementation, a data table association job can determine whether there is target data table data in a preset cache; wherein the preset cache includes data table data obtained by the data table association job from at least one first computer device running a data table write job; if the target data table data exists in the preset cache, the target data table data is obtained from the preset cache; if the target data table data does not exist in the preset cache, a step of obtaining the event time of the target data table data in the target data table to be associated with the data table association job is triggered.
[0159] For example, when a data table association job needs to query data in a data table, it can first query the local preset cache (Cache: the cache here refers to the temporary storage of historical query results on the local machine to avoid repeated queries on the data table and improve performance). If the target data table data exists in the preset cache, the target data table data is obtained from the preset cache; if the target data table data does not exist in the preset cache, the target data table data is obtained from the first computer device.
[0160] In one implementation, a data table association job can determine whether target data table data exists in a preset cache; if target data table data does not exist in the preset cache, configuration information is obtained, and the configuration information is used to indicate whether a data table control function is enabled; if the configuration information indicates that the data table control function is enabled, a step of obtaining the event time of the target data table data in the target data table to be associated with the data table association job is triggered.
[0161] For example, when a data table association job needs to query data in a data table, it can first query the local preset cache. When the target data table data does not exist in the preset cache, the data table association job attempts to check whether the user has enabled the data table association alignment capability. If it is not enabled, it directly queries the data table and then exits the process. If the data table association job detects that the data table association alignment capability is enabled, the data table association job can obtain the event time of the target data table data in the target data table to be associated with the data table association job, and obtain the write progress of the target field in the target data table used to fill the target data table data. If the write progress is earlier than the event time of the target data table data, the data table association job suspends obtaining the target data table data in the target field of the target data table from the first computer device until the write progress of the target field of the target data table newly obtained is later than the event time of the target data table data.
[0162] S207: The data table association job obtains the writing progress of the target field in the target data table for filling the target data table data.
[0163] The write progress refers to the watermark of a data table write job used to write data table data to a target field, and the watermark is used to indicate the maximum event time among the event times of at least one data table data written by the data table write job.
[0164] In one embodiment, a data table association job obtains the writing progress of a target field in a target data table for filling target data table data, which may include: obtaining a data table identifier of the target data table and a field identifier of a target field for filling target data table data; obtaining the data table identifier and the writing progress associated with the field identifier; and using the obtained writing progress as the writing progress of the target field.
[0165] For example, each write progress stored in the first computer device consists of two parts: a key and a value. The key (KEY) consists of the unique identifier (Identifier) and the field name (FieldName) of the data table. The value consists of the write progress of the field. Therefore, the data table association job can first obtain the data table identifier and field identifier corresponding to the write progress to be queried, and then use the data table identifier and field identifier as the key, and the value found is the write progress of the target field.
[0166] In one embodiment, a data table association job obtains the write progress associated with the data table identifier and the field identifier, which may include: obtaining the first update time of the first write progress of the target field in the locally stored target data table; wherein the first update time refers to the update time when the data table write job updates the write progress of the target field in the target data table to the first write progress; if the difference between the current system time and the first update time is less than or equal to the first preset duration, then obtaining the write progress associated with the data table identifier and the field identifier from the local; wherein the write progress associated with the data table identifier and the field identifier is the first write progress.
[0167] Optionally, if the difference between the current system time and the first update time is greater than a first preset duration, the data table association job obtains a second writing progress associated with the data table identifier and the field identifier from the first computer device; determines the second writing progress as the writing progress associated with the data table identifier and the field identifier; and updates the writing progress associated with the locally stored data table identifier and the field identifier from the first writing progress to the second writing progress.
[0168] For example, the data table association job first checks the difference between the last update time of the locally stored write progress metadata and the current system time. If the difference is greater than the pre-configured local metadata update interval, the data table association job will pull the latest write progress metadata corresponding to the data table from the first computer device and update it locally. The latest write progress metadata corresponding to the data table may include the write progress metadata of each field of the data table.
[0169] Then, after the data table association job obtains the write progress of the target field of the target data table, if the write progress of the target field of the target data table is earlier than the event time of the target data table data, the data table association job regards the current data table as being in a delayed state, that is, the currently required target data table data has not been written to the target data table. At this time, the data table association job will fall into a loop and wait for the next update of the write progress metadata. If the check finds that the write progress of the target field of the target data table is later than the event time of the target data table data, the data table association job allows the query to be released and exits the process after the target data table data is queried.
[0170] In this embodiment, regardless of whether the data table writing operation continuously updates or periodically updates the writing progress metadata, the data table association operation periodically pulls the writing progress metadata. If there are multiple data table association operations, the pulling cycles of each data table association operation may also be different according to different application scenarios.
[0171] In one embodiment, a data table association job obtains the write progress of a target field in a target data table used to fill in target data table data, which may include: obtaining data content of the target data table, the data content including data table data of at least one field of the target data table, and write progress metadata of any field; obtaining write progress metadata of the target field from the data content of the target data table; obtaining the write progress of the target field in the target data table from the write progress metadata of the target field in the target data table.
[0172] If the data table data and the writing progress of each field of the data table are both written to the data table, that is, the data table data of the same data table and the writing progress of each field of the data table are stored in the same storage area of the data table storage medium, then when the data table association job queries the target data table data, it can first obtain the data content of the target data table from the first computer device, and the data content includes the data table data of at least one field of the target data table, and the writing progress metadata of any field, and then the data table association job obtains the writing progress metadata of the target field from the data content of the target data table, and then the data table association job obtains the writing progress metadata of the target field in the target data table from the writing progress metadata of the target field in the target data table.
[0173] In one embodiment, a data table association job obtains write progress metadata of a target field from data content of a target data table, which may include: obtaining at least one write progress metadata including a metadata identifier from data content of the target data table; wherein the metadata identifier is used to indicate that the data is write progress metadata; and searching for write progress metadata of the target field from the at least one write progress metadata.
[0174] In order to avoid polluting the data in the data table, the data table writing job defines a special prefix (DIM_META_DATA) for the writing progress metadata when writing the data table data, which is used to distinguish the data table data from the metadata. Therefore, when obtaining the writing progress, the data table association job can first obtain at least one writing progress metadata containing the metadata identifier from the data content of the target data table, and then search for the writing progress metadata of the target field from the at least one writing progress metadata.
[0175] S208. If the writing progress is earlier than the event time of the target data table data, the data table association job suspends obtaining the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the latest obtained target data table is later than the event time of the target data table data.
[0176] The first computer device is used to store a target data table, which includes at least one field, and any field is used to fill in data in the data table.
[0177] In one embodiment, if the write progress is earlier than the event time of the target data table data, the data table associated job suspends obtaining the target data table data in the target field of the target data table from the first computer device, which may include: if the number of write progresses of the target field in the target data table is multiple, determining the job identifier of the data table write job used to write the target data table data; if the write progress of the data table write job corresponding to the job identifier to write the data table data to the target field in the target data table is earlier than the event time of the target data table data, suspending obtaining the target data table data in the target field of the target data table from the first computer device.
[0178] When a field is written by multiple data table writing jobs, the field corresponds to multiple writing progresses, and each writing progress is stored in association with the data table identifier, the field identifier, and the job identifier. Therefore, when the data table associated job wants to query the data table data written by a data table writing job in a field of a data table, it can determine the job identifier of the data table writing job used to write the target data table data; if the writing progress of the data table writing job corresponding to the job identifier writing the data table data to the target field in the target data table is earlier than the event time of the target data table data, then the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended.
[0179] In this embodiment, after the data table write job updates the data table, the write progress of the current data table write job is updated to the first computer device; in addition, before querying the target data table data, the data table association job first checks the write progress of the target field of the target data table. If the write progress is earlier than the event time of the target data table data, the data table association job suspends obtaining the target data table data in the target field of the target data table from the first computer device until the write progress of the target field of the target data table newly obtained is later than the event time of the target data table data, thereby improving the accuracy of the target data table data obtained by the data table association job.
[0180] Based on the above Figure 2The data table control method shown, the embodiment of the present application introduces a heartbeat mechanism, specifically, the data table writing job can obtain the current system time every preset period, and update the heartbeat time of the target data table to the current heartbeat time; send the updated heartbeat time of the target data table to the first computer device, so that the first computer device updates the heartbeat time of the target data table to the updated heartbeat time of the target data table. For the data table association job, if the writing progress of the target field of the target data table is earlier than the event time of the target data table data, the data table association job obtains the heartbeat time of the target data table; if the difference between the current system time and the heartbeat time is greater than the second preset duration, the step of pausing the acquisition of the target data table data in the target field of the target data table from the first computer device is triggered. If the difference between the current system time and the heartbeat time is less than or equal to the second preset duration, the target data table data in the target field of the target data table is acquired from the first computer device.
[0181] In the above Figure 2 In the data table control method shown, if the data in the data table write operation is very small, an abnormal blocking problem will occur. Assuming that there is no abnormality or delay in the data table write operation, but there is no new data to be written to the data table at this time, the watermark of the data table write operation will not be updated at this time, and at the same time, the writing progress of the corresponding field in the metadata will not be updated, and it will be maintained at a fixed time. At this time, the event time of the latest processed data of the associated data table associated operation will be greater than the writing progress of the field in the metadata, and blocking will occur at this time. If the data table continues to be not updated, the data table associated operation will continue to be blocked.
[0182] In order to solve this problem, the present application further proposes to use a heartbeat mechanism to solve this problem. An additional heartbeat update strategy can be added to the data table write job, that is, the current system time is periodically submitted as the heartbeat time of the corresponding data table, indicating the survival status of the data table write job. When the heartbeat mechanism is turned on for the data table associated job, when it is found that the data table to be queried is in a delayed state, the data table associated job will check the heartbeat time of the corresponding data table. When the heartbeat time of the data table is within the pre-configured threshold, the data table associated job will regard the current data table state as a low-traffic state. Since the heartbeat time is within the threshold, it is determined that the data table write job is running normally, and the data table associated query is released. On the contrary, if the difference between the heartbeat time and the current time exceeds the pre-configured threshold, the current data table write job is deemed to have failed, and will continue to wait until the data table failure is restored.
[0183] Data table failures usually occur in two scenarios: one is that the job cannot run normally due to a job failure, and the job is in a stopped state; the other is that the data table write job is delayed, resulting in untimely update of the written data. The following will explain the effectiveness of the implementation of the heartbeat mechanism based on these two scenarios.
[0184] When a data table fails, the heartbeat submission fails, and the corresponding heartbeat time in the write progress metadata will be maintained at a fixed time. At this time, the related data table associated jobs fall into a loop check because the write progress and heartbeat of the fields in the write progress metadata have not been updated until the metadata resumes updating. When a data table is delayed, there must be data table write traffic at this time, but the data table write is delayed due to performance issues (if there is no data write, there will be no delay). At this time, the write progress of the corresponding field in the metadata will be updated and it will be in a delayed state. At this time, the heartbeat mechanism will not be triggered to release the data, which will block the data table associated jobs. It can be seen that based on the heartbeat mechanism, the problem of data table association blocking in low-traffic scenarios can be overcome.
[0185] It is understandable that the data table write job will periodically submit the current time as the heartbeat time of the corresponding data table. If the data table write job fails and causes a delay in the data table write, the heartbeat time of the data table will not be the latest time, so the data table associated job can be blocked. If the data table write is delayed due to performance issues, the data table write job will still periodically submit the current time as the heartbeat time of the corresponding data table, then the heartbeat time of the data table will be the latest time, so there is no need to block the data table associated job.
[0186] Based on the above Figure 2 The data table control method shown, the embodiment of the present application introduces a publish-subscribe model.
[0187] Based on the publish-subscribe model, we design the publishing and subscription methods of the data table progress, and based on this, we implement automatic blocking and recovery of data table association. Based on the metadata storage structure defined above, we can characterize the writing progress of different fields of a data table to facilitate query blocking and recovery. In order to enable the writing progress metadata to flow between the data table writing job and the data table association job, this application designs the following based on the publish-subscribe model. Figure 5 Schematic diagram of the metadata delivery model shown.
[0188] Jobs that need to use write progress metadata can be divided into two categories: one is the publisher (Publisher), which refers to the data table write job. In addition to writing the data table data into the data table, the data table write job also needs to write (publish) the field write progress (Progress Meta) into the metadata structure for storage (Progress Channel) for query by the data table associated job. The other is the subscriber (Subscriber), which refers to the data table associated job. Before actually implementing the data table query, the data table associated job can check whether the write progress of the corresponding query field in the data table meets the conditions to decide whether to block the query.
[0189] Based on the above metadata structure and publisher-subscriber model, this application provides Figure 6 The flowchart of another data table control method shown in the figure realizes data alignment in the data table association process.
[0190] The first part is Figure 6 The data table writing process is shown on the right.
[0191] After receiving the data table data, the data table writing job needs to write the data table data into the data table. After the data table data is written, it is necessary to check whether the data table association alignment capability is enabled. If it is not enabled, the process will be directly exited. It can be seen that when this function is not enabled, the data table data writing process has not changed compared to the traditional method.
[0192] When the data table write job checks and finds that this function is enabled, the data table write job further checks the metadata update (publish) strategy configured for the current job. The present application provides two different metadata update (publish) strategies: continuous update (Per Record) and periodic update (Per Interval). Among them, the continuous update strategy will update (publish) the metadata corresponding to the write field every time a new data is processed, and update it to the watermark of the current data table write job. In the periodic update strategy mode, when the data table write job processes a new data, it will first check the difference between the time of the last metadata update and the current time. Only when and only when the difference is greater than the pre-configured threshold, the metadata update (publish) is performed and updated to the watermark of the current data table write job. On the contrary, if the difference is less than the pre-configured threshold, the data table write job will not update (publish) the metadata. These two update strategies have their own advantages and disadvantages. The continuous update strategy can ensure that the write progress stored in the metadata remains up to date, but when the amount of data is large, it may cause the metadata to be updated too frequently, which will have a certain impact on the performance of the data table write job. In contrast, the periodic update strategy has a certain delay in updating metadata compared to the continuous update strategy, but because it is a periodic update, it will not be affected by the amount of data written and is only related to the update interval configured by the user. In high-traffic scenarios, it can significantly reduce the performance loss caused by updating metadata.
[0193] The second part is Figure 6 The data table association process shown on the left. After receiving the data, the data table association job first queries the local cache (Cache: the cache here refers to the temporary storage of historical query results on the local machine to avoid repeated queries on the data table and improve performance), and ends the process when the cache is hit.
[0194] When there is no historical query in the cache, the data table association job attempts to check whether the user has enabled the data table association alignment capability. If not, it directly queries the data table and exits the process afterwards. It is understandable that at this time, the data table association job is not aware of the status of the data table. If the data table write job is delayed or fails, the data table association job is not aware of it, which may cause data association failure, and then cause the data quality of the data table association job processing results to seriously deteriorate, and dirty data will be written to the downstream; if the data table association job detects that the user has enabled the data table association alignment capability, the data table association job first checks the difference between the last update time of the locally stored data table metadata and the current time. If the difference is greater than the local metadata update interval configured by the user, the data table association job will pull the latest metadata corresponding to the data table from the metadata storage and update it to the local metadata.
[0195] Then, the data table association job checks the writing progress of the fields to be queried in the data table metadata. If the writing progress of the fields in the metadata is earlier than the event time of the currently processed data, the data table association job regards the current data table as being in a delayed state, that is, the currently required data has not been written to the data table. At this time, the data table association job will fall into a loop and wait for the next metadata update. If the check finds that the writing progress of the fields in the metadata is later than the event time of the currently processed data by the data table association job, the data table association job allows the query to be released and exits the process after the query.
[0196] Based on the above process, it is not difficult to see that when a data table write job fails, the metadata update is stagnant, which will cause the write progress of all data table fields associated with it to continue to not be updated. At this time, all related data table-related jobs will fall into a loop check because the metadata write progress is not as expected. At this time, no real query will be initiated on the data table, and the current data will not be written to the downstream. When the data table write job is restored, the data table write job will continue to update the write progress of the fields in the metadata. At this time, the jobs associated with these fields will detect the metadata update, and the write progress of the corresponding fields is greater than the event time of the current data processing. In this case, the query on the data table will be resumed, and the data will be released to achieve automatic recovery.
[0197] Based on the above description, the present application provides a Figure 7 The real-time computing engine based on Apache Flink is shown. Apache Flink is a stateful computing distributed processing engine and framework, in which an Apache Flink job consists of a master node (JobManager) and several worker nodes (TaskManager).
[0198] In the working node (TaskManager), there are several task slots (Task Slot), and a task (Task) can be deployed in each task slot. In Flink, each task has completely independent execution logic and does not interfere with each other.
[0199] In the master node (JobManager), the coordinator is an important component, responsible for coordinating the deployment of tasks between working nodes, the creation of snapshots, and fault recovery (a snapshot refers to a backup of the current job state, based on which the job can be restored to the state at the time of the snapshot). In addition, the master node also holds a global aggregator, which can be used to aggregate data between tasks. For example, when we need to know the current progress of the slowest task among all tasks in the entire Flink job, we can apply the global aggregator to summarize the write progress of all tasks and generate a write progress at the current job level.
[0200] In such Figure 7 In the implementation architecture shown, in addition to the data table writing operation and the data table association operation, there is another important participant: the metadata storage medium. The storage medium uses a common key-value pair storage engine, and the present application can also be applied to other storage media for storing metadata structures.
[0201] All tasks in all working nodes in the data table write job submit the write progress (watermark) of the current task to the master node, which summarizes it and hands it over to task 0 (Flink will number all tasks in the job from 0, and task 0 is the first task) to submit it to the metadata storage medium. Only task 0 submits the summarized write progress metadata, which can effectively avoid data competition caused by multiple tasks updating metadata at the same time.
[0202] The storage structure of the data table writing progress metadata at the field granularity is presented in the metadata storage medium, and is agreed upon by the data table writing job, the data table association job and the metadata storage medium to perform writing and reading according to the storage structure.
[0203] Automatic query blocking and recovery are implemented based on the publish-subscribe model, which is implemented in the working node (publisher) of the data table writing job -> metadata storage medium (message pipeline) -> working node (subscriber) of the data table associated job.
[0204] The heartbeat mechanism is implemented in the working node of the data table writing job. When the data table writing job completes a snapshot, Task 0 in the data table writing job submits the current time to the metadata storage medium (the heartbeat is marked with the field name __heartbeat__).
[0205] This application is not limited to the computing engine it relies on, and can also be applied to other computing engines to achieve data accuracy optimization and disaster recovery associated with data tables.
[0206] An embodiment of the present application further provides a computer storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the corresponding methods described in the above embodiments.
[0207] See also Figure 8 , Figure 8 It is a structural schematic diagram of a data table control device provided in an embodiment of the present application.
[0208] In one implementation of the data table control device of the embodiment of the present application, the data table control device includes the following structure.
[0209] An acquiring unit 801 is used to acquire the event time of the target data table data in the target data table to be associated with the data table association operation; wherein the event time refers to the generation time of the target data table data;
[0210] The acquisition unit 801 is further used to acquire a write progress of a target field in the target data table for filling the target data table data; wherein the write progress refers to a watermark of a data table write operation for writing data table data to the target field, and the watermark is used to indicate a maximum event time among event times of at least one data table data written by the data table write operation;
[0211] Processing unit 802 is used to suspend obtaining the target data table data in the target field of the target data table from the first computer device if the writing progress is earlier than the event time of the target data table data, until the writing progress of the target field of the target data table most recently obtained is later than the event time of the target data table data; wherein, the first computer device is used to store the target data table, and the target data table includes at least one field, any field being used to fill in data table data.
[0212] In one embodiment, the acquiring unit 801 acquires the writing progress of the target field in the target data table for filling the target data table data, including:
[0213] Acquire a data table identifier of the target data table and a field identifier of a target field for filling data in the target data table;
[0214] Obtaining the data table identifier and the writing progress associated with the field identifier;
[0215] The acquired writing progress is used as the writing progress of the target field.
[0216] In one embodiment, the acquiring unit 801 acquires the data table identifier and the writing progress associated with the field identifier, including:
[0217] Obtaining a first update time of a first write progress of a target field in the target data table stored locally; wherein the first update time refers to the update time when the data table write job updates the write progress of the target field in the target data table to the first write progress;
[0218] If the difference between the current system time and the first update time is less than or equal to the first preset duration, the writing progress associated with the data table identifier and the field identifier is obtained locally; wherein the writing progress associated with the data table identifier and the field identifier is the first writing progress.
[0219] In one embodiment, the acquisition unit 801 is further configured to acquire the second writing progress associated with the data table identifier and the field identifier from the first computer device if the difference between the current system time and the first update time is greater than the first preset time length;
[0220] The processing unit 802 is further configured to determine the second writing progress as the writing progress associated with the data table identifier and the field identifier;
[0221] The processing unit 802 is further configured to update the writing progress associated with the locally stored data table identifier and the field identifier from the first writing progress to the second writing progress.
[0222] In one embodiment, if the writing progress is earlier than the event time of the target data table data, the processing unit 802 suspends obtaining the target data table data in the target field of the target data table from the first computer device, including:
[0223] If the number of writing progresses of the target field in the target data table is multiple, determining a job identifier of a data table writing job for writing data in the target data table;
[0224] If the writing progress of the data table writing job corresponding to the job identifier to write the data table data to the target field in the target data table is earlier than the event time of the target data table data, then the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended.
[0225] In one embodiment, the acquiring unit 801 acquires the writing progress of the target field in the target data table for filling the target data table data, including:
[0226] Acquire data content of the target data table, wherein the data content includes data table data of at least one field of the target data table and write progress metadata of any field;
[0227] Acquire the write progress metadata of the target field from the data content of the target data table;
[0228] The writing progress of the target field in the target data table is obtained from the writing progress metadata of the target field in the target data table.
[0229] In one embodiment, the acquiring unit 801 acquires the write progress metadata of the target field from the data content of the target data table, including:
[0230] Acquire at least one write progress metadata including a metadata identifier from the data content of the target data table; wherein the metadata identifier is used to indicate that the data is write progress metadata;
[0231] The write progress metadata of the target field is searched from the at least one write progress metadata.
[0232] In one embodiment, the acquisition unit 801 is further used to acquire configuration information, where the configuration information is used to indicate whether to enable the data table control function;
[0233] If the configuration information indicates to enable the data table control function, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
[0234] In one embodiment, the processing unit 802 is further configured to determine whether the target data table data exists in a preset cache; wherein the preset cache includes the data table data obtained by the data table association operation from at least one first computer device that executes a data table write operation;
[0235] The acquisition unit 801 is further configured to acquire the target data table data from the preset cache if the target data table data exists in the preset cache;
[0236] The acquiring unit 801 is further configured to trigger the step of acquiring the event time of the target data table data in the target data table to be associated with the data table association operation if the target data table data does not exist in the preset cache.
[0237] In one embodiment, the acquisition unit 801 is further used to acquire the heartbeat time of the target data table if the writing progress is earlier than the event time of the target data table data; wherein the heartbeat time of the target data table is sent by the data table writing operation every preset period, and the heartbeat time of the target data table refers to the system time when the data table writing operation reaches the preset period;
[0238] The processing unit 802 is further configured to trigger the step of pausing acquisition of the target data table data in the target field of the target data table from the first computer device if the difference between the current system time and the heartbeat time is greater than a second preset duration.
[0239] In one embodiment, the acquisition unit 801 is further used to acquire the target data table data in the target field of the target data table from the first computer device if the difference between the current system time and the heartbeat time is less than or equal to the second preset duration.
[0240] In an embodiment of the present application, if the writing progress of the target field in the target data table used to fill the target data table data is earlier than the event time of the target data table data, the processing unit 802 suspends obtaining the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the latest obtained target data table is later than the event time of the target data table data, thereby achieving the accuracy of the target data table data obtained by the data table association job.
[0241] See also Fig. 9 , Fig. 9 9 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device in the embodiment of the present application includes a power supply module and other structures, and includes a processor 901, a storage device 902, and a communication interface 903. The processor 901, the storage device 902, and the communication interface 903 can exchange data, and the processor 901 implements the corresponding video encoding method.
[0242] The storage device 902 may include a volatile memory, such as a random-access memory (RAM); the storage device 902 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the storage device 902 may also include a combination of the above-mentioned types of memory.
[0243] The processor 901 may be a central processing unit (CPU). The processor 901 may also be a combination of a CPU and a GPU. In the server, multiple CPUs and GPUs may be included as needed to perform corresponding data table control. In one embodiment, the storage device 902 is used to store program instructions. The processor 901 may call program instructions to implement various methods involved in the embodiments of the present application.
[0244] In a first possible implementation, a processor 901 of a computer device calls a program instruction stored in a storage device 902 to obtain an event time of target data table data in a target data table to be associated with a data table association operation; wherein the event time refers to the generation time of the target data table data; obtains a write progress of a target field in the target data table used to fill the target data table data; wherein the write progress refers to a watermark of a data table write operation used to write data table data to the target field, and the watermark is used to indicate a maximum event time among the event times of at least one data table data written by the data table write operation; if the write progress is earlier than the event time of the target data table data, suspending the acquisition of the target data table data in the target field of the target data table from the first computer device until the latest acquired write progress of the target field of the target data table is later than the event time of the target data table data; wherein the first computer device is used to store the target data table, and the target data table includes at least one field, any field being used to fill in data table data.
[0245] In one embodiment, when acquiring the writing progress of the target field in the target data table for filling the target data table data, the processor 901 is configured to perform the following operations:
[0246] Acquire a data table identifier of the target data table and a field identifier of a target field for filling data in the target data table;
[0247] Obtaining the data table identifier and the writing progress associated with the field identifier;
[0248] The acquired writing progress is used as the writing progress of the target field.
[0249] In one embodiment, when acquiring the data table identifier and the write progress associated with the field identifier, the processor 901 is configured to perform the following operations:
[0250] Obtaining a first update time of a first write progress of a target field in the target data table stored locally; wherein the first update time refers to the update time when the data table write job updates the write progress of the target field in the target data table to the first write progress;
[0251] If the difference between the current system time and the first update time is less than or equal to the first preset duration, the writing progress associated with the data table identifier and the field identifier is obtained locally; wherein the writing progress associated with the data table identifier and the field identifier is the first writing progress.
[0252] In one embodiment, the processor 901 is further configured to perform the following operations:
[0253] If the difference between the current system time and the first update time is greater than the first preset time, obtaining the data table identifier and the second writing progress associated with the field identifier from the first computer device;
[0254] Determine the second writing progress as the writing progress associated with the data table identifier and the field identifier;
[0255] The writing progress associated with the locally stored data table identifier and the field identifier is updated from the first writing progress to the second writing progress.
[0256] In one embodiment, when the processor 901 pauses obtaining the target data table data in the target field of the target data table from the first computer device if the writing progress is earlier than the event time of the target data table data, it is configured to perform the following operations:
[0257] If the number of writing progresses of the target field in the target data table is multiple, determining a job identifier of a data table writing job for writing data in the target data table;
[0258] If the writing progress of the data table writing job corresponding to the job identifier to write the data table data to the target field in the target data table is earlier than the event time of the target data table data, then the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended.
[0259] In one embodiment, when acquiring the writing progress of the target field in the target data table for filling the target data table data, the processor 901 is configured to perform the following operations:
[0260] Acquire data content of the target data table, wherein the data content includes data table data of at least one field of the target data table and write progress metadata of any field;
[0261] Acquire the write progress metadata of the target field from the data content of the target data table;
[0262] The writing progress of the target field in the target data table is obtained from the writing progress metadata of the target field in the target data table.
[0263] In one embodiment, when the processor 901 obtains the writing progress metadata of the target field from the data content of the target data table, it is configured to perform the following operations:
[0264] Acquire at least one write progress metadata including a metadata identifier from the data content of the target data table; wherein the metadata identifier is used to indicate that the data is write progress metadata;
[0265] The write progress metadata of the target field is searched from the at least one write progress metadata.
[0266] In one embodiment, the processor 901 is further configured to perform the following operations:
[0267] Acquire configuration information, where the configuration information is used to indicate whether to enable a data table control function;
[0268] If the configuration information indicates to enable the data table control function, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
[0269] In one embodiment, the processor 901 is further configured to perform the following operations:
[0270] Determine whether the target data table data exists in a preset cache; wherein the preset cache includes the data table data obtained by the data table association operation from at least one first computer device that executes a data table writing operation;
[0271] If the target data table data exists in the preset cache, acquiring the target data table data from the preset cache;
[0272] If the target data table data does not exist in the preset cache, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
[0273] In one embodiment, the processor 901 is further configured to perform the following operations:
[0274] If the writing progress is earlier than the event time of the target data table data, the heartbeat time of the target data table is obtained; wherein the heartbeat time of the target data table is sent every preset period of the data table writing operation, and the heartbeat time of the target data table refers to the system time when the data table writing operation reaches the preset period;
[0275] If the difference between the current system time and the heartbeat time is greater than a second preset duration, the step of pausing the acquisition of the target data table data in the target field of the target data table from the first computer device is triggered.
[0276] In one embodiment, the processor 901 is further configured to perform the following operations:
[0277] If the difference between the current system time and the heartbeat time is less than or equal to the second preset duration, the target data table data in the target field of the target data table is obtained from the first computer device.
[0278] In an embodiment of the present application, if the writing progress of the target field in the target data table used to fill the target data table data is earlier than the event time of the target data table data, the processor 901 suspends obtaining the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the latest obtained target data table is later than the event time of the target data table data, thereby achieving the accuracy of the target data table data obtained by the data table association job.
[0279] See also Fig.10 , Fig.10 It is a structural schematic diagram of another data table control device provided in an embodiment of the present application.
[0280] In one implementation of the data table control device of the embodiment of the present application, the data table control device includes the following structure.
[0281] An acquiring unit 1001 is used to acquire the event time of the target data table data during the process of writing the target data table data into the target field of the target data table;
[0282] The processing unit 1002 is configured to update the watermark of the data table writing operation to the event time of the target data table data if the event time of the target data table data is higher than the watermark of the data table writing operation, and update the writing progress of the target field of the target data table to the watermark of the data table writing operation; wherein the data table writing operation refers to the data table writing operation for writing the data table data to the target field of the target data table;
[0283] The sending unit 1003 is used to send the updated writing progress of the target field of the target data table and the target data table data to the first computer device, so that the first computer device stores the target data table data and the updated writing progress of the target field of the target data table.
[0284] In one embodiment, the sending unit 1003 sends the updated writing progress of the target field of the target data table to the first computer device, including:
[0285] Acquire a data table identifier of the target data table, a field identifier of the target field, and a write progress of the target field of the target data table after the update;
[0286] The data table identifier, field identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and field identifier to the updated write progress of the target field of the target data table.
[0287] In one embodiment, the sending unit 1003 sends the data table identifier, the field identifier, and the updated writing progress of the target field of the target data table to the first computer device, including:
[0288] Acquire the write progress metadata of the target field, the write progress metadata including a metadata identifier, the data table identifier, a field identifier, and the updated target field of the target data table; the metadata identifier is used to indicate that the data is write progress metadata;
[0289] The write progress metadata is sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the updated write progress of the target field of the target data table based on the metadata identifier in the write progress metadata.
[0290] In one embodiment, the sending unit 1003 sends the updated writing progress of the target field of the target data table and the target data table data to the first computer device, including:
[0291] If there are multiple data table writing jobs writing data table data to the target field of the target data table, then for the data table writing jobs, obtaining the data table identifier of the target data table, the field identifier of the target field, the job identifier of the data table writing job, and the writing progress of the target field of the target data table after the update;
[0292] The data table identifier, field identifier, job identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier, field identifier and job identifier to the updated write progress of the target field of the target data table.
[0293] In one embodiment, the acquiring unit 1001 acquires the event time of the target data table data during the process of writing the target data table data into the target field of the target data table, including:
[0294] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0295] If the write progress update strategy is a continuous update strategy, the event time of the target data table data is obtained.
[0296] In one embodiment, the acquiring unit 1001 acquires the event time of the target data table data during the process of writing the target data table data into the target field of the target data table, including:
[0297] In the process of writing the target data table data into the target field of the target data table, obtaining a second update time of the writing progress of the target field that was most recently updated;
[0298] If the difference between the current system time and the second update time is greater than a third preset time length, the event time of the target data table data is obtained.
[0299] In one embodiment, the acquiring unit 1001 acquires the second update time of the writing progress of the target field most recently updated during the process of writing the target data table data into the target field of the target data table, including:
[0300] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0301] If the writing progress update strategy is a periodic update strategy, the second update time of the writing progress of the target field that was most recently updated is obtained.
[0302] In one embodiment, the acquisition unit 1001 is further configured to acquire the current system time every preset period, and update the heartbeat time of the target data table to the current heartbeat time;
[0303] The sending unit 1003 is further configured to send the updated heartbeat time of the target data table to the first computer device, so that the first computer device updates the heartbeat time of the target data table to the updated heartbeat time of the target data table.
[0304] In an embodiment of the present application, the acquisition unit 1001 acquires the event time of the target data table data during the process of writing the target data table data into the target field of the target data table; the processing unit 1002 updates the watermark of the data table writing operation to the event time of the target data table data if the event time of the target data table data is higher than the watermark of the data table writing operation, and updates the writing progress of the target field of the target data table to the watermark of the data table writing operation; the sending unit 1003 sends the updated writing progress of the target field of the target data table and the target data table data to the first computer device, so that the first computer device stores the target data table data and the updated writing progress of the target field of the target data table, so that the data table association operation acquires the target data table data when the writing progress of the target field of the target data table is later than the event time of the target data table data, thereby achieving the accuracy of the target data table data acquired by the data table association operation.
[0305] See also Fig. 9 , Fig. 9 9 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device in the embodiment of the present application includes a power supply module and other structures, and includes a processor 901, a storage device 902 and a communication interface 903. The processor 901, the storage device 902 and the communication interface 903 can exchange data, and the processor 901 implements the corresponding video encoding method. The processor 901 can call program instructions to implement various methods involved in the embodiments of the present application.
[0306] In a first possible implementation, the processor 901 of the computer device calls the program instructions stored in the storage device 902 to obtain the event time of the target data table data during the process of writing the target data table data into the target field of the target data table; if the event time of the target data table data is higher than the watermark of the data table write operation, the watermark of the data table write operation is updated to the event time of the target data table data, and the write progress of the target field of the target data table is updated to the watermark of the data table write operation; wherein the data table write operation refers to a data table write operation for writing data table data to the target field of the target data table; the updated write progress of the target field of the target data table and the target data table data are sent to the first computer device, so that the first computer device stores the target data table data and the updated write progress of the target field of the target data table.
[0307] In one embodiment, when the processor 901 sends the updated writing progress of the target field of the target data table to the first computer device through the communication interface 903, it is configured to perform the following operations:
[0308] Acquire a data table identifier of the target data table, a field identifier of the target field, and a write progress of the target field of the target data table after the update;
[0309] The data table identifier, field identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and field identifier to the updated write progress of the target field of the target data table.
[0310] In one embodiment, when the processor 901 sends the data table identifier, the field identifier, and the writing progress of the updated target field of the target data table to the first computer device through the communication interface 903, it is used to perform the following operations:
[0311] Acquire the write progress metadata of the target field, the write progress metadata including a metadata identifier, the data table identifier, a field identifier, and the updated target field of the target data table; the metadata identifier is used to indicate that the data is write progress metadata;
[0312] The write progress metadata is sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the updated write progress of the target field of the target data table based on the metadata identifier in the write progress metadata.
[0313] In one embodiment, when the processor 901 sends the updated writing progress of the target field of the target data table and the target data table data to the first computer device through the communication interface 903, it is configured to perform the following operations:
[0314] If there are multiple data table writing jobs writing data table data to the target field of the target data table, then for the data table writing jobs, obtaining the data table identifier of the target data table, the field identifier of the target field, the job identifier of the data table writing job, and the writing progress of the target field of the target data table after the update;
[0315] The data table identifier, field identifier, job identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier, field identifier and job identifier to the updated write progress of the target field of the target data table.
[0316] In one embodiment, the processor 901 is configured to perform the following operations when acquiring the event time of the target data table data during the process of writing the target data table data into the target field of the target data table:
[0317] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0318] If the write progress update strategy is a continuous update strategy, the event time of the target data table data is obtained.
[0319] In one embodiment, the processor 901 is configured to perform the following operations when acquiring the event time of the target data table data during the process of writing the target data table data into the target field of the target data table:
[0320] In the process of writing the target data table data into the target field of the target data table, obtaining a second update time of the writing progress of the target field that was most recently updated;
[0321] If the difference between the current system time and the second update time is greater than a third preset time length, the event time of the target data table data is obtained.
[0322] In one embodiment, the processor 901 is configured to perform the following operations when acquiring the second update time of the writing progress of the target field that was most recently updated during the process of writing the target data table data into the target field of the target data table:
[0323] In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy;
[0324] If the writing progress update strategy is a periodic update strategy, the second update time of the writing progress of the target field that was most recently updated is obtained.
[0325] In one embodiment, the processor 901 is further configured to perform the following operations:
[0326] Acquire the current system time every preset period, and update the heartbeat time of the target data table to the current heartbeat time;
[0327] The updated heartbeat time of the target data table is sent to the first computer device, so that the first computer device updates the heartbeat time of the target data table to the updated heartbeat time of the target data table.
[0328] In an embodiment of the present application, the processor 901 obtains the event time of the target data table data during the process of writing the target data table data into the target field of the target data table; if the event time of the target data table data is higher than the watermark of the data table writing operation, the watermark of the data table writing operation is updated to the event time of the target data table data, and the writing progress of the target field of the target data table is updated to the watermark of the data table writing operation; the updated writing progress of the target field of the target data table and the target data table data are sent to a first computer device, so that the first computer device stores the target data table data and the updated writing progress of the target field of the target data table, so that the data table association operation obtains the target data table data when the writing progress of the target field of the target data table is later than the event time of the target data table data, thereby achieving the accuracy of the target data table data obtained by the data table association operation.
[0329] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0330] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of this application are still within the scope of the present invention.
Claims
1. A data table control method, characterized in that: include: Acquire the event time of the target data table data in the target data table to be associated in the data table association operation; wherein the event time refers to the generation time of the target data table data; Obtaining a write progress of a target field in the target data table for filling the target data table data; wherein the write progress refers to a watermark of a data table write operation for writing data table data to the target field, and the watermark is used to indicate a maximum event time among event times of at least one data table data written by the data table write operation; If the writing progress is earlier than the event time of the target data table data, suspending the acquisition of the target data table data in the target field of the target data table from the first computer device until the writing progress of the target field of the target data table acquired most recently is later than the event time of the target data table data; wherein, the first computer device is used to store the target data table, and the target data table includes at least one field, any one of which is used to fill in data table data.
2. The method according to claim 1, characterized in that The obtaining the writing progress of the target field in the target data table for filling the target data table data includes: Acquire a data table identifier of the target data table and a field identifier of a target field for filling data in the target data table; Obtaining the data table identifier and the writing progress associated with the field identifier; The acquired writing progress is used as the writing progress of the target field.
3. The method according to claim 2, characterized in that The obtaining of the data table identifier and the writing progress associated with the field identifier includes: Obtaining a first update time of a first write progress of a target field in the target data table stored locally; wherein the first update time refers to the update time when the data table write job updates the write progress of the target field in the target data table to the first write progress; If the difference between the current system time and the first update time is less than or equal to the first preset duration, the writing progress associated with the data table identifier and the field identifier is obtained locally; wherein the writing progress associated with the data table identifier and the field identifier is the first writing progress.
4. The method according to claim 3, characterized in that The method further comprises: If the difference between the current system time and the first update time is greater than the first preset time, obtaining the data table identifier and the second writing progress associated with the field identifier from the first computer device; Determine the second writing progress as the writing progress associated with the data table identifier and the field identifier; The writing progress associated with the locally stored data table identifier and the field identifier is updated from the first writing progress to the second writing progress.
5. The method according to claim 1, characterized in that If the writing progress is earlier than the event time of the target data table data, pausing to obtain the target data table data in the target field of the target data table from the first computer device comprises: If the number of writing progresses of the target field in the target data table is multiple, determining a job identifier of a data table writing job for writing data in the target data table; If the writing progress of the data table writing job corresponding to the job identifier to write the data table data to the target field in the target data table is earlier than the event time of the target data table data, then the acquisition of the target data table data in the target field of the target data table from the first computer device is suspended.
6. The method according to claim 1, characterized in that The obtaining the writing progress of the target field in the target data table for filling the target data table data includes: Acquire data content of the target data table, wherein the data content includes data table data of at least one field of the target data table and write progress metadata of any field; Acquire the write progress metadata of the target field from the data content of the target data table; The writing progress of the target field in the target data table is obtained from the writing progress metadata of the target field in the target data table.
7. The method according to claim 6, characterized in that The acquiring the writing progress metadata of the target field from the data content of the target data table includes: Acquire at least one write progress metadata including a metadata identifier from the data content of the target data table; wherein the metadata identifier is used to indicate that the data is write progress metadata; The write progress metadata of the target field is searched from the at least one write progress metadata.
8. The method according to claim 1, characterized in that The method further comprises: Acquire configuration information, where the configuration information is used to indicate whether to enable the data table control function; If the configuration information indicates to enable the data table control function, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
9. The method according to claim 1, characterized in that The method further comprises: Determine whether the target data table data exists in a preset cache; wherein the preset cache includes the data table data obtained by the data table association operation from at least one first computer device that executes a data table writing operation; If the target data table data exists in the preset cache, acquiring the target data table data from the preset cache; If the target data table data does not exist in the preset cache, the step of obtaining the event time of the target data table data in the target data table to be associated with the data table association operation is triggered.
10. The method according to claim 1, characterized in that The method further comprises: If the writing progress is earlier than the event time of the target data table data, the heartbeat time of the target data table is obtained; wherein the heartbeat time of the target data table is sent every preset period of the data table writing operation, and the heartbeat time of the target data table refers to the system time when the data table writing operation reaches the preset period; If the difference between the current system time and the heartbeat time is greater than a second preset duration, the step of pausing the acquisition of the target data table data in the target field of the target data table from the first computer device is triggered.
11. The method according to claim 10, characterized in that The method further comprises: If the difference between the current system time and the heartbeat time is less than or equal to the second preset duration, the target data table data in the target field of the target data table is obtained from the first computer device.
12. A data table control method, characterized in that: include: In the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data; If the event time of the target data table data is higher than the watermark of the target data table associated job, the watermark of the target data table write job is updated to the event time of the target data table data, and the write progress of the target field of the target data table is updated to the watermark of the target data table write job; wherein the target data table write job refers to a data table write job for writing data table data to the target field of the target data table; The updated writing progress of the target field of the target data table and the target data table data are sent to the first computer device, so that the first computer device stores the target data table data and the writing progress of the target field of the target data table.
13. The method according to claim 12, characterized in that The step of sending the updated writing progress of the target field of the target data table to the first computer device includes: Acquire a data table identifier of the target data table, a field identifier of the target field, and a write progress of the target field of the target data table after the update; The data table identifier, field identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and field identifier to the updated write progress of the target field of the target data table.
14. The method according to claim 13, characterized in that The step of sending the data table identifier, the field identifier, and the updated writing progress of the target field of the target data table to the first computer device includes: Acquire the write progress metadata of the target field, the write progress metadata including a metadata identifier, the data table identifier, a field identifier, and the updated target field of the target data table; the metadata identifier is used to indicate that the data is write progress metadata; The write progress metadata is sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier and the field identifier to the updated write progress of the target field of the target data table based on the metadata identifier in the write progress metadata.
15. The method according to claim 12, characterized in that The step of sending the updated writing progress of the target field of the target data table and the target data table data to the first computer device includes: If there are multiple data table writing jobs writing data table data to the target field of the target data table, then for the target data table writing job, obtaining the data table identifier of the target data table, the field identifier of the target field, the job identifier of the target data table writing job, and the writing progress of the target field of the target data table after the update; The data table identifier, field identifier, job identifier and the updated write progress of the target field of the target data table are sent to the first computer device, so that the first computer device updates the write progress associated with the data table identifier, field identifier and job identifier to the updated write progress of the target field of the target data table.
16. The method according to claim 12, characterized in that In the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data includes: In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy; If the write progress update strategy is a continuous update strategy, the event time of the target data table data is obtained.
17. The method according to claim 12, characterized in that In the process of writing the target data table data into the target field of the target data table, obtaining the event time of the target data table data includes: In the process of writing the target data table data into the target field of the target data table, obtaining a second update time of the writing progress of the target field that was most recently updated; If the difference between the current system time and the second update time is greater than a third preset time length, the event time of the target data table data is obtained.
18. The method according to claim 17, characterized in that The step of obtaining the second update time of the writing progress of the target field when writing the target data table data into the target field of the target data table includes: In the process of writing the target data table data into the target field of the target data table, obtaining a writing progress update strategy; If the writing progress update strategy is a periodic update strategy, the second update time of the writing progress of the target field that was most recently updated is obtained.
19. The method of claim 12, wherein: The method further comprises: Obtain the current system time every preset period, and update the heartbeat time of the target data table to the current heartbeat time; The updated heartbeat time of the target data table is sent to the first computer device, so that the first computer device updates the heartbeat time of the target data table to the updated heartbeat time of the target data table.
20. A computer device, characterized in that: The computer device comprises a processor, a storage device and a communication interface, wherein the processor, the storage device and the communication interface are connected to each other, wherein: The storage device is used to store a computer program, wherein the computer program includes program instructions; The processor is used to call the program instructions to execute the data table control method according to any one of claims 1 to 19.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, they are used to execute the data table control method according to any one of claims 1 to 19.
22. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is suitable for being loaded by a processor and executing the data table control method according to any one of claims 1 to 19.
