Batch business task execution methods, apparatus, equipment, media and program products
Patent Information
- Application Number
- CN202210433253.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-04-22
AI Technical Summary
若同时要在服务器端针对数据中心中包括操作系统、数据库、中间件、存储在内的等多种类型的专业对象进行脚本任务或命令的批量调度执行,现有情况下尚缺少统一便捷的手段能够根据运维需求集中调度,实现在服务器端批量对包含多个专业对象在内的脚本任务进行统一调度执行,并将其反馈给运维操作人员
[0023]本公开提供了一种批量业务任务执行方法、装置、设备、介质和程序产品。其中,批量业务任务执行方法,包括:解析所述批量业务任务对应的批量任务文件,确定所述批量任务文件中每个任务文件对应的任务要素信息;根据所述任务要素信息获取对应所述每个任务文件的本地任务脚本;以及基于所述批量任务文件对应的任务检查信息,执行所述每个任务文件的本地任务脚本,完成所述批量业务任务执行。因此,本公开的批量业务任务执行方法可以适用于大规模数据中心,且能适配各种版本的各种专业对象,支持对系统环境批量进行脚本任务推送与自动化执行,并能够最大化降低一线系统侧的运维成本,能够在保证任务执行精度的情况下,进一步提升批量业务任务执行效率。
Smart Images

