Server task implementation method and device, readable storage medium and electronic equipment
By automating the distribution and operation queue management, the problems of latency and low efficiency caused by server task reliance on manual operation are solved, and efficient and secure task execution is achieved.
Patent Information
- Application Number
- CN202111318295.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2041-11-09
AI Technical Summary
In existing technologies, server task implementation relies on manual operation, which leads to latency and low execution efficiency, and makes it difficult to guarantee operation quality and security.
By obtaining the task parameters of the target task and storing them in the distribution queue, determining the list of executable operations and saving it to the operation queue, and using the execution thread to automatically execute the operations until all operations successfully complete the target task.
It enables automated execution of server tasks, improving efficiency while ensuring task quality and security.
Smart Images

Figure CN114035952B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a server task implementation method, a server task implementation apparatus, a readable storage medium, and an electronic device. Background Technology
[0002] The server features high-speed CPU computing power, long-term reliable operation, powerful input / output external data throughput, and better scalability, enabling it to provide computing or application services to other clients on the network.
[0003] However, currently, server tasks are implemented manually, which suffers from latency and low execution efficiency, leading to increased server downtime. In addition, manual operation is uncontrollable, making it difficult to guarantee the quality and security of the operation, which will affect normal application services.
[0004] Therefore, a new method for implementing server tasks is needed.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a server task implementation method, server task implementation apparatus, readable storage medium, and electronic device, thereby overcoming, at least to some extent, the problem of low server task implementation efficiency caused by the limitations and defects of related technologies.
[0007] According to one aspect of this disclosure, a method for implementing a server task is provided, comprising:
[0008] Obtain the target task from the target server and the corresponding task parameters, and store the task parameters in the distribution queue;
[0009] Obtain the current task parameters included in the distribution queue, determine the list of executable operations corresponding to the current task parameters, and save the executable operations in the list of executable operations to the operation queue;
[0010] The executable operations in the operation queue are retrieved and executed. After all executable operations in the list of executable operations are successfully executed, the target task of the target server is completed.
[0011] In one exemplary embodiment of this disclosure, obtaining task parameters corresponding to the target task and storing the task parameters in a distribution queue includes:
[0012] Obtain the unique identifier, type, initialization operation of the target task, and initialization status of the initialization operation included in the task parameters;
[0013] Task key-value pairs are generated based on the task parameters, and the task key-value pairs are stored in the distribution queue; wherein, the unique identifier, type, and initialization operation of the target task are the keys; and the initialization state of the initialization operation is the value.
[0014] In one exemplary embodiment of this disclosure, obtaining the current task parameters included in the distribution queue and determining the list of executable operations corresponding to the current task parameters includes:
[0015] Listen to the distribution queue and obtain the current task key-value pairs included in the distribution queue;
[0016] Based on the type of the target task included in the key of the current task key-value pair, determine the list of executable operations corresponding to the type of the target task.
[0017] In one exemplary embodiment of this disclosure, saving executable operations from the executable operation list to an operation queue includes:
[0018] An operation key-value pair is generated based on the unique identifier and type of the target task, the first executable operation in the list of executable operations, and the operation status of the first executable operation; wherein, the unique identifier, type, and first executable operation of the target task are the keys, and the operation status of the first executable operation is the value;
[0019] Determine the operation type of the first executable operation;
[0020] The operation key-value pair is stored in the operation queue corresponding to the operation type according to the operation type of the first executable operation.
[0021] In one exemplary embodiment of this disclosure, obtaining and executing executable operations from the operation queue includes:
[0022] Listen to the operation queue and obtain the currently executable operations in the operation queue;
[0023] Determine the execution thread corresponding to the currently executable operation, and start the execution thread to execute the currently executable operation;
[0024] Once the currently executable operation is completed, the operation status of the currently executable operation is updated.
[0025] In one exemplary embodiment of this disclosure, after updating the operation state related to the currently executable operation, the server task implementation method further includes:
[0026] Update the operation state of the currently executable operation stored in the distribution queue;
[0027] When a change in the operation state of the currently executable operation is detected in the distribution queue, the next executable operation of the currently executable operation is obtained;
[0028] Generate an operation key-value pair corresponding to the next executable operation, and store the operation key-value pair corresponding to the next executable operation in the operation queue.
[0029] In one exemplary embodiment of this disclosure, the server task implementation method further includes:
[0030] Obtain the preset execution time of the target task and store the preset execution time of the target task in the timeout queue;
[0031] The timeout queue is monitored, and when the execution time of the target task exceeds the preset execution time, the timeout time of the target task is updated and an alarm is triggered.
[0032] According to one aspect of this disclosure, a server task implementation apparatus is provided, comprising:
[0033] The target task distribution module is used to obtain the target task of the target server and the task parameters corresponding to the target task, and store the task parameters in the distribution queue;
[0034] An executable operation determination module is used to obtain the current task parameters included in the distribution queue, determine the executable operation list corresponding to the current task parameters, and save the executable operations in the executable operation list to the operation queue.
[0035] The executable operation execution module is used to obtain executable operations from the operation queue and execute them. After all executable operations in the executable operation list are successfully executed, the target task of the target server is completed.
[0036] According to one aspect of this disclosure, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the server task implementation method described in any of the exemplary embodiments above.
[0037] According to one aspect of this disclosure, an electronic device is provided, comprising:
[0038] Processor; and
[0039] Memory for storing the executable instructions of the processor;
[0040] The processor is configured to execute the server task implementation method described in any of the above exemplary embodiments by executing the executable instructions.
[0041] This disclosure provides a server task implementation method, which involves obtaining a target task of a target server and corresponding task parameters, storing the task parameters in a distribution queue; obtaining current task parameters included in the distribution queue, determining an executable operation list corresponding to the current task parameters, saving the executable operations in the executable operation list to an operation queue; executing the executable operations in the operation queue, and completing the target task of the target server after all executable operations in the executable operation list are successfully executed. On one hand, by storing the obtained target task parameters in the distribution queue, listening to the distribution queue to obtain the current task parameters, determining the executable operation list corresponding to the current task parameters, saving the executable operations in the executable operation list to the operation queue, and executing the executable operations in the operation queue to complete the server task, this method achieves automatic server task implementation, solving the problems of manual operation in the prior art, which relies on manual operation and suffers from delays and low execution efficiency, thus improving the efficiency of server task implementation. On the other hand, because automatic server task implementation is achieved, the quality and security of server task implementation are guaranteed.
[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0044] Figure 1 The flowchart illustrates a server task implementation method according to an example embodiment of the present disclosure.
[0045] Figure 2 The diagram schematically illustrates a block diagram of a server task implementation system according to an example embodiment of the present disclosure.
[0046] Figure 3This diagram illustrates the connection method of components included in a server task implementation system according to an example embodiment of the present disclosure.
[0047] Figure 4 The flowchart illustrates a method for obtaining task parameters corresponding to a target task and storing the task parameters in a distribution queue according to an example embodiment of the present disclosure.
[0048] Figure 5 A block diagram of a server operating system according to an example embodiment of the present disclosure is shown schematically.
[0049] Figure 6 The flowchart illustrates a method for obtaining current task parameters included in a distribution queue and determining a list of executable operations corresponding to the current task parameters, according to an example embodiment of the present disclosure.
[0050] Figure 7 The flowchart illustrates a method for saving executable operations from a list of executable operations to an operation queue according to an example embodiment of the present disclosure.
[0051] Figure 8 The flowchart illustrates a method for executing an executable operation from an operation queue according to an example embodiment of the present disclosure.
[0052] Figure 9 The flowchart illustrates a server task implementation method after updating the operational state of a currently executable operation, according to an example embodiment of the present disclosure.
[0053] Figure 10 The diagram illustrates a target task implementation process according to an example embodiment of the present disclosure.
[0054] Figure 11 The flowchart illustrates a server task implementation method according to an example embodiment of the present disclosure.
[0055] Figure 12 This illustration schematically depicts a server task implementation method when the target task is a reinstallation task, according to an example embodiment of the present disclosure.
[0056] Figure 13 The diagram schematically illustrates a block diagram of a server task implementation apparatus according to an exemplary embodiment of the present disclosure.
[0057] Figure 14 An electronic device for implementing the above-described server task implementation method is illustrated according to an example embodiment of the present disclosure. Detailed Implementation
[0058] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0059] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0060] Server tasks can include server arrival self-inspection, online installation, delivery inspection, restart, power on / off, reinstallation, password reset, and customized system fault repair. Currently, server self-service reinstallation and rescue modes have achieved semi-automation; however, there is no complete method to automate all server tasks. In server self-service reinstallation, parameter files need to be configured manually or semi-automatically according to the different reinstallation needs of different servers. Each server also needs to be manually booted into network boot mode individually, making full automation impossible and inefficient. Furthermore, current self-service reinstallation has limited custom task operation capabilities, only handling simple system reinstallation and unable to handle customized operating systems. Additionally, server self-service reinstallation cannot automatically modify or create Redundant Arrays of Independent Disks (RAID), requiring the server to have a complete RAID configuration, making it highly dependent on hardware factors and resulting in low automation efficiency. In server rescue mode, it relies on CD-ROM booting, has limited system fault repair methods, is slow and difficult, and depends on manual operation, preventing batch operations and further reducing efficiency.
[0061] Based on one or more of the above-mentioned problems, this exemplary embodiment first provides a server task implementation method, which can run on a server, server cluster, or cloud server, etc. Of course, those skilled in the art can also run the method disclosed herein on other platforms as needed, and this exemplary embodiment does not make any special limitations on this. Figure 1 A flowchart illustrating the server task implementation method is shown. (Refer to...) Figure 1 As shown, the server task implementation method may include the following steps:
[0062] Step S110. Obtain the target task of the target server and the task parameters corresponding to the target task, and store the task parameters in the distribution queue;
[0063] Step S120. Obtain the current task parameters included in the distribution queue, determine the list of executable operations corresponding to the current task parameters, and save the executable operations in the list of executable operations to the operation queue;
[0064] Step S130. Obtain the executable operations in the operation queue and execute them. After all executable operations in the executable operation list are successfully executed, the target task of the target server is completed.
[0065] The above-described server task implementation method involves obtaining the target task of the target server and the task parameters corresponding to the target task, storing the task parameters in a distribution queue; obtaining the current task parameters included in the distribution queue, determining the list of executable operations corresponding to the current task parameters, saving the executable operations in the list of executable operations to an operation queue; executing the executable operations in the operation queue, and completing the target task of the target server after all executable operations in the list of executable operations are successfully executed. On one hand, by storing the obtained target task parameters in the distribution queue, listening to the distribution queue to obtain the current task parameters, determining the list of executable operations corresponding to the current task parameters, saving the executable operations in the list of executable operations to the operation queue, and executing the executable operations in the operation queue to complete the server task, the method achieves automatic implementation of the server task, solving the problems of latency and low execution efficiency in the implementation of server tasks in the prior art, thus improving the efficiency of server task implementation. On the other hand, because automatic implementation of the server task is achieved, the quality and security of the server task implementation are guaranteed.
[0066] The following provides a detailed explanation and description of each step involved in the server task implementation method of the exemplary embodiments of this disclosure.
[0067] First, the application scenarios and purpose of the exemplary embodiments of this disclosure will be explained and described. Specifically, the exemplary embodiments of this disclosure can be used to automate server tasks, mainly focusing on how to improve the efficiency of server task implementation.
[0068] In this disclosure, based on the received target task from the server and the corresponding task parameters, the obtained task parameters of the target task are stored in a distribution queue. The distribution queue is monitored to obtain the current task parameters in the distribution queue, determine the list of executable operations corresponding to the current parameters, and save the executable operations in the list of executable operations to an operation queue. The execution thread completes the corresponding executable operations in the operation queue, and after the executable operations are completed, the operation status of the executable operations is changed until all executable operations in the executable operation queue are executed successfully. This realizes automatic implementation of server tasks and improves the efficiency of server task implementation.
[0069] Secondly, the server task implementation system involved in the exemplary embodiments of this disclosure will be explained and described. (Reference) Figure 2As shown, the server task implementation system may include a server resource management system 210, a server operation center 220, an out-of-band management interface 230, a target server 240, and a network boot environment 250. The server resource management system 210 serves as the data source and front-end entry point, and may include a task work order process. Users can initiate target tasks to the target server in batches within the server resource management system 210 and forward the target task parameters to the server operation center 220. The server operation center 220, connected to the server resource management system 210 via the network, serves as the server task control and forwarding center, used to forward target task parameters to the out-of-band management interface 230. The out-of-band management interface 230 is connected to the server operation center 220. The network connection is obtained by integrating and extending the tree node search optimization algorithm based on the Redfish protocol (an open industry standard specification released by the Distributed Management Task Force (DMTF)). It is used to access the target server through the out-of-band network. The target server 240 is connected to the out-of-band management interface 230 and the network boot environment 240. It is used to complete the target task according to the out-of-band network provided by the out-of-band management interface 230 and the dependent environment 240. The network boot environment 250 is connected to the target server. It is used to provide the target server with an IP address when the target server is in network boot mode, so that the target server can complete the target task according to the IP address. The network boot environment 250 includes DHCPServer (Dynamic Host Configuration Protocol Server, a server that provides a temporary IP address to the target server), TFTPSever (Trivial File Transfer Protocol, a server that provides file download to the server).
[0070] Further reference Figure 3 As shown, the connection method of the various components included in this server task implementation system is as follows: the server resource management system 210 and the server operation center 220 are centralized software services used to manage multiple servers; the out-of-band management interface 230 is deployed in a location that can connect to an out-of-band network. Figure 3In the diagram, solid lines represent communication between components via a network. The out-of-band management interface 230 can control the server via IPMI (Intelligent Platform Management Interface) or the Redfish protocol. The server operation center 220 can call the out-of-band management interface 230 through various communication protocols. The target server 240 can obtain an IP address from the DHCP server in the dependent environment 240 through the network port of the business network, and then use the IP address to communicate on the business network. The target server 240 can also call the interface of the server operation center 220 to obtain target task parameters and reporting information.
[0071] The following will combine Figure 2 as well as Figure 3 Steps S110-S130 are explained and described in detail.
[0072] In step S110, the target task of the target server and the task parameters corresponding to the target task are obtained, and the task parameters are stored in the distribution queue.
[0073] In this example embodiment, reference Figure 4 As shown, obtaining the task parameters corresponding to the target task and storing the task parameters in the distribution queue may include steps S410 and S420:
[0074] Step S410. Obtain the unique identifier, type, initialization operation of the target task, and initialization status of the initialization operation included in the task parameters;
[0075] Step S420. Generate task key-value pairs according to the task parameters, and store the task key-value pairs in the distribution queue; wherein, the unique identifier, type, and initialization operation of the target task are the keys; and the initialization state of the initialization operation is the value.
[0076] The following will explain and describe steps S410 and S420. First, the server operation center 220 receives the target task from the target server, converts the task parameters of the server task, and stores the converted parameters in the distribution queue. The task parameters include the unique identifier of the target task, the target task type, the initialization operation of the target task, and the initialization status of the initialization operation. The server operation center 220 can convert the task parameters into task key-value pairs, where the unique identifier of the target task, the target task type, and the initialization operation of the target task can be the keys of the task key-value pairs, and the initialization status of the initialization operation is the value of the task key-value pairs. After converting the task parameters into task key-value pairs, the task key-value pairs can be stored in the distribution queue.
[0077] For example, when the target server is an already deployed server, the target task can be any of the following: restart, power on / off, reinstall, password reset, or customized system fault repair. When the target task is reinstall, the task parameters can include: a unique identifier for the reinstallation task, the type is reinstallation, the initialization operation of the reinstallation task is: target server PXE restart, and the initialization status of the initialization operation is: incomplete. A task key-value pair is generated based on the task parameters of the reinstallation task, and the task key-value pair is stored in the distribution queue. When the target server is a server being deployed, the target task can be the deployment of the target server. The task parameters can include: a unique identifier for the deployment task, the type is deployment, the initialization operation of the deployment task is: target server power on, and the initialization status of the initialization operation is: incomplete. A task key-value pair is generated based on the task parameters of the deployment task, and the task key-value pair is stored in the distribution queue.
[0078] In this example embodiment, when the target task of the target server is a reinstallation task, the server operation center 220 can also receive the installation parameters of the target server. The installation parameters of the target server include: the target server serial number (SN), which is used to uniquely identify a server; the hostname of the target server; the configuration parameters of the operating system to be installed; and the out-of-band IP of the target server.
[0079] Further reference Figure 5As shown, the server operation center 220 may include an information receiving module 510, a status control module 520, an execution module 530, a timeout control module 540, an alarm notification module 550, and an information return module 560. Specifically, the information receiving module 510 receives task parameters of the target task sent by the server resource management system 210, converts the received task parameters into task key-value pairs, and stores the converted task key-value pairs in a distribution queue. The status control module 520 maintains a list of executable operations corresponding to the task type of the target task, listens to the distribution queue, and when a new task key-value pair is added to the distribution queue, it determines the list of executable operations corresponding to the target task based on the task type of the target task in the new task key-value pair and the list of executable operations corresponding to the task type of the target task; and places each executable operation in the list into the operation queue corresponding to the operation type of that executable operation. The execution module 530 listens to the operation queue, obtains the executable operations in the operation queue, and executes the executable operations. After the executable operation is completed, the status control module 560... Module 520 updates the operation status of the executable operation and obtains the next executable operation from the executable operation list, storing the next executable operation in the corresponding operation queue. When it is determined that all executable operations in the executable operation list have been executed successfully, the status control module 520 stores the unique identifier of the target task in the information return queue. The information return module 560 listens to the information return queue. When it hears the newly added unique identifier of the target task in the information return queue, it returns a message that the target task has been completed to the server resource management system 210. When the target task arrives at the information conversion module 510, the timeout control module 540 stores the timeout time of the target task in the timeout queue. The status control module 520 listens to the timeout queue and updates the timeout time of the target task in a timely manner. The alarm notification module 550 listens to the operation and usage of other modules. When the operation and usage of any module is abnormal, an alarm is triggered.
[0080] In step S120, the current task parameters included in the distribution queue are obtained, the list of executable operations corresponding to the current task parameters is determined, and the executable operations in the list of executable operations are saved to the operation queue.
[0081] In this example embodiment, reference Figure 6 As shown, obtaining the current task parameters included in the distribution queue and determining the list of executable operations corresponding to the current task parameters may include steps S610 and S620:
[0082] Step S610. Listen to the distribution queue and obtain the current task key-value pairs included in the distribution queue;
[0083] Step S620. Determine the list of executable operations corresponding to the type of the target task based on the type of the target task included in the key of the current task key-value pair.
[0084] The following will explain and describe steps S610 and S620. Specifically, after storing the task key-value pair of the target task in the distribution queue, the status control module 520 listens to the task distribution queue, obtains the newly added task key-value pair in the distribution queue, obtains the task type of the target task included in the newly added task key-value pair, and determines the list of executable operations corresponding to the target task based on the task type of the target task. For example, when the task type of the target task included in the obtained key-value pair is reinstallation, the list of executable operations corresponding to reinstallation can be obtained. The executable operations included in the list of executable operations corresponding to reinstallation include: restarting the server PXE (PrebooteXecution Environment), obtaining a temporary IP (Internet Protocol Address), loading a customized Ramfs (Random Access Memory Filing System), downloading and installing task parameters, configuring and mounting RAID, partitions, and formatting disks, downloading and installing the image, configuring a fixed IP hostname, and GRUB (GRandUnified)... Bootloader (multi-operating system startup program) installation, restart and load initialization program and callback server operation center system installation completed; when the target task type included in the obtained key-value pair is "listing", a list of executable operations corresponding to the listing can be obtained. The executable operations included in the list of executable operations include: server power-on, automatic PXE boot, obtaining temporary IP, loading customized ramfs, and obtaining the target server's out-of-band MAC address, target server serial number SN, target server's network access switch ToR (Top of Rack) and target server port.
[0085] After obtaining the list of executable operations for the target task, refer to... Figure 7 As shown, saving the executable operations in the executable operation list to the operation queue may include steps S710-S730:
[0086] Step S710. Generate an operation key-value pair based on the unique identifier and type of the target task, the first executable operation in the list of executable operations, and the operation status of the first executable operation; wherein, the unique identifier, type, and first executable operation of the target task are the keys, and the operation status of the first executable operation is the value;
[0087] Step S720. Determine the operation type of the first executable operation;
[0088] Step S730. Store the operation key-value pair into the operation queue corresponding to the operation type according to the operation type of the first executable operation.
[0089] The following will explain and illustrate steps S710-S730. Specifically, firstly, the state control module 520 generates operation key-value pairs based on the unique identifier of the target task, the type of the target task, the first executable operation in the list of executable operations corresponding to the target task, and the operation status of the first executable operation. The unique identifier of the target task, the type of the target task, and the first executable operation in the list of executable operations corresponding to the target task are the keys of the operation key-value pairs, and the operation status of the first executable operation is the value of the operation key-value pairs. Then, the operation type of the first executable operation is determined, and the operation queue corresponding to that operation type is determined based on the operation type. Finally, the state control module 520 stores the operation key-value pairs in the corresponding operation queues. The server operation center may include multiple operation queues, each storing executable operations of different types. Multiple operation queues are executed in parallel, while the executable operations in each operation queue are executed serially.
[0090] For example, when the target task is a reinstallation task, firstly, an operation key-value pair can be generated based on the first executable operation in the list of executable operations corresponding to the reinstallation task. The key of the operation key-value pair is the unique identifier of the reinstallation task, "reinstallation," and "server PXE restart," while the value is "incomplete." Then, the operation type of the first executable operation is determined to be "PXE restart," the operation queue for executing the PXE restart operation is determined, and the operation key-value pair is stored in the operation queue. When the target task is a deployment task, firstly, an operation key-value pair can be generated based on the first executable operation in the list of executable operations corresponding to the deployment task. The key of the operation key-value pair is the unique identifier of the deployment task, "deployment," and "server power-on," while the value is "incomplete." Then, the operation type of the first executable operation is determined to be "power-on," the operation queue for executing the power-on operation is determined, and the operation key-value pair is stored in the operation queue.
[0091] In step S130, the executable operations in the operation queue are obtained and executed. After all executable operations in the list of executable operations are successfully executed, the target task of the target server is completed.
[0092] In this example embodiment, reference Figure 8 As shown, obtaining executable operations from the operation queue and executing them may include steps S810-S830:
[0093] Step S810. Listen to the operation queue and obtain the currently executable operations in the operation queue;
[0094] Step S820. Determine the execution thread corresponding to the currently executable operation, and start the execution thread to execute the currently executable operation;
[0095] Step S830. After the currently executable operation is completed, update the operation state of the currently executable operation.
[0096] The following will explain and describe steps S810-S830. Specifically, the execution module 530 listens to the operation queue, obtains the currently executable operations in the operation queue, determines the execution thread to execute the currently executable operation through the out-of-band management interface 230, starts the execution thread and executes the currently executable operation; when the execution thread finishes executing the currently executable operation and executes it successfully, the status control module updates the operation status of the currently executable operation.
[0097] Further reference Figure 9 As shown, after updating the operation state of the currently executable operation, the server task implementation method further includes steps S910-S930:
[0098] Step S910. Update the operation state of the currently executable operation stored in the distribution queue;
[0099] Step S920. When a change in the operation state of the currently executable operation is detected in the distribution queue, obtain the next executable operation of the currently executable operation;
[0100] Step S930. Generate an operation key-value pair corresponding to the next executable operation, and store the operation key-value pair corresponding to the next executable operation in the operation queue.
[0101] The following will explain and describe steps S910-S930. Specifically, firstly, after the execution module successfully executes the current executable operation, the status control module updates the operation status of the current executable operation stored in the distribution queue. When the status of the current executable operation is updated to complete, the next executable operation of the current executable operation in the executable operation list corresponding to the target task is obtained, an operation key-value pair of the next executable operation is generated, and the operation key-value pair is stored in the operation queue for execution by the execution module. When the execution is successful, the status update module updates the operation status of the next executable operation. The above execution steps are repeated until all executable operations in the executable operation list corresponding to the target task are successfully executed.
[0102] For example, when the target task is a reinstallation task, firstly, based on the first executable operation in the executable operation list corresponding to the reinstallation task: server PXE restart, an operation key-value pair is generated and stored in the operation queue. The execution module 530 obtains the operation key-value pair and determines the execution thread for executing the server PXE restart through the out-of-band management interface 230, starts the execution thread, and executes the server PXE restart operation. When the execution is successful, the status control module 520 updates the operation status of the server PXE restart operation from incomplete to complete. Then, the status control module 520 obtains the next executable operation for the server PXE restart operation: obtain a temporary IP, and executes it. When the execution is successful, the status control module updates the operation status of the obtain temporary IP operation. The above execution process is repeated until all executable operations in the executable operation list corresponding to the reinstallation task are successfully executed. When the target task is a listing task, firstly, based on the first executable operation in the executable operation list corresponding to the listing task: generating an operation key-value pair for server power-on, and storing this operation key-value pair in the operation queue, the execution module 530 obtains the operation key-value pair and determines the execution thread for executing server power-on through the out-of-band management interface 230, starts the execution thread, and executes the server power-on operation. When the execution is successful, the status control module 520 updates the operation status of the server power-on operation from incomplete to complete. Then, the status control module 520 obtains the next executable operation for the server power-on operation: automatic PXE booting, and executes it. When the execution is successful, the status control module updates the operation status of the automatic PXE booting operation. The above execution process is repeated until all executable operations in the executable operation list corresponding to the listing task are successfully executed.
[0103] Furthermore, the following will combine Figure 10The implementation process of the target task described in the example embodiments of this application will be further explained and described. When the target task of the target server is reinstallation, firstly, the Server Resource Management System (SRMS) pushes the task parameters of the target task to the Server Operation Center (SOC). The Server Operation Center generates installation parameters according to the target server and determines the list of executable operations corresponding to the target task based on the received task parameters: server PXE restart, obtaining a temporary IP, loading a customized Ramfs, downloading and installing task parameters, configuring and mounting RAID, partitions, and formatted disks, downloading and installing the image, configuring a fixed IP hostname, GRUB installation, restarting and loading the initialization program, and calling back to the Server Operation Center. When executing the executable operations in the list of executable operations, remote PXE based on the Redfish protocol is performed on the target server through the out-of-band management interface (ILOAPI). After a Reset (reboot + network boot), the target server will then enter network boot mode. It will obtain a temporary business IP from the network boot dependency environment, remotely load a customized memory file system and kernel, and then request reinstallation task parameters from the SOC. Based on the parameters, it will create the specified RAID, partition the disk, format the disk, and configure the mount. Next, it will download the required operating system image from the network boot environment and configure the basic operating system configuration (such as fixed network, GRUB installation, and the initialization program to be executed on the next boot). At this point, the critical installation of the operating system is basically completed. Then, it will reboot into the target operating system of the target server. By default, the initialization program is loaded to install some common business dependency software and configurations. Finally, the SOC will be called back to update the status and the installation is complete. Finally, the SOC will report the task completion status to SRMS.
[0104] When the target server's task is a setup task, it automatically performs PXE network boot upon power-up. During this boot process, the target server obtains an out-of-band IP address from the DHCP Server, downloads and loads a customized memory file system and kernel. After the customized memory file system is successfully loaded, it automatically requests setup task parameters from the SOC and executes the designated task program corresponding to that setup task. During task execution, the target server needs to collect information, including tor, port, SN, and out-of-band MAC address, and uploads this information to the SRMS, ensuring the completeness of the closed-loop SRMS data. In a network-dependent boot environment, the DHCP Server periodically obtains the latest out-of-band MAC and IP addresses from the SRMS, statically binds them, and restarts the DHCP Server. The target server obtains an out-of-band IP address from the DHCP Server at preset intervals. Based on the DHCP static binding priority principle, the server will always obtain the designated out-of-band IP address planned by the SRMS. Therefore, ILOAPI can remotely operate through the out-of-band IP address to complete the target server's target task, achieving a closed-loop automated task operation.
[0105] In this example embodiment, reference Figure 11 As shown, the server task implementation method further includes steps S1110-S1120:
[0106] Step S1110. Obtain the preset execution time of the target task and store the preset execution time of the target task in the timeout queue;
[0107] Step S1120. Monitor the timeout queue. When the execution time of the target task exceeds the preset execution time, update the timeout time of the target task and trigger an alarm message.
[0108] The following will explain and describe steps S1110-S1120. Specifically, before executing the target task on the target server, the preset execution time of the target task is first obtained. The preset execution time can be dynamically specified by the target task or can be customized. In this example embodiment, the method of generating the preset execution time of the target task is not specifically limited. After obtaining the preset execution time of the target task, the timeout control module 540 stores the target task and its preset execution time in a timeout queue. The status control module 520 monitors this timeout queue. When the execution time of the target task exceeds its preset execution time, the status control module 520 updates the timeout time of the target task and triggers the alarm notification module 550 to issue an alarm message for the target task. The completion time of the target task is determined by the execution times of the executable operations included in the executable operation list of the target task.
[0109] The server task implementation method provided in this exemplary embodiment has at least the following advantages: On the one hand, the task parameters of the acquired target task are stored in a distribution queue, the current task parameters in the distribution queue are monitored, a list of executable operations corresponding to the current task parameters is determined, the executable operations in the list of executable operations are saved to an operation queue, and the executable operations in the operation queue are executed to complete the server task. This realizes the automatic implementation of the server task and solves the problem that the implementation of server tasks in the prior art relies on manual operation, which has the problems of delay and low execution efficiency. This improves the implementation efficiency of the server task. On the other hand, since the server task is implemented automatically, the quality and security of the server task implementation are guaranteed.
[0110] The following, combined with Figure 12 When the target task of this exemplary embodiment is a reinstallation task, the task implementation method of the target server will be further explained and described. It may include:
[0111] S1201.SRMS serves as the data source and front-end entry point, distributing the target task to the SOC;
[0112] S1202.SOC acts as a task control and forwarding center, forwarding high-concurrency asynchronous task processing to ILOAPI;
[0113] S1203.ILOAPI serves as a remote basic operation channel, directly accessing data center servers via out-of-band network to perform power operations such as restarts and network booting.
[0114] S1204. During the network boot process, the target server obtains an out-of-band IP address from the DHCP server;
[0115] S1205. The target server downloads a customized memory file system and kernel from the TFTPServer;
[0116] After the S1206 customized memory file system is successfully loaded, it automatically requests the actual task parameters from the SOC and executes the specified task program. However, the customized memory file system and kernel file are limited in size, and some task programs are stored in the HTTPServer. Therefore, the task programs can be downloaded through the HTTPServer.
[0117] S1207. During the execution of the target task, the target server uploads the collected target server information to the SOC.
[0118] This disclosure also provides a server task implementation apparatus, as illustrated in the example embodiments. Figure 13 As shown, it may include: a target task distribution module 1310, an executable operation determination module 1320, and an executable operation execution module 1330. Wherein:
[0119] The target task distribution module 1310 is used to obtain the target task of the target server and the task parameters corresponding to the target task, and store the task parameters in the distribution queue;
[0120] The executable operation determination module 1320 is used to obtain the current task parameters included in the distribution queue, determine the executable operation list corresponding to the current task parameters, and save the executable operations in the executable operation list to the operation queue;
[0121] The executable operation execution module 1330 is used to obtain executable operations in the operation queue and execute them. After all executable operations in the executable operation list are successfully executed, the target task of the target server is completed.
[0122] The specific details of each module in the above-mentioned server task implementation device have been described in detail in the corresponding server task implementation methods, so they will not be repeated here.
[0123] In one exemplary embodiment of this disclosure, obtaining task parameters corresponding to the target task and storing the task parameters in a distribution queue includes:
[0124] Obtain the unique identifier, type, initialization operation of the target task, and initialization status of the initialization operation included in the task parameters;
[0125] Task key-value pairs are generated based on the task parameters, and the task key-value pairs are stored in the distribution queue; wherein, the unique identifier, type, and initialization operation of the target task are the keys; and the initialization state of the initialization operation is the value.
[0126] In one exemplary embodiment of this disclosure, obtaining the current task parameters included in the distribution queue and determining the list of executable operations corresponding to the current task parameters includes:
[0127] Listen to the distribution queue and obtain the current task key-value pairs included in the distribution queue;
[0128] Based on the type of the target task included in the key of the current task key-value pair, determine the list of executable operations corresponding to the type of the target task.
[0129] In one exemplary embodiment of this disclosure, saving executable operations from the executable operation list to an operation queue includes:
[0130] An operation key-value pair is generated based on the unique identifier and type of the target task, the first executable operation in the list of executable operations, and the operation status of the first executable operation; wherein, the unique identifier, type, and first executable operation of the target task are the keys, and the operation status of the first executable operation is the value;
[0131] Determine the operation type of the first executable operation;
[0132] The operation key-value pair is stored in the operation queue corresponding to the operation type according to the operation type of the first executable operation.
[0133] In one exemplary embodiment of this disclosure, obtaining and executing executable operations from the operation queue includes:
[0134] Listen to the operation queue and obtain the currently executable operations in the operation queue;
[0135] Determine the execution thread corresponding to the currently executable operation, and start the execution thread to execute the currently executable operation;
[0136] Once the currently executable operation is completed, the operation status of the currently executable operation is updated.
[0137] In one exemplary embodiment of this disclosure, after updating the operation state related to the currently executable operation, the server task implementation method further includes:
[0138] Update the operation state of the currently executable operation stored in the distribution queue;
[0139] When a change in the operation state of the currently executable operation is detected in the distribution queue, the next executable operation of the currently executable operation is obtained;
[0140] Generate an operation key-value pair corresponding to the next executable operation, and store the operation key-value pair corresponding to the next executable operation in the operation queue.
[0141] In one exemplary embodiment of this disclosure, the server task implementation method further includes:
[0142] Obtain the preset execution time of the target task and store the preset execution time of the target task in the timeout queue;
[0143] The timeout queue is monitored, and when the execution time of the target task exceeds the preset execution time, the timeout time of the target task is updated and an alarm is triggered.
[0144] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0145] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0146] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0147] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0148] The following reference Figure 14 To describe an electronic device 1400 according to such an embodiment of the present disclosure. Figure 14The electronic device 1400 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0149] like Figure 14 As shown, the electronic device 1400 is manifested in the form of a general-purpose computing device. The components of the electronic device 1400 may include, but are not limited to: at least one processing unit 1410, at least one storage unit 1420, a bus 1430 connecting different system components (including storage unit 1420 and processing unit 1410), and a display unit 1440.
[0150] The storage unit stores program code that can be executed by the processing unit 1410, causing the processing unit 1410 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 1410 can perform actions such as... Figure 1 The steps shown are as follows: S110: Obtain the target task of the target server and the task parameters corresponding to the target task, and store the task parameters in the distribution queue; S120: Obtain the current task parameters included in the distribution queue, determine the list of executable operations corresponding to the current task parameters, and save the executable operations in the list of executable operations to the operation queue; S130: Obtain the executable operations in the operation queue and execute them. After all executable operations in the list of executable operations are successfully executed, the target task of the target server is completed.
[0151] Storage unit 1420 may include readable media in the form of volatile storage units, such as random access memory (RAM) 14201 and / or cache memory 14202, and may further include read-only memory (ROM) 14203.
[0152] Storage unit 1420 may also include a program / utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0153] Bus 1430 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0154] Electronic device 1400 can also communicate with one or more external devices 1500 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1400, and / or with any device that enables electronic device 1400 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1450. Furthermore, electronic device 1400 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1460. As shown, network adapter 1460 communicates with other modules of electronic device 1400 via bus 1430. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0155] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0156] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.
[0157] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0158] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0159] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0160] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0161] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and 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).
[0162] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0163] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A method for implementing a server task, characterized by, The method comprises the following steps: obtaining a target task of a target server and a task parameter corresponding to the target task, and storing the task parameter into a distribution queue; obtaining a current task parameter included in the distribution queue, determining an executable operation list corresponding to the current task parameter, and saving an executable operation in the executable operation list into an operation queue; monitoring the operation queue, obtaining a current executable operation in the operation queue; determining an execution thread corresponding to the current executable operation, and starting the execution thread to execute the current executable operation; updating an operation state of the current executable operation after the execution of the current executable operation is completed, updating the operation state of the current executable operation stored in the distribution queue, and obtaining a next executable operation of the current executable operation when a change in the operation state of the current executable operation is monitored in the distribution queue; generating an operation key-value pair corresponding to the next executable operation, storing the operation key-value pair corresponding to the next executable operation into the operation queue, and completing the target task of the target server after all executable operations in the executable operation list are executed successfully.
2. The method of claim 1, wherein, obtaining a task parameter corresponding to the target task, and storing the task parameter into a distribution queue, comprising: obtaining a unique identifier, a type, an initialization operation of the target task, and an initialization state of the initialization operation included in the task parameter; generating a task key-value pair according to the task parameter, and storing the task key-value pair into the distribution queue; wherein the unique identifier, the type of the target task, and the initialization operation of the target task are keys; and the initialization state of the initialization operation is a value.
3. The method of claim 2, wherein, obtaining a current task parameter included in the distribution queue, and determining an executable operation list corresponding to the current task parameter, comprising: monitoring the distribution queue, and obtaining a current task key-value pair included in the distribution queue; determining an executable operation list corresponding to the type of the target task according to the type of the target task included in the key of the current task key-value pair.
4. The method of claim 3, wherein, saving an executable operation in the executable operation list into an operation queue, comprising: generating an operation key-value pair according to the unique identifier, the type of the target task, a first executable operation in the executable operation list, and an operation state of the first executable operation; wherein the unique identifier, the type of the target task, and the first executable operation are keys, and the operation state of the first executable operation is a value; determining an operation type of the first executable operation; storing the operation key-value pair into an operation queue corresponding to the operation type according to the operation type of the first executable operation.
5. The method of claim 1, wherein, The server task implementation method further comprises: obtaining a preset execution time of the target task, and storing the preset execution time of the target task into a timeout queue; monitoring the timeout queue, updating a timeout time of the target task and triggering an alarm information when the execution time of the target task is greater than the preset execution time.
6. A server task implementation apparatus characterized by comprising: The method comprises the following steps: a target task distribution module is configured to obtain a target task of a target server and a task parameter corresponding to the target task, and store the task parameter in a distribution queue; an executable operation determination module is configured to obtain a current task parameter included in the distribution queue, determine an executable operation list corresponding to the current task parameter, and save an executable operation in the executable operation list in an operation queue; an executable operation execution module is configured to listen to the operation queue, obtain a current executable operation in the operation queue, determine an execution thread corresponding to the current executable operation, and start the execution thread to execute the current executable operation; when the current executable operation is executed, update an operation state of the current executable operation, update an operation state of the current executable operation stored in the distribution queue, and when a change in the operation state of the current executable operation is detected in the distribution queue, obtain a next executable operation of the current executable operation; generate an operation key-value pair corresponding to the next executable operation, store the operation key-value pair corresponding to the next executable operation in the operation queue, and complete the target task of the target server when all executable operations in the executable operation list are successfully executed.
7. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the server task implementation method of any one of claims 1-5.
8. An electronic device, comprising: The method comprises the following steps: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the server task implementation method of any one of claims 1-5 by executing the executable instructions.
Citation Information
Patent Citations
Batch task processing method, device and equipment and storage medium
CN110806933A