Cross-engine switching evaluation methods, devices, storage media and electronic equipment
By using table feature values to determine the consistency of engine results during cross-engine switching, the problem of data consistency verification error in traditional methods is solved, achieving more efficient engine switching and data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2026-03-13
AI Technical Summary
Traditional methods have errors in data consistency verification when switching between engines, and cannot ensure data consistency before and after migration.
The target task is executed by the original engine and the backup engine respectively, and the results are recorded in the disk table. The table feature values are calculated to determine consistency, and the backup engine with consistent table feature values is selected as the candidate switching engine.
It improves the accuracy of data consistency verification during cross-engine switching, ensuring data consistency and efficiency after migration.
Smart Images

Figure CN116991862B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a cross-engine switching evaluation method, apparatus, storage medium, and electronic device. Background Technology
[0002] Traditional data warehouses are built using the Hive computing engine. However, with business growth and the surge in data volume, offline analysis using Hive can no longer meet our needs in terms of resource utilization and response latency. Currently, most internet companies are replacing Hive with Spark SQL as their computing engine to transform their offline data warehouses. To ensure strict consistency of data output before and after the migration, for example, when switching Hive tasks to Spark SQL execution, data comparison is required to ensure consistency during the engine switch. Traditional methods use sampling comparisons to verify data consistency; however, this method inevitably introduces detection errors. Summary of the Invention
[0003] This application provides a cross-engine switching evaluation method, apparatus, storage medium, and electronic device, which can improve the accuracy of consistency verification of execution results obtained from different engines performing the same task.
[0004] In a first aspect, embodiments of this application provide a cross-engine switching evaluation method, including:
[0005] Obtain the original engine and backup engine for executing the target task;
[0006] The target task is executed by the original engine and the backup engine respectively, and the execution results are recorded in the first disk table and the second disk table respectively.
[0007] Determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table;
[0008] Determine whether the feature values of the second table are consistent with the feature values of the first table;
[0009] If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0010] In some embodiments, determining the first table characteristic value of the first disk table and the second table characteristic value of the second disk table includes:
[0011] Each row of data in the first disk table is concatenated to obtain the first concatenated data, and each row of data in the second disk table is concatenated to obtain the second concatenated data.
[0012] The checksum algorithm is used to calculate the checksum of the first concatenated data as the first row feature value, and the checksum algorithm is used to calculate the checksum of the second concatenated data as the second row feature value;
[0013] The first table feature values are obtained by summing the first row feature values corresponding to all rows in the first disk table, and the second table feature values are obtained by summing the second row feature values corresponding to all rows in the second disk table.
[0014] In some embodiments, the step of using the backup engine as a candidate switching engine if the feature value of the second table is consistent with the feature value of the first table includes:
[0015] Obtain the first data row number of the first disk table and the second data row number of the second disk table;
[0016] If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0017] In some embodiments, after selecting the backup engine as the candidate switching engine if the second data row count is the same as the first data row count and the second table feature value is the same as the first table feature value, the method further includes:
[0018] Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0019] If the second execution time is less than the first execution time, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0020] In some embodiments, after selecting the backup engine as the candidate switching engine if the second data row count is the same as the first data row count and the second table feature value is the same as the first table feature value, the method further includes:
[0021] Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0022] If the second computing resource is less than the first computing resource, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0023] In some embodiments, after selecting the backup engine as the candidate switching engine if the second data row count is the same as the first data row count and the second table feature value is the same as the first table feature value, the method further includes:
[0024] Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0025] Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0026] The first execution time and the first computing resources of the original engine are evaluated using a preset quality evaluation model to obtain a first quality evaluation score.
[0027] The second execution time and the second computing resources of the candidate switching engine are evaluated using the preset quality evaluation model to obtain a second quality evaluation score.
[0028] If the second quality evaluation score is greater than the first quality evaluation score, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0029] In some embodiments, before executing the target task through the original engine and the backup engine respectively, and recording the execution results into the first disk table and the second disk table respectively, the method further includes:
[0030] Create the first disk table, which is used to store the execution results of the target task executed by the original engine;
[0031] Create a second disk table, which is used to store the execution results of the target task performed by the backup engine.
[0032] Secondly, embodiments of this application also provide a cross-engine switching evaluation device, comprising:
[0033] The acquisition unit is used to acquire the original engine and backup engine for executing the target task;
[0034] A recording unit is used to execute the target task through the original engine and the backup engine respectively, and record the execution results into the first disk table and the second disk table respectively.
[0035] The determining unit is used to determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table.
[0036] A judgment unit is used to determine whether the feature values of the second table are consistent with the feature values of the first table;
[0037] The selection unit is configured to select the backup engine as a candidate switching engine if the feature value of the second table is consistent with the feature value of the first table.
[0038] Thirdly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when run on a computer, causes the computer to perform the cross-engine switching evaluation method as provided in any embodiment of this application.
[0039] Fourthly, embodiments of this application also provide an electronic device, including a processor and a memory, the memory having a computer program, the processor executing the cross-engine switching evaluation method as provided in any embodiment of this application by calling the computer program.
[0040] The technical solution provided in this application involves obtaining the original engine and backup engine for executing the target task, executing the target task through the original engine and the backup engine respectively, and recording the execution results into a first disk table and a second disk table respectively. A first characteristic value of the first disk table and a second characteristic value of the second disk table are determined, and it is judged whether the second characteristic value is consistent with the first characteristic value. If the second characteristic value is consistent with the first characteristic value, the backup engine is selected as a candidate switching engine. This application verifies the consistency of execution results of different engines executing the same task by comparing whether the table characteristic values are consistent, which can improve the accuracy of consistency verification. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating a cross-engine switching evaluation method provided in an embodiment of this application.
[0043] Figure 2 This is a schematic diagram illustrating the overall implementation logic of the cross-engine switching evaluation method provided in the embodiments of this application.
[0044] Figure 3 This is a schematic diagram of the cross-engine switching evaluation device provided in an embodiment of this application.
[0045] Figure 4This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.
[0047] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0048] This application provides a cross-engine switching evaluation method. The execution entity of this cross-engine switching evaluation method can be the cross-engine switching evaluation device provided in this application, or an electronic device integrating the cross-engine switching evaluation device. The cross-engine switching evaluation device can be implemented in hardware or software. The electronic device can be any device configured with a processor and having processing capabilities, such as a server.
[0049] Please see Figure 1 , Figure 1 This is a flowchart illustrating a cross-engine switching evaluation method provided in an embodiment of this application. The specific process of the cross-engine switching evaluation method provided in this embodiment may include the following steps:
[0050] S110, Obtain the original engine and backup engine for executing the target task.
[0051] The original engine refers to the current engine used to execute the target task. The backup engine refers to an engine other than the original engine.
[0052] For example, the target task can be a Hive task, with the original engine being the Hive engine and the alternative engine being the Spark SQL engine.
[0053] In this context, a Hive task refers to a data processing task written using the Hive query language. The Hive engine refers to the execution engine used by Hive; Hive supports multiple execution engines, including MapReduce, Tez, and Spark.
[0054] The Spark engine refers to the execution engine used by Spark. Spark supports multiple execution engines, including Spark Core, Spark SQL, Spark Streaming, and MLlib.
[0055] It should be noted that a backup engine may include one or more engines.
[0056] S120. The target task is executed by the original engine and the backup engine respectively, and the execution results are recorded in the first disk table and the second disk table respectively.
[0057] In this embodiment, the target task is executed by the original engine and the execution result is recorded in the first disk table. The target task is executed by the backup engine and the execution result is recorded in the second disk table.
[0058] S130. Determine the first table characteristic value of the first disk table and the second table characteristic value of the second disk table.
[0059] In this embodiment, the first table feature value corresponding to the first disk drop table can be calculated, and the second table feature value corresponding to the second disk drop table can be calculated.
[0060] In some embodiments, step S130, "determining the first table characteristic value of the first disk table and the second table characteristic value of the second disk table," may include the following steps:
[0061] S1310. Concatenate each row of data in the first disk table to obtain the first concatenated data, and concatenate each row of data in the second disk table to obtain the second concatenated data.
[0062] S1320. Calculate the checksum of the first concatenated data as the first row feature value using a checksum algorithm, and calculate the checksum of the second concatenated data as the second row feature value using a checksum algorithm.
[0063] For example, the checksum algorithm can be the CRC-32 algorithm. The cyclic redundancy code of the first concatenated data can be calculated using the CRC-32 algorithm as the feature value of the first row, and the cyclic redundancy code of the second concatenated data can be calculated using the same CRC-32 algorithm as the feature value of the second row.
[0064] It should be noted that each row of data in the disk table corresponds to a row feature value.
[0065] S1330. The first row feature values corresponding to all rows in the first disk table are summed to obtain the first table feature values, and the second row feature values corresponding to all rows in the second disk table are summed to obtain the second table feature values.
[0066] In this embodiment, the row feature values (denoted as the first row feature values) corresponding to all rows in the first disk table are summed to obtain the table feature value (denoted as the first table feature value) corresponding to the first disk table. The row feature values (denoted as the second row feature values) corresponding to all rows in the second disk table are summed to obtain the table feature value (denoted as the second table feature value) corresponding to the second disk table.
[0067] S140. Determine whether the feature values of the second table are consistent with the feature values of the first table.
[0068] In this embodiment, it is determined whether the feature value of the second table is the same as the feature value of the first table.
[0069] S150. If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is used as a candidate switching engine.
[0070] In this embodiment, if the feature value of the second table is consistent with the feature value of the first table, it means that the result obtained by the backup engine and the original engine in executing the target task is consistent. Therefore, the backup engine can be selected to execute the target task when executing the target task, and thus the backup engine is used as a candidate switching engine.
[0071] Understandably, if the second table feature value is inconsistent with the first table feature value, it means that the result obtained by the backup engine and the original engine in executing the target task is inconsistent. Therefore, the backup engine cannot be selected to execute the target task, and the backup engine cannot be used as a candidate switching engine.
[0072] In practice, this application is not limited by the execution order of the described steps. Without causing conflicts, some steps may be performed in other orders or simultaneously.
[0073] As can be seen from the above, the cross-engine switching evaluation method provided in this application obtains the original engine and the backup engine for executing the target task, executes the target task through the original engine and the backup engine respectively, and records the execution results into a first disk table and a second disk table respectively. It determines the first characteristic value of the first disk table and the second characteristic value of the second disk table, and judges whether the second characteristic value is consistent with the first characteristic value. If the second characteristic value is consistent with the first characteristic value, the backup engine is selected as a candidate switching engine. This application verifies the consistency of execution results of different engines executing the same task by comparing whether the table characteristic values are consistent, which can improve the accuracy of consistency verification.
[0074] In some embodiments, step S150, "if the feature value of the second table is consistent with the feature value of the first table, then the backup engine is used as a candidate switching engine," may include the following steps:
[0075] S1510. Obtain the first data row number of the first disk table and the second data row number of the second disk table;
[0076] S1520. If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0077] In this embodiment, the number of data rows corresponding to the two disk tables and the table feature values corresponding to the two disk tables are compared. If the number of data rows corresponding to the two disk tables are the same and the table feature values corresponding to the two disk tables are the same, then the execution result obtained by the backup engine and the original engine in executing the target task is the same. Then the backup engine can be used as a candidate switching engine for execution when the target task needs to be executed.
[0078] In some embodiments, after step S1520, "If the second data row number is consistent with the first data row number, and the second table feature value is consistent with the first table feature value, then the backup engine is selected as the candidate switching engine," the following steps may also be included:
[0079] S15210. Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0080] In this embodiment, timing can begin when the original engine executes the target task and end when the original engine finishes executing the target task, with the obtained timing duration serving as the first execution time. Similarly, timing can begin when the backup engine executes the target task and end when the backup engine finishes executing the target task, with the obtained timing duration serving as the second execution time.
[0081] S15220. If the second execution time is less than the first execution time, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0082] In this embodiment, if the second execution time is less than the first execution time, it means that when the backup engine processes the target task, not only is the execution result consistent with the execution result of the original engine, but the execution time spent by the backup engine is also shorter than that of the original engine. In this case, the engine that executes the target task will be switched from the original engine to the candidate switching engine.
[0083] It should be noted that there may be one or more backup engines, and there may also be one or more candidate switching engines. When there are multiple candidate switching engines, the candidate switching engine with the shortest execution time can be selected as the switching engine to execute the target task.
[0084] In some embodiments, after selecting the backup engine as the candidate switching engine if the second data row count is the same as the first data row count and the second table feature value is the same as the first table feature value, the following steps may be further included:
[0085] S15230, Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0086] Computing resources include memory resources and processing resources. The memory and processing resources consumed by the engine when executing tasks can be obtained through the engine's built-in functions.
[0087] S15240. If the second computing resource is less than the first computing resource, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0088] In this embodiment, if the second computing resource is less than the first computing resource, it means that when the backup engine processes the target task, not only is the execution result consistent with the execution result of the original engine, but the computing resources consumed by the backup engine are also less than those of the original engine. In this case, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0089] It should be noted that there may be one or more backup engines, and there may also be one or more candidate switching engines. When there are multiple candidate switching engines, the candidate switching engine with the least computing resources can be selected as the switching engine to perform the target task.
[0090] In some embodiments, after selecting the backup engine as the candidate switching engine if the second data row count is the same as the first data row count and the second table feature value is the same as the first table feature value, the following steps may be further included:
[0091] S15250, Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0092] S15260. Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0093] S15270. The first execution time and the first computing resources of the original engine are evaluated using a preset quality evaluation model to obtain a first quality evaluation score.
[0094] In this embodiment, the preset quality evaluation model can normalize the first execution time and the first computing resources respectively to obtain the normalized first execution time and the normalized first computing resources. Based on the preset first weight value corresponding to the execution time and the preset second weight value corresponding to the computing resources, the corresponding first quality evaluation score is calculated.
[0095] The normalization method used in the preset quality evaluation model can be set by those skilled in the art as needed, and the preset first weight value and preset second weight value can also be set by those skilled in the art. For example, when the time required to execute the target task is short, the preset first weight value can be set larger than the preset second weight value. For example, if the processing resources of the current operating environment are insufficient, the preset first weight value can be set smaller than the second preset weight value. That is to say, in this embodiment, the preset first weight value and the second weight value can be set according to the urgency of the execution target and the available computing resources in the operating environment.
[0096] S15280. The second execution time and the second computing resources of the candidate switching engine are evaluated using the preset quality evaluation model to obtain a second quality evaluation score.
[0097] In this embodiment, the preset quality evaluation model can normalize the second execution time and the second computing resources respectively to obtain the normalized second execution time and the normalized second computing resources. Based on the preset first weight value corresponding to the execution time and the preset second weight value corresponding to the computing resources, the corresponding second quality evaluation score is calculated.
[0098] S15290. If the second quality evaluation score is greater than the first quality evaluation score, then the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0099] In this embodiment, when the second quality evaluation score is greater than the first quality evaluation score, it indicates that the candidate switching engine performs better than the original engine when performing the target task. Therefore, the engine performing the target task can be switched from the original engine to the candidate switching engine.
[0100] In some embodiments, before step S120 "execute the target task through the original engine and the backup engine respectively, and record the execution results into the first disk table and the second disk table respectively", the following steps may also be included:
[0101] S1210. Create the first disk table, which is used to store the execution result of the original engine executing the target task;
[0102] S1220. Create the second disk table, which is used to store the execution results of the target task performed by the backup engine.
[0103] In this embodiment, a disk table is created in advance to record the execution results obtained by the engine in the process of executing the task, and the created disk table is used for subsequent data consistency analysis to determine whether the backup engine can be used as a candidate switching engine to handle the target task.
[0104] In one embodiment, for a clearer illustration of the cross-engine evaluation method provided in this application, please refer to [reference needed]. Figure 2 , Figure 2 This is a schematic diagram illustrating the overall implementation logic of the cross-engine switching evaluation method provided in this application embodiment. For ease of understanding, it is illustrated using the Hive engine as the original engine and the SparkSQL engine as the backup engine. Figure 2 The description may include the following steps:
[0105] Step 1: Select a task, submit it for execution using Hive or SparkSQL engines respectively, and record the results to a disk table;
[0106] Step 2: For the table written to disk, use the Spark engine to execute SQL commands to calculate its feature values. First, concatenate any rows of data together (for collection type fields (such as List), use a custom function to sort them before concatenating). Then, use SparkSQL's built-in CRC32 algorithm to calculate the cyclic redundancy code as the row feature value. Finally, sum the feature values of all rows to obtain the table's feature value.
[0107] Step 3: Add a capability to Spark and Hive to support obtaining the resource consumption (CPU, memory) of a SQL task from Yarn after the task is executed. At the same time, integrate this function into the quality evaluation scheme to supplement the resource consumption and time usage information of the completed task.
[0108] This added capability is a built-in method of the engine itself.
[0109] Step 4: Next, compare the quality of two source tasks using different engines. This mainly involves checking whether the number of rows of data in the disk table output by the task is consistent, whether the table feature values calculated based on CRC32 are consistent, and whether the execution time and resource consumption have been improved. This will give you a definite quality evaluation result.
[0110] Step 5: After obtaining a definitive quality assessment result, a decision can be made on whether to switch the execution engine for the target task in the production environment.
[0111] In one embodiment, a cross-engine switching evaluation apparatus is also provided. See also... Figure 3 , Figure 3 This is a schematic diagram of the cross-engine switching evaluation device 200 provided in an embodiment of this application. The cross-engine switching evaluation device 200 is applied to an electronic device and includes an acquisition unit 201, a recording unit 202, a determination unit 203, a judgment unit 204, and a selection unit 205, as follows:
[0112] Acquisition unit 201 is used to acquire the original engine and backup engine for executing the target task;
[0113] Recording unit 202 is used to execute the target task through the original engine and the backup engine respectively, and record the execution results into the first disk table and the second disk table respectively;
[0114] The determining unit 203 is used to determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table.
[0115] Judgment unit 204 is used to determine whether the feature value of the second table is consistent with the feature value of the first table;
[0116] Selection unit 205 is used to select the backup engine as a candidate switching engine if the feature value of the second table is consistent with the feature value of the first table.
[0117] In some embodiments, the determining unit 203 may be used for:
[0118] Each row of data in the first disk table is concatenated to obtain the first concatenated data, and each row of data in the second disk table is concatenated to obtain the second concatenated data.
[0119] The checksum algorithm is used to calculate the checksum of the first concatenated data as the first row feature value, and the checksum algorithm is used to calculate the checksum of the second concatenated data as the second row feature value;
[0120] The first table feature values are obtained by summing the first row feature values corresponding to all rows in the first disk table, and the second table feature values are obtained by summing the second row feature values corresponding to all rows in the second disk table.
[0121] In some embodiments, the selection unit 205 may be used for:
[0122] Obtain the first data row number of the first disk table and the second data row number of the second disk table;
[0123] If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0124] In some embodiments, the selection unit 205 may also be used for:
[0125] Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0126] If the second execution time is less than the first execution time, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0127] In some embodiments, the selection unit 205 may also be used for:
[0128] Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0129] If the second computing resource is less than the first computing resource, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0130] In some embodiments, the selection unit 205 may also be used for:
[0131] Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task;
[0132] Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task;
[0133] The first execution time and the first computing resources of the original engine are evaluated using a preset quality evaluation model to obtain a first quality evaluation score.
[0134] The second execution time and the second computing resources of the candidate switching engine are evaluated using the preset quality evaluation model to obtain a second quality evaluation score.
[0135] If the second quality evaluation score is greater than the first quality evaluation score, the engine executing the target task will be switched from the original engine to the candidate switching engine.
[0136] In some embodiments, the recording unit 202 may also be used for:
[0137] Create the first disk table, which is used to store the execution results of the target task executed by the original engine;
[0138] Create a second disk table, which is used to store the execution results of the target task performed by the backup engine.
[0139] It should be noted that the cross-engine switching evaluation device provided in this application embodiment belongs to the same concept as the cross-engine switching evaluation method in the above embodiment. The cross-engine switching evaluation device can implement any of the methods provided in the cross-engine switching evaluation method embodiment. For details of its implementation process, please refer to the cross-engine switching evaluation method embodiment, which will not be repeated here.
[0140] Furthermore, to better implement the cross-engine switching evaluation method in the embodiments of this application, this application also provides an electronic device based on the cross-engine switching evaluation method. Please refer to... Figure 4 , Figure 4 A schematic diagram of one structure of the electronic device 300 provided in this application is shown, such as... Figure 4 As shown, the electronic device 300 provided in this application includes a processor 301 and a memory 302. The processor 301 executes the computer program stored in the memory 302 to implement the steps of the cross-engine switching evaluation method as described in the above embodiments of this application, such as:
[0141] Obtain the original engine and backup engine for executing the target task;
[0142] The target task is executed by the original engine and the backup engine respectively, and the execution results are recorded in the first disk table and the second disk table respectively.
[0143] Determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table;
[0144] Determine whether the feature values of the second table are consistent with the feature values of the first table;
[0145] If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0146] For example, a computer program can be divided into one or more modules / units, one or more of which are stored in memory 302 and executed by processor 301 to complete the embodiments of this application. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in a computer device.
[0147] Electronic device 300 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that the illustrations are merely examples of electronic device 300 and do not constitute a limitation on electronic device 300. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, electronic device 300 may also include input / output devices, network access devices, buses, etc., with processor 301, memory 302, input / output devices, and network access devices connected via a bus.
[0148] Processor 301 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of electronic device 300, connecting various parts of the electronic device 300 through various interfaces and lines.
[0149] The memory 302 can be used to store computer programs and / or modules. The processor 301 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 302 and by calling the data stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 300 (such as audio data, video data, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the cross-engine switching evaluation device, electronic device 300 and its corresponding units described above can be referred to the description of the cross-engine switching evaluation method in the above embodiments of this application, and will not be repeated here.
[0151] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0152] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple instructions that can be loaded by a processor to execute steps in the cross-engine switching evaluation method described above, such as:
[0153] Obtain the original engine and backup engine for executing the target task;
[0154] The target task is executed by the original engine and the backup engine respectively, and the execution results are recorded in the first disk table and the second disk table respectively.
[0155] Determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table;
[0156] Determine whether the feature values of the second table are consistent with the feature values of the first table;
[0157] If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is selected as the candidate switching engine.
[0158] For specific instructions, please refer to the description of the cross-engine switching evaluation method in the above embodiments of this application, which will not be repeated here.
[0159] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0160] Since the instructions stored in the computer-readable storage medium can execute the steps in the cross-engine switching evaluation method in the above embodiments of this application, the beneficial effects that the cross-engine switching evaluation method in the above embodiments of this application can achieve can be realized, as detailed in the preceding description, and will not be repeated here.
[0161] Furthermore, the terms "first," "second," and "third," etc., used in this application are used to distinguish different objects, not to describe a specific order. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments may also include steps or modules not listed, or some embodiments may include other steps or modules inherent to these processes, methods, products, or devices.
[0162] The foregoing has provided a detailed description of the cross-engine switching evaluation method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A cross-engine switching evaluation method, characterized in that, include: Obtain the original engine and backup engine for executing the target task; The target task is executed by the original engine and the backup engine respectively, and the execution results are recorded in the first disk table and the second disk table respectively. Determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table; Determine whether the feature values of the second table are consistent with the feature values of the first table; If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is used as a candidate switching engine. Before executing the target task through the original engine and the backup engine respectively, and recording the execution results into the first disk table and the second disk table respectively, the process also includes: Create the first disk table, which is used to store the execution results of the target task executed by the original engine; Create a second disk table, which is used to store the execution results of the target task performed by the backup engine.
2. The cross-engine switching evaluation method as described in claim 1, characterized in that, Determining the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table includes: Each row of data in the first disk table is concatenated to obtain the first concatenated data, and each row of data in the second disk table is concatenated to obtain the second concatenated data. The checksum algorithm is used to calculate the checksum of the first concatenated data as the first row feature value, and the checksum algorithm is used to calculate the checksum of the second concatenated data as the second row feature value; The first table feature values are obtained by summing the first row feature values corresponding to all rows in the first disk table, and the second table feature values are obtained by summing the second row feature values corresponding to all rows in the second disk table.
3. The cross-engine switching evaluation method as described in claim 1, characterized in that, If the feature value of the second table is consistent with the feature value of the first table, then the backup engine is used as a candidate switching engine, including: Obtain the first data row number of the first disk table and the second data row number of the second disk table; If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then the backup engine is selected as the candidate switching engine.
4. The cross-engine switching evaluation method as described in claim 3, characterized in that, If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then after selecting the backup engine as the candidate switching engine, the method further includes: Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task; If the second execution time is less than the first execution time, the engine executing the target task will be switched from the original engine to the candidate switching engine.
5. The cross-engine switching evaluation method as described in claim 3, characterized in that, If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then after selecting the backup engine as the candidate switching engine, the method further includes: Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task; If the second computing resource is less than the first computing resource, the engine executing the target task will be switched from the original engine to the candidate switching engine.
6. The cross-engine switching evaluation method as described in claim 3, characterized in that, If the number of the second data rows is the same as the number of the first data rows, and the feature value of the second table is the same as the feature value of the first table, then after selecting the backup engine as the candidate switching engine, the method further includes: Obtain the first execution time of the original engine executing the target task, and obtain the second execution time of the candidate switching engine executing the target task; Obtain the first computing resources consumed by the original engine in executing the target task, and obtain the second computing resources consumed by the candidate switching engine in executing the target task; The first execution time and the first computing resources of the original engine are evaluated using a preset quality evaluation model to obtain a first quality evaluation score. The second execution time and the second computing resources of the candidate switching engine are evaluated using the preset quality evaluation model to obtain a second quality evaluation score. If the second quality evaluation score is greater than the first quality evaluation score, the engine executing the target task will be switched from the original engine to the candidate switching engine.
7. A cross-engine switching evaluation device, characterized in that, include: The acquisition unit is used to acquire the original engine and backup engine for executing the target task; A recording unit is used to execute the target task through the original engine and the backup engine respectively, and record the execution results into the first disk table and the second disk table respectively. The determining unit is used to determine the first table characteristic value of the first disk drop table and the second table characteristic value of the second disk drop table. A judgment unit is used to determine whether the feature values of the second table are consistent with the feature values of the first table; The selection unit is used to select the backup engine as a candidate switching engine if the feature value of the second table is consistent with the feature value of the first table. The recording unit can also be used for: Create the first disk table, which is used to store the execution results of the target task executed by the original engine; Create a second disk table, which is used to store the execution results of the target task performed by the backup engine.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run on the computer, it causes the computer to perform the cross-engine switching evaluation method as described in any one of claims 1 to 6.
9. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, The processor invokes the computer program to execute the cross-engine switching evaluation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Database verification method and system
CN105989044A
Cross-multi-engine routing processing method and device, equipment and storage medium
CN114020446A