Task migration method and device, computer equipment, storage medium and program product

Through batch annotation and parameter adjustment of task metadata, automated task migration is realized, which solves the problems of poor task migration timeliness and manual participation in the existing technology, and improves the accuracy and efficiency of migration.

CN118656358APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410537180.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The existing technology has poor timeliness during the task migration process and requires manual parameter modification, which affects the testing efficiency and may lead to errors.

Method used

By annotating the metadata of the to-be-migrated tasks in batches, copying the task code, adjusting the target parameters based on the annotated metadata, generating a second task code, and uploading it to the target system, automated migration is achieved.

Benefits of technology

It greatly shortens the task migration time, improves the timeliness and accuracy, avoids manual participation, and improves the efficiency of testing work and the accuracy of business system testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656358A
    Figure CN118656358A
Patent Text Reader

Abstract

The invention relates to a task migration method and device, computer equipment, a storage medium and a program product. The task migration method comprises the following steps: labeling metadata of a task to be migrated to obtain labeled metadata; copying a first task code of the to-be-migrated task to obtain a task code copy; adjusting a target parameter in the task code copy based on the annotation metadata to obtain a second task code of the to-be-migrated task; the second task code is online to a target system, and task migration is completed. By adopting the method, the timeliness and accuracy of task migration can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a task migration method, apparatus, computer equipment, storage medium and program product. Background Art

[0002] In the business system, you can perform tasks according to user needs, such as writing data from one table to another. In some application scenarios, tasks in the business system need to be migrated. Traditional migration solutions mainly migrate tasks that need to be migrated one by one, and users need to manually modify parameters during each migration process. Summary of the invention

[0003] Based on this, it is necessary to provide a task migration method, apparatus, computer equipment, computer readable storage medium and computer program product to address the above technical problems, which can effectively improve the timeliness and accuracy of task migration.

[0004] In a first aspect, the present application provides a task migration method, the method comprising:

[0005] The metadata of the task to be migrated is annotated to obtain annotated metadata;

[0006] Copying the first task code of the task to be migrated to obtain a task code copy;

[0007] Based on the annotated metadata, adjusting the target parameters in the task code copy to obtain a second task code for the task to be migrated;

[0008] The second task code is uploaded to the target system to complete the task migration.

[0009] In a second aspect, the present application further provides a task migration device, the device comprising:

[0010] An annotation module is used to annotate the metadata of the task to be migrated to obtain annotated metadata;

[0011] A copy module, used for copying the first task code of the task to be migrated to obtain a task code copy;

[0012] An adjustment module, configured to adjust the target parameters in the task code copy based on the annotated metadata to obtain a second task code for the task to be migrated;

[0013] The migration module is used to upload the second task code to the target system to complete the task migration.

[0014] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the task migration method when executing the computer program.

[0015] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the task migration method are implemented.

[0016] In a fifth aspect, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the task migration method are implemented.

[0017] The above-mentioned task migration method, apparatus, computer equipment, storage medium and computer program product mark the metadata of the task to be migrated, copy the first task code of the task to be migrated, and obtain a task code copy. Therefore, the target parameters in the task code copy can be adjusted based on the marked metadata, so that the metadata can be used to batch modify the relevant parameters in the task code copy to obtain the second task code, which effectively improves the efficiency of parameter modification. Therefore, the second task code can be quickly put online to the target system, which greatly shortens the time of task migration, effectively improves the timeliness of task migration, and avoids manual participation, greatly improving the accuracy of task migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 An application environment diagram of a task migration method in an embodiment;

[0019] Figure 2 A flowchart of a task migration method in one embodiment;

[0020] Figure 3 A schematic diagram of a flow chart of executing a task code of a target task to obtain an output table in one embodiment;

[0021] Figure 4 is a flowchart of a task migration method in another embodiment;

[0022] Figure 5 A schematic diagram of metadata changes during task migration in one embodiment;

[0023] Figure 6 is a structural block diagram of a task migration device in one embodiment;

[0024] Figure 7 is a structural block diagram of a task migration device in another embodiment;