Figure CN114721807B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically to a method, apparatus, device, medium, and program product for executing batch business tasks. Background Technology
[0002] Data center open platform servers are numerous, with a wide variety of operational objects and versions. Currently, there is a lack of a unified and convenient method to centrally schedule and execute script tasks or commands on the server side for various types of specialized objects within the data center, including operating systems, databases, middleware, and storage. This would allow for batch execution of script tasks involving multiple specialized objects on the server side and subsequent feedback to operations personnel. Summary of the Invention
[0003] In view of the above problems, this disclosure provides a batch business task execution method, device, equipment, media and program product that is applicable to large-scale data centers, can be adapted to various professional objects of various versions, supports batch script task push and automated execution in system environment, and can maximize the reduction of operation and maintenance costs on the front-line system side.
[0004] According to a first aspect of this disclosure, a method for executing batch business tasks is provided, comprising: parsing batch task files corresponding to the batch business tasks, determining task element information corresponding to each task file in the batch task files; obtaining a local task script corresponding to each task file based on the task element information; and executing the local task script of each task file based on task check information corresponding to the batch task files to complete the execution of the batch business tasks.
[0005] According to an embodiment of this disclosure, before parsing the batch task file corresponding to the batch business task and determining the task element information corresponding to each task file in the batch task file, the method further includes: receiving the batch business task through a downlink task link; listening to and pulling the batch task information corresponding to the batch business task in the corresponding data partition according to the heartbeat connection process; wherein, the batch task information includes the batch task file and batch script version information.
[0006] According to an embodiment of this disclosure, before listening to and pulling the batch task file corresponding to the batch business task in the corresponding data partition according to the heartbeat connection process, the method further includes: copying the batch business task to the corresponding data partition according to the batch target address of the batch business task; and creating the heartbeat connection process in response to copying the batch business task to the corresponding data partition.
[0007] According to an embodiment of this disclosure, the step of parsing the batch task files corresponding to the batch business tasks and determining the task element information corresponding to each task file in the batch task files includes: parsing the specific task request corresponding to each task file in the batch task files; and determining the task element information corresponding to each task file based on the specific task request.
[0008] According to an embodiment of this disclosure, before parsing the specific task request corresponding to each task file in the batch task file, the method further includes: matching the batch script version information with the local script version information, and checking the script check information of the batch task file; in response to the script check information, parsing the batch task file to check the task execution type corresponding to each task file; wherein, the task check information includes the task execution type and the script check information.
[0009] According to an embodiment of this disclosure, after matching the batch script version information with the local script version information and checking the script check information of the batch task files, the method further includes: updating the local script version information in response to the script check information.
[0010] According to an embodiment of this disclosure, in the step of parsing the batch task files to check the task execution type corresponding to each task file in response to the script check information, the method includes: parsing the batch task files concurrently through the corresponding task thread pool according to the file task identifier of each task file, wherein the method includes: determining the task execution type of each task file according to the task process identifier of each task file through the corresponding task thread in the task thread pool; wherein the task execution type includes immediate task type and scheduled task type.
[0011] According to an embodiment of this disclosure, the step of obtaining a local task script corresponding to each task file based on the task element information includes: matching multiple basic task elements in the task element information one by one according to a preset matching order; and obtaining a local task script that matches all of the multiple basic task elements.
[0012] According to an embodiment of this disclosure, in the step of executing the local task script of each task file based on the task check information corresponding to the batch task files to complete the batch business task execution, the method includes: when the task execution type of the task check information is an immediate task type, executing the local task script of each task file; when the task execution type of the task check information is a timed task type, executing the local task script of each task file according to the specified execution time of each task file.
[0013] According to embodiments of this disclosure, the local task script for executing each task file includes: when each task file corresponds to a parallel task, concurrently executing multiple first sub-task scripts corresponding to the local task script based on multiple first platform script task identifiers of each task file; and / or when each task file corresponds to a serial task, sequentially executing multiple second sub-task scripts corresponding to the local task script based on multiple second platform script task identifiers of each task file and according to the task script execution identifier order marked by each second platform script task identifier.
[0014] According to an embodiment of this disclosure, the local task script for executing each task file further includes: stopping the execution of the local task script based on the time task element in the task element information.
[0015] According to an embodiment of this disclosure, after executing the local task script of each task file based on the task check information corresponding to the batch task files, the method further includes: summarizing the execution result messages of the local task scripts and outputting them to a loading queue; and uploading the execution result messages in the loading queue via the uplink task link.
[0016] A second aspect of this disclosure provides a batch business task execution apparatus, including a file parsing module, a script acquisition module, and a task execution module. The file parsing module parses the batch task files corresponding to the batch business tasks to determine task element information corresponding to each task file in the batch task files; the script acquisition module acquires a local task script corresponding to each task file based on the task element information; and the task execution module executes the local task script of each task file based on task check information corresponding to the batch task files to complete the batch business task execution.
[0017] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the batch business task execution method described above.
[0018] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described batch business task execution method.
[0019] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described batch business task execution method.
[0020] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the batch business task execution method described above.
[0021] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described batch business task execution method.
[0022] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described batch business task execution method.
[0023] This disclosure provides a method, apparatus, device, medium, and program product for batch business task execution. The batch business task execution method includes: parsing batch task files corresponding to the batch business tasks to determine task element information corresponding to each task file in the batch task files; obtaining a local task script corresponding to each task file based on the task element information; and executing the local task script of each task file based on task check information corresponding to the batch task files to complete the batch business task execution. Therefore, the batch business task execution method of this disclosure is applicable to large-scale data centers and can adapt to various versions and professional objects. It supports batch script task push and automated execution in the system environment, and can minimize the operation and maintenance costs of the front-line system side. It can further improve the efficiency of batch business task execution while ensuring task execution accuracy. Attached Figure Description
[0024] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0025] Figure 1 The illustration schematically depicts an application scenario of a batch business task execution method, apparatus, device, medium, and program product according to embodiments of the present disclosure;
[0026] Figure 2 A flowchart illustrating a batch service task execution method according to an embodiment of the present disclosure is shown schematically.
[0027] Figure 3 This illustration schematically shows another scenario diagram of a batch business task execution method according to an embodiment of the present disclosure;
[0028] Figure 4A An execution timing diagram of a batch service task execution method according to an embodiment of the present disclosure is illustrated schematically;
[0029] Figure 4B The flowchart illustrating the execution of a batch business task execution method according to an embodiment of the present disclosure is shown in the illustration.
[0030] Figure 4C The flowchart illustrating the execution of timed tasks and real-time tasks in the batch business task execution method according to embodiments of the present disclosure is shown in the illustration.
[0031] Figure 5 A schematic diagram illustrating a structural block diagram of a batch service task execution apparatus according to embodiments of the present disclosure; and
[0032] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a batch service task execution method according to an embodiment of the present disclosure. Detailed Implementation
[0033] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0034] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0035] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0036] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0037] The application of information technologies such as the Internet, artificial intelligence, and the Internet of Things is rapidly changing people's lives and work styles. Some jobs have even been replaced by artificial intelligence. The application of these technologies generates massive amounts of data, and the servers that store this data form large-scale data centers through clusters. Large-scale refers to the ability to rapidly expand to meet super-demands, addressing the ever-increasing demand for data storage. It allows for rapid capacity increases with optimal performance. Functionality, computing power, memory, network infrastructure, and storage resources are commonly used to define large-scale data centers. A large-scale data center can support hundreds or even tens of thousands of physical servers and millions of virtual machines.
[0038] Information Technology (IT) is a general term for all technologies primarily used to manage and process information. It mainly applies computer science and communication technologies to design, develop, install, and implement information systems and application software. It is also often referred to as Information and Communications Technology (ICT). Research in information technology encompasses disciplines such as science, technology, engineering, and management. Applications of information technology include computer hardware and software, network and communication technologies, and application software development tools. In financial organizations such as banks, the information technology architecture is a comprehensive structure for adopting and developing information technology to achieve strategic goals. It includes management and technical components. The management component includes mission, functions and information requirements, system configuration, and information flows, while the technical component includes information technology standards and rules used to implement the management architecture.
[0039] IT operations and maintenance monitoring (i.e., IT integrated management system) is a collective term for a series of IT management products based on data center platforms. It encompasses powerful, easy-to-use, and comprehensive solutions, providing a one-stop solution to meet various IT management needs. IT operations and maintenance monitoring features stable performance, a user-friendly interface, cross-platform compatibility, ease of implementation, and easy integration. It greatly simplifies the monitoring and management of IT facilities and business systems, improves user IT management efficiency, and ensures the normal operation of network equipment and business systems through fault early warning and rapid location. It is particularly suitable for customers in numerous industries such as telecommunications, power, education, service organizations, finance / banking, healthcare, transportation, and government. More and more customers are considering or adopting centralized business solutions. However, centralizing business systems not only increases the workload of operation and maintenance but also makes the centralized system more complex. An effective system and application monitoring system is crucial for understanding the usage of business resources, promptly identifying potential system failures, and ensuring system operation. On the other hand, with the help of centralized monitoring solutions, users can correctly and promptly understand the system's operating status, identify bottlenecks affecting the overall system operation, assist system personnel in making necessary system optimizations and configuration changes, and even provide a basis for system upgrades and expansions. Powerful monitoring and diagnostic tools can also help operations and maintenance personnel quickly analyze the causes of application failures, freeing them from tedious and repetitive tasks. Therefore, many enterprise IT departments have requested the establishment of centralized IT management systems to monitor networks, servers, databases, middleware, and applications. Centralized monitoring systems enable timely detection of system faults, reducing troubleshooting time. Currently, centralized IT management systems can be implemented based on large-scale data equipment systems such as data centers. For data development and data operation and maintenance platforms derived from data centers, they are suitable for organizations and departments with a certain IT scale, such as banks, securities firms, telecommunications companies, government agencies, healthcare institutions, education institutions, insurance companies, broadcasting companies, railway companies, civil aviation companies, tobacco companies, military industries, and large and medium-sized enterprise users.
[0040] The rapid development of the financial industry has led to a rapid expansion of its corresponding data information systems. Currently, taking a typical financial IT system data center as an example, it can develop into a large-scale, multi-source, heterogeneous information system with a network coverage area of millions of square meters, more than 300 servers, and 5,000 terminals and network devices. It encompasses multiple core business systems such as business processing, service development, information security, data management, and commercial applications, serving tens of thousands or even hundreds of thousands of users.
[0041] As data centers continue to expand in scale, business applications increase, and the number of service users grows, data center operation and maintenance personnel will inevitably face a complex situation with numerous business types, corresponding equipment types, professional service objects within the equipment, and proxy service types for these professional objects. This results in scattered information and difficulty in unifying versions, making it impossible for frontline operation and maintenance personnel to achieve timely and accurate information operation and maintenance management and effectively control the overall network and system operation. Furthermore, second-line management personnel cannot understand future trends in network and system operation.
[0042] The application of information technologies such as the Internet, artificial intelligence, and the Internet of Things is rapidly changing people's lives and work styles. Some jobs have even been replaced by artificial intelligence. The application of these technologies generates massive amounts of data, and the servers that store this data form large-scale data centers through clusters. Large-scale refers to the ability to rapidly expand to meet super-demands, addressing the ever-increasing demand for data storage. It allows for rapid capacity increases with optimal performance. Functionality, computing power, memory, network infrastructure, and storage resources are commonly used to define large-scale data centers. A large-scale data center can support hundreds or even tens of thousands of physical servers and millions of virtual machines.
[0043] For data centers, there are various operational objects, such as the various IT equipment, management tools, systems and data used in providing IT services, as well as maintenance personnel. IT equipment mainly includes hardware resources such as storage, servers, network equipment, and security equipment. These devices provide computing, storage, and communication functions in the process of providing IT services to users, and are the most direct physical carriers of IT services. Management tools include infrastructure monitoring software, IT monitoring software, workflow management platforms, reporting platforms, and SMS platforms. These management objects are hardware and software facilities that help management entities manage various management objects within the data center more efficiently and undertake some management functions in management activities. Through these management tools, one can intuitively see and verify how well the data center manages its IT-related resources, thereby indirectly improving IT availability and reliability. Systems and data include operating systems, databases, and other components. Software resources such as middleware and applications, as well as various types of data such as business data, configuration files, and logs, are not as "visible and tangible" as the previous two types of managed objects, but they are the logical carriers of IT services. Operation and maintenance personnel include data center technicians, IT operations and maintenance personnel, managers, and service provider personnel. On the one hand, these personnel are responsible for managing data center operation and maintenance objects as the main body of management, and on the other hand, they are also managed objects that support the operation of IT. These objects are different from other operation and maintenance objects and have strong subjective initiative. The quality of their management will directly affect the entire operation and maintenance management system, not just the operation and maintenance objects themselves.
[0044] For data centers, there are various operational objects, such as the various IT equipment, management tools, systems and data used in providing IT services, as well as maintenance personnel. IT equipment mainly includes hardware resources such as storage, servers, network equipment, and security equipment. These devices provide computing, storage, and communication functions in the process of providing IT services to users, and are the most direct physical carriers of IT services. Management tools include infrastructure monitoring software, IT monitoring software, workflow management platforms, reporting platforms, and SMS platforms. These management objects are hardware and software facilities that help management entities manage various management objects within the data center more efficiently and undertake some management functions in management activities. Through these management tools, one can intuitively see and verify how well the data center manages its IT-related resources, thereby indirectly improving IT availability and reliability. Systems and data include operating systems, databases, and other components. Software resources such as middleware and applications, as well as various types of data such as business data, configuration files, and logs, are not as "visible and tangible" as the previous two types of managed objects, but they are the logical carriers of IT services. Operation and maintenance personnel include data center technicians, IT operations and maintenance personnel, managers, and service provider personnel. On the one hand, these personnel are responsible for managing data center operation and maintenance objects as the main body of management, and on the other hand, they are also managed objects that support the operation of IT. These objects are different from other operation and maintenance objects and have strong subjective initiative. The quality of their management will directly affect the entire operation and maintenance management system, not just the operation and maintenance objects themselves.
[0045] In existing technologies, since system components (such as operating systems, databases, middleware, and storage) may differ depending on the application versions provided by different vendors and the upgrade versions at different times, the batch scheduling and execution of script tasks for system components on the server side still requires writing separate crontab reading commands or script tasks for each component on the server side for separate execution. Each time, manual maintenance and updates of the execution scripts through the underlying devices are required. It is impossible to centrally and uniformly schedule batch script tasks for multiple components according to operation and maintenance needs, making the batch task processing and execution process very complex, highly dependent on manual intervention, with low accuracy and low execution efficiency.
[0046] To address the technical problem of low efficiency in batch task execution caused by the lack of a unified system for retrieving batch scripts from multiple professional objects and the reliance on manual methods for updating and maintaining batch task execution scripts through underlying devices, this disclosure provides a batch business task execution method, device, equipment, medium, and program product that is suitable for large-scale data centers, adaptable to various versions of various professional objects, supports batch script task push and automated execution in the system environment, and can minimize the operation and maintenance costs of the front-line system side.
[0047] It should be noted that the batch business task execution method and apparatus described in the embodiments of this disclosure can be used in the fields of big data technology and artificial intelligence technology, as well as in the financial field and any field outside the financial field. The application fields of the batch business task execution method and apparatus described in the embodiments of this disclosure are not limited.
[0048] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data, including user personal information, all comply with relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Furthermore, user authorization or consent has been obtained before acquiring or collecting user personal information.
[0049] The embodiments of this disclosure provide a method for executing batch business tasks, including: parsing batch task files corresponding to the batch business tasks, determining task element information corresponding to each task file in the batch task files; obtaining local task scripts corresponding to each task file based on the task element information; and executing the local task scripts of each task file based on task check information corresponding to the batch task files to complete the execution of the batch business tasks.
[0050] Figure 1 The diagram illustrates an application scenario of a batch business task execution method according to an embodiment of the present disclosure.
[0051] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, network 104, and server 105. Network 104 is used as a medium to provide a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0052] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0053] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0054] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0055] It should be noted that the batch service task execution method provided in this disclosure embodiment can generally be executed by server 105. Correspondingly, the batch service task execution device provided in this disclosure embodiment can generally be located in server 105. The batch service task execution method provided in this disclosure embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the batch service task execution device provided in this disclosure embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0056] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0057] The following will be based on Figure 1 The described scene, through Figures 2-6 The batch business task execution method of the disclosed embodiments is described in detail.
[0058] Figure 2 A flowchart illustrating a batch service task execution method according to an embodiment of the present disclosure is shown schematically.
[0059] like Figure 2 As shown, the batch business task execution method of this embodiment includes operations S201 to S203.
[0060] In operation S201, the batch task file corresponding to the batch business task is parsed, and the task element information corresponding to each task file in the batch task file is determined.
[0061] In operation S202, the local task script corresponding to each task file is obtained based on the task element information;
[0062] In operation S203, based on the task check information corresponding to the batch task files, the local task script of each task file is executed to complete the batch business task execution.
[0063] Batch business tasks are a collection of business tasks that handle a large number of business services. They can include a variety of different business tasks corresponding to different professional objects, such as open platform security technology inspection tasks, security configuration management tasks, parallel tasks including user switching, cloud deployment tasks including emergency switching and infrastructure, serial tasks including routine operations, and batch scheduled execution tasks with user-defined times and periods. When batch business tasks are executed, they can be used to implement the corresponding business service functions.
[0064] Each business task in a batch of business tasks can be represented as a data file, forming a corresponding task file. In other words, for a batch of business tasks, there are a batch of task data files corresponding to each of the aforementioned business tasks. The collection of these task data files constitutes the aforementioned batch task file.
[0065] Each task file contains corresponding task element information. This task element information is generally the script element data for the task file during execution. This script element data can be directly applied to the corresponding script execution process, thereby realizing the execution of the business task corresponding to the task file. Different task files correspond to different types, quantities, and forms of task element information, and correspondingly, different task execution strategies.
[0066] Therefore, by performing parallel parsing operations on each task file of the batch task files corresponding to batch business tasks, the task element information corresponding to each task file can be determined. This task element information can be used to determine the script information required when batch executing these task files. In this way, different task files can be matched with different task element information, achieving the effect of task isolation execution. Each different business task can be matched and executed one by one, thereby effectively simplifying the complexity of operation without having to worry about the impact of the underlying device on the execution of business tasks.
[0067] Since task element information can determine the script element data when the corresponding task file is executed, this script element data can be matched with the local task script of each task file corresponding to the batch business tasks. This local task script can be used as the direct execution script when each task file is executed, and this script conforms to the local (e.g., the current server) script execution rules. These script execution rules can be preset locally so that the local task script can match the task element information of the corresponding task file to determine the appropriate local task script. Simultaneously, when this local task script is executed, the business task of the corresponding task file can be executed. In this way, different local task scripts can be matched to different task files for different task element information, further ensuring the effect of task isolation execution. Each different business task can be matched and executed one-to-one, thus more effectively simplifying operational complexity without needing to consider the impact of the underlying device on business task execution.
[0068] For each task file in the batch task file, the task check information refers to the execution strategy information used when the local task scripts of these task files are executed. This execution strategy information defines the specific execution operations of these local task scripts, so that, under the premise of task isolation, the specific execution logic of these independent task execution processes can be defined separately, such as execution type as scheduled execution, immediate execution, and corresponding parallel or serial execution, etc. Therefore, by executing the local task scripts corresponding to each task file through the above-mentioned task check information, it can be ensured that each local task script can perform execution operations independently and without affecting each other. This allows different execution operations to be assigned to different business tasks, simplifies the operational complexity of the batch execution process of business tasks, improves the accuracy, automation and intelligence of batch task execution, and reduces the impact of underlying devices on business task execution.
[0069] Therefore, for large-scale data centers with a large number and variety of servers, the batch business task execution method disclosed herein is applicable to large-scale data centers with millions of servers. Compared to the existing technology where batch task execution scripts are manually processed through underlying devices, this method achieves transparency to the underlying devices, provides a categorized scheduling of business tasks for batch task execution, implements task isolation, and ensures that different tasks are allocated to different execution thread pools. This greatly improves the granularity of batch task execution while simplifying operational complexity. During execution, there is no need to worry about the impact of the version, model, and type of the underlying devices and execution systems on the execution process. Furthermore, the corresponding task execution scheduling can be customized based on local task scripts according to business needs to meet the execution requirements of various data center services. This ensures the stability and reliability of the execution flow logic of each business task during batch task execution, improving the automation, intelligence, and granularity of business execution, as well as its operability.
[0070] Figure 3 This illustration schematically shows another scenario diagram of a batch business task execution method according to an embodiment of the present disclosure; Figure 4A An execution timing diagram of a batch service task execution method according to an embodiment of the present disclosure is illustrated schematically; Figure 4B The flowchart illustrating the execution of a batch business task execution method according to an embodiment of the present disclosure is shown in the illustration. Figure 4C The flowchart illustrating the execution of timed tasks and real-time tasks in the batch business task execution method according to embodiments of the present disclosure is shown.
[0071] like Figure 3 As shown, the batch business task execution method described in this embodiment can be implemented based on an application scenario consisting of a message queue middleware 310, a proxy server 320, a local script library 330, and a media server 340, and it can be applied to a large number of servers in a large-scale data center.
[0072] Batch business tasks are primarily distributed to the queue of message queue middleware 310. Message queue middleware 310 is the initial processing middleware for business task messages, mainly responsible for processing various distributed business messages to form message queues. Message queue middleware 310 can be, for example, a primary-level ActiveMQ message middleware. Proxy server 320 can be, for example, a server with Agent proxy services. Proxy server 320 only interacts with message queue middleware 310 externally. The two can establish a message listening connection, allowing the task listening object of proxy server 320 to listen to the data partition 311 (such as a topic partition) of message queue middleware 310 and actively obtain task requests from various businesses, such as... Figure 3The operation S301 is shown. Before task execution, the task scheduling object of the agent server 320 can first check the script update information of the local script library 330, such as... Figure 3 The operation S303 is shown. If it is determined that the local script library 330 needs to be updated, the latest script library media on the media server 340 is downloaded to upgrade the scripts in the local script library 330, such as... Figure 3 Operations S305 and S304 are shown. After the corresponding business task is completed, the proxy server 320 can send the execution result messages of various tasks back to the loading queue 312 (such as the UPLOAD queue) of the message queue middleware 310. Then, after being consumed by the upstream data links such as the primary institution Storm, the head office ActiveMQ, and the head office Storm, the execution result messages are written to the head office Redis for various businesses to read, such as... Figure 3 Operation S302 is shown.
[0073] During the execution of business tasks on the proxy server 320, different task execution types require different business task execution processing logic. Specifically, the proxy server 320 can categorize business tasks into immediate tasks 321 and scheduled tasks 322 based on their execution type. Both can be triggered by business task messages issued by the business module, starting an execution thread to receive the business task file. By parsing the task file, the corresponding thread pool is started to execute the matching local task script, completing the batch execution of business tasks and returning the task results.
[0074] Specifically, for the immediate task 321, there are two corresponding tasks: the immediate parallel task 321a and the serial task 321b. The execution of the parallel task 321a generally involves business tasks that can be defined for concurrent execution within the task's script. These business tasks include open platform security technology inspection tasks, security configuration management tasks, and user switching tasks. The execution of the serial task 321b generally involves business tasks that need to be executed serially according to a process script. These business tasks include emergency switching tasks, infrastructure cloud deployment tasks, and routine operation tasks. For the scheduled task 322, there are two main task types: the task 322a that expires at a specified time and the task 322b that is executed repeatedly at a specified period. The task 322a that expires at a specified time generally does not need to be repeated, while the task 322b that is executed repeatedly at a fixed period.
[0075] Therefore, based on the above application scenarios, the batch business task execution method of this disclosure provides a solution that offers centralized and unified batch business task fine-grained execution management for upper-layer technical modules and business modules. It has a wide range of applications and can be used on most operating system open platform application servers in the industry, specifically such as SuSELINUX, AIX, Windows, Red Hat, HP-UX, Solaris, Ubuntu, etc. To achieve the technical effects of the above solution, the specific development languages used in this disclosure embodiment may include Java, and the relevant development tools may include Eclipse, JDK, ActiveMQ client, log4j, JNA, and other development application platforms.
[0076] Therefore, based on the application scenarios described above, the batch business task execution method of the present disclosure can follow the principles of high cohesion and low coupling, has good modular design, wide coverage, and higher application and promotion value.
[0077] like Figures 2-4C As shown, according to an embodiment of this disclosure, before step S201, which involves parsing the batch task files corresponding to the batch business tasks and determining the task element information corresponding to each task file in the batch task files, the method further includes:
[0078] The batch service tasks are received via the downlink task link;
[0079] Based on the heartbeat connection process, listen for and pull the batch task information corresponding to the batch business tasks of the corresponding data partition;
[0080] The batch task information includes the batch task file and batch script version information.
[0081] like Figure 4AAs shown, the downlink task link is a data or message transmission channel between the business module 410 (which serves as the business task initiation platform) and the message queue middleware 420. It forms the transmission channel for business tasks, such as a data transmission channel formed by modules like ESB, HttpServer, head office MQ, and Storm (the opposite of the uplink data link). The business module 410 can be the object initiating the business task, such as at least one of an emergency switching platform, a user centralized management system, and an open platform security technology inspection system. Specifically, the emergency switching platform can initiate an emergency switching task under a specific application failure scenario as a business task. Simultaneously, the user centralized management system may initiate a user switching task as a business task, and the open platform security technology inspection system may initiate a security inspection task as a business task. These business modules can simultaneously initiate multiple different business tasks as the batch business tasks described in this embodiment.
[0082] All of the aforementioned batch business tasks can be transmitted to the message queue middleware 420 via the downlink task link as batch business task execution requests, such as... Figure 4A The operation S401 and shown Figure 4B Operations S411-S412 are shown. The heartbeat connection process is a message retrieval process based on the heartbeat-based message transmission link established between the proxy server 430 and the message queue middleware 420. This heartbeat connection process enables the proxy server 430 to periodically or sequentially retrieve business task messages from a specified queue in the message queue middleware 420, and receive batch business tasks, such as... Figure 4A Operations S402-S403 and shown Figure 4B The operation shown is S413. The message queue middleware 420 establishes a heartbeat connection with the proxy server 430, enabling the proxy server 430 to monitor whether there are any tasks to be processed within the data partition of the topic of the message queue middleware 420. Figure 4B In operation S413, the business task information in the corresponding topic-2 is listened to and retrieved for processing. Therefore, before executing the business task receiving operation, a heartbeat connection process needs to be established between the corresponding proxy server 430 and the message queue middleware 420 to satisfy the message queue transmission connection relationship, such as... Figure 4B The operation shown is S431.
[0083] The message queue middleware 420 has different types of message queues, each of which can be implemented according to different forms of data partitions (such as topic-1 to topic-n). Data partitions can arrange message queues for various types of business tasks and their related information. Each data partition can correspond to a business task of a fixed execution type and its corresponding messages for queue processing. For example, the data partition for topic-2 can correspond to user switching tasks, while the data partition for topic-3 can correspond to emergency switching tasks.
[0084] Task files can be XML data files for each business task in a batch of business tasks, used to achieve matching and isolation processing of business tasks. Batch task files are a collection of these task files, used to summarize them for concurrent execution of the corresponding task processing. Each task file corresponds to a different script version number. These script version numbers serve as script version information for defining the business tasks within these task files, ensuring that when these business tasks are executed subsequently, the corresponding matching local task script is the latest execution script. Therefore, batch script version information is a batch collection of script information corresponding to these script version numbers, each corresponding to a task file of a specific business task. Specifically, the corresponding batch task information includes the task file and script version information for each business task in the aforementioned batch of business tasks.
[0085] Therefore, by leveraging the aforementioned business task monitoring and retrieval process, the batch task information corresponding to the corresponding batch business tasks can be dynamically and in real time, enabling a one-to-one correspondence between the task files and script version information corresponding to the batch task information. This ensures the isolated execution of business tasks and facilitates efficient and unified batch task execution management.
[0086] like Figures 2-4C As shown, according to an embodiment of this disclosure, before the step of listening to and retrieving the batch task file corresponding to the batch business task of the corresponding data partition based on the heartbeat connection process, the method further includes:
[0087] Based on the batch target address of the batch business tasks, copy the batch business tasks to the corresponding data partition;
[0088] In response to the copying of the batch business tasks to the corresponding data partition, the heartbeat connection process is created.
[0089] Each business task in a batch process has a target identifier parameter that identifies the message execution path of that business task. This target identifier parameter can be the target IP address parameter of the corresponding execution path. The set of target IP address parameters for these task files can serve as the batch target address corresponding to the batch business tasks. The message execution path is used to specify the data partition corresponding to the business task during message distribution.
[0090] Using the target address corresponding to each business task, the message queue middleware 420 can copy the corresponding business task into a corresponding business task message and match the business task message to the corresponding data partition topic. Specifically, the message queue middleware 420 can mainly utilize algorithms such as hash sharding to partition and manage all message areas with connection relationships, matching all data partitions corresponding to the packets of the proxy server 430. Different data partition topics are used to distribute business task messages to the proxy server 430 based on the heartbeat connection process.
[0091] After the message queue middleware 420 completes the batch replication of each business task in the batch business task and replicates it to the corresponding data partition, the proxy server 430 will initiate a heartbeat connection process with the message queue middleware 420, such as... Figure 4B The operation S431 is shown. This heartbeat connection process allows the proxy server 430 to accurately listen for business task messages that match its preset task message retrieval rules. For example, it can listen for and retrieve matching business task messages from the data partition of topic-2, and then parse the message information locally on the proxy server 430. This message information is batch task information, including batch task files in XML format and batch script version information such as the feedback script version number.
[0092] Therefore, by establishing the aforementioned heartbeat connection process and combining it with the data partitioning of the message queue of the message middleware 420, it is possible to accurately obtain task messages that match business tasks. This avoids the complexity and error-proneness caused by heavy reliance on underlying device processing during message distribution, greatly reducing manual operation costs and improving task forwarding speed and processing accuracy.
[0093] like Figures 2-4C As shown, according to an embodiment of this disclosure, in operation S201, parsing the batch task files corresponding to the batch business tasks and determining the task element information corresponding to each task file in the batch task files includes:
[0094] Parse the specific task request corresponding to each task file in the batch task file;
[0095] The task element information corresponding to each task file is determined based on the specific task request.
[0096] Each task file corresponds to a specific task request. This specific task request corresponds to the business service function implemented by the business task associated with that task file, and is represented by task parameter tags in XML file format. Each task parameter tag can be used to match the basic task elements corresponding to that business task. These basic task elements are the constituent units of task element information, and are the execution elements of the local task script, such as script name, script ID, applicable platform, script path, script MD5 value, script input parameters, script output parameter format, or script execution timeout.
[0097] Therefore, by parsing each task file in the aforementioned batch task files, the specific task request of each task file can be determined. Based on the task parameter tags defined in that specific task request and their corresponding reading rules, the task parameter tags of that specific task request can be read sequentially from top to bottom according to the reading rules to determine the basic task elements to be executed. The set of these basic task elements is then used as the aforementioned task element information, such as... Figure 4A The operation shown is S405 and Figure 4B The operation shown is S416. The task element information includes the script name, script ID, applicable platform, script path, script MD5 value, script input parameters, script output parameter format, and script execution timeout. These basic task elements can be customized based on the task scheduling function required by the business to accommodate the execution needs of various business tasks in the data center.
[0098] Therefore, by identifying the specific task request corresponding to each task file, the relevant task element information can be determined. This allows for the acquisition of subsequent local script files based on the task element information, enabling the matching and correspondence between business tasks and local task scripts. By automating the retrieval logic of the task element information of the matched local task script, a local task script retrieval process is established. This facilitates the unified execution of the corresponding business task classification and processing, thereby enhancing the classification and processing capabilities of business tasks, improving the efficiency of business task execution and management, and avoiding human interference.
[0099] The specific task requests in the task file can be customized from the business scenario to form a task file in XML format. The proxy server 430 can identify and classify the task scripts of the business tasks according to the rules set in the XML file, and return the results of the business tasks in the required way, thereby meeting the various business needs of the data center, such as open platform security technology inspection, configuration management tasks, emergency switching, infrastructure cloud deployment tasks, routine operation tasks, and other business needs.
[0100] like Figures 2-4C As shown, according to an embodiment of this disclosure, before parsing the specific task request corresponding to each task file in the batch task file, the method further includes:
[0101] Match the batch script version information with the local script version information, and check the script check information of the batch task file;
[0102] In response to the script check information, the batch task files are parsed to check the task execution type corresponding to each task file;
[0103] The task inspection information includes the task execution type and the script inspection information.
[0104] The local script version information can be a collection of script version numbers for the local scripts in the local script library 440 at the current moment, including both existing and updated version numbers of the corresponding local scripts. The corresponding script version numbers for the local scripts in the local script library 440 can be downloaded and updated from the script information in the media server 450.
[0105] Therefore, for the batch script version information corresponding to the batch task files in the batch task information, it contains the script version number information for each task file. Using this script version number information, the script version information in the local script library 440 corresponding to the local proxy server 430 can be compared with the current script version number information of each task file to confirm whether the current script version information of the local proxy server 430 is up-to-date. Specifically, the script check information is based on the aforementioned determination of whether the current script version information of the local proxy server 430 is up-to-date.
[0106] After determining the script's check information, the task execution type of each task file in the batch task file can be parsed, such as... Figure 4A The operation shown is S405 and Figure 4B The operation shown is S415. Each task file has a different execution type for its business tasks. These execution types can define the execution logic or rules of the local task scripts that match the task file, such as scheduled tasks and immediate tasks.
[0107] Therefore, local task script matching and execution can be achieved faster and more accurately, enabling local task scripts to correspond one-to-one with business task files, ensuring independent operation of each local task script, assigning different execution logic to different business tasks, simplifying the complexity of batch business execution operations, and improving the efficiency of batch business task execution management.
[0108] like Figures 2-4CAs shown, according to an embodiment of this disclosure, after matching the batch script version information with the local script version information and checking the script check information of the batch task files, the method further includes:
[0109] In response to the script check information, update the local script version information.
[0110] The proxy server 430 can compare the script version information corresponding to each business task (target script version number) with the current local script version number in the local script library 440 to determine if the two script version numbers are consistent. If they are consistent, the task type of the task file is parsed and determined; if they are inconsistent, it means that the script version number information in the local script library 440 is not up-to-date. In this case, the proxy server 430 actively connects to the media server 450 to obtain the latest script data package, upgrades and updates the script version of the local script library 440, and executes the parsing of the specific task request of the corresponding task file with the updated current script version information of the local script library 440.
[0111] Specifically, if the script version number information of the task file cannot be matched, it means that the local script library 440 is missing the script version number information and its corresponding local script. In this case, the script check information for the task file indicates that the script library script data needs to be updated, and the script version information of the local script library 440 needs to be updated and upgraded. Conversely, if the script version number information of the task file can be matched, it means that the local script library 440 contains the script version number information and its corresponding local script. In this case, the script check information for the task file indicates that the script library script data is up-to-date, and the script version information of the local script library 440 does not need to be updated and upgraded.
[0112] Specifically, when the script version information of the local script library 440 needs to be updated or upgraded, the proxy server 430 can retrieve the corresponding incremental script upgrade data information from the media server 450, including the incremental script version number information and the corresponding incremental script data, for use in updating and upgrading the script information of the local script library 440. Figure 4A The operation S404 and shown Figure 4B Operations S414, S441, and S442 are shown.
[0113] Therefore, since the script information for each business task issued can be directly updated in real time on the media server 450, the media server 450 always maintains the latest script information. Thus, by utilizing the aforementioned script check information, real-time updates of the script information in the local script library 440 can be directly achieved, avoiding script matching errors caused by mismatched local task scripts and eliminating the need for manual intervention due to unmatched scripts. This ensures that the script data is up-to-date while improving the matching speed and accuracy of the script information.
[0114] like Figures 2-4C As shown, according to an embodiment of this disclosure, the step of parsing the batch task file to check the task execution type corresponding to each task file in response to the script check information includes:
[0115] Based on the file task identifier of each task file, the batch task files are parsed concurrently through the corresponding task thread pool, including: determining the task execution type of each task file based on the task process identifier of each task file through the corresponding task thread in the task thread pool;
[0116] The task execution types include immediate task types and scheduled task types.
[0117] Proxy server 430 performs multi-threaded parallel parsing of batch task files. Specifically, it matches different parsing threads based on the file task identifier of different task files to parse multiple task files concurrently. A task parsing thread is generally a thread from the task thread pool that can be used to parse a task file corresponding to a specific file task identifier in the batch task files. The file task identifier is typically the corresponding filename of the task file, such as an XML filename, and is mainly used to identify the identity of the task file and define its parsing type, so as to match the corresponding task parsing thread in the task thread pool. This allows for precise matching of the parsing thread for the task files, preventing erroneous parsing during the parsing process and thus avoiding data corruption.
[0118] Furthermore, the file process identifier is used to identify the business function identity of the task file. This business function identity can be used to specify the execution logic, or execution strategy, of the business task execution script corresponding to the task file. This file process identifier can be a process ID tag in XML format, such as Process ID. Different execution strategies correspond to different execution types. For task files in the task parsing thread, different task process identifiers can determine the execution type of different task files. For example, if the process ID tag of the task process identifier contains the keyword "instant," then the corresponding task file script execution logic can be confirmed as immediate task execution logic, and the task execution type of the task file is immediate task type. Correspondingly, if the process ID tag of the task process identifier contains the keywords "timing" or "repeat," then the corresponding task file script execution logic can be confirmed as scheduled task execution logic, and the task execution type of the task file is scheduled task type, and so on. Figure 4A The operation shown is S405 and Figure 4B The operation S415 is shown. In this operation, multiple task files are parsed concurrently using different task thread pools. If the data volume is too large and the number of task threads in the thread pool is too small, a queue waiting operation can be performed on the task files to be parsed, as detailed below. Figure 4A The operation shown is S405 and Figure 4B The operation shown is S415.
[0119] Therefore, it is evident that the parsing process of task execution types based on the above-mentioned task thread pool can ensure the orderly parsing of task files, prevent parsing errors, and further enhance the differentiation of various business tasks in unified execution operations compared to the existing batch task execution process based on the underlying device. This reflects the isolation of business task script execution, reduces operational difficulty, and improves the parsing and processing speed of file types.
[0120] like Figures 2-4C As shown, according to an embodiment of this disclosure, the local task script for obtaining the corresponding task file based on the task element information in operation S202 includes:
[0121] According to the preset matching order, multiple basic task elements in the task element information are matched one by one.
[0122] Obtain a local task script that matches all of the aforementioned basic task elements.
[0123] Each basic task element in the task element information needs to be matched one-to-one with the basic task elements in the local task scripts in the local script library 440. The matching order of these basic task elements is a preset matching order. For example... Figure 4AIn operation S406, based on the multiple basic task elements of the acquired task element information, and according to the preset matching order mentioned above, the basic task elements of the local task script in the local script library 440 are matched one by one in sequence to obtain the corresponding local task script that conforms to all the basic task elements of the above task element information.
[0124] Specifically, such as Figure 4A In operations S461-S464, S417, and S481, the basic task elements of script name (e.g., script ID), applicable platform, script path, and MD5 checksum are matched sequentially: If the script ID matches the script name of a local task script in the local script library 440, a message will be displayed indicating that the script ID was not found, and the process can be killed; if the script ID matches, then all local task scripts whose script IDs match will be checked for applicable platform matching. If the applicable platform does not match the local operating system platform of the proxy server 430 corresponding to the local task script, a message will be displayed indicating that no suitable platform was found, and the process can be killed; if the applicable platform matches, then the remaining local task scripts that simultaneously satisfy the script ID and applicable platform will be checked for matching the script path. If no corresponding local task script is found in the script's path, a message will be displayed indicating that the task script was not found, and the process can be killed; if a local script that simultaneously satisfies the script ID, applicable platform, and script path is found, then MD5 checksum verification will be performed. If the MD5 check fails, a script update error will be displayed, and the process can be killed. If the MD5 check passes, the target local task script will be selected if it simultaneously satisfies the following criteria: script ID, applicable platform, script path, and MD5 check pass. In other words, the final selected target local task script is the one whose basic task element information matches.
[0125] Therefore, the acquired local task scripts can be better matched with the corresponding business tasks, preventing situations where business tasks cannot match the matching local task scripts due to subjective human judgment. This greatly improves the accuracy of business task execution, and also enhances the independence, automation, and intelligence of business task execution.
[0126] like Figures 2-4C As shown, according to an embodiment of this disclosure, in operation S203, based on the task check information corresponding to the batch task files, the local task script of each task file is executed to complete the batch business task execution, including:
[0127] When the task execution type of the task check information is an immediate task type, the local task script of each task file is executed.
[0128] When the task execution type of the task check information is a scheduled task type, the local task script of each task file is executed according to the specified execution time of each task file.
[0129] After matching the local task scripts, the system can accurately obtain the local task scripts that match the business function scenario of the business task. Different task execution types require different business task execution processing logic.
[0130] like Figure 4A and Figure 4B As shown in operations S407 and S418, for local task scripts of business tasks that conform to the instant task type, the proxy server 430 can immediately execute the local task script. Generally, it can be executed once and will not be repeated. Specifically, it can be done as follows: Figure 4C The operation S431 is shown. When the agent server 430 process triggers the execution of a local task script of the immediate task type, the agent server 430 can create a script execution thread according to the platform script task identifier (such as TASKID) of the task file, and immediately trigger the execution of the local task script by taking the above-mentioned local task script as the input parameter.
[0131] For local task scripts that conform to the scheduled task type, the proxy server 430 can execute the local task script according to the specified execution time. The specified execution time includes a specified execution moment and a specified execution period. For local task scripts with a specified execution moment, the script execution operation is triggered periodically at the corresponding specified moment; for local task scripts with a specified execution period, the script execution is repeatedly triggered periodically when the corresponding specified period is met, as can be described in detail below. Figure 4C Operations S421, S422, and S423 are shown. Specifically, when the agent server 430 process triggers the execution of a local task script of a scheduled task type, the agent server 430 can directly start the task execution process, calculate the required waiting time, and wait silently during this time. After the waiting time has elapsed until a specified moment or period, referring to the aforementioned instant task, a script execution thread is created to trigger the execution of the batch local task scripts involved in the scheduled task.
[0132] Therefore, the batch business tasks described in this embodiment can be executed on a scheduled or real-time basis according to the task execution type of the task check information matching the business task, thereby completing the corresponding batch task execution operation. The entire execution process of the local task script is fully automated, while ensuring the independent execution of the local task script, avoiding the impact of two or more scripts on each other's script execution process during concurrent execution, satisfying the execution logic of scheduled and real-time execution, greatly improving the efficiency of script execution, meeting the requirements for fine-grained script execution, and completely avoiding the need to call the underlying device as in the prior art.
[0133] like Figures 2-4C As shown, according to an embodiment of this disclosure, the local task script for executing each task file includes:
[0134] When each task file corresponds to a parallel task, multiple first subtask scripts corresponding to the local task script are executed concurrently according to multiple first platform script task identifiers of each task file; and / or
[0135] When each task file corresponds to a serial task, the multiple second platform script task identifiers of each task file are used to execute the multiple second sub-task scripts corresponding to the local task script in sequence according to the order of the task script execution identifiers marked by each second platform script task identifier.
[0136] For scheduled tasks, the corresponding scripts are executed after the specified execution time, following the same process as instant tasks. The specific script execution process can be further differentiated based on the execution method of local task scripts, primarily into serial and parallel tasks for batch local task scripts corresponding to batch business tasks. Parallel tasks typically execute the batch local task scripts of batch tasks concurrently, while serial tasks execute them sequentially one by one. A single business task's business function can correspond to multiple sub-tasks, each with its own local task sub-script. That is, each task file corresponds to multiple sub-tasks, and each sub-task corresponds to a sub-task script of a local task script. When these sub-scripts are executed concurrently, the execution of these sub-tasks is completed, realizing the business function scenario corresponding to the task file. The first platform script task identifier is an identifier parameter used to identify these sub-tasks, and the first sub-task script is the script unit that makes up the local task scripts of this task file.
[0137] like Figure 4CAs shown, when each task file corresponds to a parallel task, in operation S441, for the concurrent execution of the local task script of a single business function, multiple execution threads are created for multiple first sub-task scripts of the local task script for that task file based on the platform task identifier (such as TASK ID) of multiple sub-tasks contained in the single task file (such as an XML format file). These execution threads can concurrently execute operations on these first sub-task scripts. Each platform task identifier has 0 or 1 execution script task identifier (such as UNIT ID) for the same type of applicable platform, and each execution script task identifier corresponds to one sub-task script of the local task script of that task file.
[0138] In operation S451, for the concurrent execution of multiple local task scripts corresponding to multiple task files, the agent server 430 can create multiple threads corresponding to these parallel business tasks for concurrent processing, and simultaneously batch execute multiple local task scripts specified by the platform task identifier of multiple business tasks. For a single task file, concurrent operations as described in operation S441 can be further performed during concurrent execution, which will not be elaborated here. Regarding concurrent execution, the number of concurrent threads is generally limited by existing threading technology, such as a maximum of 5 script execution threads. Other unnecessary local task scripts for business tasks will be queued and wait. The failure of any one script execution thread will not affect the results of other execution threads. Therefore, through the above concurrent execution operations, multiple business operations such as user switching, checking CPU and memory resource usage, and executing security check scripts can be performed concurrently. Furthermore, after user switching is completed, multiple switching tasks such as checking database master / slave status, checking database listener status, and checking database version can be performed concurrently. Concurrent script execution can speed up script execution and also ensure that the scripts are independent and isolated during execution, avoiding the impact of other factors on the execution results.
[0139] For a single business function scenario, multiple sub-tasks can be executed sequentially, each corresponding to a local task sub-script. That is, each task file corresponds to multiple different sub-tasks, and each sub-task corresponds to a sub-task script of a local task script. When these sub-scripts are executed sequentially, the business function scenario corresponding to that task file is realized. The second platform script task identifier is an identifier parameter used to identify these sub-tasks, and the second sub-task script is the script unit that makes up the local task script of this task file. Each sub-task can correspond to one of the aforementioned business tasks, one task file, and one local task script.
[0140] like Figure 4CAs shown, in operation S461, when each task file corresponds to a serial task, a single execution thread is created based on the multiple platform task identifiers (such as TASK IDs) contained in the task file. This execution thread then sequentially executes local task scripts with multiple execution script task identifiers (such as UNIT IDs) for the same applicable platform, with each execution script task identifier corresponding to a sub-task script. After the aforementioned local task scripts are executed sequentially one by one, the serial task execution corresponding to the task file is completed. Therefore, through the above serial execution operation, sequential tasks such as switching to a database user, checking for waiting events in the database, performing blocking session killing on waiting events, checking again that waiting events still exist in the database, initiating database master-slave switch for the database instance, and subsequent triggering depends on the results of preceding tasks can be executed sequentially.
[0141] The proxy server 430 creates a thread for each platform task identifier. Within this thread, scripts are executed sequentially according to a preset order. The output of the previous script task identifier serves as the input parameter for the next, and the output of the last script task identifier is the output of the thread's serial execution result for that platform task identifier. In the serial execution process, if a script fails at an intermediate stage, it affects the return of the execution result for the current platform task identifier.
[0142] Therefore, based on the above-described parallel and serial task script execution processes, batch execution of business tasks in this embodiment of the disclosure can be achieved. This batch execution can adapt to concurrent execution that meets high-speed processing requirements, as well as various serial executions that meet business function needs. It can separately match concurrent and serial executions, preventing resource consumption and avoiding complex operations caused by frequent thread calls. Furthermore, this process maintains a high degree of script execution isolation, avoiding mutual interference between thread executions, which helps ensure fine-grained script execution and improves the efficiency of batch script execution management.
[0143] like Figures 2-4C As shown, according to an embodiment of this disclosure, the local task script for executing each task file further includes:
[0144] Based on the time task element in the task element information, stop the execution of the local task script.
[0145] In operations S418-S481, during the summary of the execution process of the local task script matched with the task element information, if the execution time of the local task script exceeds the script timeout time matched with the task element information (such as the default execution threshold of 30 seconds), the execution of the local task script will not obtain a script execution result within the script timeout period. In this case, the proxy server 430 can directly return an error code indicating script execution failure and kill the script execution thread to prevent it from becoming a zombie process and thus avoiding the situation where it occupies system resources and cannot be released. If the execution of the local task script obtains a script execution result within the script timeout period, the proxy server 430 will return a script execution success and normal script result. Furthermore, if the script input and output parameters do not match, it will only affect the normal execution of the script and the correct result output; no further judgment or prompts will be made.
[0146] Therefore, by setting the process to kill as described above, the execution of the confirmed local task script can be further restricted by the task element information, preventing the high resource consumption of the execution thread caused by long-term unresponsive execution from affecting the execution of subsequent local task scripts.
[0147] like Figures 2-4C As shown, according to an embodiment of this disclosure, after performing step S203, which involves executing the local task script for each task file based on the task check information corresponding to the batch task files, the method further includes:
[0148] The execution result messages of the local task scripts are summarized and output to the loading queue;
[0149] The execution result message in the loading queue is uploaded via the uplink task link.
[0150] like Figure 4A Operations S408-S409 and shown Figure 4B As shown in operations S419-S420, the proxy server 430 can sequentially summarize the batch local task script execution results obtained during the above script execution process according to the platform task identifier, forming an execution result message, which is then output in heartbeat form to the loading queue (such as the UPLOAD queue) of the message queue middleware 420 via the heartbeat connection process. This execution result message can be returned by an output method such as string or file defined in the execution script.
[0151] After receiving the task upload request for the execution result message, the message queue middleware 420 forwards the execution result message to the uplink task link. Through the upload path determined by the uplink task link, such as through the primary agency Storm, the head office MQ, HttpServer and ESB modules to the components in the emergency switchover process, the execution result message is fed back to the business modules 410 such as the emergency switchover process components.
[0152] Therefore, for large-scale data centers with a large number and variety of servers, the batch business task execution method disclosed herein is applicable to large-scale data centers with millions of servers. Compared to the existing technology where batch task execution scripts are manually processed through underlying devices, this method achieves transparency to the underlying devices, provides a categorized scheduling of business tasks for batch task execution, implements task isolation, and ensures that different tasks are allocated to different execution thread pools. This greatly improves the granularity of batch task execution while simplifying operational complexity. During execution, there is no need to worry about the impact of the version, model, and type of the underlying devices and execution systems on the execution process. Furthermore, the corresponding task execution scheduling can be customized based on local task scripts according to business needs to meet the execution requirements of various data center services. This ensures the stability and reliability of the execution flow logic of each business task during batch task execution, improving the automation, intelligence, and granularity of business execution, as well as its operability.
[0153] Furthermore, the batch task execution method described in this embodiment provides a batch task execution solution for large-scale data centers, which can support batch script task push and automated execution for data centers with millions of servers or similar scales. It can also support a wide range of professional objects, greatly reducing production and maintenance costs, improving the convenience of operation and maintenance and production management, and is applicable to various open application platform environments such as Linux, AIX, Neokylin, and Windows, with good universality and promotion.
[0154] Based on the above-described batch task execution method, this disclosure also provides a batch task execution apparatus. The following will be combined with... Figure 5 The device is described in detail.
[0155] Figure 5 A schematic block diagram of a batch task execution apparatus according to an embodiment of the present disclosure is shown.
[0156] like Figure 5 As shown, the batch business task execution device 800 of this embodiment includes a file parsing module 510, a script acquisition module 520, and a task execution module 530.
[0157] The file parsing module 510 is used to parse the batch task files corresponding to the batch business tasks and determine the task element information corresponding to each task file in the batch task files. In one embodiment, the file parsing module 510 can be used to perform the operation S201 described above, which will not be repeated here.
[0158] The script acquisition module 520 is used to acquire the local task script corresponding to each task file based on the task element information. In one embodiment, the script acquisition module 520 can be used to execute the operation S202 described above, which will not be repeated here.
[0159] The task execution module 530 is used to execute the local task script of each task file based on the task check information corresponding to the batch task files, thereby completing the batch business task execution. In one embodiment, the task execution module 530 can be used to execute the operation S203 described above, which will not be repeated here.
[0160] According to embodiments of this disclosure, any plurality of modules among the file parsing module 510, script acquisition module 520, and task execution module 530 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the file parsing module 510, script acquisition module 520, and task execution module 530 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the file parsing module 510, script acquisition module 520, and task execution module 530 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0161] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a batch service task execution method according to an embodiment of the present disclosure.
[0162] like Figure 6As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0163] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0164] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0165] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0166] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.
[0167] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.
[0168] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0169] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0170] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0171] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0173] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0174] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for executing batch business tasks, wherein, include: Match batch script version information with local script version information, and check the script check information of batch task files; In response to the script check information, the batch task files are parsed concurrently through the corresponding task thread pool according to the file task identifier of each task file, including: determining the task execution type of each task file according to the task process identifier of each task file through the corresponding task thread in the task thread pool; The task execution type includes immediate task type and scheduled task type, and the task inspection information includes the task execution type and the script inspection information; Analyze the specific task request corresponding to each task file in the batch business tasks; Determine the task element information corresponding to each task file based on the specific task request; According to a preset matching order, multiple basic task elements in the task element information are matched one by one with the basic task elements of local task scripts in the local script library; the multiple basic task elements include: script name, script applicable platform, script path and script MD5 value. After the script name, the applicable platform, and the path where the script is located are all successfully matched, the matched local task script is verified by MD5 based on the script's MD5 value. If the MD5 check passes, obtain the local task script that matches all of the multiple basic task elements; and Based on the task check information corresponding to the batch task files, the local task script of each task file is executed to complete the batch business task execution.
2. The method according to claim 1, wherein, Before parsing the specific task request corresponding to each task file in the batch business tasks, the method further includes: The batch service tasks are received via the downlink task link; Based on the heartbeat connection process, listen for and pull the batch task information corresponding to the batch business tasks of the corresponding data partition; The batch task information includes the batch task file and batch script version information.
3. The method according to claim 2, wherein, Before listening to and retrieving the batch task file corresponding to the batch business task of the corresponding data partition based on the heartbeat connection process, the method further includes: Based on the batch target address of the batch business tasks, copy the batch business tasks to the corresponding data partition; In response to the copying of the batch business tasks to the corresponding data partition, the heartbeat connection process is created.
4. The method according to claim 1, wherein, After matching the batch script version information with the local script version information and checking the script check information of the batch task files, the method further includes: In response to the script check information, update the local script version information.
5. The method according to claim 1, wherein, The process of executing the local task script of each task file based on the task check information corresponding to the batch task files to complete the batch business task execution includes: When the task execution type of the task check information is an immediate task type, the local task script of each task file is executed. When the task execution type of the task check information is a scheduled task type, the local task script of each task file is executed according to the specified execution time of each task file.
6. The method according to claim 5, wherein, The local task script that executes each of the task files includes: When each task file corresponds to a parallel task, multiple first subtask scripts corresponding to the local task script are executed concurrently according to multiple first platform script task identifiers of each task file; and / or When each task file corresponds to a serial task, according to the multiple second platform script task identifiers of each task file, and based on the order of the task script execution identifiers marked by each second platform script task identifier, the multiple second sub-task scripts corresponding to the local task script are executed sequentially.
7. The method according to claim 5, wherein, The local task script that executes each of the task files also includes: Based on the time task element in the task element information, stop the execution of the local task script.
8. The method according to claim 1, wherein, After executing the local task script for each task file based on the task check information corresponding to the batch task files, the method further includes: The execution result messages of the local task scripts are summarized and output to the loading queue; The execution result message in the loading queue is uploaded via the uplink task link.
9. A batch business task execution device, comprising: The file parsing module is used to match batch script version information with local script version information and check the script check information of batch task files. In response to the script check information, the batch task files are parsed concurrently through the corresponding task thread pool according to the file task identifier of each task file, including: determining the task execution type of each task file according to the task process identifier of each task file through the corresponding task thread in the task thread pool; The task execution type includes immediate task type and scheduled task type, and the task inspection information includes the task execution type and the script inspection information; the specific task request corresponding to each task file in the batch business task is parsed; and the task element information corresponding to each task file is determined according to the specific task request. The script acquisition module is used to match multiple basic task elements in the task element information with the basic task elements of local task scripts in the local script library one by one according to a preset matching order. The multiple basic task elements include: script name, applicable platform, script path, and script MD5 value. After the script name, applicable platform, and script path are all successfully matched, the matched local task script is subjected to MD5 verification based on the script MD5 value. If the MD5 verification passes, the local task script that matches all of the multiple basic task elements is acquired. The task execution module is used to execute the local task script of each task file based on the task check information corresponding to the batch task files, so as to complete the execution of the batch business tasks.
10. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 8.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Server automatic batch processing method and system
CN111459631A