Tag updating method, apparatus, device, and medium

By generating SQL query statements corresponding to the data output table and updating the tag result data table in real time, the problem of low query efficiency of tag result data is solved, achieving efficient querying and resource saving.

CN116860776BActive Publication Date: 2025-12-12政采云股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310827018.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2025-12-12
Estimated Expiration
2043-07-06

AI Technical Summary

Technical Problem

In existing technologies, the query efficiency of tag result data is low, the query speed is slow and consumes cluster resources, especially when the data volume is large and multiple tables are joined, the performance is poor.

Method used

By determining the target configuration information corresponding to the data output table of the current scheduling task, an SQL query statement is generated to obtain the label result data to be updated, and the label result data table is updated in real time. The target data is queried directly from the latest data table, avoiding the frequent generation of SQL query statements and querying of underlying data.

Benefits of technology

It improves the efficiency of tag result data query, reduces query time and cluster resource consumption, and optimizes query performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116860776B_ABST
    Figure CN116860776B_ABST
Patent Text Reader

Abstract

The application discloses a label updating method and device, equipment and medium, and relates to the technical field of computers, comprising: determining target configuration information corresponding to the data output table of the current scheduling task to generate a corresponding first SQL query statement, obtaining to-be-updated label result data corresponding to the first SQL query statement to update the last label result data table and obtain the current label result data table; and if a data query command is received, querying target label result data from the current label result data table based on the data query command. The label management platform updates the label result data table, directly queries the target label result data from the updated label result data table when the data query command is received, avoids query time consumption and cluster resource waste caused by the need to regenerate the SQL query statement and call resources to query the underlying data each time, and improves the query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a label updating method and device, equipment and medium. BACKGROUND

[0002] The underlying data in the label result data comes from a big data platform, the underlying data comes from a Hive table, the data in the Hive table is offline data, most of the data is t+1 output, and the underlying Hive table may be a large table with a large amount of data. If the label result data is real-time query, the query speed is slow due to the large amount of data, and the cluster resources are consumed for each query, which consumes a lot of cluster resources.

[0003] The underlying uses ClickHouse as a database to store the original data of the label dependency, dynamically generates a SQL query statement according to the configuration of the label to query the underlying data, and dynamically generates a SQL query statement for each query, which consumes a lot of cluster resources, and the query is time-consuming in the case of large amount of data. In addition, due to the characteristics of the ClickHouse database, the query performance is poor in the case of multi-table association, and the query performance becomes more and more inefficient as the number of associated tables increases.

[0004] In summary, how to improve the query efficiency of label result data is a problem to be solved in the art. SUMMARY

[0005] Therefore, the purpose of the present application is to provide a label updating method, device, equipment and medium, which can improve the query efficiency of label result data. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a label updating method, comprising:

[0007] determining target configuration information corresponding to a data output table of a current scheduling task, and generating a first SQL query statement corresponding to the target configuration information, and obtaining to-be-updated label result data corresponding to the first SQL query statement;

[0008] updating a previous label result data table based on the to-be-updated label result data to obtain a current label result data table;

[0009] If a data query command is received, the target label result data is queried from the current label result data table based on the data query command.

[0010] Optionally, the target configuration information corresponding to the data output table of the current scheduling task is determined, a first SQL query statement corresponding to the target configuration information is generated, and the to-be-updated label result data corresponding to the first SQL query statement is obtained, including:

[0011] The preset interface of the label management platform is called through the preset task scheduling platform, and the table name of the data output table of the current scheduling task is sent to the label management platform by using the preset interface;

[0012] The target configuration information corresponding to the table name of the data output table is determined, and the to-be-updated label result data corresponding to the first SQL query statement generated based on the target configuration information is obtained.

[0013] Optionally, the target configuration information corresponding to the table name of the data output table is determined, and the to-be-updated label result data corresponding to the first SQL query statement generated based on the target configuration information is obtained, including:

[0014] The target configuration information corresponding to the table name of the data output table is determined from the label configuration information table, and the first SQL query statement generated based on the target configuration information is obtained;

[0015] The StarRocks query engine is used to query the to-be-updated label result data corresponding to the first SQL query statement from the Hive table.

[0016] Optionally, the last label result data table is updated based on the to-be-updated label result data to obtain the current label result data table, including:

[0017] The version number of the to-be-updated label result data is determined;

[0018] The to-be-updated label result data is inserted into the last label result data table based on the version number, and the last label result data table is updated to obtain the current label result data table.