[0025] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] It should be noted that in the following description, the terms "first, second and third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first, second and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0028] The task migration method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 and the server 106 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104 and the server 106, or it can be placed on the cloud or other network servers. The terminal 102 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an Internet of Things device, and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, and a smart car device. The portable wearable device can be a smart watch, a smart bracelet, and a head-mounted device.

[0029] The server 104 and the server 106 can be one server or two independent servers; the server 104 can be installed with a business system, and the server 106 can be installed with a target system (such as a test system). It should be noted that the business system and the target system can be independent systems or different subsystems in the same system.

[0030] In the related art, when it is necessary to migrate tasks in a business system to a target system, the tasks to be migrated are usually migrated one by one, and the user is required to manually modify the parameters during each migration process. For example, in order to avoid the normal operation of the business system, when the business system needs to be tested, the related tasks to be tested need to be migrated to the test system for testing. However, this solution of migrating tasks one by one will greatly prolong the migration time, resulting in poor migration timeliness, seriously affecting the efficiency of the test work, and easily causing errors in task migration.

[0031] The present application provides a task migration method. When it is necessary to migrate a task, the metadata of the task to be migrated is batch labeled, and the first task code of the task to be migrated is copied according to the obtained labeled metadata to obtain a task code copy. Therefore, the target parameters in the task code copy can be adjusted in batches based on the labeled metadata, thereby realizing the use of metadata to modify the relevant parameters of the task code copy to obtain a second task code, which effectively improves the efficiency of parameter modification. Therefore, the second task code can be quickly put online to the target system, such as online to the test system, which can greatly shorten the time of task migration, effectively improve the timeliness of task migration, thereby improving the efficiency of testing work, and avoiding manual participation, greatly improving the accuracy of task migration, and also conducive to improving the accuracy of business system testing.

[0032] In one embodiment, Figure 2 As shown, a task migration method is provided, which can be Figure 1 The method is executed by a server (such as server 104 or server 106) in the embodiment of the present invention, and includes the following steps:

[0033] S202: annotate metadata of the task to be migrated to obtain annotated metadata.

[0034] Among them, a task can be an operation process to be performed when implementing a certain business (or matter), or it can be a task operation item displayed on the business system. When a user clicks the task operation item, a task code in a certain business (or matter) can be executed.

[0035] The tasks to be migrated may refer to tasks that need to be migrated (i.e., copied) from the business system to the target system, such as migrating tasks a and b from the business system to the test system, so that tasks a and b can be tested in the test system without affecting the execution of tasks a and b in the business system.

[0036] The task to be migrated can refer to the task that needs to be migrated (i.e. copied) from the business data to the target system. It should be noted that after the migration is completed, both the business system and the target system exist and can execute the task to be migrated; in addition, the business system and the target system can be independent systems or different subsystems in the same system. For example, task a and task b are migrated from the business system to the test system, so that task a and task b can be tested in the test system without affecting the execution of task a and task b in the business system.

[0037] It should be noted that each task has a corresponding code, which is referred to as the task code in this application for the convenience of description. The task code is as follows:

[0038] The code of task task_a: insert overwrite table db1.table_a select xx fromdb1.table_b / / Select xx data from table b and write it into table a;

[0039] The code of task task_b: insert overwrite table db1.table_b select xx fromdb1.table_c / / Select xx data from table c and write it into table b;

[0040] Task task_c code: insert overwrite table db1.table_c select xx fromdb1.table_d / / Select xx data from table d and write it to table c.

[0041] Metadata can be data used to describe a task, such as a task identifier (such as a task name), task dependencies, or at least one of the input table information or output table information of a task; the input table information of the task can refer to the table information of the input table required to execute the task (such as the input table name), and the output table information can refer to the table information corresponding to the table output after executing the task (such as the output table name). The metadata can be metadata about the task to be migrated in a metadata set, and the metadata set is a set composed of corresponding combinations of metadata of each task. The number of metadata sets can be one or more, and the presentation form can be a table, as shown in Tables 1 to 3, as follows:

[0042] Table 1 Task table relationship

[0043]

[0044] Table 2 Basic information of tasks

[0045]

[0046] Table 3 Task dependencies

[0047]

[0048] The annotated metadata may refer to annotated metadata, such as metadata in which the item “Whether to copy” in Tables 1 to 3 is annotated as yes.

