Method, device, equipment, storage medium and program product for updating AI optimizer
Patent Information
- Application Number
- CN202510977172.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2026-10-30
AI Technical Summary
然而,AI优化器的整个更新过程中,由于AI优化器更新涉及的模型训练,而模型训练具有资源消耗大和训练时间长的特性,因此将会显著影响业务系统的正常业务
[0045]上述AI优化器的更新方法、装置、设备、存储介质和程序产品,在业务系统设置不同的节点,在需要进行模型训练时,在业务系统中选择需要进行模型训练的其中一种第一节点,通过第一节点的网络模型确定业务请求的执行成本预测值,基于执行成本预测值和业务请求的实际执行成本值优化网络模型,而业务系统中的第二节点并不参与模型训练,因此可以有效避免模型训练过程对业务系统的正常业务的影响;此外,将所得的模型训练结果同步至业务系统的第二节点,模型训练结果用于更新第一节点的AI优化器和第二节点的AI优化器,从而不仅可以确保第一节点和第二节点之间的AI优化器的一致性,有利于业务系统的高可用性和业务处理的准确性,而且由于更新耗时短,可以降低更新时对业务系统的影响;最后,在完成AI优化器的整个更新过程后,第一节点或第二节点接收到待处理业务请求时,通过更新后的AI优化器从候选执行方式中选取目标执行方式执行待处理业务请求,可以有效提高业务的准确性。
Smart Images