[0019] Optionally, the target label result data is queried from the current label result data table based on the data query command, including:

[0020] The to-be-queried label configuration ID is determined based on the data query command, and it is determined whether the target label result data corresponding to the to-be-queried label configuration ID exists in the current label result data table;

[0021] If the target label result data exists, the target label result data is returned.

[0022] Optionally, after judging whether the target label result data corresponding to the to-be-queried label configuration ID exists in the current label result data table, the method further comprises:

[0023] If not, obtaining to-be-queried configuration information corresponding to the to-be-queried label configuration ID from the label configuration information table, and generating a second SQL query statement corresponding to the to-be-queried configuration information;

[0024] Obtaining target label result data corresponding to the second SQL query statement, returning the target label result data, and updating the current label result data table based on the target label result data.

[0025] Optionally, before determining the target configuration information corresponding to the data output table of the current scheduling task, the method further comprises:

[0026] Obtaining initial label configuration information, and generating a third SQL query statement according to the label configuration information;

[0027] Obtaining initial label result data corresponding to the third SQL query statement, and initializing an original label result data table by using the initial label result data to obtain an initial label result data table.

[0028] In a second aspect, the present application discloses a label updating device, comprising:

[0029] A result data obtaining module is configured to determine target configuration information corresponding to a data output table of a current scheduling task, generate a first SQL query statement corresponding to the target configuration information, and obtain to-be-updated label result data corresponding to the first SQL query statement.

[0030] A data table updating module is configured to update a previous label result data table based on the to-be-updated label result data to obtain a current label result data table.

[0031] A result data querying module is configured to, if a data query command is received, query target label result data from the current label result data table based on the data query command.

[0032] In a third aspect, the present application discloses an electronic device, comprising:

[0033] A memory is configured to save a computer program.

[0034] A processor is configured to execute the computer program to implement the steps of the label updating method disclosed above.

[0035] In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the steps of the label updating method disclosed above.

[0036] The present application has the following beneficial effects: the target configuration information corresponding to the data output table of the current scheduling task is determined, the first SQL query statement corresponding to the target configuration information is generated, and the to-be-updated label result data corresponding to the first SQL query statement is obtained; the last label result data table is updated based on the to-be-updated label result data to obtain the current label result data table; if a data query command is received, the target label result data is queried from the current label result data table based on the data query command. As can be seen, the label management platform obtains the corresponding to-be-updated label result data according to the target configuration information of the data output table of the current scheduling task, which is used to update the last label result data table, so that when the data query command is received, the target label result data can be directly queried from the updated label result data table, that is, the time-consuming caused by the generation of the SQL query statement each time is avoided, and the query time-consuming and the waste of cluster resources caused by the calling of resources to query the underlying data each time are also avoided, thereby improving the query efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of the provided drawings.

[0038] Figure 1 A label updating method flow chart disclosed by the present application;

[0039] Figure 2 A specific label result data initialization diagram disclosed by the present application;

[0040] Figure 3 A specific label result table data storage diagram disclosed by the present application;

[0041] Figure 4 A specific label updating method flow chart disclosed by the present application;

[0042] Figure 5 A specific label result data table updating diagram disclosed by the present application;

[0043] Figure 6 Another specific label updating method flow chart disclosed by the present application;

[0044] Figure 7 A specific data query schematic diagram disclosed by the present application;

[0045] Figure 8 A label updating device structure schematic diagram disclosed by the present application;

[0046] Figure 9 An electronic device structure diagram disclosed by the present application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0048] The underlying data in the label result data comes from a big data platform, the underlying data comes from a Hive table, the data in the Hive table is offline data, most of the data is t+1 output, and the underlying Hive table can be a large table with a large amount of data. If the label result data is real-time query, the query speed is slow due to the large amount of data, and the cluster resources are consumed to query each time, which consumes a lot of cluster resources.

[0049] The underlying ClickHouse is used as a database to store the original data of the label dependency, and a SQL query statement is dynamically generated according to the configuration of the label to query the underlying data. Each query needs to dynamically generate a SQL statement for query, which consumes a lot of cluster resources, and the query is time-consuming in the case of large amount of data. In addition, due to the inherent characteristics of the ClickHouse database, the query performance is poor in the case of multi-table association, and the query performance becomes more and more inefficient with the increase of the number of associated tables.

[0050] Therefore, the present application correspondingly provides a label updating scheme, which can improve the query efficiency of label result data.