[0049] In one embodiment, the server may batch-label the metadata of the tasks to be migrated to obtain the labeled metadata. For example, the server may create multiple threads or processes and utilize these threads or processes to batch-label the metadata of the tasks to be migrated.

[0050] S204, copying the first task code of the task to be migrated to obtain a task code copy.

[0051] The first task code may be a computer program code for implementing the task to be migrated. The task code copy may be used as the initial task code of the target task, and the initial task code at this time needs to be parameter adjusted according to the annotated metadata, so as to obtain the second task code of the task to be migrated.

[0052] In one embodiment, the server obtains the first task code of the task to be migrated in the business system according to the annotation metadata, and then copies the first task code to obtain a task code copy. In addition, after obtaining the task code copy, the server can also modify the task name corresponding to the task code copy to obtain the task name of the target task (referred to as the target task name), such as task_a_new and task_b_new.

[0053] S206: Adjust the target parameters in the task code copy based on the annotated metadata to obtain a second task code for the task to be migrated.

[0054] The target parameters may be parameters that need to be modified in the task code copy, including a first parameter corresponding to the input table, a second parameter corresponding to the output table, and a third parameter corresponding to the table storage address.

[0055] The second task code of the task to be migrated may refer to the task code of the target task corresponding to the task to be migrated. The target task may be the task corresponding to the task to be migrated and migrated to the target system. For example, if the tasks to be migrated are task_a and task_b, the target tasks may be task_a_new and task_b_new.

[0056] In one embodiment, the server can adjust the parameters corresponding to the input data and output data in the task code copy based on the annotation metadata. The input data can be the data required to perform the task, and the output data can be obtained by processing the data, so the output data can refer to the data output after the task is performed.

[0057] In some actual application scenarios, the input data may be an input table (i.e., a list that needs to be relied upon when executing a task) and the output data may be an output table (i.e., a list to be output after executing a task). Therefore, the parameters corresponding to the input data and the output data may be: identification information used to represent the input data and the output data, specifically, keywords of the input data and the output data (such as the table names of the input table and the output table). For example, when the input data and the output data are the table names of the input table and the output table, respectively, the parameters corresponding to the input data and the output data may be the names of the input table and the output table.

[0058] In one embodiment, the annotation metadata includes input table information and output table information, so the above step S206 may include: based on the input table information, adjusting the first parameter corresponding to the input table in the task code copy; based on the output table information, adjusting the second parameter corresponding to the output table in the task code copy to obtain the second task code for the task to be migrated.

[0059] The input table information may be the table name of the input table, and the output table information may be the table name of the output table. The first parameter may be a parameter in the task code copy corresponding to the input table (such as the table name of the input table). The second parameter may be a parameter in the task code copy corresponding to the output table (such as the table name of the output table).

[0060] For modifying the first parameter corresponding to the input table and the second parameter corresponding to the output table, specific modification methods may include: modifying the input table information and the output table information to obtain target input table information and target output table information; adjusting the first parameter corresponding to the input table in the task code copy to the target input table information; adjusting the second parameter corresponding to the output table in the task code copy to the target output table information.

[0061] For example, the server uses the input table name of the task to be migrated (that is, the table name of the input table) to modify the table name of the input table in the target task code (such as the code of the task task_a_new), such as modifying the table name db1.table_b of the input table in the task code "insert overwritetable db1.table_a select xx from db1.table_b" to "db2.table_b", and obtaining the adjusted task code "insert overwrite tabledb1.table_a select xx from db2.table_b"; then, the server uses the input table name of the task to be migrated to continue to modify the table name of the output table, such as modifying the table name db1.table_a of the output table in the task code "insert overwrite table db1.table_a select xx fromdb2.table_b" to "db2.table_a", and obtaining the task code of the task task_a_new. The task code of the task task_a_new is: insert overwritetable db2.table_a select xx from db2.table_b. Similarly, you can get the task code of task task_b_new: insert overwrite table db2.table_b select xx from db1.table_c.

[0062] In one embodiment, since the annotation metadata includes the task name and task dependency of the task to be migrated, after S206, the server can rename the task name of the task to be migrated to obtain the target task name; and update the first task dependency of the task to be migrated based on the target task name to obtain the second task dependency. At this time, the server can associate the second task dependency with the target task, or associate the second task dependency with the target task after completing the launch.