Figure CN123011288A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, storage medium, and program product for updating an AI optimizer. Background Technology
[0002] Artificial Intelligence (AI) optimizers enable databases to make optimal decisions using artificial intelligence, such as generating optimal plan or rewriting SQL. To better handle constantly evolving business needs, AI optimizers are typically updated dynamically. However, the entire update process for AI optimizers involves model training, which is resource-intensive and time-consuming, and can significantly impact the normal operation of the business system. Summary of the Invention
[0003] Therefore, it is necessary to provide an AI optimizer update method, apparatus, device, storage medium, and program product to address the above-mentioned technical problems, which can reduce or even avoid impacting the normal operation of business systems during the AI optimizer update process.
[0004] In a first aspect, this application provides a method for updating an AI optimizer, the method comprising:
[0005] Select the first node in the business system where model training is required;
[0006] The predicted execution cost of the business request is determined using the network model of the first node.
[0007] The network model is optimized based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results.
[0008] The model training results are synchronized to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the business request to be processed.
[0009] Secondly, this application also provides an AI optimizer updating apparatus, the apparatus comprising:
[0010] The selection module is used to select the first node in the business system that needs to be used for model training.
[0011] The determination module is used to determine the predicted execution cost of the business request based on the network model of the first node;
[0012] The optimization module is used to optimize the network model based on the predicted execution cost and the actual execution cost of the business request, and obtain the model training results;
[0013] An update module is used to synchronize the model training results to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it can select the target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer.
[0014] In one embodiment, the selection module is further configured to determine the business that the business system will process during a target time period; determine the model training method based on the business; and select a first node in the business system that requires model training based on the model training method and the business.
[0015] In one embodiment, the selection module is further configured to select a first node for model training in the business system when the model training method is offline training and the business meets the first business condition; the first node is a backup node and the second node is the main node in the business system;
[0016] The determining module is further configured to determine the resource load information of the business system; and, if the resource load information meets the preset load conditions, execute the network model through the first node to determine the predicted value of the execution cost of the business request.
[0017] In one embodiment, the update module is further configured to synchronize the model training results to the master node, so as to update the AI optimizer of the master node based on the model training results. After the update is completed, if a pending business request is received, the updated AI optimizer selects a target execution method from the candidate execution methods to execute the pending business request. After the AI optimizer of the master node is updated, the AI optimizer of the standby node is updated according to the model training results.
[0018] In one embodiment, the master node continuously provides service during the training of the network model of the backup node;
[0019] The update module is also used to synchronize the model training results to the master node so that the master node stops providing the business service and updates the AI optimizer of the master node based on the model training results.
[0020] In one embodiment, the service request is a service request that was executed in a historical time or a preset service request;
[0021] The determining module is further configured to obtain the actual execution cost value obtained after the business request is executed; or, to obtain the actual execution cost value by executing the business request through the backup node.
[0022] In one embodiment, the selection module is further configured to, when the model training mode is automatic training mode and the business meets the second business condition, select a first node in the business system that needs to be trained on the model if the business system meets the preset idle condition; the first node is the primary node and the second node is the backup node in the business system.
[0023] The optimization module is further configured to optimize the network model based on the predicted execution cost and the actual execution cost of the business request until the model converges or reaches a preset time limit, thereby obtaining the model training results.
[0024] In one embodiment, the selection module is further configured to, in response to a received training task start instruction, select a first node in the business system that needs to be trained on the model, when the model training mode is online training mode and the business meets the third business condition; the first node is the primary node and the second node is the backup node in the business system.
[0025] In one embodiment, the update module is further configured to synchronize the model training results to the backup node, so as to update the AI optimizer of the backup node based on the model training results; after the AI optimizer of the backup node is updated, the AI optimizer of the master node is updated according to the model training results, so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0026] In one embodiment, the service request is a service request that was executed in a historical time or a preset service request;
[0027] The determining module is further configured to obtain the actual execution cost value obtained after the business request is executed; or, obtain the actual execution cost value by re-executing the business request through the master node.
[0028] In one embodiment, the selection module is further configured to select a first node in the business system that needs to be trained on the model when the model training method is quasi-real-time training and the business meets the fourth business condition; the first node is the primary node and the second node is the backup node in the business system.
[0029] The determining module is used to obtain the original network model trained by offline training, automatic training or online training, and use the original network model as the network model of the master node to determine the execution cost prediction of the business request.
[0030] In one embodiment, the update module is further configured to synchronize the model training results to the backup node, so as to update the AI optimizer of the backup node based on the model training results; after the AI optimizer of the backup node is updated, the AI optimizer of the master node is updated according to the model training results, so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0031] In one embodiment, the determining module is further configured to, if the resource load information and resource occupancy information of the business system meet the preset training conditions, select the business request received by the business system for execution according to the target probability, and obtain the actual execution cost value of the business request.
[0032] In one embodiment, the first node is the master node, the second node is a plurality of backup nodes, and the AI optimizer update of each backup node begins when an update notification is received.
[0033] The update module is further configured to synchronize the model training results to each of the backup nodes; broadcast the verification information of the model training results to each of the backup nodes; and send the update notification to each of the backup nodes when it receives a verification pass message from the backup nodes in response to the verification information.
[0034] In one embodiment, the first node is a target backup node among a plurality of backup nodes, and the second node is the master node; the AI optimizer update of the master node and the AI optimizer update of the other backup nodes among the plurality of backup nodes begin when an update notification is received.
[0035] The update module is further configured to synchronize the model training results to the master node and the other backup nodes; broadcast the verification information of the model training results to the master node and the other backup nodes; and send the update notification to the master node and the other backup nodes when it receives a verification pass message from the master node and the other backup nodes in response to the verification information.
[0036] In one embodiment, the device further includes:
[0037] The fault handling module is used to pause the training process of the network model if a fault is detected in the first node during the training of the network model of the first node, and resume the training process of the network model when the first node recovers; or,
[0038] The overload handling module is used to dynamically adjust the resource usage of each node during the training process of the network model of the first node if resource contention is detected; or, if the business system is detected to be overloaded during the training process of the network model of the first node, a new backup node is added, the training task of the network model is divided into sub-training tasks, and the obtained sub-training tasks are distributed to each of the backup nodes for distributed training.
[0039] In one embodiment, the device further includes:
[0040] The circuit breaker and degradation module is used to reduce the resource consumption during network model training or suspend the training process of the network model when the service traffic received by the service system exceeds a preset threshold.
[0041] The disaster recovery module is used to periodically store the intermediate training results of the network model during the training process, so that in the event of an interruption and recovery, the network model can be restored to the training process based on the stored intermediate training results.
[0042] Thirdly, this application also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the AI optimizer update method.
[0043] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the AI optimizer update method.
[0044] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the AI optimizer update method.
[0045] The aforementioned AI optimizer update method, apparatus, device, storage medium, and program product set up different nodes in the business system. When model training is required, one of the first nodes in the business system is selected for model training. The network model of the first node determines the predicted execution cost of the business request. The network model is optimized based on the predicted execution cost and the actual execution cost of the business request. The second node in the business system does not participate in model training, thus effectively avoiding the impact of the model training process on the normal business operations of the business system. In addition, the obtained model training results are synchronized to the second node in the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node. This not only ensures the consistency of the AI optimizer between the first node and the second node, which is beneficial to the high availability and accuracy of business processing of the business system, but also reduces the impact of the update on the business system due to the short update time. Finally, after the entire AI optimizer update process is completed, when the first node or the second node receives a business request to be processed, it selects the target execution method from the candidate execution methods to execute the business request through the updated AI optimizer, which can effectively improve the accuracy of business operations. Attached Figure Description
[0046] Figure 1 This is an application environment diagram of the AI optimizer update method in one embodiment;
[0047] Figure 2 This is a flowchart illustrating the update method of the AI optimizer in one embodiment;
[0048] Figure 3 This is a timing diagram of the AI optimizer update method in one embodiment;
[0049] Figure 4 This is a schematic diagram illustrating the process of training and updating the AI optimizer using an offline machine learning model training method in one embodiment.
[0050] Figure 5 This is a schematic diagram illustrating the process of training and updating the AI optimizer using an automated machine learning model in one embodiment.
[0051] Figure 6 This is a schematic diagram illustrating the process of training and updating the AI optimizer using an online machine learning model in one embodiment.
[0052] Figure 7This is a schematic diagram illustrating the training and AI optimizer update process using a near real-time machine learning model in one embodiment.
[0053] Figure 8 This is a flowchart illustrating the update method of the AI optimizer in another embodiment;
[0054] Figure 9 This is a structural block diagram of the updating device of the AI optimizer in one embodiment;
[0055] Figure 10 This is a structural block diagram of the updating device of the AI optimizer in another embodiment;
[0056] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0058] It should be noted that in the following description, the terms "first, second, ..., fifth" are merely used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, ..., fifth" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0059] The AI optimizer update method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server cluster 104 via a network. Server cluster 104 selects a master node for model training within the business system; trains the AI model on the master node to obtain the training results; and synchronizes the training results to backup nodes in the business system, thereby updating the AI optimizers of the first and second nodes using the training results. Terminal 102 initiates a pending business request. If the master node receives the pending business request, it selects the target execution method from the candidate execution methods using the updated AI optimizer of the master node to execute the pending business request.
[0060] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses.
[0061] Server cluster 104 can be a cluster of multiple independent physical servers that can provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0062] In one embodiment, such as Figure 2 As shown, an update method for an AI optimizer is provided, which is based on the method described above. Figure 1 Taking the execution of a server cluster as an example, the following steps are included:
[0063] S202, select the first node in the business system that needs to be trained on the model.
[0064] The business system can be a database system, a procurement system, a financial system, an asset management system, a customer business system, or other systems for various other business operations. It should be noted that the same business system can handle different business processes, or handle sub-business processes at different stages of the same business. For example, in a "people, goods, and place" business scenario, there are different business tables such as a customer table, an order table, an order details table, and a parts table. The business system can update and maintain these business tables, such as writing, modifying, deleting, and reading data from them.
[0065] This business system can have different types of nodes. These nodes coordinate and divide tasks to ensure the orderly processing of various pending business operations. The system can employ a primary / backup architecture for node deployment, such as deploying a primary node and a backup node. Furthermore, management nodes can be deployed on these business nodes to handle tasks other than business operations, model training, and AI optimizer updates. For example, in the event of an emergency, the backup node can be switched to handle business operations; or a suitable node can be selected for model training. It should be noted that the primary or backup node in the business system can also perform the aforementioned tasks of the management node. In this case, the management node no longer exists independently but its functions are integrated into the primary or backup node.
[0066] The first node can be either a primary or backup node of the business system. For example, the business system can be deployed with a corresponding server cluster, or the server cluster can have the business system installed. The servers in this cluster can be nodes used to process business operations, including primary and backup nodes (i.e., slave nodes, also known as standby machines or slaves). Additionally, they can be management nodes used to process other tasks. Alternatively, each server in the cluster can have components or databases installed for business processing. These components or databases can be nodes in the business system, also including primary and backup nodes. Therefore, nodes in the business system can be hardware nodes or software nodes, both including primary and backup nodes.
[0067] In business systems, standby nodes serve as redundant backup nodes to ensure high availability (HA) and data security. They typically maintain data consistency with the primary node through synchronization mechanisms. High availability refers to ensuring that business systems (such as database systems) can continue to provide services even when some nodes fail, minimizing downtime and ensuring business continuity through mechanisms such as redundant deployment, automatic fault detection and failover.
[0068] A master-slave architecture is a highly available design where the master node handles business operations and synchronizes data changes to the slave / replica node in real time. It supports automatic failover, read / write separation, and data redundancy, ensuring the continuity and reliability of database services. For example, the master database handles write operations and synchronizes data changes to the slave database in real time; this design constitutes a master-slave architecture for a database system.
[0069] When nodes in a business system process business operations, they utilize an AI optimizer to make decisions. This involves the AI optimizer analyzing the business to obtain all possible execution plans, and then using the network model of the AI optimizer to select an execution plan that meets specific conditions. The AI optimizer can be an enhanced optimizer, possessing machine learning capabilities and using machine learning methods to replace traditional optimizers in making decisions; it can also be an optimizer that integrates a network model.
[0070] For example, the system analyzes all possible execution plans for a business request and selects a specific execution plan by combining the business request with the network model of the AI optimizer. This business request can be a request message in the form of a Structured Query Language (SQL) statement, such as a write data request or a read data request.
[0071] In one embodiment, the server cluster can select the first node for model training within the business system based on the business requirements and model training methods. The type of the first node selected for model training may differ depending on the specific business and model training method; it could be a primary node or a backup node.
[0072] S204 determines the predicted execution cost of the business request based on the network model of the first node.
[0073] The network model can refer to an AI model. In practical applications, the network model can be a Large Language Model (LLM) or other artificial intelligence models with reasoning or decision-making capabilities.
[0074] The execution cost prediction can be the execution cost value required to execute a business request, as predicted by the network model. In practical applications, this execution cost value can be the resource consumption value, the execution time (i.e., execution duration), or a combination of the two. The resource consumption value can be the consumption of computer resources such as CPU (Central Processing Unit), I / O (Input / Output), and memory.
[0075] A business request can be an SQL statement-type request used to request the execution of a specific business function. Furthermore, considering that a business function may not be completed in one step, it can be parsed into multiple sub-business requests, which can form a business request chain. These sub-business requests can be executed sequentially, partially sequentially, or partially in parallel. Alternatively, completing a business function may involve related sub-businesses, so the business requests corresponding to each sub-business can also form a business request chain. For example, for a payment service business request, since the payment service involves authentication and fund transfer, executing the payment service business request requires executing the authentication business request and the fund transfer business request sequentially.
[0076] In one embodiment, the server cluster obtains resource usage information of a business request during its historical execution, inputs the resource usage information and the business request into the network model of the first node, and the network model predicts the execution cost required to execute the business request based on the resource usage information and the business request.
[0077] S206. Optimize the network model based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results.
[0078] The model training result can be the optimized network model obtained after training, or the model parameters in the optimized network model. This model training result can be persisted according to the target format and used to update the AI optimizer.
[0079] The above steps S204 and S206 can be used as the model training process for the network model. Taking a database system as an example, model training can be achieved by collecting the actual execution cost values (such as actual execution time and resource consumption) of historical business requests (such as query requests), and using the predicted execution cost values and actual execution cost values to train the network model, thereby obtaining a network model that can predict the execution cost of business requests.
[0080] In one embodiment, the server cluster can first obtain the actual execution cost value of the business request, or execute the business request to obtain the actual execution cost value, and then optimize the network model based on the predicted execution cost value and the actual execution cost value of the business request to obtain the model training result.
[0081] During optimization, the server cluster can first determine the loss value based on the predicted execution cost and the actual execution cost of the business request. Then, it can optimize the parameters of the network model based on the loss value to obtain the model training results. After obtaining the model training results, the server cluster can persist the model training results.
[0082] For example, a server cluster can replay SQL statements, that is, re-execute stored SQL statements, thereby obtaining the actual execution cost value. Replaying SQL statements refers to re-executing stored SQL statements to reproduce database operation processes, supporting model training scenarios for AI optimizers.
[0083] S208, synchronize the model training results to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it can select the target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer.
[0084] In this configuration, when the first node is the primary node of the business system, the second node is the backup node. Conversely, when the first node is the backup node, the second node is the primary node.
[0085] The pending business requests can be business requests that have been received and need to be processed.
[0086] In one embodiment, the server cluster can use an import method or a remote procedure call method to synchronize the obtained model training results to the second node of the business system, so that the second node can start a replay task and replay the network model based on the model training results, thereby updating the AI optimizer of the second node; after the second node completes the replay task, it returns a replay task completion message. At this time, the first node starts a replay task and replays the network model based on the model training results, thereby updating the AI optimizer of the first node. This ensures the consistency of the network model and AI optimizer between the first node and the second node.
[0087] For example, taking a backup node as the backup node and a second node as the primary node, the backup node sends a training completion message to the primary node. Additionally, it uses import or remote procedure call methods to synchronize the obtained model training results to the primary node of the business system. This allows the primary node to initiate a replay task, replaying the AI model based on the training results, thereby updating the AI optimizer on the primary node. After completing the replay task, the primary node returns a replay task completion message. At this point, the backup node immediately initiates its own replay task, replaying the AI model based on the training results, thus updating its AI optimizer. This ensures the consistency of the network model and AI optimizer between the backup and primary nodes. Users can then use the updated AI optimizer to execute their business logic.
[0088] In one embodiment, for different stages or periods of the same business scenario, the server cluster can select the corresponding model training method according to the different stages or periods of the business. Then, in the business system, the first node that needs to be trained is selected according to the model training method and the business. This enables the switching of different model training methods for different stages or periods of the same business scenario, training the network model of the first node with the corresponding model training method, and updating the AI optimizer of the first node and the AI optimizer of the second node.
[0089] In another embodiment, for different services within the same business scenario, the server cluster can select the corresponding model training method according to the different services. Then, in the business system, the first node that needs to be trained is selected based on the model training method and the service. This allows different model training methods to be used in the same business scenario to train the network model of the first node and update the AI optimizer of the first node and the AI optimizer of the second node.
[0090] As an example, to more intuitively understand the technical solution of this application, here is combined with Figure 3 The explanation is as follows:
[0091] S302, the management node selects the offline training method based on the specific business;
[0092] S304, The management node selects a suitable backup node for model training in the business system;
[0093] S306, the standby node uses the network model in the AI optimizer to determine the predicted execution cost of business requests;
[0094] S308, the backup node optimizes the network model based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results;
[0095] S310, the standby node synchronizes the model training results to the master node of the business system.
[0096] S312, the master node starts the replay task and updates the master node's AI optimizer using the model training results.
[0097] S314, the standby node starts the replay task and updates the AI optimizer of the standby node using the model training results.
[0098] After both the AI optimizer of the first node and the standby node have been updated, the primary node and the standby node will use the updated AI optimizer to select the target execution method from the candidate execution methods when they receive a pending business request.
[0099] It should be noted that the above example uses a management node to select the offline training method. Alternatively, a backup node or a primary node can select the offline training method based on the business being processed, thus determining the backup node as the suitable node for model training.
[0100] In the above embodiments, different nodes are set up in the business system. When model training is required, one of the first nodes in the business system is selected for model training. The network model of the first node determines the predicted execution cost of the business request. The network model is optimized based on the predicted execution cost and the actual execution cost of the business request. The second node in the business system does not participate in model training, thus effectively avoiding the impact of the model training process on the normal business operations of the business system. In addition, the obtained model training results are synchronized to the second node in the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node. This not only ensures the consistency of the AI optimizer between the first node and the second node, which is beneficial to the high availability and accuracy of business processing of the business system, but also reduces the impact of the update on the business system due to the short update time. Finally, after the entire update process of the AI optimizer is completed, when the first node or the second node receives a business request to be processed, it selects the target execution method from the candidate execution methods to execute the business request through the updated AI optimizer, which can effectively improve the accuracy of the business.
[0101] In one embodiment, the server cluster can select the first node for model training in the following manner: Specifically, the server cluster determines the business processes handled by the business system during the target time period; determines the model training method based on the business processes; and within the business system, selects the first node for model training based on the model training method and the business processes.
[0102] The model training method can be offline training, automatic training, online training, or near real-time training. A business system can deploy all four model training methods simultaneously, allowing the selection of a suitable method based on actual needs.
[0103] The target time period can be a time period obtained by moving a preset length from the target time point in the historical time direction. The target time point can be the current time point or a recent time point, so the target time period can be a recent time period, such as the most recent week, month, quarter, or half-year.
[0104] In one embodiment, after determining the business, the server cluster can also determine the characteristics of that business and determine the model training method based on those characteristics, or based on both the business and its characteristics. For example, regarding the updating and maintenance of a certain business table, if the data volume of the business table is small and the update and maintenance frequency is low, an online training method can be selected.
[0105] For example, offline training can be used for services with high traffic load (i.e., almost no idle time) and high sensitivity to response time (i.e., extremely sensitive to performance fluctuations), as well as for relatively stable services (i.e., metadata / table data does not change significantly).
[0106] Considering that the business system can simultaneously deploy four model training methods—offline training, automatic training, online training, and near real-time training—the training process for these four model training methods and the corresponding AI optimizer updates are described below:
[0107] (1) Offline training method:
[0108] In one embodiment, when selecting the first node, the server cluster can select the first node for model training in the business system if the model training method is offline and the business meets the first business condition. The first node is a backup node, and the second node is the master node in the business system. In addition, the server cluster can also determine the resource load information of the business system. If the resource load information meets the preset load condition, S204 is executed, that is, the predicted value of the execution cost of the business request is determined through the network model of the first node.
[0109] The resource load information can include the load status of the business system's hardware resources, such as the load status of CPU, I / O, and memory; it can also include the load status of the business system's software resources. These hardware and software resources can be collectively referred to as the system resources of the business system.
[0110] The resource load information meets the preset load condition if the resource load information is less than a certain preset threshold, which means that the hardware resource load of the business system is low and the number of business processes that the business system needs to process is small. At this time, some hardware resources can be used to train the network model of the nodes in the business system and to update the AI optimizer using the model training results.
[0111] Offline training, also known as offline machine learning model training, involves the primary node providing normal business services to the system, while the backup node determines whether to execute the model training task based on the current resource load information of the business system. If training is required, it can begin executing S204; otherwise, it can begin executing S204. Offline training ensures that the business system's processing is completely unaffected, fully utilizing the backup machine's computing potential. Furthermore, the network model has high accuracy and is less prone to performance regression; it is also unrestricted by business scenarios and suitable for any situation.
[0112] In one embodiment, in addition to selecting a backup node for model training as described above, the server cluster can also select a backup node as the model training node based on whether the AI optimizer is being used for the first time. If so, offline training can be prioritized, and the backup node can be selected as the model training node. If not, the offline training method can be selected based on the business requirements. If offline training is selected, the backup node can be selected as the model training node.
[0113] For example, for scenarios where AI optimizers are used for the first time, offline training can be prioritized to help the AI optimizer quickly become familiar with the current business and extract traffic characteristics.
[0114] In one embodiment, after the server cluster obtains the model training results by executing S204 and S206, it can synchronize the model training results to the master node so that the AI optimizer of the master node can be updated based on the model training results. After the update is completed, if a pending business request is received, the target execution method is selected from the candidate execution methods to execute the pending business request through the updated AI optimizer. After the AI optimizer of the master node is updated, the AI optimizer of the standby node is updated according to the model training results.
[0115] The candidate execution methods can be the execution schemes to be selected for executing the pending business requests. It should be noted that a single pending business request can have multiple different execution methods. In this case, the AI optimizer can decide on the target execution method, such as selecting the optimal execution method from the candidate execution methods to execute the pending business request.
[0116] For example, after obtaining the model training results, the standby node in the server cluster synchronizes the model training results to the master node in the server cluster. The master node then starts a replay task, replaying the AI model based on the model training results, thereby updating the AI optimizer of the master node. After the master node completes the replay task, it returns a replay task completion message. At this time, the standby node immediately starts its own replay task, replaying the AI model based on the model training results, thereby updating the AI optimizer of the standby node. This ensures the consistency of the network model and AI optimizer between the standby node and the master node, and the updated AI optimizer can then be enabled. When the business system receives a pending business request, the updated AI optimizer of the master node can be enabled. The current resource usage information and the pending business request are input into the network model of the updated AI optimizer. The network model can then analyze all candidate execution methods and select the target execution method from the candidate execution methods to execute the pending business request.
[0117] In one embodiment, the master node continues to provide business services while the network model of the standby node is being trained; in addition, the server cluster can synchronize the model training results to the master node so that the master node stops providing business services and updates the AI optimizer of the master node based on the model training results.
[0118] Among them, business services can be service operations performed by a business system in response to business requests, such as executing business requests.
[0119] During the training of the network model on the backup node, the primary node continuously provides business services. While the primary node updates the AI optimizer, business services are paused to complete the update, and resume after both the primary and backup nodes have completed their AI optimizer updates. Because network model training is time-consuming, the primary node's continuous service provision during this process, coupled with the short time required to update the AI optimizer after training, effectively prevents prolonged business interruptions.
[0120] In one embodiment, when the model is trained offline, the business request is a business request that has been executed in the past or a preset business request. Therefore, before optimizing the network model, the server cluster can first obtain the actual execution cost value of the business request after execution; or, the actual execution cost value can be obtained by executing the business request through a standby node.
[0121] Among them, business requests executed in the historical time can be business requests executed by the primary node or the standby node in the historical time. Pre-set business requests can be business requests pre-built based on the business services processed in the current period or a certain time period (such as the most recent week, month, quarter, or year).
[0122] As an example, such as Figure 4 As shown, for offline machine learning model training, the master node and the standby node will perform the following operations:
[0123] 1. The master node is processing business normally;
[0124] 2. The backup node starts the model training task;
[0125] The standby node determines whether to start the model training task based on the current load status of the business system (such as CPU load, memory load, etc.).
[0126] 3. The backup node trains the AI model;
[0127] When the standby node determines that machine learning training can begin, it will execute historical SQL statements or user-preset SQL statements to obtain corresponding resource consumption data. The standby node will then continuously process this data using the AI model to obtain the model training results. During this process, after thorough verification and ensuring that no rollback will occur, the standby node will terminate the model training task.
[0128] Once the model training is complete, the training result set of the model trained on the standby node will be stored in the set table or a user-preset external file.
[0129] 4. After the backup node model has been trained, it sends a notification to the master node that training has ended.
[0130] 5. The standby node synchronizes model data with the master node;
[0131] Users can obtain the model training results from the backup node by manually importing the model training result set or by synchronizing via RPC.
[0132] 6. The master node creates a replay task, and the system enters the update state;
[0133] 7. Play back the AI model on the main node;
[0134] 8. Replay AI models on standby nodes;
[0135] 9. The AI optimizer for the standby node has been updated.
[0136] 10. Once the replay tasks on the primary and backup nodes are completed, services will resume.
[0137] After the master node obtains the model training result set, the server cluster will replay the AI model and restart the AI optimizers of the master node and standby nodes, so that the new AI optimizers will be used to provide business services.
[0138] (2) Automatic training method:
[0139] In one embodiment, if the model training method is automatic and the business meets the second business condition, and the business system meets the preset idle condition, the server cluster can select the first node in the business system that needs to be trained on the model; the first node is the master node and the second node is the backup node in the business system; for the optimization of the network model, the server cluster can optimize the network model based on the predicted execution cost value and the actual execution cost value of the business request until the model converges or reaches the preset time limit condition, and then obtain the model training result.
[0140] The preset idle conditions can be pre-set idle time periods. Correspondingly, a business system meeting the preset idle conditions means that the business system is currently in an idle time period, at which point automatic training can be used for model training. For example, users can set the idle time periods for their business based on its characteristics, and if the set time period requirements are met, the automatic machine learning model training task can be started.
[0141] Automatic training, also known as automatic machine learning model training, involves the master node providing normal business services to the business system. During preset idle periods, the master node executes training tasks, which can then initiate S204. Automatic training ensures that the business system receives processing services without any impact, and users are unaware of it. Furthermore, the network model can be periodically iterated and optimized. Therefore, automatic training is suitable for periodic batch processing businesses with idle periods, such as daily business reports and monthly summaries. It is also suitable for relatively stable business scenarios and business scenarios where the model does not require frequent iterations.
[0142] In one embodiment, after obtaining the model training results, the server cluster can synchronize the model training results to the standby node so that the AI optimizer of the standby node can be updated based on the model training results. After the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0143] For example, after obtaining the model training results, the master node in the server cluster synchronizes the model training results to the standby node in the server cluster. The standby node starts a replay task, replaying the AI model based on the model training results, thereby updating the AI optimizer of the standby node. After the standby node completes the replay task, it returns a replay task completion message. At this time, the master node immediately starts a replay task, replaying the AI model based on the model training results, thereby updating the AI optimizer of the master node. This ensures the consistency of the network model and AI optimizer between the master node and the standby node, and the updated AI optimizer can then be enabled. When the business system receives a pending business request, the updated AI optimizer on the master node can be enabled. The current resource usage information and the pending business request are input into the network model of the updated AI optimizer. The network model can then analyze all candidate execution methods and select the target execution method from the candidate execution methods to execute the pending business request.
[0144] In one embodiment, when the model training method is automatic training, the business request is a business request that has been executed in the past or a preset business request; therefore, before optimizing the network model, the server cluster can first obtain the actual execution cost value obtained after the business request is executed; or, the actual execution cost value can be obtained by re-executing the business request through the master node.
[0145] The historical time period can be the working period before the idle period.
[0146] As an example, such as Figure 5 As shown, for automated machine learning model training, the master node and standby node will perform the following operations:
[0147] 1. Set the cycle and time period for automatic machine learning;
[0148] This time period can be any idle period during which model training can be performed.
[0149] In the training of automated machine learning models, users can set idle traffic periods based on current business characteristics; in addition, they can also set the cycle of automated machine learning.
[0150] 2. The time required for the master node to detect and automatically learn machine learning;
[0151] 3. The master node replays the SQL statements;
[0152] After the user sets an idle period, the automatic machine learning model training task can be started if the preset idle period is met. Once the automatic machine learning model training task is started, the master node will replay the SQL statements from the non-idle period (usually slow query statements or user-preset query statements).
[0153] 4. The master node performs AI model training;
[0154] 5. Model training has ended or the training time limit has been exceeded;
[0155] Once all SQL statements have been replayed or the time limit set for the idle period has been exceeded, the master node will receive an updated model training result.
[0156] 6. The master node sends a notification to the standby node that training has ended;
[0157] 7. The master node synchronizes model data to the standby node;
[0158] Once the master node receives the new model training results, it indicates that one phase of the training task has ended. At this point, the master node will automatically synchronize the model data (i.e., the model training results) to the standby nodes via logs.
[0159] 8. Replay AI models on standby nodes;
[0160] After receiving the model training results synchronized from the master node, the standby node will start the replay task, that is, start the work of replaying the AI model, and send a notification message to the master node after the replay task is completed.
[0161] 9. Play back the AI model on the main node;
[0162] Once the master node receives the notification message from the standby node, it will immediately start the replay task on the master node, which ensures the consistency of the AI model between the master node and the standby node.
[0163] 10. The AI optimizer has been updated, and the entire training task has ended.
[0164] After the replay task on the primary node is completed, both the primary and standby nodes will officially use the AI optimizer. As a result, the business system will use the new AI optimizer to provide business services when processing business operations.
[0165] (3) Online training method:
[0166] In one embodiment, the server cluster can, in response to the received training task start instruction, select the first node in the business system that needs to be trained on the model, provided that the model training method is online and the business meets the third business condition; the first node is the master node and the second node is the backup node in the business system.
[0167] The training task start command, also known as the model training command, is a user-triggered command for model training.
[0168] Online training, also known as online machine learning model training, involves the master node executing the training task, which then initiates the S204 process. Online training is relatively simple to operate, requires less time and system resources, and is suitable for simpler business scenarios that are less sensitive to performance fluctuations. It is also suitable for businesses with rapid iteration capabilities, allowing for quick learning of business characteristics. Furthermore, it is applicable to business scenarios where rapid model updates are needed after changes to metadata or system data.
[0169] In one embodiment, after obtaining the model training results, the server cluster can synchronize the model training results to the standby node so that the AI optimizer of the standby node can be updated based on the model training results. After the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0170] In one embodiment, when the model is trained online, the business request is a business request that has been executed in the past or a preset business request; therefore, the actual execution cost value of the business request after execution is obtained before optimizing the network model; or, the actual execution cost value is obtained by re-executing the business request through the master node.
[0171] In the case of online training, the implementation schemes for model training results, AI optimizer updates, and obtaining actual execution cost values can be referenced from the automatic training method.
[0172] As an example, such as Figure 6 As shown, for online machine learning model training, the master node and the standby node will perform the following operations:
[0173] 1. The master node starts the model training task;
[0174] For online machine learning model training, users can trigger model training commands synchronously, that is, when online machine learning model training is required, the model training task can be started by command.
[0175] 2. The master node replays the SQL statements;
[0176] 3. The master node performs iterative training of the AI model;
[0177] 4. AI model training is complete;
[0178] After a user starts a model training task, the master node will replay the SQL statements (usually slow query statements or user-preset SQL statements). At this time, the master node will wait synchronously until all SQL statements have been replayed and the model iteration training is complete, at which point the master node will obtain an updated model training result.
[0179] 5. The master node sends a notification to the standby node that training has ended;
[0180] 6. The master node synchronizes model data to the standby node;
[0181] Once an updated model training result is obtained, the master node will send a notification message indicating that model training has ended to the standby node, informing the standby node that the model training task has been completed.
[0182] After that, the master node will synchronize the model training results to the standby nodes in the form of logs.
[0183] 7. Replay the AI model on the backup node;
[0184] After receiving the model training result set sent by the master node, the standby node will synchronously start the replay task, that is, start the task of replaying the AI model. After the replay is completed, it will notify the master node in the form of RPC that the replay is complete.
[0185] 8. Play back the AI model on the main node;
[0186] Once the master node receives a message that the backup node has completed its replay task, it will start the replay task on the master node.
[0187] 9. The AI optimizer has been updated, and the entire training task has ended.
[0188] Once the primary node has completed its replay task, both the primary and standby nodes will officially begin using the new AI optimizer. From then on, the business system will use the new AI optimizer to provide business services when processing transactions.
[0189] (4) Quasi-real-time training method:
[0190] In one embodiment, the server cluster can select the first node in the business system that needs to be trained on the model, provided that the model training method is quasi-real-time training and the business meets the fourth business condition. The first node is the master node, and the second node is the backup node in the business system. In the process of determining the execution cost prediction value, the server cluster can obtain the original network model trained based on offline training, automatic training or online training, and use the original network model as the network model of the master node to determine the execution cost prediction of the business request.
[0191] The near-real-time training method, also known as near-real-time machine learning model training, involves the master node extracting a portion of traffic for model training with a certain probability (e.g., 10%). For example, 10% of business requests are selected for model training. Other business requests are processed by the master node using conventional methods. Near-real-time training allows for continuous iteration, consistently ensuring the model's optimal performance and quickly correcting deviations. Therefore, it is suitable for businesses seeking ultimate overall performance but insensitive to performance fluctuations and glitches; it is also suitable for businesses that are relatively unstable and experience frequent changes in table data and metadata schema; furthermore, it is suitable for real-time plan optimization scenarios, ensuring that the plan is optimal in most cases.
[0192] Furthermore, when using near real-time machine learning model training, it is necessary to first obtain the original network model using offline, automated, or online machine learning model training methods, and then continuously iterate to update the model and the AI optimizer. The main idea behind near real-time machine learning model training is to obtain a better network model through continuous iterative updates of the original network model, thereby updating the AI optimizer.
[0193] In one embodiment, after obtaining the model training results, the server cluster can synchronize the model training results to the standby node so that the AI optimizer of the standby node can be updated based on the model training results. After the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0194] For the update process of the AI optimizer, you can refer to the update process of the AI optimizer in the automatic training method.
[0195] In one embodiment, when the model training method is quasi-real-time training, the business request is a business request that the business system receives and processes in real time. Therefore, before optimizing the network model, if the resource load information and resource occupancy information of the business system meet the preset training conditions, the server cluster can select the business request received by the business system for execution according to the target probability to obtain the actual execution cost value of the business request.
[0196] Resource load can be the hardware resource load of the business system, such as at least one of CPU load, I / O load, or memory load, and the corresponding resource load information can be a specific resource load value. Resource occupancy information can be used to indicate the busy level of the business system, such as resource utilization rate, which can specifically be at least one of CPU utilization rate, I / O utilization rate, or memory utilization rate.
[0197] The resource load information and resource occupancy information of the business system can meet the preset training conditions if: the resource load value of the business system is less than or equal to the preset load value, and the resource occupancy rate is less than or equal to the preset occupancy rate.
[0198] As an example, such as Figure 7 As shown, for near real-time machine learning model training, the master node and the standby node will perform the following operations:
[0199] 1. The master node starts the initial AI model and extracts a certain number of business requests with a target probability;
[0200] 2. The master node starts the model training task;
[0201] Among them, the model training task can be the task of training a near real-time machine learning model.
[0202] 3. The master node trains the initial AI model;
[0203] Once the task of training a near real-time machine learning model is initiated, the business system will comprehensively consider characteristics such as resource load and busy level, and extract a portion of business requests for model training with a specific probability (e.g., 10%). Among them, the data obtained from each execution of the SQL statement corresponding to the business request (such as the actual execution cost value) can be used as training data for model training.
[0204] 4. AI model training is complete;
[0205] 5. The master node sends a notification to the standby node that training has ended;
[0206] 6. The master node synchronizes model data to the standby node;
[0207] After a period of time, the model training task ends, and the standby node is notified that training is complete. At the same time, the master node will send the model training data to the standby node.
[0208] 7. Replay the AI model on the backup node;
[0209] After receiving the model training result set, the standby node will start the replay task, that is, start the work of replaying the AI model, thereby realizing the update of the AI optimizer of the standby node.
[0210] 8. Play back the AI model on the main node;
[0211] Once the backup node's replay task is completed, the master node's replay task will begin, which means starting the replay of the AI model and updating the master node's AI optimizer.
[0212] 9. The AI optimizer has been updated, and the entire training task has ended.
[0213] Finally, the AI optimizer on the primary node and the AI optimizer on the standby node will be reactivated, and users will then be able to use the new AI optimizer to provide business services normally.
[0214] It should be noted that the above Figures 4 to 7 The implementation of this method includes not only the model training process but also the activation of the AI optimizer after the update. Therefore, the above training and AI optimizer activation process can be regarded as a model training deployment method, that is: training the AI model, using the trained AI model to update the AI optimizer, and applying the updated AI optimizer model to the business system to provide business services, covering the entire chain process from model training to AI optimizer activation.
[0215] In addition to the various model training and deployment methods mentioned above, this application innovatively proposes a hybrid training and deployment mode that organically combines these methods. Each model training and deployment method will be suitable for different business scenarios within the same context, possessing different advantages and disadvantages. A unified interface will exist for all model training and deployment methods to facilitate switching between them. Specifically, each model training task will have standardized input and output parameters to transmit the model training results, ensuring that the model is adaptable to various model training and deployment methods.
[0216] As an example, suppose a typical "people, goods, and place" business scenario has the following business architecture:
[0217] Customer table: Records basic customer information (such as customer ID, name, and address), and is associated with the order table;
[0218] The Orders table stores master order information (such as order identifier, date, and total amount), as well as the relationship between the customer table and the order details table.
[0219] Order Details (LINEITEM): Detailed entries for an order (such as part identifier, quantity, price, and discounts). It is a typical master-child table structure, with the primary key consisting of the order identifier (L_ORDERKEY) and the item number (L_LINENUMBER).
[0220] Part list: Describes part attributes (such as part ID, name, type, and size).
[0221] A typical order processing workflow is as follows: Customer Table → Order Table → Order Details Table → Parts Table. Additionally, the company periodically purchases a certain number of parts from suppliers, requiring regular updates to the parts table. Therefore, the model training and deployment architecture of the business system is as follows:
[0222] 1) In the initial stage of business deployment, the model can be trained through offline machine learning model training deployment to update the AI optimizer, thereby learning the processing capabilities of order business and order detail business. Therefore, the business system can use the updated AI optimizer to provide services for order business and order detail business.
[0223] Furthermore, considering that the customer business and parts business have relatively low data volumes and fewer queries, a fast-response online machine learning model training and deployment method can be used to train the model and update the AI optimizer. This allows the system to learn the processing capabilities of the customer business and parts business, so the business system can use the updated AI optimizer to provide services for the customer business and parts business.
[0224] 2) After the business has been running for a period of time, if there is a need to regularly purchase goods from suppliers, the automatic machine learning model training and deployment method can be used to train the model and update the AI optimizer, thereby learning the processing capabilities of the parts business; or, when there is a need for weekly or daily reports, the automatic machine learning model training and deployment method can also be used.
[0225] 3) When it is found that the order business is relatively busy and the plan is relatively unstable, some resources can be reserved and the near real-time machine learning model training deployment mode can be enabled to train the AI optimizer model.
[0226] Therefore, in the solution of this application, the AI optimizer under the primary and backup architecture can seamlessly switch between different business operations and various model training and deployment methods.
[0227] In the above embodiments, the business system has multiple different model training methods. It can select one of these methods for model training and AI optimizer updates based on business needs, rationally allocate the responsibilities of primary and backup nodes, and fully utilize idle system resources, effectively reducing the cost of AI model training. Furthermore, seamless switching between different model training methods ensures that the cost of AI model training is minimized to the greatest extent possible.
[0228] In one embodiment, the first node is the master node, and the second node consists of multiple backup nodes. The AI optimizer update of each backup node begins upon receiving an update notification. Therefore, the method may further include: the server cluster can synchronize the model training results to each backup node; broadcast the verification information of the model training results to each backup node; and send an update notification to each backup node upon receiving a verification pass message from the backup node in response to the verification information feedback.
[0229] Among these measures, updating the AI optimizers of each backup node upon receiving an update notification can effectively ensure the consistency of the AI optimizers across all nodes in the business system, specifically the consistency of the network models of each AI optimizer.
[0230] Verification information can be a checksum, which can be obtained by performing bitwise operations on the data content (i.e., the model training results) and is used to verify the integrity and correctness of the data content.
[0231] The synchronization of model training results can be achieved by directly sending the model training results to a backup node, or by using log synchronization. Log synchronization, in particular, captures, transmits, and applies database change logs to achieve data consistency across multiple nodes or heterogeneous systems, and can be used for system disaster recovery, read / write separation, and real-time data analysis.
[0232] In one embodiment, during the synchronization of model training results, the server cluster can persist the obtained model training results, such as using CSV (Comma-Separated Values) format, log data format, or RPC (Remote Procedure Call) data format. Thus, it can be seen that the model training results can support multiple data formats.
[0233] For example, after the master node completes model training, the training results are synchronized to all standby nodes. Furthermore, before replaying the AI model, the master node broadcasts the checksum of the training results to all standby nodes. Upon receiving the checksum from the master node, each standby node calculates its own checksum for the training results it stores (i.e., the results synchronized from the master node) and then verifies it (compares the two checksums). If the verification passes, a message is sent to the master node. Once the master node receives checksum confirmation messages from all machines, it notifies all standby nodes to begin replaying the AI model. If not all checksum confirmation messages are received, the replay task will not start, thus ensuring the consistency of the AI model within the cluster.
[0234] In another embodiment, the first node is the target backup node among multiple backup nodes, and the second node is the master node; the AI optimizer update of the master node and the AI optimizer updates of other backup nodes among the multiple backup nodes begin upon receiving an update notification; therefore, the method may further include: the server cluster can synchronize the model training results to the master node and other backup nodes; broadcast the verification information of the model training results to the master node and other backup nodes; and upon receiving a verification pass message from the master node and other backup nodes in response to the verification information feedback, send an update notification to the master node and other backup nodes.
[0235] For the synchronization of model training results and the verification before sending update notifications, the above-mentioned implementation of the first node as the master node can be referred to.
[0236] In one embodiment, the method further includes: if a failure is detected in the first node during the training of the network model of the first node, the server cluster may suspend the training process of the network model and resume the training process of the network model when the first node recovers; or, if resource contention is detected in the first node during the training process of the network model of the first node, the resource usage of each node during the training process may be dynamically adjusted; or, if overload of the business system is detected during the training process of the network model of the first node, a new backup node may be added, and the training task of the network model may be divided into sub-training tasks, and the obtained sub-training tasks may be distributed to each backup node for distributed training.
[0237] In the primary-backup architecture, the AI optimizer achieves a deep integration of high availability and computational efficiency through intelligent health monitoring and dynamic resource management mechanisms. This AI optimizer relies on a multi-dimensional health check system based on a cloud database, employing a basic heartbeat detection method to determine the health status of the standby node's model training tasks, achieving sub-second fault detection.
[0238] When a failure is detected based on the health check mechanism (such as a power outage or other reasons that prevent the task from continuing), the AI optimizer's automatic failover mechanism can achieve lossless disaster recovery for the model training task. Specifically, when a failure is detected on the backup node, the model training task on the backup node will be temporarily suspended until the backup node returns to normal, at which point the model training task will resume.
[0239] Furthermore, when an overload is detected in the business system, the AI optimizer's autoscaling mechanism is activated. In a primary / standby architecture, the AI optimizer's autoscaling mechanism achieves dynamic adaptation and load balancing of system resources through the coordinated operation of vertical scaling (Scale Up) and horizontal scaling (Scale Out).
[0240] Vertical scaling relies on the cloud database's machine load monitoring mechanism. When resource contention is detected on a node, the CPU allocation and memory limits of the node are dynamically adjusted to achieve rational resource utilization. For example, when resource contention is detected, the AI optimizer will notify the upper-layer management module, thereby dynamically adjusting the CPU allocation and memory limits of the node.
[0241] Horizontal scaling is primarily designed for distributed model training scenarios where backup nodes are in training mode. When the task load of an AI model is detected to be too heavy, the AI optimizer will notify the upper-level management model to add backup nodes. After the backup nodes are added, the overall training task will be divided into several sub-tasks and then distributed to each backup node for distributed training. Finally, the master node will aggregate the training results of each backup node to obtain the final model training result.
[0242] In one embodiment, in addition to the aforementioned fault handling and overload handling capabilities, the server cluster may also have circuit breaker degradation and disaster recovery backup capabilities. Therefore, when the business traffic received by the business system exceeds a preset threshold, the server cluster reduces the resource consumption during network model training or pauses the network model training process; alternatively, it periodically stores intermediate training results of the network model during training so that, in the event of an interruption and subsequent recovery, the network model can be resumed from its training state based on the stored intermediate training results.
[0243] Among them, business traffic can be the data stream of each business request during the transmission process.
[0244] During model training, in the event of a sudden surge in traffic, the model training task needs to undergo circuit breaking and degradation to ensure business availability. For example, if the master node or upper-layer management module detects an anomaly in the business system, a degradation strategy will be adopted first, i.e., reducing the concurrency of the model training task. In single-threaded training mode, the AI optimizer will consume very low memory / CPU resources, thus ensuring the normal operation of the business and not affecting the continuity of model training. If the degradation strategy fails to restore the business to normal, an aggressive circuit breaking strategy will be adopted to quickly save the training model data and temporarily stop the model training task.
[0245] In the event of extreme situations such as geological disasters or power outages, the data in the AI optimizer's memory will be lost. Therefore, upon restoration of normal operation, it is necessary to reread the training model data and replay the AI model. During the model training process, the AI optimizer uses a checkpoint mechanism to persistently store the current model training results in real time or periodically. Simultaneously, to ensure the correctness and continuity of each model training result, the AI optimizer also periodically replays the model training results from disk for verification during training.
[0246] In one embodiment, such as Figure 8 As shown, another method for updating the AI optimizer is provided, which is based on... Figure 1 Taking the execution of a server cluster as an example, the following steps are included:
[0247] S802, determine the business processes that the business system will handle during the target time period;
[0248] S804, Determine the model training method based on business needs;
[0249] S806 is the first node in the business system that needs to train the model based on the model training method and business requirements.
[0250] In one embodiment, S806 may include: the server cluster may select a first node in the business system that needs to be trained on the model if the model training method is offline training and the business meets the first business condition; the first node is a backup node and the second node is the master node in the business system; in addition, the server cluster may also determine the resource load information of the business system; if the resource load information meets the preset load condition, S808 is executed.
[0251] In one embodiment, S806 may include: when the model training method is automatic training and the business meets the second business condition, if the business system meets the preset idle condition, then select the first node in the business system that needs to be trained on the model; the first node is the master node and the second node is the backup node in the business system.
[0252] In one embodiment, S806 may include: when the model training method is online training and the business meets the third business condition, in response to the received training task start instruction, selecting the first node in the business system that needs to be trained on the model; the first node is the master node and the second node is the backup node in the business system.
[0253] In one embodiment, S806 may include: when the model training method is quasi-real-time training and the business meets the fourth business condition, selecting a first node in the business system that needs to be trained on the model; the first node is the master node and the second node is a backup node in the business system.
[0254] S808 determines the predicted execution cost of a business request based on the network model of the first node.
[0255] In one embodiment, when the model training method is a near real-time training method, S808 may include: the server cluster obtaining the original network model trained based on the offline training method, the automatic training method, or the online training method, using the original network model as the network model of the master node, and determining the execution cost prediction of the business request.
[0256] S810 optimizes the network model based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results;
[0257] In one embodiment, when the model training method is automatic training, S810 may include: the server cluster can optimize the network model based on the predicted execution cost and the actual execution cost of the business request until the model converges or reaches the preset time limit condition, and obtain the model training result.
[0258] S812 synchronizes the model training results to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it can select the target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer.
[0259] In one embodiment, when the model training method is offline training, S812 may include: the server cluster can synchronize the model training results to the master node so that the AI optimizer of the master node can be updated based on the model training results; after the update is completed, if a pending business request is received, the target execution method is selected from the candidate execution methods to execute the pending business request through the updated AI optimizer; after the AI optimizer of the master node is updated, the AI optimizer of the standby node is updated according to the model training results.
[0260] In one embodiment, during the training of the network model for the standby node, the master node continues to provide business services; the step of synchronizing the model training results to the master node so as to update the AI optimizer of the master node based on the model training results may specifically include: the server cluster can synchronize the model training results to the master node so that the master node stops providing business services and updates the AI optimizer of the master node based on the model training results.
[0261] In one embodiment, the business request is a business request that has been executed in the past or a preset business request; obtaining the actual execution cost may include: the server cluster can obtain the actual execution cost value obtained after the business request is executed; or, the actual execution cost value can be obtained by executing the business request through a standby node.
[0262] In one embodiment, when the model training method is automatic training or online training, S812 may include: the server cluster can synchronize the model training results to the standby node so that the AI optimizer of the standby node can be updated based on the model training results; after the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0263] In one embodiment, the business request is a business request that has been executed in the past or a preset business request; obtaining the actual execution cost may include: the server cluster can obtain the actual execution cost value obtained after the business request is executed; or, the actual execution cost value can be obtained by re-executing the business request through the master node.
[0264] In one embodiment, when the model training method is a near real-time training method, S812 may include: the server cluster can synchronize the model training results to the standby node so that the AI optimizer of the standby node can be updated based on the model training results; after the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0265] In one embodiment, if the resource load information and resource occupancy information of the business system meet the preset training conditions, the server cluster selects the business requests received by the business system for execution according to the target probability to obtain the actual execution cost value of the business requests.
[0266] In one embodiment, the first node is the master node, and the second node consists of multiple backup nodes. The AI optimizer update of each backup node begins upon receiving an update notification. The method further includes: the server cluster can synchronize the model training results to each backup node; broadcast the verification information of the model training results to each backup node; and send an update notification to each backup node upon receiving a verification pass message from the backup node in response to the verification information.
[0267] In one embodiment, the first node is the target standby node among multiple standby nodes, and the second node is the master node; the AI optimizer update of the master node and the AI optimizer updates of other standby nodes among the multiple standby nodes begin upon receiving an update notification. The method further includes: the server cluster can synchronize the model training results to the master node and other standby nodes; broadcast the verification information of the model training results to the master node and other standby nodes; and send an update notification to the master node and other standby nodes upon receiving a verification pass message from the master node and other standby nodes in response to the verification information feedback.
[0268] In one embodiment, the method further includes: if a failure is detected in the first node during the training of the network model of the first node, the server cluster may suspend the training process of the network model and resume the training process of the network model when the first node recovers; or, if resource contention is detected in the first node during the training process of the network model of the first node, the resource usage of each node during the training process may be dynamically adjusted; or, if overload of the business system is detected during the training process of the network model of the first node, a new backup node may be added, and the training task of the network model may be divided into sub-training tasks, and the obtained sub-training tasks may be distributed to each backup node for distributed training.
[0269] In one embodiment, the method further includes: when the business traffic received by the business system exceeds a preset threshold, the server cluster can reduce the resource consumption during network model training or suspend the network model training process; or, periodically store the intermediate training results of the network model during the training process so that, in the event of an interruption and recovery, the network model can be resumed in the training process based on the stored intermediate training results.
[0270] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0271] Based on the same inventive concept, this application also provides an AI optimizer updating apparatus for implementing the AI optimizer updating method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more AI optimizer updating apparatus embodiments provided below can be found in the limitations of the AI optimizer updating method described above, and will not be repeated here.
[0272] In one embodiment, such as Figure 9 As shown, an update device for an AI optimizer is provided, comprising: a selection module 902, a determination module 904, an optimization module 906, and an update module 908, wherein:
[0273] Select module 902 is used to select the first node in the business system that needs to be trained on the model;
[0274] The determination module 904 is used to determine the predicted execution cost of the business request based on the network model of the first node;
[0275] Optimization module 906 is used to optimize the network model based on the predicted execution cost and the actual execution cost of the business request, and obtain the model training results;
[0276] The update module 908 is used to synchronize the model training results to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it can select the target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer.
[0277] In one embodiment, the selection module 902 is further configured to determine the business that the business system will process during the target time period; determine the model training method based on the business; and select the first node that needs to be trained in the business system according to the model training method and the business.
[0278] In one embodiment, the selection module 902 is further configured to select a first node in the business system that needs to be trained on the model when the model training method is offline training and the business meets the first business condition; the first node is a backup node and the second node is the main node in the business system.
[0279] The determination module 904 is also used to determine the resource load information of the business system; if the resource load information meets the preset load conditions, the network model through the first node is executed to determine the predicted value of the execution cost of the business request.
[0280] In one embodiment, the update module 908 is further configured to synchronize the model training results to the master node so that the AI optimizer of the master node is updated based on the model training results. After the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request. After the AI optimizer of the master node is updated, the AI optimizer of the standby node is updated according to the model training results.
[0281] In one embodiment, the master node continues to provide service while the network model of the backup node is being trained.
[0282] The update module 908 is also used to synchronize the model training results to the master node so that the master node stops providing business services and updates the AI optimizer of the master node based on the model training results.
[0283] In one embodiment, the service request is a service request that has been executed in the past or a preset service request;
[0284] The determination module 904 is also used to obtain the actual execution cost value obtained after the business request is executed; or, to obtain the actual execution cost value by executing the business request through a standby node.
[0285] In one embodiment, the selection module 902 is further configured to select a first node in the business system that needs to be trained if the business system meets the preset idle condition, when the model training mode is automatic training mode and the business meets the second business condition; the first node is the main node and the second node is the backup node in the business system.
[0286] The optimization module 906 is also used to optimize the network model based on the predicted execution cost and the actual execution cost of the business request until the model converges or reaches the preset time limit condition, and then obtain the model training results.
[0287] In one embodiment, the selection module 902 is further configured to, in response to the received training task start instruction, select a first node in the business system that needs to be trained on the model when the model training mode is online training mode and the business meets the third business condition; the first node is the main node and the second node is the backup node in the business system.
[0288] In one embodiment, the update module 908 is further configured to synchronize the model training results to the standby node so that the AI optimizer of the standby node is updated based on the model training results; after the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0289] In one embodiment, the service request is a service request that has been executed in the past or a preset service request;
[0290] The determination module 904 is also used to obtain the actual execution cost value obtained after the business request is executed; or, to obtain the actual execution cost value by re-executing the business request through the master node.
[0291] In one embodiment, the selection module 902 is further configured to select a first node in the business system that needs to be trained when the model training method is quasi-real-time training and the business meets the fourth business condition; the first node is the main node and the second node is the backup node in the business system.
[0292] The determination module 904 is used to obtain the original network model trained by offline training, automatic training or online training, and use the original network model as the network model of the master node to determine the execution cost prediction of the business request.
[0293] In one embodiment, the update module 908 is further configured to synchronize the model training results to the standby node so that the AI optimizer of the standby node is updated based on the model training results; after the AI optimizer of the standby node is updated, the AI optimizer of the master node is updated according to the model training results so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
[0294] In one embodiment, the determining module 904 is further configured to select the business request received by the business system for execution according to the target probability if the resource load information and resource occupancy information of the business system meet the preset training conditions, thereby obtaining the actual execution cost value of the business request.
[0295] In one embodiment, the first node is the master node, the second node is multiple backup nodes, and the AI optimizer update of each backup node begins when an update notification is received.
[0296] The update module 908 is also used to synchronize the model training results to each backup node; broadcast the verification information of the model training results to each backup node; and send an update notification to each backup node when it receives a verification pass message in response to the verification information feedback from the backup node.
[0297] In one embodiment, the first node is the target backup node among a plurality of backup nodes, and the second node is the master node; the AI optimizer update of the master node and the AI optimizer updates of other backup nodes among the plurality of backup nodes begin when an update notification is received.
[0298] The update module 908 is also used to synchronize the model training results to the master node and other standby nodes; broadcast the verification information of the model training results to the master node and other standby nodes; and send an update notification to the master node and other standby nodes when it receives a verification pass message from the master node and other standby nodes in response to the verification information feedback.
[0299] In one embodiment, such as Figure 10 As shown, the device also includes:
[0300] The fault handling module 910 is used to pause the training process of the network model if a fault is detected in the first node during the training of the network model of the first node, and resume the training process of the network model when the first node recovers; or,
[0301] The overload handling module 912 is used to dynamically adjust the resource usage of each node during the training process of the network model of the first node if resource contention is detected; or, if the business system pressure is overloaded during the training process of the network model of the first node, a new backup node is added, and the training task of the network model is divided into sub-training tasks, and the obtained sub-training tasks are distributed to each backup node for distributed training.
[0302] In one embodiment, such as Figure 10 As shown, the device also includes:
[0303] The circuit breaker degradation module 914 is used to reduce the resource consumption during network model training or to pause the network model training process when the business traffic received by the business system exceeds a preset threshold.
[0304] The disaster recovery module 916 is used to periodically store the intermediate training results of the network model during the training process, so that the network model can be restored to the training process based on the stored intermediate training results in the event of an interruption and recovery.
[0305] The modules in the aforementioned AI optimizer's update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the operations corresponding to each module.
[0306] In one embodiment, a computer device is provided, which may be a server in a server cluster, and its internal structure diagram may be as follows: Figure 11 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores business requests and model training results. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When executed by the processor, the computer program implements an AI optimizer update method.
[0307] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0308] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described AI optimizer update method.
[0309] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described AI optimizer update method.
[0310] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described AI optimizer update method.
[0311] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0312] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, and other data processing logic devices, and are not limited to these.
[0313] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0314] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for updating an AI optimizer, characterized in that, The method includes: Select the first node in the business system where model training is required; The predicted execution cost of the business request is determined using the network model of the first node. The network model is optimized based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results. The model training results are synchronized to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the business request to be processed.
2. The method according to claim 1, characterized in that, The selection of the first node for model training in the business system includes: Determine the business processes that the business system will handle during the target time period; Determine the model training method based on the aforementioned business requirements; In the business system, the first node that needs to train the model is selected based on the model training method and the business requirements.
3. The method according to claim 2, characterized in that, In the business system, the first node that needs to train the model based on the model training method and the business selection includes: When the model training method is offline training and the business meets the first business condition, a first node for model training is selected in the business system; the first node is a backup node, and the second node is the main node in the business system. The method further includes: determining the resource load information of the business system; If the resource load information meets the preset load conditions, the network model through the first node is executed to determine the predicted execution cost of the service request.
4. The method according to claim 3, characterized in that, The step of synchronizing the model training results to the second node of the business system, wherein the model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it selects a target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer, includes: The model training results are synchronized to the master node so that the AI optimizer of the master node is updated based on the model training results. After the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request. After the AI optimizer of the master node is updated, the AI optimizer of the backup node is updated according to the model training results.
5. The method according to claim 3, characterized in that, During the training of the network model for the backup node, the master node continuously provides business services; The step of synchronizing the model training results to the master node, so as to update the AI optimizer of the master node based on the model training results, includes: The model training results are synchronized to the master node so that the master node stops providing the business service, and the AI optimizer of the master node is updated based on the model training results.
6. The method according to claim 3, characterized in that, The business request is a business request that has been executed in the past or a preset business request; Before optimizing the network model based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results, the method further includes: Obtain the actual execution cost value obtained after the business request is executed; or, The actual execution cost value is obtained by executing the business request through the backup node.
7. The method according to claim 2, characterized in that, In the business system, the first node that needs to train the model based on the model training method and the business selection includes: When the model training method is automatic training and the business meets the second business condition, if the business system meets the preset idle condition, then the first node that needs to be trained in the business system is selected; the first node is the main node and the second node is the backup node in the business system. The process of optimizing the network model based on the predicted execution cost and the actual execution cost of the business request to obtain the model training results includes: The network model is optimized based on the predicted execution cost and the actual execution cost of the business request until the model converges or reaches a preset time limit, at which point the model training result is obtained.
8. The method according to claim 2, characterized in that, In the business system, the first node that needs to train the model based on the model training method and the business selection includes: When the model training method is online training and the service meets the third service condition, in response to the received training task start instruction, a first node for model training is selected in the service system; the first node is the primary node and the second node is the backup node in the service system.
9. The method according to claim 7 or 8, characterized in that, The step of synchronizing the model training results to the second node of the business system, wherein the model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it selects a target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer, includes: The model training results are synchronized to the backup node so that the AI optimizer of the backup node is updated based on the model training results; After the AI optimizer of the backup node is updated, the AI optimizer of the master node is updated according to the model training results, so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
10. The method according to claim 2, characterized in that, In the business system, the first node that needs to train the model based on the model training method and the business selection includes: When the model training method is a near real-time training method and the business meets the fourth business condition, a first node for model training is selected in the business system; the first node is the primary node and the second node is the backup node in the business system. The step of determining the predicted execution cost of the service request using the network model of the first node includes: Obtain the original network model trained using offline, automatic, or online training methods, and use the original network model as the network model of the master node to determine the predicted execution cost of the business request.
11. The method according to claim 10, characterized in that, The step of synchronizing the model training results to the second node of the business system, wherein the model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it selects a target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer, includes: The model training results are synchronized to the backup node so that the AI optimizer of the backup node is updated based on the model training results; After the AI optimizer of the backup node is updated, the AI optimizer of the master node is updated according to the model training results, so that after the update is completed, if a pending business request is received, the updated AI optimizer selects the target execution method from the candidate execution methods to execute the pending business request.
12. The method according to claim 10, characterized in that, The method further includes: If the resource load information and resource occupancy information of the business system meet the preset training conditions, then the business requests received by the business system are selected for execution according to the target probability to obtain the actual execution cost value of the business requests.
13. The method according to any one of claims 1 to 8, 10 to 12, characterized in that, The first node is the master node, and the second node consists of multiple backup nodes. The AI optimizer update of each backup node begins upon receiving an update notification. The step of synchronizing the model training results to the second node of the business system includes: Synchronize the model training results to each of the backup nodes; The method further includes: broadcasting the verification information of the model training results to each of the backup nodes; Upon receiving a verification pass message from the backup node in response to the verification information feedback, the update notification is sent to each of the backup nodes.
14. The method according to any one of claims 1 to 8, 10 to 12, characterized in that, The first node is the target backup node among multiple backup nodes, and the second node is the master node; the AI optimizer update of the master node and the AI optimizer update of other backup nodes among the multiple backup nodes begin when an update notification is received. The step of synchronizing the model training results to the second node of the business system includes: The model training results are synchronized to the master node and the other backup nodes; The method further includes: broadcasting the verification information of the model training results to the master node and the other backup nodes; Upon receiving a verification pass message from the primary node and the other standby nodes in response to the verification information feedback, the update notification is sent to the primary node and the other standby nodes.
15. The method according to any one of claims 1 to 8, 10 to 12, characterized in that, The method further includes: If a fault is detected in the first node during the training of the network model, the training process is paused, and resumed when the first node recovers; or... During the training of the network model for the first node, if resource contention is detected among nodes, the resource usage of each node during training is dynamically adjusted; or, If the business system is detected to be overloaded during the training of the network model of the first node, a new backup node is added, and the training task of the network model is divided into sub-training tasks. The resulting sub-training tasks are then distributed to each of the backup nodes for distributed training.
16. The method according to any one of claims 1 to 12, characterized in that, The method further includes: When the service system receives service traffic exceeding a preset threshold, the resource consumption during network model training is reduced, or the network model training process is paused; or... Intermediate training results of the network model during the training process are stored periodically so that the network model can be restored to its training state based on the stored intermediate training results in the event of an interruption and subsequent recovery.
17. An update apparatus for an AI optimizer, characterized in that, The device includes: The selection module is used to select the first node in the business system that needs to be used for model training. The determination module is used to determine the predicted execution cost of the business request based on the network model of the first node; The optimization module is used to optimize the network model based on the predicted execution cost and the actual execution cost of the business request, and obtain the model training results; An update module is used to synchronize the model training results to the second node of the business system. The model training results are used to update the AI optimizer of the first node and the AI optimizer of the second node, so that when the first node or the second node receives a business request to be processed, it can select the target execution method from the candidate execution methods to execute the business request to be processed through the updated AI optimizer.
18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 16.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 16.