[0051] Referring to Figure 1 The embodiments of the present application disclose a label updating method, which comprises:

[0052] Step S11: determining target configuration information corresponding to the data output table of the current scheduling task, and generating a first SQL query statement corresponding to the target configuration information, and obtaining to-be-updated label result data corresponding to the first SQL query statement.

[0053] Before determining the target configuration information corresponding to the data output table of the current scheduling task, the method further includes: obtaining initial label configuration information, generating a third SQL query statement according to the label configuration information; obtaining initial label result data corresponding to the third SQL query statement, and initializing the original label result data table by using the initial label result data to obtain an initial label result data table. For example Figure 2 A specific label result data initialization diagram is shown in FIG. 1. The specific process of label result data initialization is shown in FIG. 2.

[0054] 1) The user sets the configuration information of the corresponding label for each object, and saves the configuration information to initialize the original label configuration information table to obtain the initialized label configuration information table. For example, a specific merchant or other user is marked to describe and classify the attributes and characteristics of the object. The configuration information of the label includes object table and index table information. For example, the object table is a supplier information table, and the index table includes supplier name, GMV (Gross Merchandise Volume, i.e., transaction amount), sales amount, and the like. In this scenario, a condition such as a customer with a sales amount exceeding 100 million yuan is set as a "large customer", and a customer with a sales amount less than 100 million yuan is set as a "small customer".

[0055] 2) The label management platform obtains the initialized label configuration information table. According to the initial label configuration information in the label configuration information table, a corresponding third SQL query statement can be generated, and the third SQL query statement is sent to the StarRocks query engine.

[0056] 3) The StarRocks query engine queries the initial label result data from the Hive table according to the third SQL query statement, for example, the supplier information corresponding to the label. Hive is a data warehouse tool based on Hadoop, which can map structured data files into a database table and provide SQL query functions. It is one of the important components in the Hadoop ecosystem. Hive supports most SQL statements, and can query and analyze data through SQL-like query statements. Hive uses the MapReduce framework of Hadoop at the bottom layer, and can process PB (petabyte) level data.

[0057] 4) The StarRocks query engine obtains the initial label result data, and initializes the original label result data table by using the initial label result data, that is, inserts the initial label result data into the original label result data table, and returns a success state to the label management platform.

[0058] Real-time monitoring whether the last label result data table needs to be updated, the trigger condition for needing to update is that the table name of the data output table of the current scheduling task sent by the preset task scheduling platform is received, that is, when the table name of the data output table is received, updating is started, that is, the target configuration information corresponding to the data output table of the current scheduling task is determined, and the first SQL query statement corresponding to the target configuration information is generated, and the to-be-updated label result data corresponding to the first SQL query statement is obtained.

[0059] Step S12: updating the last label result data table based on the to-be-updated label result data to obtain a current label result data table.

[0060] In the embodiment, the updating the last label result data table based on the to-be-updated label result data to obtain a current label result data table includes: determining a version number of the to-be-updated label result data; inserting the to-be-updated label result data into the last label result data table based on the version number, updating the last label result data table to obtain a current label result data table. For example Figure 3 A specific label result table data storage diagram is shown. The label result table stores four kinds of information, including a label configuration ID (Identity document, namely, identity), an object ID, a label name, and a version number. The version number refers to the time when the label result data is inserted into the last label result data table. The label result data includes the object ID and the label name. When the to-be-updated label result data is obtained, the version number of the to-be-updated label result data is determined. There is only version data for the same label configuration. Therefore, if the data of the old version number is inconsistent with the data of the new version number, the data of the old version number is deleted, and the data of the new version number is inserted into the corresponding position. If the data of the old version number is consistent with the data of the new version number, the old version number can be directly updated to the new version number, and the updating of the label result data table is completed.

[0061] Step S13: if a data query command is received, querying target label result data from the current label result data table based on the data query command.

[0062] In this embodiment, if a data query command is received, the target label result data is queried from the current label result data table according to the label configuration ID of the data query command, that is, the corresponding target label result data is queried from the latest label result data table. It should be noted that only when the latest label result data table does not have the target label result data corresponding to the label configuration ID, a corresponding SQL query statement needs to be regenerated, then the target label result data corresponding to the SQL query statement is queried from the Hive table, and the current label result data table can be updated based on the target label result data, so that when the target label result data is queried again, it can be directly obtained from the label result data without wasting resources to query the Hive table.