[0063] The first task dependency relationship of the tasks to be migrated may be the dependency relationship between the tasks to be migrated, and the dependency relationship between the tasks to be migrated and other tasks (ie, tasks that do not need to be migrated) on the business system.

[0064] The second task dependency can be the dependency between target tasks and the dependency between the target task and other tasks on the business system. It should be noted that when it is necessary to execute the target task on the target system, if the target task depends on other tasks, the business system can be called to run the task code of the other business, and then the target task can be executed using the results of the other tasks.

[0065] For example, the server can modify the task name corresponding to the task code copy, such as modifying tasks task_a and task_b to tasks task_a_new and task_b_new, thereby obtaining the task name of the target task. After obtaining the task name of the target task corresponding to the task to be migrated, the task dependency relationship of the task to be migrated is updated using the task name of the target task, that is, modifying task task_a's dependency on task_b and task task_b's dependency on task_c to task task_a_new's dependency on task_b_new and task task_b_new's dependency on task_c, thereby obtaining the task dependency relationship of the target task.

[0066] In one embodiment, after S206, the server may also copy the output table structure to the target database according to the output table information, so that when the task code of the target task is executed after task migration is completed to obtain the corresponding business data, the business data is written into the output table structure.

[0067] In addition to input table information and output table information, the annotation metadata can also include the table storage address. Therefore, when adjusting the target parameters, in addition to adjusting the parameters of the input table and the output table, the table storage address can also be adjusted. Specifically, the server modifies the table storage address to the address of the target database to obtain the target table storage address. The database corresponding to the table storage address is a different database from the target database; the third parameter corresponding to the table storage address in the task code copy is modified to the target table storage address.

[0068] The table storage address may be a database address storing the output table of the task to be migrated. The target table storage address may be a database address storing the output table of the target task. The database corresponding to the table storage address is different from the target database. For example, if the database corresponding to the table storage address is database a, the database corresponding to the target table storage address may be database b.

[0069] The third parameter may be the specific content of the table storage address. Therefore, when adjusting the parameters, the server may modify the third parameter corresponding to the table storage address in the task code copy to the target table storage address, so that the table storage address in the task code copy is updated, that is, the output table before the update is stored in a certain database, and the output table after the update is stored in another database. It should be pointed out that the tasks to be migrated may include not only the tasks involved above (such as list processing tasks), but also tasks for storing lists. The list may refer to the output table of the task to be migrated and the output table of the target task.

[0070] S208, uploading the second task code to the target system to complete the task migration.

[0071] After the second task code is uploaded to the target system, the target task can be executed on the target system, and during the execution of the target task, the execution of tasks on the business system is not affected.

[0072] In one embodiment, the server can compile the task code of the target task to obtain a compiled package; then the compiled package is uploaded to the target system, so that the target task corresponding to the task to be migrated on the business system can be executed on the target system, that is, the same task as the business system can be executed, thereby completing the task migration.

[0073] When there are multiple target tasks, the server may compile the task code of each target task through each compilation thread (or compilation process) during compilation.

[0074] In one embodiment, the target task may be a task obtained after the second task code is uploaded to the target system. Therefore, after completing the task migration, the server may also associate the second task dependency obtained above with the target task, thereby determining the dependency between the target tasks, as well as the dependency between the target task and other tasks. Therefore, when it is necessary to execute tasks, the execution order of each task may be clarified.

[0075] In the above embodiment, the metadata of each task on the big data link is identified in the business system to obtain a metadata set, the metadata of the tasks to be migrated in the metadata set are batch labeled, and the task code of the tasks to be migrated is copied according to the obtained labeled metadata to obtain a task code copy. Therefore, the parameters corresponding to the input data and output data in the task code copy can be adjusted in batches based on the labeled metadata, thereby realizing batch modification of relevant parameters of the tasks to be migrated using metadata to obtain the task code of the target task, effectively improving the efficiency of parameter modification, and therefore the task code of the target task can be quickly uploaded to the target system, such as to the test system, which can greatly shorten the time of task migration, effectively improve the timeliness of task migration, thereby improving the efficiency of testing work, and avoiding manual participation, greatly improving the accuracy of task migration, and also conducive to improving the accuracy of business system testing.

