Method and device for orderly quitting computing power resource storage tasks of intelligent computing center
In the computing resource storage task of the intelligent computing center, the main task module periodically sends registration task requests to the coordination management module and checks the main task exit flag, which solves the problem of lack of the main thread checking the registration thread status in the existing technology, and achieves orderly exit and task stability.
Patent Information
- Application Number
- CN202510282793.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-27
AI Technical Summary
The lack of the main thread in the prior art checks the status of the registered thread, resulting in the unregistered backup/restore task affecting other tasks and affecting the entire process.
In the computing resource storage task of the Intelligent Computing Center, the main task module periodically sends registration task requests for the main task renewal to the coordination management module, checks whether the main task is set to the main task exit flag, and sets the registration task exit flag and cancels the registration task according to the results.
Through mutual checking exit marks between the main task and the registered task, orderly exit is achieved, the stability of the task and the integrity of the process are improved, and the problem of lack of main thread checking the status of the registered thread in the prior art is solved.
Smart Images

Figure CN120216128A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of intelligent computing centers, intelligent computing centers and computing power infrastructure technologies, and particularly relates to a method and device for orderly exiting a computing power resource storage task of an intelligent computing center. Background Art
[0002] With the rapid development of artificial intelligence technology, "intelligent computing centers" and "intelligent computing centers" have emerged as the times require.
[0003] An "intelligent computing center" refers to a facility that provides the required computing power, data, and algorithms for artificial intelligence applications (such as scenarios of artificial intelligence deep learning model development, model training, and model inference) by using large-scale heterogeneous computing power resources, including general computing power and intelligent computing power. The intelligent computing center covers facilities, hardware, and software, and can provide full-stack capabilities from underlying computing power to top-level application enabling.
[0004] The "intelligent computing center" includes but is not limited to the "intelligent computing center".
[0005] An "intelligent computing center", that is, an artificial intelligence computing center, is a type of computing power infrastructure that provides computing power services, data services, and algorithm services required for artificial intelligence applications based on artificial intelligence theory and using an artificial intelligence computing architecture.
[0006] "Computing power" is the core of "intelligent computing centers" and "intelligent computing centers", and is the ability of computer devices or computing / data centers to process information. It is the ability of computer hardware and software to cooperate to jointly execute a certain computing requirement. It is the computing ability to output a target result by processing information data. It is a new type of productive force integrating information computing power, network carrying capacity, and data storage capacity, and mainly provides services to society through computing power infrastructure.
[0007] "Computing power resource metadata" is a set of data used to describe and identify computing power resources, and is an identity card that details various attributes of this machine, this cluster, or this cloud instance, facilitating the management, scheduling, and use of computing power resources.
[0008] In the scenario of full-library backup / restore of the data storage of computing power resource metadata, at the end of the task execution, that is, before the main thread exits, it is necessary to check the status of the registered thread and know when the registered thread exits. However, in the prior art, the main thread lacks checking the status of the registered thread, which may lead to the situation that if there are backup / restore tasks that have not been cancelled, it will affect other backup or restore tasks, thereby affecting the entire process. Summary of the Invention
[0009] The present invention provides a method and apparatus for orderly exiting a computing power resource storage task in an intelligent computing center to solve the problem that the existing technology lacks a main thread to check the status of a registered thread.
[0010] To solve the above technical problems, the present invention is implemented as follows:
[0011] In a first aspect, the present invention provides a method for orderly exiting a computing power resource storage task in an intelligent computing center, which is applied to a registration task module and includes:
[0012] Step S1: When the main task module executes the main task, periodically send a request for renewing the registration task of the main task to the coordination management module, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0013] Step S2: Check whether the main task module sets a main task exit flag for the main task;
[0014] Step S3: If a main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task;
[0015] Step S4: If a main task exit flag is not set for the main task, perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation, and cancel the registration task.
[0016] Optionally, before the step S1, it further includes:
[0017] Step S0: Send a request for the first registration task of the main task to the coordination management module, receive a notice for executing the main task sent by the coordination management module according to the request for the registration task, and forward the notice for executing the main task to the main task module.
[0018] Optionally, in the step S4, the error detection operation includes:
[0019] Step S41: Set an error flag and a registration retry count for the registration task;
[0020] Step S42: Check whether an error occurs in the registration task;
[0021] Step S43: If no error occurs in the registration task, clear the error flag and return to the step S2 after waiting for a preset time;
[0022] Step S44: If an error occurs in the registration task, wait for a preset time and then check whether the main task module sets a main task exit flag for the main task; if the main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task; if the main task exit flag is not set for the main task, check whether the registration retry count is exhausted; if the registration retry count is exhausted, set a registration task exit flag and cancel the registration task; if the registration retry count is not exhausted, return to step S42 until the registration retry count is exhausted or it is checked that the registration task has no error.
[0023] In a second aspect, the present invention provides a method for orderly exiting a computing power resource storage task of an intelligent computing center, which is applied to a main task module and includes:
[0024] Step S1': Check whether the registration task under the registration task module exits abnormally.
[0025] Step S2': If the registration task exits abnormally, cancel the registration task and exit the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task.
[0026] Step S3': If the registration task does not exit abnormally, check whether a main task exit flag is set for the main task; where the registration task module sets a registration task exit flag and cancels the registration task by checking whether a main task exit flag is set for the main task.
[0027] Step S4': If a main task exit flag is set for the main task, check whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task; if the main task exit flag is not set for the main task, set a main task exit flag for the main task and check whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task.
[0028] Optionally, before step S1', it further includes:
[0029] Step S0': Receive a notification for executing the main task forwarded by the registration task module and execute the main task according to the notification for executing the main task.
[0030] Optionally, step S4' further includes:
[0031] Step S41': When checking whether a registration task exit flag is set for the registration task, cancel the registration task or check again whether the registration task exit flag is set after a preset waiting time.
[0032] In a third aspect, the present invention provides a registration task module, including:
[0033] A first sending module, configured to periodically send a request for a registration task for renewing the main task to a coordination management module when the main task module executes the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0034] A first checking module, configured to check whether the main task module sets a main task exit flag for the main task;
[0035] A first processing module, configured to set a registration task exit flag and cancel the registration task if the main task module sets a main task exit flag;
[0036] A second processing module, configured to perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation and cancel the registration task if the main task module does not set a main task exit flag.
[0037] Optionally, before the step S1, it further includes:
[0038] A third processing module, configured to send a request for the first registration task of the main task to the coordination management module, receive a notice for executing the main task sent by the coordination management module according to the request for the registration task, and forward the notice for executing the main task to the main task module.
[0039] Optionally, the error detection operation includes:
[0040] A fourth processing module, configured to set an error flag and a registration retry count for the registration task;
[0041] A second checking module, configured to check whether an error occurs in the registration task;
[0042] A fifth processing module, configured to clear the error flag and return to the step S2 after waiting for a preset time if no error occurs in the registration task;
[0043] A sixth processing module, configured to: if an error occurs in the registration task, wait for a preset time and then check whether the main task module sets a main task exit flag for the main task; if the main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task; if the main task exit flag is not set for the main task, check whether the registration retry count is exhausted; if the registration retry count is exhausted, set a registration task exit flag and cancel the registration task; if the registration retry count is not exhausted, return to step S42 until the registration retry count is exhausted or it is checked that the registration task has no error.
[0044] In a fourth aspect, the present invention provides a main task module, including:
[0045] A third checking module, configured to check whether a registration task under the registration task module abnormally exits;
[0046] A seventh processing module, configured to: if the registration task abnormally exits, cancel the registration task and exit the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0047] An eighth processing module, configured to: if the registration task does not abnormally exit, check whether a main task exit flag is set for the main task; where the registration task module sets a registration task exit flag and cancels the registration task by checking whether the main task exit flag is set for the main task;
[0048] A ninth processing module, configured to: if the main task exit flag is set for the main task, check whether the registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task; if the main task exit flag is not set for the main task, set the main task exit flag for the main task and check whether the registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task.
[0049] Optionally, it further includes:
[0050] A tenth processing module, configured to receive a notification of executing the main task forwarded by the registration task module and execute the main task according to the notification of executing the main task;
[0051] Optionally, it further includes:
[0052] The fourth checking module is used to execute the cancellation of the registration task or check again whether the registration task has set a registration task exit flag after a preset waiting time when checking whether the registration task has set a registration task exit flag.
[0053] In a fifth aspect, the present invention provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, it implements the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the first aspects, or the steps in the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the second aspects.
[0054] In a sixth aspect, the present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the first aspects, or the steps in the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the second aspects.
[0055] In a seventh aspect, the present invention provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, it implements the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the first aspects, or the steps in the method for orderly exit of the computing power resource storage task of the intelligent computing center as described in any one of the second aspects.
[0056] In the present invention, when the main task module executes the main task, it periodically sends a request for the registration task of renewing the main task to the coordination management module, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task; check whether the main task module has set a main task exit flag for the main task; if a main task exit flag has been set for the main task, then set a registration task exit flag and cancel the registration task; step S4: if a main task exit flag has not been set for the main task, then perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation, and cancel the registration task. By mutually checking the exit flags between the main task and the registration task, an orderly exit is achieved, making the code logic clearer, facilitating subsequent maintenance and expansion, and solving the problem that the existing method lacks the main thread to check the status of the registration thread. Description of the Drawings
[0057] Upon reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0058] Figure 1 is a flowchart of the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention when applied to a registration task module;
[0059] Figure 2 is a schematic diagram of the sending of a registration task request for the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention;
[0060] Figure 3 is an overall flowchart of the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention when applied to a registration task module;
[0061] Figure 4 is a schematic diagram of the synchronous check of the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention;
[0062] Figure 5 is a flowchart of the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention when applied to a main task module;
[0063] Figure 6 is an overall flowchart of the method for orderly exit of computing power resource storage tasks in an intelligent computing center provided by the present invention when applied to a main task module;
[0064] Figure 7 is a schematic diagram of the structure of a registration task module provided by the present invention;
[0065] Figure 8 is a schematic diagram of the structure of a main task module provided by the present invention;
[0066] Figure 9 is a schematic diagram of the structure of an electronic device provided by the present invention. Detailed embodiments
[0067] Next, the technical solutions in the present invention will be clearly and completely described in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts fall within the protection scope of the present invention.
[0068] First, the technical terms related to the present invention will be briefly described below.
[0069] The "computing power" described in the present invention refers to: the ability of a computer device or a computing / data center to process information, the ability of computer hardware and software to cooperate to jointly execute a certain computing requirement, the computing ability to achieve the output of a target result by processing information data, a new type of productive force integrating information computing power, network carrying capacity, and data storage capacity, and mainly providing services to society through computing power infrastructure.
[0070] The "computational power" (Computational Power, CP) described in the present invention refers to: the ability of a data center server to process data and achieve result output, a comprehensive indicator for measuring the computing ability of a data center, including general computing ability, supercomputing ability, and intelligent computing ability. The commonly used measurement unit is the number of floating-point operations per second (FLOPS, 1 EFLOPS = 10^18 FLOPS), and the larger the value, the stronger the comprehensive computing ability. It is estimated that 1 EFLOPS is approximately the computing power output of 5 Tianhe-2A or 500,000 mainstream server CPUs or 2 million mainstream laptops. The calculation formula is: CP = CP_general + CP_intelligent + CP_super.
[0071] The "network power" (Network Power, NP) described in the present invention refers to: the manifestation of the data transmission ability of computing power facilities, a comprehensive ability including network architecture, network bandwidth, transmission delay, intelligent management and scheduling, etc., involving network transmission within and between data centers, and a comprehensive indicator for measuring network transmission scheduling ability.
[0072] The "storage power" (Storage Power, SP) described in the present invention refers to: the comprehensive ability of a data center in four aspects: data storage capacity, performance, security and reliability, and green and low-carbon, a comprehensive indicator for measuring the data storage ability of a data center, including external storage devices such as storage arrays and server internal storage devices. The commonly used measurement unit for storage capacity is exabyte (EB, 1 EB = 2^60 bytes), the commonly used measurement unit for performance is the number of read / write operations per second per unit capacity (IOPS / TB, Input / Output Operations Per Second / TB), and the disaster recovery ratio is an important manifestation of security and reliability.
[0073] The "computing power infrastructure" described in the present invention refers to: a new type of information infrastructure integrating information computing power, network carrying capacity, and data storage capacity, which can realize the centralized computing, storage, transmission, and application of information, presenting characteristics such as multi-element ubiquitous, intelligent and agile, secure and reliable, green and low-carbon, and is of great significance for boosting industrial transformation and upgrading, empowering China's scientific and technological innovation, meeting people's beautiful life, and realizing high-efficiency social governance.
[0074] The "new information infrastructure" described in the present invention refers to: mainly including network infrastructures such as 5G networks, fiber broadband networks, backbone networks, international communication networks, satellite Internet, etc., computing power infrastructures such as data centers, general computing power centers, intelligent computing centers, supercomputing centers, etc., and new technology facilities such as artificial intelligence, blockchain, and quantum computing. With the emergence and popularization of new general technologies, the form of the new information infrastructure will be more diverse.
[0075] The "computing power" described in the present invention includes: general computing power, intelligent computing power, and super computing power.
[0076] The "general computing power" described in the present invention refers to: the computing power provided by servers based on CPU (Central Processing Unit) chips, which is used to support basic general computing such as cloud computing and edge computing.
[0077] The "intelligent computing power" described in the present invention refers to: for various artificial intelligence innovation applications, a computing platform is deployed on a large scale based on dedicated chips such as GPU (Graphics Processing Unit), FPGA (Field Programmable Gate Array), and ASIC (Application Specific Integrated Circuit), such as natural language processing, machine vision, etc.
[0078] The "super computing power" described in the present invention refers to: mainly the computing power provided by high-performance computing clusters such as supercomputers. It utilizes the centralized computing resources of multiple computer systems working in parallel and processes extremely complex or data-intensive problems through a dedicated operating system, mainly used for computing in cutting-edge scientific fields, such as planetary simulation, drug molecule design, gene analysis, etc.
[0079] The "intelligent computing center" described in the present invention refers to: a facility that provides the required computing power, data, and algorithms mainly for artificial intelligence applications (such as scenarios like artificial intelligence deep learning model development, model training, and model inference) by using large-scale heterogeneous computing power resources, including general computing power (CPU) and intelligent computing power (GPU, FPGA, ASIC, etc.). The intelligent computing center covers facilities, hardware, and software, and can provide full-stack capabilities from underlying computing power to top-level application enabling.
[0080] The "intelligent computing center" described in the present invention includes but is not limited to the "intelligent computing center".
[0081] The "Intelligent Computing Center" described in the present invention, namely the artificial intelligence computing center, is a type of computing infrastructure based on artificial intelligence theory, adopting an artificial intelligence computing architecture, and providing computing power services, data services, and algorithm services required for artificial intelligence applications.
[0082] The "Computing Power Center" described in the present invention refers to: a facility mainly composed of infrastructure such as wind, fire, water, and electricity and IT software and hardware devices, with computing power, carrying capacity, and storage capacity, including general data centers, intelligent computing centers, supercomputing centers, etc.
[0083] The "Supercomputing Center" described in the present invention refers to: that is, a supercomputing data center, which is a data center based on supercomputers or large-scale computing clusters, capable of providing functions such as large-scale computing, storage, and network services, and is widely used in application scenarios such as aerospace, national defense, oil exploration, climate modeling, and genome sequencing.
[0084] The "Computing Power Resources" described in the present invention refers to: technologies and facilities with information computing, transmission, storage, and application capabilities required for the development of the digital society, including but not limited to computing resources such as CPUs and GPUs, network resources such as switches and routers, storage resources such as storage arrays and distributed storage, security resources such as firewalls and intrusion detection systems, and support and guarantee resources such as wind, fire, water, and electricity.
[0085] The "Model" described in the present invention includes but is not limited to "Large Language Model" and "Multimodal Large Model".
[0086] The "Large Language Model" described in the present invention refers to a large language model (LLM), which is a language model with a relatively large number of parameters, aiming to understand and generate human language, trained through a large amount of text data, and can perform a wide range of tasks including text summarization, translation, sentiment analysis, etc.
[0087] The "Multimodal Large Model" described in the present invention refers to: a model that jointly trains multi-modal information such as text, images, videos, and audio, including but not limited to multimodal large language models.
[0088] Please refer to Figure 1 , the present invention provides a method for orderly exiting the storage task of computing power resources in an intelligent computing center, which is applied to a registration task module, including:
[0089] Step S1: When the main task module executes the main task, periodically send a request for registering a task for renewing the main task to the coordination management module, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0090] In the present invention, the backup / recovery module includes the registration task module and the main task module; the main tasks include the full backup task and the full recovery task in the storage tasks. Among them, the full backup task is to back up the full data of a certain time point of the cluster, including tenants, databases, tables, and region databases. The backup / recovery module interacts with the coordination and management module to initiate a full backup request; the full recovery task is to restore the backed-up disk files to a brand-new empty library up to the directory of the restored data. The backup / recovery module interacts with the coordination and management module to initiate a full recovery request.
[0091] In the present invention, optionally, before the step S1, the following is further included:
[0092] Step S0: Send a request for the registration task of the main task for the first time to the coordination and management module, receive the notice for executing the main task sent by the coordination and management module according to the request for the registration task, and forward the notice for executing the main task to the main task module.
[0093] Specifically, please refer to Figure 2 , after sending a request for the registration task of the main task for the first time to the coordination and management module, receive the notice for executing the main task sent by the coordination and management module according to the request for the registration task, and forward the notice for executing the main task to the main task module; subsequently, the registration task module periodically sends a request for the renewal registration task of the main task to the coordination and management module, and the coordination and management module will determine whether the request for the registration task meets the preset task requirements and return a response to the request for the registration task, so as to ensure that only one main task is supported for execution at the same time. If the registration task times out or exits, the execution of other main tasks is allowed, and the coordination and management module can also clean up the main task in time, which is convenient for allowing the execution of other backup / recovery tasks and enhancing the stability of the system.
[0094] Step S2: Check whether the main task module sets a main task exit flag for the main task;
[0095] Step S3: If a main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task;
[0096] In the present invention, please refer to Figure 3, when the registration task is not run for the first time, set the main thread, that is, set the main task as running, and check whether the main task module sets a main task exit flag for the main task, that is, check whether the main task is about to exit. If the main task exit flag is not set for the main task, set an error code for the registration task, set a registration task exit flag, and directly cancel the registration task, that is, set the registration task to exit; subsequently, the main task will determine whether to exit the main task according to the registration task exit flag; that is, if the registration task sets a registration task exit flag, cancel the registration task and exit the main task.
[0097] Step S4: If the main task exit flag is not set for the main task, perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation, and cancel the registration task.
[0098] In the present invention, optionally, in the step S4, the error detection operation includes:
[0099] Step S41: Set an error flag and a registration retry count for the registration task;
[0100] Step S42: Check whether an error occurs in the registration task;
[0101] Step S43: If no error occurs in the registration task, clear the error flag, wait for a preset time, and then return to the step S2;
[0102] Step S44: If an error occurs in the registration task, wait for a preset time and then check whether the main task module sets a main task exit flag for the main task; if the main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task; if the main task exit flag is not set for the main task, check whether the registration retry count is exhausted; if the registration retry count is exhausted, set a registration task exit flag and cancel the registration task; if the registration retry count is not exhausted, return to the step S42 until the registration retry count is exhausted or it is checked that no error occurs in the registration task.
[0103] In the present invention, specifically, please refer to Figure 3 , if the main task exit flag is not set for the main task, set an error flag and a registration retry count for the registration task, where the retry count can be configured according to the actual situation and can be set to 5 times in the present invention but is not limited thereto;
[0104] Continuously and periodically send a request for the registration task of renewing the main task (including a registration backup task or a registration recovery task) to the Coordinator.
[0105] Check whether an error occurs in the registration task;
[0106] If no error occurs in the registration task, clear the error flag and wait for a preset time, then return to step S2, that is, re-check whether the main task module sets a main task exit flag for the main task;
[0107] If an error occurs in the registration task, wait for a preset time and then re-check whether the main task module sets a main task exit flag for the main task;
[0108] If a main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task;
[0109] If a main task exit flag is not set for the main task, check whether the registration retry count is exhausted; if the registration retry count is exhausted, set a registration task exit flag and cancel the registration task; if the registration retry count is not exhausted, return to step S42 until the registration retry count is exhausted or it is checked that no error occurs in the registration task.
[0110] In the present invention, please refer to Figure 4 , by mutually checking the exit flags between the main task and the registration task, an orderly exit is realized, making the code logic clearer, facilitating subsequent maintenance and extension, and using atomic operations for synchronization between the main task and the registration task, where the atomic operation is an uninterruptible operation, either fully executed or not executed at all, that is, controlling the memory visibility between atomic operations to prevent errors caused by instruction reordering and ensuring synchronization between tasks.
[0111] In the present invention, when the main task module executes the main task, it periodically sends a request for the registration task of renewing the main task to the coordination management module, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task; check whether the main task module sets a main task exit flag for the main task; if a main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task; step S4: if a main task exit flag is not set for the main task, perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation, and cancel the registration task. By mutually checking the exit flags between the main task and the registration task, an orderly exit is realized, making the code logic clearer, facilitating subsequent maintenance and extension, and solving the problem that the existing technology lacks the main thread to check the status of the registration thread.
[0112] Please refer to Figure 5, the present invention provides a method for the orderly exit of computing power resource storage tasks in an intelligent computing center, which is applied to the main task module and includes:
[0113] Step S1': Check whether the registered tasks under the registered task module have exited abnormally;
[0114] In the present invention, the backup / restore module includes the registered task module and the main task module; the main task module executes the main task, and the main task includes the full backup task and the full restore task in the storage task. Among them, the full backup task is to back up the full data of a certain time point of the cluster, including tenants, databases, tables, and region databases. The backup / restore module interacts with the coordination management module to initiate a full backup request; the full restore task is to restore the backed-up disk files to a brand-new empty library until the directory of the playback data is reached. The backup / restore module interacts with the coordination management module to initiate a full restore request.
[0115] In the present invention, optionally, before the step S1', it further includes:
[0116] Step S0': Receive the notification of executing the main task forwarded by the registered task module, and execute the main task according to the notification of executing the main task;
[0117] In the present invention, the registered task module sends a request for the first registered task of the main task to the coordination management module, receives the notification of executing the main task sent by the coordination management module according to the request of the registered task, and forwards the notification of executing the main task to the main task module.
[0118] Specifically, please refer to Figure 2, after the registration task module sends a request for the first registration task of the main task to the coordination management module, it receives a notice to execute the main task sent by the coordination management module according to the request of the registration task, and forwards the notice to execute the main task to the main task module; among them, when the main task registers with the coordination management module, it can set the timeout time to 30 seconds according to the actual situation, that is, after the time (30 seconds) has passed, when the task registers with the coordinator again, it is considered that the main task has failed this time. Then, when the registration task is initiated every 5 seconds, that is, the registration task has 6 opportunities. Even if the first 6 attempts fail and the 7th registration is successful, the main task can still continue to run normally. However, when the registration task is completed, the main task needs to wait for the current registration task to exit. Since the registration task is a timed task and it takes up to 5 seconds to receive the exit instruction initiated by the main task, progress waiting can be added to ensure the normal operation of the task. Subsequently, the registration task module periodically sends a request for the registration task of renewing the main task to the coordination management module, and the coordination management module will judge whether the request of the registration task meets the preset task requirements and return a response to the request of the registration task, so as to ensure that only one main task is supported for execution at the same time. If the registration task times out or exits, other main tasks are allowed to execute, and the coordination management module can also clean up the main task in time, which is convenient for allowing other backup / restore tasks to execute and enhancing the stability of the system.
[0119] Step S2': If the registration task exits abnormally, cancel the registration task and exit the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0120] In the present invention, please refer to Figure 6 , if the registration task has exited before the main task sets the main task exit flag, it means that the registration task has exited abnormally. Cancel the registration task and exit the main task, that is, the main task first checks whether there is a registration task being executed. If so, it checks the exit flag.
[0121] Step S3': If the registration task has not exited abnormally, check whether the main task exit flag is set for the main task; among them, the registration task module sets the registration task exit flag and cancels the registration task by checking whether the main task exit flag is set for the main task.
[0122] In the present invention, if the registration task does not abnormally exit, it is checked whether a main task exit flag is set for the main task; if the main task exit flag is set as not exited, the main task exit flag is set as exited, and a signal is forcibly sent to the registration thread, so that the registration task module can check whether the main task module sets a main task exit flag for the main task, that is, check whether the main task is about to exit. Thus, by checking whether a main task exit flag is set for the main task, a registration task exit flag is set, and the registration task is cancelled.
[0123] Step S4': If a main task exit flag is set for the main task, it is checked whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, the registration task is cancelled, and the main task exits; if a main task exit flag is not set for the main task, a main task exit flag is set for the main task, and it is checked whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, the registration task is cancelled, and the main task exits.
[0124] In the present invention, if a main task exit flag is set for the main task, it is checked whether a registration task exit flag is set for the registration task. If it is seen that the registration task has completed and exited, the main task exits.
[0125] In the present invention, optionally, step S4' further includes:
[0126] Step S41': When checking whether a registration task exit flag is set for the registration task, after a preset waiting time, the registration task is cancelled or it is checked again whether a registration task exit flag is set for the registration task.
[0127] In the present invention, by setting a preset waiting time, it can be set to one second according to actual situations, but is not limited thereto. By setting the waiting time, system resources can be effectively managed, avoiding an overloaded system caused by overly frequent cancellation operations, and avoiding conflicts with other tasks. Setting the waiting time can ensure that these tasks are completed before cancellation, thereby reducing potential errors or data loss.
[0128] In the present invention, please refer to Figure 4 , and by mutually checking the exit flags between the main task and the registration task, an orderly exit is achieved, making the code logic clearer, facilitating subsequent maintenance and expansion, and using atomic operations for synchronization between the main task and the registration task. Among them, the atomic operation is an uninterruptible operation, either fully executed or not executed at all, that is, controlling the memory visibility between atomic operations, preventing errors caused by instruction reordering, and ensuring synchronization between tasks.
[0129] Please refer to Figure 7 , the present invention provides a registration task module, including:
[0130] A first sending module 71, configured to periodically send a request for registering a task for renewing the main task to a coordination management module when the main task module executes the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0131] A first checking module 72, configured to check whether the main task module sets a main task exit flag for the main task;
[0132] A first processing module 73, configured to set a registration task exit flag and cancel the registration task if the main task module sets a main task exit flag for the main task;
[0133] A second processing module 74, configured to perform an error detection operation and determine whether to set a registration task exit flag according to the result of the error detection operation and cancel the registration task if the main task module does not set a main task exit flag for the main task.
[0134] In the present invention, optionally, before the step S1, it further includes:
[0135] A third processing module, configured to send a request for registering a task for the first time of the main task to the coordination management module, receive a notification for executing the main task sent by the coordination management module according to the request for the registration task, and forward the notification for executing the main task to the main task module.
[0136] In the present invention, optionally, the error detection operation includes:
[0137] A fourth processing module, configured to set an error flag and a registration retry count for the registration task;
[0138] A second checking module, configured to check whether an error occurs in the registration task;
[0139] A fifth processing module, configured to clear the error flag and wait for a preset time and then return to the step S2 if no error occurs in the registration task;
[0140] The sixth processing module is configured to, if an error occurs in the registration task, check whether the main task module sets a main task exit flag for the main task after waiting for a preset time; if the main task exit flag is set for the main task, set a registration task exit flag and cancel the registration task; if the main task exit flag is not set for the main task, check whether the registration retry count is exhausted; if the registration retry count is exhausted, set a registration task exit flag and cancel the registration task; if the registration retry count is not exhausted, return to step S42 until the registration retry count is exhausted or it is checked that the registration task has no error.
[0141] The registration task module provided by the present invention can implement Figure 1 each process implemented by the method embodiments described above and achieve the same technical effects. To avoid repetition, they will not be elaborated here.
[0142] Please refer to Figure 8 , the present invention provides a main task module, including:
[0143] The third checking module 81 is configured to check whether the registration task under the registration task module exits abnormally;
[0144] The seventh processing module 82 is configured to, if the registration task exits abnormally, cancel the registration task and exit the main task, where the registration task is a secondary task, and the main task includes a data backup task or a data recovery task;
[0145] The eighth processing module 83 is configured to, if the registration task does not exit abnormally, check whether a main task exit flag is set for the main task; wherein, the registration task module sets a registration task exit flag and cancels the registration task by checking whether a main task exit flag is set for the main task;
[0146] The ninth processing module 84 is configured to, if a main task exit flag is set for the main task, check whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task; if the main task exit flag is not set for the main task, set a main task exit flag for the main task and check whether a registration task exit flag is set for the registration task; if the registration task exit flag is set for the registration task, cancel the registration task and exit the main task.
[0147] In the present invention, optionally, it further includes:
[0148] The tenth processing module is configured to receive a notification for executing the main task forwarded by the registration task module and execute the main task according to the notification for executing the main task;
[0149] Optionally, the present invention further includes:
[0150] A fourth inspection module, configured to execute canceling the registration task or re-inspecting whether the registration task is set with a registration task exit flag after a preset waiting time when inspecting whether the registration task is set with a registration task exit flag.
[0151] The main task module provided by the present invention can implement Figure 5 each process implemented by the method embodiments, and achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0152] The present invention provides an electronic device 90. Refer to Figure 9 as shown. Figure 9 It is a principle block diagram of the electronic device 90 of the present invention, including a processor 91, a memory 92, and a program or instruction stored on the memory 92 and executable on the processor 91. When the program or instruction is executed by the processor, it implements the steps in any one of the methods for orderly exit of the computing power resource storage task of the intelligent computing center of the present invention.
[0153] The present invention provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, it implements each process of the embodiments of the method for orderly exit of the computing power resource storage task of the intelligent computing center as described above, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0154] The embodiment of the present application further provides a computer program product, including a computer instruction, which implements each process of the method embodiment as described above Figure 1 or Figure 5 as shown when the computer instruction is executed by the processor, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0155] A computer-readable medium includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information accessible by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0156] It should be noted that in the technical solutions of the present disclosure, in aspects such as the collection, acquisition, update, analysis, processing, use, transmission, and storage of user personal information, they all comply with the provisions of relevant laws and regulations, are used for legal purposes, and do not violate public order and good customs. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and to maintain the security of user personal information and network security.
[0157] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising that element.
[0158] The above serial numbers of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0159] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a service classification device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0160] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for orderly exiting computing resource storage tasks in an intelligent computing center, characterized in that: Applicable to the registration task module, including: Step S1: When the main task module executes the main task, it periodically sends a request for a registration task for renewal of the main task to the coordination management module, wherein the registration task is a secondary task, and the main task includes a data backup task or a data recovery task; Step S2: Check whether the main task module sets a main task exit mark for the main task; Step S3: If a main task exit mark is set for the main task, a registered task exit mark is set, and the registered task is cancelled; Step S4: If the main task exit mark is not set for the main task, an error detection operation is performed and it is determined whether to set the registered task exit mark according to the result of the error detection operation, and the registered task is deregistered.
2. The method for orderly exiting computing power resource storage tasks of an intelligent computing center according to claim 1 is characterized in that: Before step S1, the method further includes: Step S0: Send the first registration task request of the main task to the coordination management module, receive the notification of executing the main task sent by the coordination management module according to the registration task request, and forward the notification of executing the main task to the main task module.
3. The method for orderly exiting computing resource storage tasks of an intelligent computing center according to claim 1, characterized in that: In step S4, the error detection operation includes: Step S41: setting an error mark for the registration task and the number of registration retries; Step S42: Check whether an error occurs in the registration task; Step S43: if no error occurs in the registration task, clear the error flag and return to step S2 after waiting for a preset time; Step S44: If an error occurs in the registration task, then wait for a preset time and then check whether the main task module sets a main task exit mark for the main task; if the main task exit mark is set for the main task, then set the registration task exit mark and cancel the registration task; if the main task exit mark is not set for the main task, then check whether the registration retry times are exhausted; if the registration retry times are exhausted, then set the registration task exit mark and cancel the registration task; if the registration retry times are not exhausted, then return to step S42 until the registration retry times are exhausted, or check that no error occurs in the registration task.
4. A method for orderly exiting computing resource storage tasks in an intelligent computing center, characterized in that: Applicable to the main task module, including: Step S1': Check whether the registration task under the registration task module exits abnormally; Step S2': if the registration task exits abnormally, cancel the registration task and exit the main task, wherein the registration task is a secondary task and the main task includes a data backup task or a data recovery task; Step S3': if the registered task is not abnormally exited, check whether a main task exit mark is set for the main task; wherein the registered task module sets a registered task exit mark and cancels the registered task by checking whether a main task exit mark is set for the main task; Step S4': If the main task exit mark is set for the main task, check whether the registered task exit mark is set for the registered task; if the registered task exit mark is set for the registered task, cancel the registered task and exit the main task; if the main task exit mark is not set for the main task, set the main task exit mark for the main task and check whether the registered task exit mark is set for the registered task; if the registered task exit mark is set for the registered task, cancel the registered task and exit the main task.
5. The method for orderly exiting computing resource storage tasks of an intelligent computing center according to claim 4 is characterized in that: Before step S1', the method further includes: Step S0': receiving the notification of executing the main task forwarded by the registered task module, and executing the main task according to the notification of executing the main task.
6. The method for orderly exiting computing resource storage tasks of an intelligent computing center according to claim 4 is characterized in that: The step S4' further comprises: Step S41 ′: when checking whether the registration task has a registration task exit mark set, canceling the registration task after a preset waiting time or checking again whether the registration task has a registration task exit mark set.
7. A registration task module, characterized in that: include: A first sending module, used for periodically sending a request for a registration task for renewal of the main task to the coordination management module when the main task module executes the main task, wherein the registration task is a secondary task, and the main task includes a data backup task or a data recovery task; A first checking module, used for checking whether the main task module sets a main task exit mark for the main task; A first processing module, configured to set a registered task exit mark and cancel the registered task if a main task exit mark is set for the main task; The second processing module is used to perform an error detection operation if the main task exit mark is not set for the main task, and determine whether to set the registered task exit mark according to the result of the error detection operation, and cancel the registered task.
8. A main task module, characterized in that: include: The third checking module is used to check whether the registration task under the registration task module exits abnormally; A seventh processing module, configured to cancel the registration task and exit the main task if the registration task exits abnormally, wherein the registration task is a secondary task and the main task includes a data backup task or a data recovery task; an eighth processing module, configured to check whether a main task exit mark is set for the main task if the registered task does not exit abnormally; wherein the registered task module sets a registered task exit mark and cancels the registered task by checking whether a main task exit mark is set for the main task; The ninth processing module is used for checking whether the registered task exit mark is set for the registered task if the main task exit mark is set for the main task; if the registered task exit mark is set for the registered task, canceling the registered task and exiting the main task; if the main task exit mark is not set for the main task, setting the main task exit mark for the main task and checking whether the registered task exit mark is set for the registered task; if the registered task exit mark is set for the registered task, canceling the registered task and exiting the main task.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, it implements the method for orderly exiting the computing power resource storage task of the intelligent computing center as described in any one of claims 1 to 3, or the steps in the method for orderly exiting the computing power resource storage task of the intelligent computing center as described in any one of claims 4 to 6.
10. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, which, when executed by the processor, implement the method for orderly exiting the computing power resource storage tasks of the intelligent computing center as described in any one of claims 1 to 3, or the steps in the method for orderly exiting the computing power resource storage tasks of the intelligent computing center as described in any one of claims 4 to 6.
11. A computer program product, characterized in that It includes computer instructions, which, when executed by a processor, implement the method for orderly exiting the computing power resource storage task of an intelligent computing center as described in any one of claims 1 to 3, or the steps in the method for orderly exiting the computing power resource storage task of an intelligent computing center as described in any one of claims 4 to 6.