[0063] The application has the beneficial effects that the target configuration information corresponding to the data output table of the current scheduling task is determined, a first SQL query statement corresponding to the target configuration information is generated, and the to-be-updated label result data corresponding to the first SQL query statement is obtained; the last label result data table is updated based on the to-be-updated label result data to obtain the current label result data table; if a data query command is received, the target label result data is queried from the current label result data table based on the data query command. As can be seen, the label management platform obtains the to-be-updated label result data corresponding to the target configuration information of the data output table of the current scheduling task, which is used to update the last label result data table, so that when the data query command is received, the target label result data can be directly queried from the updated label result data table, that is, the time-consuming caused by the regeneration of the SQL query statement each time is avoided, and the query time and the waste of cluster resources caused by the calling of resources to query the underlying data each time are also avoided, thereby improving the query efficiency.

[0064] Referring to Figure 4 The embodiment of the application discloses a specific label updating method, which comprises the following steps:

[0065] Step S21: a preset interface of the label management platform is called through a preset task scheduling platform, and a table name of a data output table of a current scheduling task is sent to the label management platform by using the preset interface.

[0066] For example Figure 5One specific label result data table updating schematic diagram is shown, taking a big data platform as a preset task scheduling platform, there are many scheduling tasks in the big data platform, each scheduling task has its corresponding data output table, after the task scheduling is completed, the big data platform will call the preset interface of the label management platform, and the table name of the data output table is transmitted to the label management platform, and the label management platform is informed that the data output table has been updated, so as to trigger the subsequent label result data table updating process.

[0067] Step S22: determining the corresponding target configuration information based on the table name of the data output table, and generating a first SQL query statement based on the target configuration information, and obtaining the to-be-updated label result data corresponding to the first SQL query statement.

[0068] In this embodiment, the target configuration information corresponding to the table name of the data output table is determined, and the first SQL query statement is generated based on the target configuration information, and the to-be-updated label result data corresponding to the first SQL query statement is obtained, including: determining the corresponding target configuration information from the label configuration information table based on the table name of the data output table, and generating a first SQL query statement based on the target configuration information; querying the to-be-updated label result data corresponding to the first SQL query statement from the Hive table by using the StarRocks query engine. The label management platform obtains the corresponding target configuration information from the label configuration information table according to the table name, and dynamically generates a first SQL query statement according to the target configuration information, and sends the first SQL query statement to the StarRocks query engine. The StarRocks query engine queries the to-be-updated label result data corresponding to the first SQL query statement from the Hive table according to the first SQL query statement.

[0069] Step S23: updating the previous label result data table based on the to-be-updated label result data to obtain the current label result data table.

[0070] In this embodiment, the to-be-updated label result data is inserted into the previous label result data table, that is, the label result data of the corresponding old version number is deleted and replaced with the label result data of the new version number, and a message indicating that the label result data updating is successful can also be returned to the label management platform.

[0071] Step S24: if a data query command is received, querying target label result data from the current label result data table based on the data query command.

[0072] Therefore, the label result data table is updated in real time, so that the latest version of label result data is stored in the label result data table. When a data query instruction is received, the latest label result data table can be directly queried, that is, a corresponding SQL query statement does not need to be generated every time, and resources are not occupied to query label result data in the Hive table every time, so that the query efficiency is improved and the computing resources required for query are saved.

[0073] Referring to Figure 6 The embodiment of the application discloses another specific label updating method, which comprises the following steps:

[0074] Step S31: Determine the target configuration information corresponding to the data output table of the current scheduling task, generate a first SQL query statement corresponding to the target configuration information, and obtain the label result data to be updated corresponding to the first SQL query statement.

[0075] Step S32: Update the previous label result data table based on the label result data to be updated to obtain the current label result data table.

[0076] Step S33: If a data query command is received, determine the label configuration ID to be queried based on the data query command, and determine whether the target label result data corresponding to the label configuration ID to be queried exists in the current label result data table.

[0077] For example Figure 7 A specific data query diagram is shown in FIG. 7. When a data query instruction is received, the label configuration ID to be queried is determined according to the data query instruction, and then the latest label result data table is queried, that is, it is determined whether the target label result data corresponding to the label configuration ID to be queried exists in the latest label result data table.

[0078] Step S34: If the target label result data exists, the target label result data is returned.

[0079] It can be understood that if the target label result data corresponding to the label configuration ID to be queried exists in the latest label result data table, the target label result data is returned, and the query process is ended.