[0076] In one embodiment, before annotating the metadata, the server may first identify the metadata of each task on the big data link in the business system to obtain a metadata set; batch annotate the metadata of the tasks to be migrated in the metadata set to obtain an annotation identifier; and extract the metadata with the annotation identifier in the metadata set to obtain annotated metadata.

[0077] Among them, the business system can be a system used to handle enterprise-related business, including the ERP (Enterprise Resource Planning) system of the production department, the CRM (Customer Relationship Management) system of the sales department, the HRM (Human Resource Management) system of the human resources department, the FA (Financial Accounting) system of the finance department, etc.; it can also be a system used to provide business services to individuals (such as users), such as food delivery systems, commodity sales systems, media service systems (such as video service systems) and life sharing systems.

[0078] A big data link can be a task chain or task tree composed of interdependent tasks. For example, the tasks that need to be performed to achieve a certain business (or matter) are an ordered data structure composed of these tasks, which is a big data link. Different businesses can correspond to different big data links.

[0079] In addition, each task on the big data link can be regarded as a task node on the big data link.

[0080] Specifically, the server can identify the metadata of each task on the big data link in the business system, and the metadata of each task includes the task name, task dependency, input table information, and output table information of each task, and then combine the task name, task dependency, input table information, and output table information of each task to obtain multiple different metadata sets, as shown in Tables 1 to 3. Then, the server annotates the metadata of the task to be migrated in the metadata set to obtain annotated metadata.

[0081] When labeling, the metadata of the tasks to be migrated can be labeled in batches. For example, a multi-threaded approach can be used to batch label the metadata of the tasks to be migrated in the metadata set in parallel, thereby achieving the purpose of batch labeling and effectively improving the labeling efficiency.

[0082] In addition, for determining the tasks to be migrated, the method may include: the server may determine the tasks to be migrated on the big data chain of the business system based on the task migration request input by the user according to actual conditions, or the server may determine the tasks to be migrated on the big data chain of the business system according to specific testing requirements.

[0083] In the above embodiment, the metadata of each task on the big data link is first identified from the business system, and the metadata of the task to be migrated in the obtained metadata set is annotated, so as to extract the annotated metadata, and then these metadata can be used to automatically modify the relevant parameters of the task to be migrated, which is beneficial to improving the efficiency of task migration.

[0084] In one embodiment, Figure 3 As shown, the method also includes:

[0085] S302, copying the output table structure to the target database according to the output table information.

[0086] The target database may be a database for storing data after the task code of the target task is run in the target system. The target database is not the same as the database for storing data after the task code of the task to be migrated is executed in the business system.

[0087] In one embodiment, the server obtains the output table structure of the task to be migrated according to the output table information, and then copies the output table structure to the target database, so that the target database has the output table structure.

[0088] In one embodiment, in the process of adjusting the target parameters in the task code copy, it is taken into account that the server may modify the output table information to obtain the target output table information, and then modify the second parameter corresponding to the output table in the task code copy to the target output table information. Therefore, when copying the output table structure, the server can also copy the output table structure to the target database according to the target output table information.

[0089] S304, running the second task code on the target system to obtain business data.

[0090] The business data may be data obtained after running the task code of the target task, for example, obtaining xx data from table b, and the obtained xx data is the above-mentioned business data.

[0091] In one embodiment, the server responds to the execution operation triggered on the target system and runs the task code of the target task on the target system to obtain the business data. For example, when it is necessary to test the task on the business system, the server does not need to directly test the task on the business system, but can run the task code of the target task on the test system to obtain the corresponding business data.

[0092] S306, writing the business data into the output table structure in the target database to obtain the output table of the second task code.

[0093] The output table of the second task code may refer to the output table of the target task.

[0094] In one embodiment, the server can obtain the output table of the task to be migrated from the business system; if the output table of the target task is the same as the output table of the task to be migrated, the task migration is successful; if the output table of the target task is different from the output table of the task to be migrated, the task migration fails.

