Online service migration verification method and storage medium
By generating equivalent business commands and using multiple business execution engines to execute and compare the results, the problem of inaccurate online business migration verification is solved, ensuring the consistency of the calculation process and data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2022-05-26
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies cannot accurately verify the impact of computing engine upgrades and iterations on online business, and directly verify the potential damage to business data.
By generating multiple equivalent first business commands, executing these commands using multiple different business execution engines, and comparing the results, the accuracy of online business migration is verified, avoiding direct verification of the execution results of the initial business commands.
Ensure consistency in the calculation process across different business execution engines, prevent business data corruption, expand to more business execution engines, and provide more accurate migration verification.
Smart Images

Figure CN117170829B_ABST
Abstract
Description
Technical Field
[0001] This application mainly relates to the field of big data, specifically to an online business migration verification method and storage medium. Background Technology
[0002] As businesses expand, the demand for computing resources for offline computing tasks increases dramatically. At the same time, new technologies are constantly being updated and iterated, and the switching and optimization of computing engines are inevitable. There is a lack of an effective means to compare and evaluate the accuracy and performance changes of actual data computing in online business.
[0003] Currently, the industry generally uses standard datasets to verify performance and results. The most commonly used are data analysis benchmark tests (TPC-H) and TPC-DS tests. These types of testing methods are based on a series of standards and templates such as ANSI, DB2, and SQL Server to build test datasets, result sets, and test SQL, which can effectively compare static data and performance.
[0004] In the field of big data, computing engines such as Hive, Spark, and Flink have their own specific syntax features and do not fully conform to standard SQL syntax. For flexible and ever-changing real-world business operations, traditional methods cannot accurately verify whether upgrades and iterations of computing engines will affect the accuracy of business operations. Online business operations cannot be interrupted, and business SQL cannot be directly used for verification, otherwise potential anomalies may lead to the corruption of business data. For flexible online business operations, traditional testing methods are clearly inadequate. Summary of the Invention
[0005] This application provides an online business migration verification method and storage medium, aiming to solve the problems of inaccurate online business migration verification and easy damage to business data under the existing technology.
[0006] Firstly, this application provides an online business migration verification method, applied to an online business migration verification system, wherein the online business migration verification system includes a testing system, and the testing system includes multiple different business execution engines; the method includes:
[0007] Receive a task command for migrating the target service, wherein the task command for migrating the service includes a task identifier parameter;
[0008] Obtain the original business command corresponding to the task identifier parameter, wherein the original business command includes task information corresponding to the task identifier parameter;
[0009] processing the original business command to generate a plurality of equivalent first business commands, the plurality of equivalent first business commands performing the same calculation logic, and the plurality of equivalent first business commands corresponding to a plurality of business execution results written to different target library tables;
[0010] controlling a plurality of different business execution engines to execute the plurality of equivalent first business commands to obtain a plurality of business execution results;
[0011] According to the plurality of business execution results, the migration of the target business is verified.
[0012] In some possible embodiments, the online business migration verification system further includes a scheduling center; the original business command corresponding to the task identification parameter is obtained, and the original business command includes task information corresponding to the task identification parameter, including:
[0013] sending the task identification parameter to the scheduling center;
[0014] After the scheduling center verifies the task identification parameter successfully, the original business command corresponding to the task identification parameter from the scheduling center is received;
[0015] The original business command includes task information corresponding to the task.
[0016] In some possible embodiments, the original business command is processed to generate a plurality of equivalent first business commands, including:
[0017] The original business command is replaced by a constant and a scheduling period to generate a second business command;
[0018] The second business command is replaced by syntax to generate a plurality of equivalent first business commands;
[0019] The plurality of equivalent first business commands perform the same calculation logic, and the plurality of equivalent first business commands correspond to a plurality of business execution results written to different target library tables.
[0020] In some possible embodiments, the original business command includes a user-defined business constant parameter and a business scheduling period;
[0021] The original business command is replaced by a constant and a scheduling period to generate a second business command, including:
[0022] The initial storage location of the original business command where the execution result is written is replaced by a target storage location to obtain a third business command;
[0023] According to the service constant parameter and the service scheduling period, the third service command is replaced by a service constant and a service scheduling period to obtain the second service command.
[0024] In some possible embodiments, the plurality of different service execution engines controlled by the preset execute the plurality of equivalent first service commands respectively to obtain a plurality of service execution results, including:
[0025] The plurality of equivalent first service commands are encapsulated to generate a plurality of to-be-executed tasks.
[0026] The plurality of different service execution engines controlled by the preset execute the plurality of to-be-executed tasks respectively to obtain a plurality of service execution results.
[0027] In some possible embodiments, the plurality of equivalent first service commands are encapsulated to generate a plurality of to-be-executed tasks, including:
[0028] A plurality of encapsulation standards corresponding to each service execution engine in the plurality of service execution engines are determined to obtain the plurality of encapsulation standards.
[0029] The plurality of equivalent first service commands are encapsulated by using the plurality of encapsulation standards to obtain a plurality of execution parameters, each execution parameter in the plurality of execution parameters corresponding to a to-be-executed task.
[0030] Each service execution engine corresponds to an execution parameter, and the service execution engine executes a task by using the execution parameter; and the plurality of execution parameters exist in a list form.
[0031] In some possible embodiments, the plurality of different service execution engines controlled by the preset execute the plurality of to-be-executed tasks respectively to obtain a plurality of service execution results, including:
[0032] Any service execution engine in the plurality of service execution engines is taken as a target service execution engine, and any execution parameter in the plurality of execution parameters is taken as a target execution parameter, to determine whether the target service execution engine matches the target execution parameter.
[0033] If the target service execution engine matches the target execution parameter, the target service execution engine is used to execute the target execution parameter to obtain a service execution result corresponding to the target execution parameter.
[0034] It is determined whether a plurality of service execution results corresponding to a quantity of the plurality of execution parameters are received.
[0035] If the plurality of service execution results corresponding to the quantity of the plurality of execution parameters are received, it is determined that the plurality of to-be-executed tasks are all executed, and the plurality of service execution results are obtained.
[0036] In some possible embodiments, the migration of the target service is verified according to the multiple service execution results. The method comprises:
[0037] determining whether the task identification parameter comprises a verification parameter;
[0038] if the task identification parameter comprises the verification parameter and the verification parameter is verification, comparing the multiple service execution results to obtain a comparison result;
[0039] verifying the migration of the target service according to the comparison result.
[0040] In some possible embodiments, the method further comprises:
[0041] if the task identification parameter comprises the verification parameter and the verification parameter is no verification, not comparing the multiple service execution results;
[0042] if the task identification parameter does not comprise the verification parameter, obtaining a configuration file of a test system to determine whether the multiple service execution results need to be compared according to the configuration file of the test system.
[0043] In a second aspect, an embodiment of the present application provides a computer readable storage medium, which stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the steps in the online service migration verification method according to any one of the above aspects.
[0044] The present application provides an online service migration verification method and a storage medium. The task identification parameter is used to identify and obtain task information comprising an original service command. The task information is processed to generate multiple equivalent first service commands. The multiple equivalent first service commands perform the same calculation logic, and the multiple equivalent first service commands correspond to different target library tables in which the execution results are written. Multiple different service execution engines execute different first service commands to obtain multiple service execution results. Finally, the multiple service execution results are compared to verify the migration of the online service. The present application processes the initial service command to obtain multiple equivalent first service commands suitable for different service execution engines, avoids directly verifying the execution result of the initial service command, and avoids the possibility of damaging the service data. Since the equivalent first service commands perform the same calculation logic, the consistency of the calculation process of different service execution engines can be ensured. Since multiple different service execution engines can be included in the execution module, the online service migration verification method provided by the present application can be extended to more service execution engines. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0046] Figure 1 is a scene schematic diagram of an online service migration verification system provided by an embodiment of the present application;
[0047] Figure 2 is an embodiment flow schematic diagram of an online service migration verification method provided by an embodiment of the present application;
[0048] Figure 3 is an embodiment flow schematic diagram of obtaining an original service command provided by an embodiment of the present application;
[0049] Figure 4 is an embodiment flow schematic diagram of generating a plurality of equivalent first service commands provided by an embodiment of the present application;
[0050] Figure 5 is an embodiment flow schematic diagram of obtaining a plurality of service execution results provided by an embodiment of the present application;
[0051] Figure 6 is an embodiment flow schematic diagram of obtaining a plurality of service execution results provided by an embodiment of the present application;
[0052] Figure 7 is an embodiment schematic diagram of an online service migration verification system provided by an embodiment of the present application;
[0053] Figure 8 shows a structural schematic diagram of a computer device related to an embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described clearly and completely in the following description with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0055] In the description of the present application, it needs to be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element indicated must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second" are only for description purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can be explicitly or implicitly included one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.
[0056] In the present application, the word "exemplary" is used to mean "serving as an example, instance, or illustration." Any implementation described as "exemplary" in the present application is not necessarily to be construed as preferred or advantageous over other implementations. The following description is presented to enable any person skilled in the art to make and use the present application. In the following description, for purposes of explanation, specific details are set forth. It will be apparent to those skilled in the art that the present application can be practiced without using these specific details. In other instances, well-known structures and processes are not elaborated in order not to obscure the description of the present application with unnecessary details. Thus, the present application is not intended to be limited by the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
[0057] Embodiments of the present application provide an online service migration verification method and a storage medium, which are described in detail below.
[0058] Please refer to Figure 1 , Figure 1 The scene schematic diagram of the online service migration verification system provided by the embodiments of the present application can include a computer device 100, and the online service migration verification system is integrated in the computer device 100.
[0059] In the embodiments of the present application, the computer device 100 can be a stand-alone server, or a server network or a server cluster composed of servers. For example, the computer device 100 described in the embodiments of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets, or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0060] In the embodiments of the present application, the computer device 100 described above can be a general-purpose computer device or a special-purpose computer device. In specific implementation, the computer device 100 can be a desktop computer, a laptop computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, etc. The embodiments are not limited to the type of the computer device 100.
[0061] Those skilled in the art can understand that the application environment shown in the above is only one application scenario of the present application scheme, and does not constitute a limitation on the application scenario of the present application scheme. Other application environments can include more or fewer computer devices than those shown in the above, for example, the application environment shown in the above includes only one computer device, and it can be understood that the online service migration verification system can also include one or more other computer devices that can process data, which is not limited specifically herein. Figure 1 Figure 1 The embodiments are not limited to the type of the computer device 100. Figure 1 The embodiments are not limited to the type of the computer device 100.
[0062] In addition, as shown in the above, the online service migration verification system can also include a storage unit 200 for storing data. Figure 1 It should be noted that the scenario diagram of the online service migration verification system shown in the above is only one example. The online service migration verification system and the scenario described in the embodiments of the present application are for more clearly explaining the technical scheme of the present application, and do not constitute a limitation on the technical scheme provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of the online service migration verification system and the appearance of new service scenarios, the technical scheme provided by the embodiments of the present application is also applicable to similar technical problems.
[0063] Figure 1 In the embodiments of the present application, the online service migration verification method is applied to the online service migration verification system, and the online service migration verification system can include a test system, and the test system includes a plurality of different service execution engines.
[0064] As shown in the above,
[0065] As shown in the above, Figure 2 Figure 2 is an embodiment flow diagram of the online service migration verification method in the embodiments of the present application. The online service migration verification method includes the following steps:
[0066] 21. Receiving a task command of target service migration, and the task command of service migration includes a task identification parameter.
[0067] In the embodiments of the present application, the results of different computing engines processing the same task are compared to determine whether the different engines can be switched to execute the same task without affecting the execution result.
[0068] Therefore, the embodiments of the present application provide a task command for service migration to execute the task by using different service execution engines subsequently, and compare the execution results of the service execution engines to determine whether the subsequent service can be migrated.
[0069] It should be noted that the task command for service migration provided by the embodiments of the present application is not to migrate the service, but to provide a task for verifying whether the task can be migrated; and the main purpose is to obtain the respective service execution results of different service execution engines executing the same task.
[0070] 22. Obtain an original service command corresponding to the task identification parameter, wherein the original service command includes task information corresponding to the task identification parameter.
[0071] In the embodiments of the present application, the received task identification parameter and the specific task information are decoupled, and the received task identification parameter only includes the application (app) to be called this time, but does not include the function that the called application can implement and the specific way to implement the function. Therefore, the task information corresponding to the task identification parameter needs to be obtained from other places according to the task identification parameter. Meanwhile, the original service command corresponding to the task information needs to be generated.
[0072] The task identification parameter can be an application selected by a user or a specific task to be executed. Generally, the task identification parameter is generated by the user according to actual needs, and the task information in the original service command can be determined according to a preset task command and task information correspondence.
[0073] For example, the task command and task information correspondence can include: obtaining information of an application according to task command A; and adjusting a state of an application according to task command B. The task command and the task information in the embodiments of the present application are correspondingly set, and the user can generate different task commands according to actual needs.
[0074] In one specific embodiment, the task command input by the user can include a unique task identification parameter appID, and the appID can represent the app called by the user this time. Further, the task identification parameter can also be taskID, that is, the ID corresponding to a specific task (task) performed by the user after calling the app. Generally, the IDs of the application (app) and the task (task) are unique.
[0075] It should be noted that the task identification parameter and the task information are pre-configured, and the user only needs to select the corresponding task identification parameter according to the actual demand.
[0076] 23. processing the original service command to generate a plurality of equivalent first service commands.
[0077] Since the embodiments of the present application use multiple different service execution engines to execute the same service, obtain multiple service execution results, and compare the multiple service execution results to compare the accuracy and efficiency of the multiple service execution engines executing the same service according to the comparison of the multiple service execution results. Therefore, multiple different service execution engines are needed to execute the same service in the embodiments of the present application.
[0078] However, since the multiple service execution engines have specific syntax characteristics, the original service command needs to be processed to generate a plurality of equivalent first service commands before executing the service.
[0079] Among them, the equivalent service command represents the same calculation logic executed by the multiple equivalent first service commands, that is, the same goal needs to be achieved; but the target library table corresponding to the multiple execution results after the execution of the multiple equivalent first service commands is different, that is, the multiple execution results are stored in different positions. The number of multiple equivalent first service commands is determined according to the task identification parameter. This is because the task identification parameter is generated by the user according to the actual demand, and when the task identification parameter is generated, it is determined which service execution engines need to be called for comparison, that is, the number of service execution engines called for this task is determined.
[0080] At the same time, since the multiple service execution engines in the embodiments of the present application are pre-set according to the actual demand, the number and types of service execution engines can be increased or decreased according to the actual demand, which can effectively improve the scalability of the online service migration verification method provided by the embodiments of the present application.
[0081] For example, with the increase of services, or the appearance of new service execution engines, the number of service execution engines can be increased to perform the service migration verification method provided by the embodiments of the present application to determine whether subsequent services can be executed in the newly added service execution engines.
[0082] 24. Control the preset multiple different service execution engines to execute the multiple equivalent first service commands respectively to obtain multiple service execution results.
[0083] 25. Verify the migration of the target service according to the multiple service execution results.
[0084] After the plurality of equivalent first business commands are executed by the plurality of different business execution engines respectively, a plurality of business execution results are obtained, and whether the online business can be migrated is determined according to the plurality of business execution results.
[0085] Specifically, the plurality of business execution results can be compared to verify the migration of the target business according to the comparison result. The comparison of the plurality of business execution results is mainly to compare the differences between the plurality of business execution results. If the difference between the plurality of business execution results is within the preset difference range, it means that the execution results will not be affected when the same business is executed by different business execution engines, and the business can be migrated to different business execution engines for execution. When the business execution engine is upgraded or replaced, the accuracy of the business will not be affected.
[0086] The online business migration verification method provided by the application uses the task identification parameter to identify and obtain task information including the original business command, processes the task information to generate a plurality of equivalent first business commands, the plurality of equivalent first business commands execute the same calculation logic, and the execution results corresponding to the plurality of equivalent first business commands are written to different target library tables. Different business execution engines execute different first business commands respectively to obtain a plurality of business execution results. Finally, the plurality of business execution results are compared to verify the migration of the online business. The application processes the initial business command to obtain a plurality of equivalent first business commands suitable for different business execution engines, avoids directly verifying the execution result of the initial business command, and avoids the possibility of damaging the business data. Since the equivalent first business commands execute the same calculation logic, the consistency of the calculation process of different business execution engines can be ensured. At the same time, since the execution module can include a plurality of different business execution engines, the online business migration verification method provided by the application can be extended to more business execution engines.
[0087] It should be noted that the plurality of equivalent first business commands execute the same calculation logic, which does not mean that the plurality of equivalent first business commands perform the same calculation process in different business execution engines; it only means that the plurality of equivalent first business commands need to obtain the same execution result in different business execution engines. For example, the same formula is calculated by a plurality of different business execution engines, regardless of the calculation process, and a calculation result will be obtained finally.
[0088] However, since there are a plurality of execution results corresponding to a plurality of different business execution engines, the different execution results need to be stored in different positions to distinguish the different execution results. Usually, when a plurality of execution results are generated or stored, a flag bit is generated to determine the storage position of the execution result and determine which business execution engine corresponds to the execution result.
[0089] In embodiments of the present application, the online service migration verification system further comprises a scheduling center for managing jobs, job scheduling periods and initiating scheduling tasks; this makes the task identification parameters and specific task information received by the online service migration verification system decoupled, i.e. the specific task information is not included in the task identification parameters, but the task information corresponding to the task identification parameters is obtained from the external scheduling center according to the task identification parameters. As shown in Figure 3 The original service command can be obtained, which can include:
[0090] 31. The task identification parameters are sent to the scheduling center.
[0091] 32. After the task identification parameters are verified successfully in the scheduling center, the task information corresponding to the task identification parameters from the scheduling center is received.
[0092] In embodiments of the present application, the task identification parameters and the specific task information are decoupled, i.e. the specific task information is not included in the task identification parameters; therefore, the specific task information needs to be obtained by interacting with the scheduling center. Specifically, the task identification parameters can be sent to the scheduling center, and the scheduling center will verify the task identification parameters; if the task identification parameters are verified successfully, the scheduling center will find the task information corresponding to the task identification parameters, and the scheduling center will return the task information to the test system.
[0093] The information returned to the test system includes the original service command, and the original service command includes the task information corresponding to the task identification parameters.
[0094] In a specific embodiment, the task identification parameters can be an application id called by the task, and the scheduling center will verify the application id. If the scheduling center includes an application corresponding to the application id, the verification is passed, and the related information corresponding to the application can be obtained, such as the function implemented by the application and how to implement the function.
[0095] As shown in Figure 4 The generation of multiple equivalent first service commands in embodiments of the present application can include an embodiment flowchart as shown in
[0096] 41. The original service command is replaced by a constant and a scheduling period to generate a second service command.
[0097] The constant can be a constant parameter that can be set by a user in a business command, such as a current date. The scheduling period refers to a scheduling period set by each task user in the scheduling center (such as monthly, daily, or manual triggering). When the relevant scheduling condition is triggered, the task will be scheduled to the computing cluster for calculation.
[0098] In one specific embodiment, a task (i.e., an original business command) is created at this time, and the corresponding sql is: “create table tab_ ${yyyy-MM-dd} ”. Assuming that the scheduling period is “scheduled by day”, when the task is executed on the date (2022-04-12), it will be replaced by “create table tab_2022-04-12”.
[0099] It should be noted that the original business command includes user-defined business constant parameters and user-defined business scheduling periods. The user-defined business constant parameters and the business period are configured in advance in the scheduling center, and can be directly obtained from the scheduling center by using the task identifier parameter. If the business constant parameters and the business scheduling period need to be changed, they can also be changed in the scheduling center.
[0100] In some embodiments, the original business command is replaced by a constant and a scheduling period to generate a second business command, which can include:
[0101] The initial storage location in the original business command where the execution result is written is replaced by the target storage location to obtain a third business command. The third business command is replaced by a business constant and a business scheduling period to obtain a second business command.
[0102] That is, the original business command in the embodiment of the application includes user-defined business constant parameters and a target storage location corresponding to the task execution. First, the storage location and the business constant parameters in the original business command need to be replaced, and then the syntax replacement is performed to generate an equivalent business command.
[0103] In one specific embodiment, the original business command includes a target storage location specified after the business execution, and the business verification system originally has an initial storage location. Therefore, the original default initial storage location needs to be replaced by the specified target storage location. In the embodiment of the application, the replaced target storage location can be connected to multiple different business execution engines at the same time to receive the execution results after the execution of the multiple business execution engines.
[0104] 42. The second business command is replaced by syntax to generate a plurality of equivalent first business commands.
[0105] The aforementioned constant replacement and dispatch cycle replacement of the original service command only exchanges part of the parameters in the original service command. If the original service command is to be executed by different service execution engines, the second service command needs to be further processed to generate a plurality of first service commands suitable for different service execution engines.
[0106] The second service command is replaced in syntax according to different service execution engines to generate a plurality of equivalent first service commands suitable for the syntax of different service execution engines. The plurality of equivalent first service commands perform the same calculation logic, but have different syntax. Because the corresponding service execution engines are different, the plurality of equivalent first service commands correspond to different target library tables for writing service execution results.
[0107] In the embodiments of the present application, the constant replacement, dispatch cycle replacement and syntax replacement have the significance of ensuring that the calculation logic executed in the new service execution engine is consistent with that of the old service execution engine. If the replacement is not performed and the online service is directly executed, the user's service will be directly invaded, and there is a potential risk of contaminating production data.
[0108] After obtaining the plurality of equivalent first service commands, the plurality of service execution engines can be used to execute the plurality of equivalent first service commands to obtain a plurality of service execution results. As shown in Figure 5 The embodiment provided by the present application can include the following steps:
[0109] 51. Encapsulating the plurality of equivalent first service commands to generate a plurality of to-be-executed tasks.
[0110] In some embodiments, encapsulating the plurality of equivalent first service commands to generate a plurality of to-be-executed tasks can include:
[0111] Determining the encapsulation standard corresponding to each service execution engine in the plurality of service execution engines to obtain a plurality of encapsulation standards. The plurality of encapsulation standards are used to encapsulate the plurality of equivalent first service commands to obtain a plurality of execution parameters, each execution parameter in the plurality of execution parameters corresponding to a to-be-executed task.
[0112] Specifically, for different service execution engines, the syntax standard corresponding to each service execution engine is different, so the standard of encapsulating the first service command into parameters recognizable by the service execution engine is also different. That is, the encapsulation standard corresponding to each service execution engine is different.
[0113] In this embodiment, it is necessary to determine the encapsulation standard corresponding to each business execution engine, and then encapsulate the first business command using the encapsulation standard. Encapsulating the first business command is actually generating execution parameters suitable for the business execution engine, which can read the execution parameters to execute the task. Therefore, after encapsulation in this embodiment, multiple execution parameters are obtained, and each of the multiple execution parameters corresponds to a task to be executed.
[0114] Typically, multiple execution parameter lists exist. In the embodiments of this application, the process of obtaining multiple execution parameters according to different encapsulation standards can be based on existing technologies and is not limited here.
[0115] 52. Control multiple pre-configured business execution engines to execute multiple tasks to be executed, and obtain multiple business execution results.
[0116] After obtaining multiple tasks to be executed (i.e. multiple execution parameters), multiple pre-set different business execution engines can be controlled to execute the multiple tasks to be executed, so as to obtain the business execution result corresponding to each business execution engine.
[0117] It's important to note that since multiple tasks to be executed are actually equivalent tasks applicable to different business execution engines, each business execution engine essentially executes the same task to obtain its corresponding business execution result. This allows for comparison of parameters such as accuracy and efficiency when multiple business execution engines execute the same business logic.
[0118] In the embodiments of this application, since there are multiple business execution engines and multiple tasks to be executed, and generally speaking, one business execution engine corresponds to only one task to be executed (when the processing logic of multiple tasks to be executed is the same); therefore, it is also necessary to match multiple business execution engines and multiple tasks to be executed.
[0119] like Figure 6 The diagram shown is a flowchart illustrating an embodiment of obtaining multiple business execution results provided in this application. Controlling multiple pre-set, different business execution engines to execute multiple tasks to be executed, thereby obtaining multiple business execution results, may include:
[0120] 61. Using any business execution engine from multiple business execution engines as the target business execution engine and any execution parameter from multiple execution parameters as the target execution parameter, determine whether the target business execution engine matches the target execution parameter.
[0121] Specifically, any business execution engine can be taken as a target business execution engine, and the target business execution engine can be matched with any execution parameter; if the two are matched, it can be indicated that the execution parameter is an execution parameter corresponding to the current target business execution engine. Then the current target business execution engine can read the execution parameter and execute the business in the execution parameter.
[0122] Since the execution parameters are obtained by encapsulating all current business execution engines according to the encapsulation standards corresponding to the business execution engines respectively, theoretically, each business execution engine corresponds to a unique execution parameter; therefore, the two can be matched. The specific process of matching can refer to the prior art, which is not limited here.
[0123] 62. If the target business execution engine is matched with the target execution parameter, the target business execution engine is used to execute the target execution parameter to obtain a business execution result corresponding to the target execution parameter.
[0124] 63. It is judged whether a plurality of business execution results corresponding to the number of the plurality of execution parameters are received.
[0125] 64. If the plurality of business execution results corresponding to the number of the plurality of execution parameters are received, it is determined that the plurality of to-be-executed tasks are executed to obtain the plurality of business execution results.
[0126] Since the plurality of execution parameters are obtained by encapsulating the plurality of equivalent first business commands according to the encapsulation standards corresponding to all current business execution engines in the embodiment of the application, the number of the plurality of execution parameters (or the plurality of to-be-executed tasks) is the same as the number of all current business execution engines; and one business execution engine corresponds to one unique execution parameter.
[0127] Therefore, if the plurality of business execution results corresponding to the number of the plurality of execution parameters are received, it can be determined that each business execution engine executes the execution parameter corresponding to itself to obtain one business execution result; finally, the plurality of business execution results corresponding to all execution parameters can be obtained.
[0128] Since the time required for each business execution engine to execute a business is different, the embodiment of the application mainly judges whether a business execution result is received to judge whether a business execution engine executes a corresponding business. Of course, in the embodiment of the application, a time threshold can also be set; if a business execution result is not received within the preset time threshold, it is necessary to judge whether the business execution engine is normal. Or, after the plurality of execution parameters are generated, the plurality of business execution engines are first verified to determine that the plurality of business execution engines can normally execute a business.
[0129] After obtaining the multiple business execution results, the multiple business execution results need to be checked. Whether to check is determined according to a check parameter. Specifically, checking the migration of the target business according to the multiple business execution results can include:
[0130] determining whether the check parameter is included in the task identification parameter; if the check parameter is included in the task identification parameter and the check parameter is check, comparing the multiple business execution results to obtain a comparison result; checking the migration of the target business according to the comparison result; if the check parameter is included in the task identification parameter and the check parameter is no check, not comparing the multiple business execution results.
[0131] Specifically, generally, the user selects whether to check the task when creating the task, that is, generates the check parameter, and selects the check parameter as check or no check; therefore, whether to compare the multiple business execution results can be determined according to the check parameter in the task identification parameter. In the embodiments of the present application, generally, whether the check parameter is included in the task identification parameter is determined after the multiple business execution results are obtained.
[0132] In other embodiments, if the check parameter is not included in the task identification parameter, that is, the user does not select whether to check the task when creating the task, a configuration file of a test system can be obtained to determine whether to compare the multiple business execution results according to the configuration file of the test system.
[0133] Specifically, although the user does not select whether to check the task when creating the current task, whether to check the task is generally set in the configuration file corresponding to the test system; and the configuration file of the test system is generally configured in advance and does not change with each task.
[0134] In an actual checking scenario, even if the check parameter is not included in the task identification parameter, the check parameter is included in the configuration file of the test system and the check parameter is check. That is, generally, whether to check the multiple business execution results can be determined according to the configuration file of the test system, and the multiple business execution results are generally checked.
[0135] In the embodiments of the present application, checking the migration of the target business according to the multiple business execution results can include: taking any business execution result in the multiple business execution results as a target execution result; comparing the target execution result with other business execution results except the target execution result to obtain a comparison result; and determining whether the target business is migratable according to the comparison result.
[0136] Specifically, the comparison result is the difference between the target execution result and the other business execution results. If the difference is large, it means that different business execution engines executing the same business (or equivalent business) will get different results, and the target business cannot be migrated. If the difference is small, it means that different business execution engines executing the same business (or equivalent business) will get the same (or similar) results, and the target business can be migrated. The judgment criteria for the difference of the comparison result is different for different business execution engines. That is, in the embodiment of the present application, the size relationship between the comparison result and the preset difference threshold is judged to determine the difference between the target execution result and the other business execution results. And in different embodiments, the preset difference threshold can be adjusted.
[0137] In a specific embodiment, the plurality of business execution results are A1-A6, A1 is the target execution result, and the differences between A1 and other business execution results A2-A5 are compared. According to the difference, the accuracy and efficiency of the business execution result obtained by different business execution engines executing the same business are judged to determine whether the business execution engine can be switched to realize the verification of the online business migration.
[0138] As shown in Figure 7 , it is an embodiment schematic diagram of the online business migration verification system provided by the present application. In Figure 7 , the entire online business migration verification system can include a test system and a dispatch center, and the test system includes a user input port (input). The test system can make a remote procedure call (RPC) with any externally related system, obtain relevant information of task scheduling by using a unique identification parameter, such as specific execution actions, specific execution objects, and other information.
[0139] In Figure 7 , the test system includes an entry, a communicator, a replacer, and an executor. The entry is responsible for receiving specified parameter input, and then interacting with the external dispatch center through the communicator to obtain task-related information. The parameters input by the user from the input port to the entry usually include the application id (app-id) in the dispatch center and the task id (task-id); and all tasks under all applications in the dispatch center will be used as test objects, and all input tasks will also be used as test objects.
[0140] It should be noted that, in general, the user input parameter includes a task identification parameter, and the application id or task id corresponding to the task can be determined according to the task identification parameter. When receiving the user input parameter, the task identification parameter needs to be determined and sent to the interactor, and the interactor interacts with the external scheduling center to obtain the task related information corresponding to the task identification parameter, that is, the original business command.
[0141] After the interactor obtains the task related information from the scheduling center, it also needs to return to the entrance and then send it to the replacer. The replacer is mainly used to process the task related information to generate multiple equivalent first business commands and return them to the entrance, which are then sent to the executor for execution.
[0142] It should be noted that, in the embodiments of the present application, in order to reduce the coupling between modules, the replacer is only designed to perform syntax semantic analysis and target table related information replacement. Specifically, the replacer mainly performs constant replacement, scheduling period replacement and syntax replacement on the original business command to generate multiple equivalent first business commands suitable for different business execution engines.
[0143] The entrance also needs to establish contact with the executor to execute multiple first business commands using multiple business execution engines included in the executor. That is, the responsibility of the executor is to extract and execute the encapsulated tasks (jobs) in parallel; and according to the verification parameter, it is determined whether to trigger the construction checker (checker) object and trigger the detection check.
[0144] It should be noted that, in the embodiments of the present application, the interactor, the replacer, the checker and the execution engine are all virtual devices, rather than actual existing devices or structures.
[0145] In the embodiments of the present application, when creating a corresponding task according to the user input parameter, it has been determined that the business execution engine needs to be called for this task, so after generating multiple equivalent first business commands, it has been encapsulated according to the encapsulation standard corresponding to the multiple business execution engines called this time, and multiple to-be-executed tasks have been obtained, that is, multiple execution parameters that can be read and recognized by multiple business execution engines have been encapsulated, and each execution parameter will be triggered and calculated by a business execution engine.
[0146] Therefore, after obtaining multiple execution parameters, the multiple execution parameters can be used to establish contact with the executor (which includes multiple business execution engines).
[0147] As shown in Figure 7 , the entrance is connected to the interactor, the replacer and the checker, and the checker is connected to the executor. Figure 7E1-En in the E1-En in the n service execution engines respectively execute the first business command corresponding to itself; these service execution engines can be general computing engines such as hive, spark, flink, or other customized engines, and the specific implementation is not limited.
[0148] The parameters received through the portal are used to establish the connection between the portal and the plurality of service execution engines, so as to distribute the plurality of equivalent first business commands to different service execution engines for execution. Relying on the executor framework, the service execution engines and the first business commands interact through a database connection (Java Database Connectivity, JDBC) to implement the execution of the business. When all the service execution engines have completed the calculation, the executor framework is triggered to perform subsequent comparison and verification of the business execution results.
[0149] In the embodiments of the present application, when all the service execution engines have completed the calculation, the executor determines whether the verification parameter is included in the input parameter to determine whether verification is required. Specifically, when the plurality of service execution engines perform the calculation, multi-task concurrent control can be implemented through CountdownLatch. When all the service execution engines have completed the calculation, the core thread of the executor is triggered to enter the subsequent verification stage. In this stage, it is determined whether to create a checker to compare the plurality of business execution results according to whether the verification parameter is included in the input parameter.
[0150] Specifically, the checker saves the jdbc connection string and the data comparison sqls; the execution logic is that the checker attempts to connect to a previous verification engine according to the connection string, and submits the data comparison sqls to the verification engine for calculation and analysis. Finally, the checker writes the analysis result into a log file for the user to compare.
[0151] It should be noted that in the embodiments of the present application, when the verification parameter is verification, the plurality of business execution results are compared to obtain a comparison result, which is actually a new result verification engine constructed according to the verification parameter, and the plurality of business execution results are compared by using the result verification engine.
[0152] The embodiments of the present application also provide a server which integrates any one of the online business migration verification systems provided by the embodiments of the present application, and the server comprises:
[0153] one or more processors;
[0154] a memory; and
[0155] One or more application programs, wherein the one or more application programs are stored in the memory and configured to perform the steps of the online service migration verification method in any of the above embodiments of the online service migration verification method.
[0156] As shown in Figure 8 the structural schematic diagram of a computer device related to the embodiments of the present application, in particular:
[0157] The computer device can include a processor 801 with one or more processing cores, a memory 802 with one or more computer readable storage media, a power supply 803, an input unit 804, and the like. Those skilled in the art can understand that the computer device structure shown in the Figure 8 above does not constitute a limitation on the computer device, and can include more or fewer components than those shown, or combine certain components, or different component arrangements. Among them:
[0158] The processor 801 is the control center of the computer device, which connects various parts of the computer device through various interfaces and lines, performs various functions of the computer device and processes data by running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, thereby overall monitoring the computer device. Optionally, the processor 801 can include one or more processing cores; the processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like, preferably, the processor 801 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 801.
[0159] The memory 802 can be used to store software programs and modules, and the processor 801 executes various function applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 802 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 802 can also include a memory controller to provide the processor 801 with access to the memory 802.
[0160] The computer device further includes a power supply 803 for supplying power to various components. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 803 can also include one or more than one direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power state indicator, and the like.
[0161] The computer device can further include an input unit 804, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0162] Although not shown, the computer device can also include a display unit, etc., which will not be described here. Specifically, in the embodiment, the processor 801 in the computer device loads an executable file corresponding to the process of one or more than one application program into the memory 802 according to the following instructions, and runs the application program stored in the memory 802 by the processor 801, so as to realize various functions, as follows:
[0163] Receiving a task command of target service migration, the task command of service migration including a task identification parameter;
[0164] Obtaining an original service command corresponding to the task identification parameter, the original service command including task information corresponding to the task identification parameter;
[0165] Processing the original service command to generate a plurality of equivalent first service commands, the plurality of equivalent first service commands executing the same calculation logic, and the plurality of equivalent first service commands corresponding to a plurality of service execution results written in different target library tables;
[0166] The preset plurality of different service execution engines are controlled to execute a plurality of equivalent first service commands respectively, to obtain a plurality of service execution results;
[0167] According to the plurality of service execution results, migration of the target service is verified.
[0168] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware by instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0169] To this end, the embodiments of the present application provide a computer readable storage medium, which can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the online service migration verification methods provided by the embodiments of the present application. For example, the computer program loaded by the processor can execute the following steps:
[0170] A task command of service migration is received, and the task command of service migration includes a task identification parameter;
[0171] An original service command corresponding to the task identification parameter is obtained, and the original service command includes task information corresponding to the task identification parameter;
[0172] The original service command is processed to generate a plurality of equivalent first service commands, the plurality of equivalent first service commands perform the same calculation logic, and the plurality of equivalent first service commands correspond to a plurality of service execution results written in different target library tables;
[0173] The preset plurality of different service execution engines are controlled to execute the plurality of equivalent first service commands respectively, to obtain the plurality of service execution results;
[0174] According to the plurality of service execution results, migration of the target service is verified.
[0175] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the detailed description of other embodiments above, which will not be repeated here.
[0176] In specific implementation, the above various units or structures can be implemented as independent entities, or can be combined as the same or several entities, and the specific implementation of the above various units or structures can be referred to the method embodiments above, which will not be repeated here.
[0177] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here again.
[0178] The above describes in detail an online service migration verification method and a storage medium provided by the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples. The above embodiment descriptions are only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation manners and application ranges will be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. An online business migration verification method, characterized in that, The method is applied to an online service migration verification system, the online service migration verification system comprises a test system, and the test system comprises a plurality of different service execution engines; the method comprises the following steps: receiving a task command of a target service migration, wherein the task command of the service migration comprises a task identification parameter; obtaining an original service command corresponding to the task identification parameter, wherein the original service command comprises task information corresponding to the task identification parameter; processing the original service command to generate a plurality of equivalent first service commands, wherein the plurality of equivalent first service commands perform the same calculation logic, and the plurality of equivalent first service commands correspond to a plurality of business execution results written in different target library tables; controlling a plurality of preset different service execution engines to execute the plurality of equivalent first service commands respectively to obtain a plurality of business execution results; verifying the migration of the target service according to the plurality of business execution results.
2. The online business migration verification method of claim 1, wherein, The online service migration verification system further comprises a scheduling center; the step of obtaining an original service command corresponding to the task identification parameter, wherein the original service command comprises task information corresponding to the task identification parameter, comprises the following steps: sending the task identification parameter to the scheduling center; after the scheduling center verifies the task identification parameter successfully, receiving the original service command corresponding to the task identification parameter from the scheduling center; wherein the original service command comprises task information corresponding to the task.
3. The method of claim 1, wherein, The step of processing the original service command to generate a plurality of equivalent first service commands comprises the following steps: performing constant replacement and scheduling period replacement on the original service command to generate a second service command; performing syntax replacement on the second service command to generate a plurality of equivalent first service commands; wherein the plurality of equivalent first service commands perform the same calculation logic, and the plurality of equivalent first service commands correspond to a plurality of business execution results written in different target library tables.
4. The method of claim 3, wherein, The original service command comprises user-defined business constant parameters and business scheduling periods. The step of performing constant replacement and scheduling period replacement on the original service command to generate a second service command comprises the following steps: replacing the initial storage location of the execution result in the original service command with a target storage location to obtain a third service command; performing business constant replacement and business scheduling period replacement on the third service command according to the business constant parameters and the business scheduling periods to obtain the second service command.
5. The method of claim 1, wherein, The step of controlling a plurality of preset different service execution engines to execute the plurality of equivalent first service commands respectively to obtain a plurality of business execution results comprises the following steps: packaging the plurality of equivalent first service commands to generate a plurality of to-be-executed tasks; controlling a plurality of preset different service execution engines to execute the plurality of to-be-executed tasks respectively to obtain a plurality of business execution results.
6. The method of claim 5, wherein, The step of packaging the plurality of equivalent first service commands to generate a plurality of to-be-executed tasks comprises the following steps: determining a packaging standard corresponding to each service execution engine in the plurality of service execution engines to obtain a plurality of packaging standards; The multiple first service commands are encapsulated by using the multiple encapsulation standards to obtain multiple execution parameters, each of the multiple execution parameters corresponding to a task to be executed; Each service execution engine corresponds to an execution parameter, and the service execution engine executes a task by using the execution parameter; and the multiple execution parameters exist in a list form.
7. The online business migration verification method of claim 6, wherein, The multiple different service execution engines controlled by the preset execute the multiple tasks to be executed to obtain multiple service execution results, including: Taking any service execution engine in the multiple service execution engines as a target service execution engine and taking any execution parameter in the multiple execution parameters as a target execution parameter, it is determined whether the target service execution engine and the target execution parameter match; If the target service execution engine and the target execution parameter match, the target service execution engine is used to execute the target execution parameter to obtain a service execution result corresponding to the target execution parameter; It is determined whether multiple service execution results corresponding to the number of the multiple execution parameters are received; If the multiple service execution results corresponding to the number of the multiple execution parameters are received, it is determined that the multiple tasks to be executed are executed to obtain the multiple service execution results.
8. The online business migration verification method of claim 1, wherein, According to the multiple service execution results, the migration of the target service is verified, including: It is determined whether the task identification parameter includes a verification parameter; If the task identification parameter includes the verification parameter and the verification parameter is verification, the multiple service execution results are compared to obtain a comparison result; According to the comparison result, the migration of the target service is verified.
9. The online business migration verification method of claim 8, wherein, The method further includes: If the task identification parameter includes the verification parameter and the verification parameter is no verification, the multiple service execution results are not compared; If the task identification parameter does not include the verification parameter, a configuration file of a test system is obtained to determine whether the multiple service execution results need to be compared according to the configuration file of the test system.
10. The method of claim 1, wherein, According to the multiple service execution results, the migration of the target service is verified, including: Taking any service execution result in the multiple service execution results as a target execution result; The target execution result is compared with other service execution results except the target execution result to obtain a comparison result; According to the comparison result, it is determined whether the target service is migratable.
11. A computer readable storage medium, characterized in that, The computer readable storage medium stores multiple instructions, which are suitable for being loaded by a processor to execute steps in the online service migration verification method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent platform management interface verification system and method
CN1707443A
Logistic system verifying device
JP2001357104A