[0080] Step S35: If the target label result data does not exist, the configuration information to be queried corresponding to the label configuration ID to be queried is obtained from the label configuration information table, a second SQL query statement corresponding to the configuration information to be queried is generated, target label result data corresponding to the second SQL query statement is obtained, the target label result data is returned, and the current label result data table is updated based on the target label result data.

[0081] In the embodiment, if the target label result data corresponding to the label configuration ID to be queried does not exist in the latest label result data table, the corresponding target label result data needs to be obtained from the underlying table again.

[0082] The label management platform obtains the to-be-queried configuration information corresponding to the to-be-queried label configuration ID from the label configuration information table, and generates a second SQL query statement corresponding to the to-be-queried configuration information. After the StarRocks query engine obtains the second SQL query statement, the target label result data corresponding to the second SQL query statement is obtained from the Hive table according to the second SQL query statement, the target label result data is returned, and the target label result data is inserted into the current label result data table to update the label result data table. In this way, when the target label result data is queried again subsequently, the target label result data can be directly obtained from the label result data table, the query performance is improved, and the fault tolerance of the label result data table is ensured.

[0083] It can be seen that, when data is queried, the present application pre-judges whether the target label result data exists in the current label result data table in order to save time and resources. If the target label result data exists, the SQL query statement does not need to be generated to query the underlying table. Only when the target label result data does not exist in the current label result data table, the corresponding target label result data needs to be obtained from the Hive table, that is, the Hive table is queried at a low frequency, and it is ensured that the query has a return result, thereby ensuring the reliability of the query.

[0084] Referring to Figure 8 The embodiment of the present application discloses a label updating device, which comprises:

[0085] The result data obtaining module 11 is configured to determine the target configuration information corresponding to the data output table of the current scheduling task, generate a first SQL query statement corresponding to the target configuration information, and obtain the to-be-updated label result data corresponding to the first SQL query statement.

[0086] The data table updating module 12 is configured to update the previous label result data table based on the to-be-updated label result data to obtain the current label result data table.

[0087] The result data querying module 13 is configured to query the target label result data from the current label result data table based on the data query command if the data query command is received.

[0088] The application has the beneficial effects that: target configuration information corresponding to the data output table of the current scheduling task is determined, a first SQL query statement corresponding to the target configuration information is generated, and tag result data to be updated corresponding to the first SQL query statement is obtained; the last tag result data table is updated based on the tag result data to be updated to obtain a current tag result data table; if a data query command is received, target tag result data is queried from the current tag result data table based on the data query command. It can be seen that the tag management platform obtains corresponding tag result data to be updated according to the target configuration information of the data output table of the current scheduling task, and the last tag result data table is updated, so that when the data query command is received, the target tag result data can be directly queried from the updated tag result data table, that is, the time consumption caused by the need to generate a SQL query statement each time the query is performed is avoided, and the query time consumption and the waste of cluster resources caused by the need to call resources to query the underlying data each time the query is performed are also avoided, and the query efficiency is improved.

[0089] Further, the application embodiment further provides an electronic device. Figure 9 The electronic device 20 structure diagram shown in the figure cannot be considered as any limitation on the use range of the application.

[0090] Figure 9 The electronic device structure diagram provided by the application embodiment. Specifically, it can include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the tag update method performed by the electronic device disclosed in any of the preceding embodiments.

[0091] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol followed by the communication interface 24 is any communication protocol applicable to the technical solution of the application, which is not limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and the specific interface type can be selected according to the specific application needs, which is not limited here.

[0092] The processor 21 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 21 can also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also known as a CPU (Central Processing Unit), and the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 21 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 21 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.

[0093] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon include an operating system 221, a computer program 222, and data 223, etc., and the storage mode can be temporary storage or permanent storage.

[0094] The operating system 221 is used to manage and control each hardware device on the electronic device and the computer program 222 to realize the operation and processing of the processor 21 on the mass data 223 in the memory 22, and can be Windows, Unix, Linux, etc. In addition to including the computer program capable of completing the tag updating method executed by the electronic device disclosed in any of the preceding embodiments, the computer program 222 can further include a computer program capable of completing other specific work. The data 223 can include data received by the electronic device from an external device, as well as data collected by the self input / output interface 25, etc.