[0095] For example, Figure 5 As shown in the figure, the task to be migrated is to select xx data from db1_table_b and write it to db1_table_a, and the target task is to select xx data from db2_table_b and write it to db2_table_a. Moreover, the data in db1_table_b and db2_table_b are both from db1_table_c, that is, the data in db1_table_b and db2_table_b are the same. Therefore, if the migration is successfully completed, the data written in db1_table_a is the same as the data written in db2_table_a. If they are different, it can be determined that the task migration is abnormal.

[0096] In another embodiment, the target system may be another business system, and thus the target task is executed on the other business system, thereby obtaining a corresponding output table, which is the result of executing the target task.

[0097] In another embodiment, the target system may also be a test system, and thus the target task is executed on the test system to obtain a corresponding output table, and then the content of the output table is tested to determine whether the output table meets preset requirements, and further determine whether there are any abnormalities in the tasks to be migrated corresponding to the target task on the business system.

[0098] For example, Figure 5As shown, the target task is to select xx data from db2_table_b and write it into db2_table_a. After obtaining db2_table_a, the content in db2_table_a is detected to determine whether the data written in db2_table_a is xx data. If so, it can be determined that the task to be migrated corresponding to the target task on the business system is normal. If not, it indicates that there is an abnormality in the task to be migrated.

[0099] In order to understand the solution of this application more clearly, Figure 4 and Figure 5 The details are as follows:

[0100] First, the task code and task dependencies are explained as follows:

[0101] 1) Task code content

[0102] Code for task task_a: insert overwrite table db1.table_a select xx from db1.table_b;

[0103] Code for task task_b: insert overwrite table db1.table_b select xx from db1.table_c;

[0104] Code of task task_c: insert overwrite table db1.table_c select xx fromdb1.table_d;

[0105] 2) Task dependencies

[0106] Task task_a depends on task_b, and task task_b depends on task_c.

[0107] like Figure 4 and Figure 5 As shown, the steps for task migration are as follows:

[0108] Step 1: Identify the metadata related to the link (task_c → task_b → task_c) in the current system. The metadata includes:

[0109] Task object information (i.e. task name): task_a, task_b and task_c;

[0110] Task dependency: Task task_a depends on task_b, and task task_b depends on task_c;

[0111] The input table and output table of the task (from corresponds to the input table, and insert corresponds to the output table): the input table of task task_a is db1.table_b, and the output table is db1.table_a; the input table of task task_b is db1.table_c, and the output table is db1.table_b; the input table of task task_c is db1.table_d, and the output table is db1.table_c.

[0112] Step 2: Mark the metadata of the tasks that need to be migrated according to business requirements, thereby marking the scope that needs to be copied and migrated.

[0113] Taking task_a and task_b as the tasks that need to be migrated, the related tasks, dependencies, and table information are marked.

[0114] Step 3: According to the annotation content (i.e., the annotated metadata), extract all the information related to the copied link tasks, including: task object information, task dependency, input table information, and output table information.

[0115] Step 4: Copy the task codes of all tasks that need to be migrated to obtain task code copies.

[0116] The task code copy may be used as the initial task code of the target tasks task_a_new and task_b_new.

[0117] Step 5: According to the annotated metadata, modify the task code copy to obtain the new task code, such as batch modifying the output table into a new table, and batch modifying the input table into a new table.

[0118] The modified task code is as follows:

[0119] Task task_a_new code: insert overwrite table db2.table_a select xx from db2.table_b; task task_b_new code: insert overwrite table db2.table_b select xx from db1.table_c.

[0120] Step 6: Associate the task dependency with the new task code, that is, associate the task dependency with the target task.

[0121] Specifically, the task dependency is modified using the target task name, so as to modify the dependency of the target task and obtain the task dependency of the target task, that is, task task_a_new depends on task_b_new, and task task_b_new depends on task_c.

[0122] Step 7: Copy the output table structure to the new database based on the annotated metadata.

[0123] For example, create a new output table structure using the original table structure as a template, such as Create table db2.table_a like db1.table_a, Create table db2.table_b like db1.table_b.

[0124] Step 8: Release the new task codes online in batches.

[0125] For example, the task codes of tasks task_a_new and task_b_new are released online in batches.

[0126] Step 9: Run the new task code in batches for verification.

[0127] For example, run the task codes of task_a_new and task_b_new to check whether the output tables db2.table_a are consistent with db1.table_a, and whether db2.table_b is consistent with db1.table_a. If the data is consistent, the task migration is successful.

[0128] The existing task migration schemes for big data task links take as little as one month, as much as half a year or even longer to replicate and migrate, and involve too much confirmation and manual participation. The scheme of this application can greatly reduce the complexity of migration operations. It only needs to confirm the terminal task node, eliminating a large number of confirmation links, automating task migration and computational verification, and can complete the migration and obtain the migration results in a short time (such as two days), greatly improving the efficiency of big data task migration.

[0129] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0130] Based on the same inventive concept, the embodiment of the present application also provides a task migration device for implementing the task migration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more task migration device embodiments provided below can refer to the limitations on the task migration method above, and will not be repeated here.

[0131] In one embodiment, Figure 6 As shown, a task migration device is provided, including: an annotation module 602, a copy module 606, an adjustment module 608 and a migration module 610, wherein:

[0132] Annotation module 602, used to annotate metadata of the task to be migrated to obtain annotated metadata;

[0133] A copy module 604, used to copy the first task code of the task to be migrated to obtain a task code copy;

[0134] An adjustment module 606, configured to adjust target parameters in the task code copy based on the annotated metadata to obtain a second task code for the task to be migrated;

[0135] The migration module 608 is used to upload the second task code to the target system to complete the task migration.

[0136] In one embodiment, the annotation module 604 is also used to identify the metadata of each task on the big data link in the business system to obtain a metadata set; batch annotate the metadata of the tasks to be migrated in the metadata set to obtain an annotation identifier; extract the metadata with the annotation identifier in the metadata set to obtain annotated metadata.

[0137] In one embodiment, the annotation module 604 is further used to select tasks to be migrated from tasks on the big data link in response to a task selection operation; identify metadata of the tasks to be migrated in the metadata data set; and annotate the metadata of the tasks to be migrated to obtain an annotation identifier.

[0138] In one embodiment, the annotation metadata includes the task name and task dependency of the task to be migrated; Figure 7 As shown, the device also includes:

[0139] A renaming module 610 is used to rename the task name of the task to be migrated to obtain a target task name;

[0140] An updating module 612, configured to update the first task dependency of the task to be migrated based on the target task name to obtain a second task dependency;

[0141] The association module is used to associate the second task dependency with the second task code, or to associate the second task dependency with the target task; the target task is the task obtained after the second task code is put online to the target system.

[0142] In one embodiment, the annotation metadata includes input table information and output table information;

[0143] The adjustment module 606 is further used to adjust the first parameter corresponding to the input table in the task code copy based on the input table information; and to adjust the second parameter corresponding to the output table in the task code copy based on the output table information to obtain the second task code of the task to be migrated.

[0144] In one embodiment, the annotation metadata also includes a table storage address;

[0145] The adjustment module 606 is also used to modify the table storage address to the address of the target database to obtain the target table storage address, where the database corresponding to the table storage address is different from the target database; and modify the third parameter corresponding to the table storage address in the task code copy to the target table storage address.

[0146] In one embodiment, Figure 7 As shown, the device also includes:

[0147] A copy module 604 is used to copy the output table structure to the target database according to the output table information;

[0148] The running module 714 is used to run the second task code on the target system to obtain business data; write the business data into the output table structure in the target database to obtain the output table of the second task code.

[0149] In one embodiment, Figure 7 As shown, the device also includes:

[0150] Test module 716 is used to obtain the output table of the first task code from the business system; if the output table of the second task code is the same as the output table of the first task code, the task migration is successful; if the output table of the second task code is different from the output table of the first task code, the task migration fails.

[0151] In the above embodiment, the metadata of each task on the big data link is identified in the business system to obtain a metadata set, the metadata of the tasks to be migrated in the metadata set are batch labeled, and the first task code of the task to be migrated is copied according to the obtained labeled metadata to obtain a task code copy. Therefore, the parameters corresponding to the input data and the output data in the task code copy can be adjusted in batches based on the labeled metadata, thereby realizing batch modification of relevant parameters of the metadata task code copy to obtain the second task code, which effectively improves the efficiency of parameter modification. Therefore, the second task code can be quickly put online to the target system, such as online to the test system, which can greatly shorten the time of task migration, effectively improve the timeliness of task migration, thereby improving the efficiency of testing work, and avoiding manual participation, greatly improving the accuracy of task migration, and also conducive to improving the accuracy of business system testing.