[0095] Further, the embodiments of the present application also disclose a computer readable storage medium, the storage medium stores a computer program, and the computer program is loaded and executed by the processor to realize the method steps executed by the tag updating process disclosed in any of the preceding embodiments.

[0096] Finally, it needs to be pointed out that in this document, relational terms such as first and second and the like can only be intended to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any such actual relationship or order between such entities or operations. Moreover, the terms "comprising", "including", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus including the stated element.

[0097] The above describes in detail a label updating method, device, equipment and medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges can be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A tag updating method, characterized in that, include: Determine the target configuration information corresponding to the data output table of the current scheduling task, generate a first SQL query statement corresponding to the target configuration information, and obtain the tag result data to be updated corresponding to the first SQL query statement; The previous label result data table is updated based on the label result data to be updated, so as to obtain the current label result data table; If a data query command is received, the target tag result data is retrieved from the current tag result data table based on the data query command; The process of determining the target configuration information corresponding to the data output table of the current scheduling task, generating a first SQL query statement corresponding to the target configuration information, and obtaining the tag result data to be updated corresponding to the first SQL query statement includes: The system calls a preset interface of the tag management platform through a preset task scheduling platform, and uses the preset interface to send the table name of the data output table of the current scheduling task to the tag management platform; determines the corresponding target configuration information based on the table name of the data output table, and obtains the tag result data to be updated corresponding to the first SQL query statement based on the target configuration information; The step of updating the previous tag result data table based on the tag result data to be updated, to obtain the current tag result data table, includes: Determine the version number of the tag result data to be updated; based on the version number, insert the tag result data to be updated into the previous tag result data table, update the previous tag result data table, and obtain the current tag result data table.

2. The tag updating method according to claim 1, characterized in that, The step of determining the corresponding target configuration information based on the table name of the data output table, and obtaining the tag result data to be updated corresponding to the first SQL query statement based on the target configuration information, includes: Based on the table name of the data output table, the corresponding target configuration information is determined from the tag configuration information table, and a first SQL query statement is generated based on the target configuration information. Use the StarRocks query engine to retrieve the tag result data to be updated from the Hive table, which corresponds to the first SQL query statement.

3. The tag updating method according to claim 1, characterized in that, The step of retrieving target tag result data from the current tag result data table based on the data query command includes: Based on the data query command, determine the configuration ID of the tag to be queried, and determine whether there is target tag result data corresponding to the configuration ID of the tag to be queried in the current tag result data table; If it exists, the target label result data will be returned.

4. The tag updating method according to claim 3, characterized in that, After determining whether target tag result data corresponding to the queried tag configuration ID exists in the current tag result data table, the method further includes: If it does not exist, retrieve the configuration information to be queried corresponding to the configuration ID to be queried from the label configuration information table, and generate a second SQL query statement corresponding to the configuration information to be queried; Obtain the target tag result data corresponding to the second SQL query statement, return the target tag result data, and update the current tag result data table based on the target tag result data.

5. The tag updating method according to any one of claims 1 to 4, characterized in that, Before determining the target configuration information corresponding to the data output table of the current scheduled task, the process also includes: Obtain initial tag configuration information, and generate a third SQL query statement based on the tag configuration information; Obtain the initial label result data corresponding to the third SQL query statement, and use the initial label result data to initialize the original label result data table to obtain the initial label result data table.

6. A tag updating device, characterized in that, include: The result data acquisition module is used to determine the target configuration information corresponding to the data output table of the current scheduling task, generate a first SQL query statement corresponding to the target configuration information, and obtain the tag result data to be updated corresponding to the first SQL query statement. The data table update module is used to update the previous tag result data table based on the tag result data to be updated, so as to obtain the current tag result data table; The result data query module is used to query the target tag result data from the current tag result data table based on the data query command if a data query command is received. Specifically, the result data acquisition module is used for: The preset task scheduling platform calls the preset interface of the tag management platform, and uses the preset interface to send the table name of the data output table of the current scheduled task to the tag management platform. Based on the table name of the data output table, the corresponding target configuration information is determined, and based on the target configuration information, a first SQL query statement is generated to obtain the tag result data to be updated corresponding to the first SQL query statement. The data table update module is specifically used for: Determine the version number of the tag result data to be updated; based on the version number, insert the tag result data to be updated into the previous tag result data table, update the previous tag result data table, and obtain the current tag result data table.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the tag update method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when executed by a processor, the computer program implements the steps of the tag update method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Label updating method and device, cluster and storage medium

    CN111381854A