[0152] Each module in the task migration device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0153] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store metadata. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task migration method is implemented.

[0154] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0155] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned task migration method when executing the computer program.

[0156] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned task migration method are implemented.

[0157] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned task migration method when executed by a processor.

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

[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0160] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A task migration method, characterized in that: The method comprises: The metadata of the task to be migrated is annotated to obtain annotated metadata; Copying the first task code of the task to be migrated to obtain a task code copy; Based on the annotated metadata, adjusting the target parameters in the task code copy to obtain a second task code for the task to be migrated; The second task code is uploaded to the target system to complete the task migration.

2. The method according to claim 1, characterized in that The metadata of the task to be migrated is annotated to obtain the annotated metadata including: Identify the metadata of each task on the big data link in the business system and obtain the metadata set; Batch labeling of metadata of tasks to be migrated in the metadata set to obtain labeling identifiers; The metadata with the annotation identifier is extracted from the metadata set to obtain the annotated metadata.

3. The method according to claim 2, characterized in that The step of batch-marking the metadata of the tasks to be migrated in the metadata set to obtain the marking identifiers includes: In response to the task selection operation, selecting a task to be migrated from the tasks on the big data link; Identifying metadata of the task to be migrated in the metadata set; The metadata of the task to be migrated is annotated to obtain an annotation identifier.

4. The method according to claim 1, characterized in that: The annotated metadata includes the task name and task dependency of the task to be migrated; after adjusting the target parameters in the task code copy based on the annotated metadata, the method further includes: Rename the task name of the task to be migrated to obtain a target task name; Based on the target task name, the first task dependency of the task to be migrated is updated to obtain a second task dependency; The second task dependency is associated with the second task code, or the second task dependency is associated with a target task; the target task is a task obtained after the second task code is put online to the target system.

5. The method according to any one of claims 1 to 4, characterized in that: The annotation metadata includes input table information and output table information; The step of adjusting the target parameters in the task code copy based on the annotated metadata to obtain the second task code of the task to be migrated includes: Based on the input table information, adjusting a first parameter in the task code copy corresponding to the input table; Based on the output table information, a second parameter corresponding to the output table in the task code copy is adjusted to obtain a second task code for the task to be migrated.

6. The method according to claim 5, characterized in that The annotated metadata also includes a table storage address; and adjusting the target parameters in the task code copy based on the annotated metadata includes: The table storage address is modified to the address of the target database to obtain the target table storage address, wherein the database corresponding to the table storage address is a different database from the target database; The third parameter corresponding to the table storage address in the task code copy is modified to the target table storage address.

7. The method according to claim 6, characterized in that The method further comprises: Copy the output table structure to the target database according to the output table information; After the second task code is uploaded to the target system and task migration is completed, the method further includes: Run the second task code on the target system to obtain business data; The business data is written into the output table structure in the target database to obtain an output table of the second task code.

8. The method according to any one of claim 7, characterized in that: After the second task code is uploaded to the target system and task migration is completed, the method further includes: Acquire an output table of the first task code from the business system; If the output table of the second task code is the same as the output table of the first task code, the task migration is successful; If the output table of the second task code is different from the output table of the first task code, the task migration fails.

9. A task migration device, characterized in that: The device comprises: An annotation module is used to annotate the metadata of the task to be migrated to obtain annotated metadata; A copy module, used for copying the first task code of the task to be migrated to obtain a task code copy; An adjustment module, configured to adjust the target parameters in the task code copy based on the annotated metadata to obtain a second task code for the task to be migrated; The migration module is used to upload the second task code to the target system to complete the task migration.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the task migration method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the task migration method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the task migration method described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Data migration method, device and system, electronic equipment and readable storage medium

    CN111708755A

  • Code migration method and system, computing equipment and storage medium

    CN116737234A

  • Data migration external table management method and device, equipment, storage medium and product

    CN117931775A

  • Method and system for implementing an automated migration tool

    US10311030B1

  • Migrating thin-provisioned volumes in tiered storage architectures

    US20130275694A1