WO2023082389A1 - 任务处理方法、设备、存储介质及程序产品 - Google Patents

任务处理方法、设备、存储介质及程序产品 Download PDF

Info

Publication number
WO2023082389A1
WO2023082389A1 PCT/CN2021/136020 CN2021136020W WO2023082389A1 WO 2023082389 A1 WO2023082389 A1 WO 2023082389A1 CN 2021136020 W CN2021136020 W CN 2021136020W WO 2023082389 A1 WO2023082389 A1 WO 2023082389A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
container
task
runtime
management module
Prior art date
Application number
PCT/CN2021/136020
Other languages
English (en)
French (fr)
Inventor
卢道和
黄润良
杨军
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023082389A1 publication Critical patent/WO2023082389A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances

Definitions

  • the present application relates to the field of financial technology (Fintech), and in particular to a task processing method, device, storage medium and program product.
  • the existing distributed batch task processing technology needs to reserve a large number of computing resources to ensure the computing resources when the batch program is running.
  • the realization of sharing or multiplexing makes the utilization rate of computing resources low, which adds a huge amount of server costs and labor costs to the operation and maintenance of financial enterprises.
  • This application provides a task processing method, device, storage medium, and program product to solve the problems of low security and high operation and maintenance costs caused by insufficient isolation when the existing distributed batch task processing technology is applied in the financial technology field. technical problem.
  • the present application provides a task processing method, including:
  • the task execution instruction corresponds to the task to be processed
  • the virtual machine container is a container running in the virtual machine
  • This application uses a virtual machine container to replace the traditional container. While inheriting the advantages of the traditional container technology, the virtual machine is introduced to overcome the problem that the host kernel is shared among the containers, which is prone to kernel escape, resulting in insufficient isolation. Or only node-level isolation can be used, which leads to the defect of insufficient isolation security for batch tasks in the financial technology field.
  • the virtual machine container further improves resource utilization, and through the high isolation of the virtual machine, an additional layer of virtual machine isolation is added to the original container-level isolation, so that insufficient isolation caused by sharing the kernel between containers will not occur. In order to improve the complete isolation effect of batch task processing in the financial technology field, improve the security of batch task processing, and reduce the technical effect of operation and maintenance costs.
  • the present application provides a task processing device, including:
  • Processing modules for:
  • the task execution instruction corresponds to the task to be processed
  • the virtual machine container is a container running in the virtual machine
  • the present application provides an electronic device, including:
  • the processor is configured to invoke and execute the program instructions in the memory, and execute any possible method for determining item storage information provided in the first aspect.
  • the present application provides a storage medium, where a computer program is stored in the readable storage medium, and the computer program is used to execute any possible task processing method provided in the first aspect.
  • the present application further provides a computer program product, including a computer program.
  • a computer program product including a computer program.
  • the computer program is executed by a processor, any possible task processing method provided in the first aspect is implemented.
  • the present application also provides a computer program, which, when running on a computer, causes the computer to execute any one of the possible task processing methods provided in the first aspect above.
  • the present application provides a task processing method, device, storage medium, and program product, by acquiring a new task instruction; then using a container management module to determine at least one task to be processed and a task execution instruction according to the new task instruction, and the task execution instruction and the task execution instruction Corresponding to the tasks to be processed; then use the preset virtual machine runtime module to determine one or more virtual machines and virtual machine containers according to the task execution instructions, and the virtual machine container is the container running in the virtual machine; finally use the virtual machine
  • the container invokes the image resource to process pending tasks. It solves the technical problems of low security and high operation and maintenance costs caused by insufficient isolation when the existing distributed batch task processing technology is applied in the financial technology field. It has achieved the technical effect of improving the complete isolation effect of batch task processing in the financial technology field, improving the security of batch task processing, and reducing operation and maintenance costs.
  • FIG. 1 is a schematic diagram of an application scenario of a task processing method provided by the present application
  • Fig. 2 is a schematic flow chart of a task processing method provided by the present application.
  • FIG. 3 is a schematic flowchart of another task processing method provided by the implementation of the present application.
  • Figure 4 is a schematic diagram of the virtual machine container interaction process provided by the embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a task processing device provided in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by the present application.
  • Virtual machine management program VMM Virtual Machine Manager: used to establish and maintain a framework for managing virtual machines.
  • Kubernetes A distributed container orchestration scheduling system.
  • CRI Kernetes Runtime Interface
  • Open container standard OCI Open Container Initiative: used to establish the image creation, certification, deployment and naming methods of containers.
  • Node a distributed computing node that provides the smallest physical unit of computing power.
  • Kubelet The proxy component of kubernetes on each node.
  • Image A form of file storage that contains a package of all the elements needed to run a scheduled task in any environment.
  • Container An instance created from an image.
  • Secure Containers Use lightweight virtual machines to run containers and implement OCI requirements themselves.
  • CornJob A computing task that runs according to cron time rules, such as once a day.
  • Job A computing task that runs only once.
  • Quality of service qos used to ensure that high-priority tasks can have sufficient resources to run.
  • the qos mechanism will force low-priority tasks to give up their computing resources according to the configured task level to ensure the execution of high-priority tasks.
  • the existing container technology needs to share the host kernel, which makes it easy to escape the kernel and cause security problems.
  • the so-called kernel escape means that the attacker escapes the container through the loopholes in the host kernel.
  • the attacker first hijacks the containerized business logic, or directly controls (such as CaaS (Communications as a Service, communication as a service) such as The scenario of legally obtaining the control of the container) and other methods have obtained the command execution capability under a certain authority in the container; then the attacker uses this command execution capability to further obtain a certain The ability to execute commands under the authority, which raises security issues.
  • the operating environment cannot be isolated: the variables (that is, a specific form of computing resources, such as environment variables and kernel parameters) required by different batch tasks may compete with each other, resulting in the failure of batch tasks.
  • Waste of resources Due to the competition of running environment variables, more machines are needed to run tasks. In addition, during the dormant period of the task, its idle computing power cannot be used to provide calculations for other tasks.
  • FIG. 1 is a schematic diagram of an application scenario of a task processing method provided in the present application.
  • the operation and maintenance personnel 101 create batch tasks through the user terminal 102 , and the batch system 103 assigns task types to each task, including Job and CornJob.
  • the execution instruction of the task is passed to kubernetes, that is, the container management module 104, and kubernetes forwards the execution instruction to the VMM, that is, the virtual machine management module 105 to apply for creating a virtual isolation environment, and the virtual machine management module builds each virtual machine 106, and in the virtual Each virtual machine container 107 corresponding to a batch task and processing a specific task runs in the machine 106 .
  • Various image packages in the batch system 103 are invoked by the virtual container 107 to complete specific computing tasks.
  • developers can store various image packages in the database of the batch system 103 in advance, so as to be called by subsequent virtual machine containers.
  • FIG. 2 is a schematic flowchart of a task processing method provided by an embodiment of the present application. As shown in Figure 2, the specific steps of the task processing method include:
  • the new task instruction includes construction information of at least one task to be processed.
  • the operation and maintenance personnel create a batch task through the user terminal, which is included in the batch task. At least one pending task.
  • the operation and maintenance personnel input the construction information of each task to be processed through the client and upload it to the batch system.
  • the developer uploads the pre-made image package files for processing various types of tasks to the database of the batch system for storage in advance, so as to be called by subsequent virtual machine containers.
  • operation and maintenance personnel can manage batch tasks through the task interface on the client side, including: creating new tasks, viewing task progress, viewing task results, and so on.
  • the task execution instruction corresponds to the task to be processed, and the task to be processed includes: a one-time task and a periodic task.
  • the container management module includes a task management interface, and uses the task management interface to determine at least one task to be processed according to the task information in the new task instruction.
  • the batch system uses the interface API ( Application Programming Interface) creates batch tasks, that is, at least one pending task, and generates execution instructions corresponding to each pending task.
  • interface API Application Programming Interface
  • the virtual machine container is a container running in a virtual machine.
  • the batch system sends the task execution instruction to the virtual machine runtime module through the first container runtime interface of the container management module; through the virtual machine runtime module, it connects to the virtual machine management module according to the task execution instruction;
  • the virtual machine management module and the virtual machine runtime module create one or more virtual machines and virtual machine containers according to task execution instructions.
  • the batch system of this embodiment supports the container management module to run the virtual machine like a container through the virtual machine runtime module, so that the virtual machine has the behavior characteristics of the container.
  • the batch system forwards the instruction to create a container in the task execution instruction to WCS-RUNTIME (that is, the virtual machine runtime module) through the CRI of kubernetes.
  • WCS-RUNTIME that is, the virtual machine runtime module
  • Create a virtual machine container by selecting a variety of VMMs (that is, virtual machine management modules) through WCS-RUNTIME.
  • VMMs that is, virtual machine management modules
  • WCS-RUNTIME implements the OCI development container standard. Through this module, the batch system can be effectively connected to kubernetes, and it can run virtual machines like containers and accept the management and scheduling of kubernetes.
  • the OCI development container standard is the OCI (Open Container Initiative) organization established by the Linux Foundation in June 2015, aiming to develop an open industrial standard around the container format and runtime.
  • OCI Open Container Initiative
  • container runtime standard runtime spec
  • container image standard image spec
  • container format standards In general, the purpose of formulating container format standards is not to be bound by the upper structure, such as specific clients, orchestration stacks, etc., but also not bound by specific suppliers or projects, that is, not limited to a specific operating system , hardware, CPU architecture, public cloud, etc.
  • OCI runtime filesytem bundle These two protocols are connected together through the standard format of OCI runtime filesytem bundle.
  • the OCI image can be converted into a bundle through tools, and then the OCI container engine can recognize the bundle to run the container.
  • WCS-RUNTIME is a self-developed container management service platform based on kubernetes in the embodiment. Because kubernetes is a distributed system dedicated to the orchestration and scheduling of containers, it can only call containers, but cannot directly call virtual machines. In order to realize the inventive concept of this application, to run the container on a virtual machine with high isolation and high resource reuse rate, an intermediary is needed to enable kubernetes to call VMM to create and manage each virtual machine. And WCS-RUNTIME is this intermediary. That is, the virtual machine runtime module is used to connect the container management module and the virtual machine container.
  • the virtual machine management module of this embodiment is used to implement the open container standard OCI, and a lightweight virtual machine can be used to run the container, so that when the container is running, there is no need to share the host kernel (because the shared The kernel of the virtual machine, not the actual host kernel), achieves the purpose of completely isolating the container, so that each batch task can meet the isolation requirements of the financial level and improve the security of the batch system.
  • the virtual machine container invokes the pre-stored image package in the database corresponding to the task to be processed to complete the processing of the task to be processed and obtain the processing result.
  • the distributed batch scheduling process is completed by docking with kubernetes.
  • virtual machines By using virtual machines to replace traditional containers, financial-level security levels are achieved, so it also has the advantages of container batch systems and makes full use of idle computing resources.
  • the computing resources After the batch task sleeps or exits, the computing resources can be given to other tasks in need. Therefore, it achieves the reuse of computing resources, reduces the waste of machine resources and reduces labor costs.
  • use the self-developed batch system and self-developed WCS-RUNTIME to connect to kubernetes give full play to the advantages of kubernetes in distributed system scheduling, and avoid the security loopholes.
  • the batch system uses a mirror warehouse to store batch program images uploaded by developers.
  • the batch system classifies these images by label and image directory, which is convenient for users to retrieve and use.
  • the batch system itself does not pay attention to the developer's batch program, but only checks whether the image is a standard OCI image.
  • Operation and maintenance personnel can create batch tasks based on existing mirroring and time rules. These batch tasks are stored in the database and can be resumed at any time.
  • the batch system queries the progress of batch tasks through the kubernetes API at any time, and defines the status of batch tasks as: not started, running, failed, and completed.
  • the operation and maintenance personnel can check the batch task progress through the web page, and retry the task if the operation fails.
  • the batch system visualizes the kubernetes Job and CronJob api, and enters through the web page, that is, the task type can be selected: one-time task, periodic task, and periodic tasks can be represented by cron expressions , supports running multiple copies at the same time, and specifies the cpu, memory and disk size required by each copy, and can create event triggers for tasks, trigger events based on task status, to reclaim resources or notify operation and maintenance personnel. These greatly facilitate operation and maintenance personnel to use the system, thus saving a lot of manpower to install and uninstall batch programs.
  • the embodiment of the present application provides a task processing method, by acquiring a new task instruction; and then using the container management module to determine at least one task to be processed and a task execution instruction according to the newly created task instruction, and the task execution instruction corresponds to the task to be processed; Then use the preset virtual machine runtime module to determine one or more virtual machines and virtual machine containers according to the task execution instructions.
  • the virtual machine container is the container running in the virtual machine; finally use the virtual machine container to call the image resource processing Handle tasks. It solves the technical problems of low security and high operation and maintenance costs caused by insufficient isolation when the existing distributed batch task processing technology is applied in the financial technology field. It has achieved the technical effect of improving the complete isolation effect of batch task processing in the financial technology field, improving the security of batch task processing, and reducing operation and maintenance costs.
  • FIG. 3 is a schematic flowchart of another task processing method provided by the implementation of this application. As shown in Figure 3, the specific steps of the task processing method include:
  • the task execution instruction corresponds to the task to be processed, and the task to be processed includes: a one-time task and a periodic task.
  • the container management module includes a task management interface, and uses the task management interface to determine at least one task to be processed according to the task information in the new task instruction.
  • the batch system uses the interface API ( Application Programming Interface) creates batch tasks, that is, at least one pending task, and generates execution instructions corresponding to each pending task.
  • interface API Application Programming Interface
  • the container management module includes: a node agent component on each node, a first container runtime interface and a container runtime management module, and the virtual machine runtime module includes: a second container runtime interface.
  • This step specifically includes: using the node proxy component to send the task execution instruction to the container runtime management module through the first container runtime interface;
  • the virtual machine runtime module includes: a second container runtime interface, and the second container runtime interface is an intermediate link medium between the container runtime management module and the virtual machine.
  • Kubelet that is, the node agent component
  • the container runtime management program contianerd that is, the container runtime management module
  • CRI interface that is, the first container runtime interface
  • containerd will forward the instructions to wcs after receiving the instructions -shim (i.e. the second container runtime interface).
  • the second container runtime interface of the virtual machine runtime module parses the container creation information in the task execution instruction, and establishes a connection with the virtual machine management module through the second container runtime interface.
  • the connection is to transmit the container creation information to the virtual machine management module, and the virtual machine management module creates one or more corresponding virtual machines to create a corresponding virtual isolated running environment for the container.
  • the virtual machine runtime module also includes: a container process management module, a virtual machine kernel, and a file system image
  • the virtual machine kernel is the kernel module used by the virtual machine when it is running
  • the file system image is the A miniature file system used when running virtual machine containers.
  • the container process management module uses the container process management module to send task execution instructions to the smallest container deployment unit (pod) of the virtual machine through the remote procedure call protocol (that is, RPC (Remote Procedure Call) remote procedure call protocol), so as to create one or more Virtual machine containers, and manage the working status of all virtual machine containers.
  • the remote procedure call protocol that is, RPC (Remote Procedure Call) remote procedure call protocol
  • the virtual machine kernel includes a personalized customization tool, and the personalized customization tool is used to personalize all submodules and various parameters in the virtual machine kernel;
  • the file system image is completely isolated from the host hosting the virtual machine and can be used independently;
  • the container process management module starts at the same time as the virtual machine, and runs in the virtual machine as an initialization process.
  • the container process management module is also used to expose the communication protocol file to the host machine that hosts the virtual machine, so that the container process management module passes the communication protocol file. Communicate with the second container runtime interface.
  • the virtual machine runtime module is the self-developed WCS-RUNTIME in this embodiment, and its components are shown in Table 1:
  • FIG. 4 is a schematic diagram of a virtual machine container interaction process provided by an embodiment of the present application. As shown in Figure 4:
  • Kubelet node proxy component 401 Send instructions to the contianerd container runtime management module 402 through the CRI interface, and the containerd container runtime management module 402 will forward the instruction to the second container runtime interface 403 of wcs-shim after receiving the instruction, and the second container runtime interface of wcs-shim
  • the second container runtime interface 403 sends commands to the Pod through a private RPC process according to the virtual machine situation, and the wcs-agent container process management module 404 manages the state of the container according to the content of the command after receiving the command.
  • Wcs-shim second container runtime interface 403 When receiving the command to create a container, WCS-RUNTIME will also create wcs-shim second container runtime interface 403 as a container runtime to communicate with the virtual machine
  • the intermediate module of the wcs-shim second container runtime interface 403 is a bridge connecting the virtual machine and the container runtime management module.
  • wcs-agent container process management module 404 when the virtual machine starts, it will start the wcs-agent container process management module 404, which runs in the virtual machine as an init initialization process, and this component will expose the vsocks file (that is, the communication protocol file) to In the host, the communication with the second container runtime interface 403 of wcs-shim is completed through vsocks.
  • the wcs-agent container process management module 404 has all the behaviors under the OCI standard, including: creating, starting and closing the container 407, I/O stream communication and all behaviors of the traditional container.
  • Guest Kernel virtual machine kernel 405 The kernel used by the virtual machine when it is actually running, rather than the traditional container sharing the host kernel, and all modules and parameters of the kernel can be customized, and a complete tool is provided to customize the personalized kernel.
  • Guest Image file system image 406 also known as Guest OS is the operating system that actually runs the container. It is completely isolated from the host and can use an independent file system.
  • the container management module further includes an annotation tool, and the function of the annotation tool includes carrying user-defined customized parameters.
  • the role of global configuration parameters includes: redefining various global default parameters and the type of container running in the virtual machine;
  • the role of container runtime configuration parameters includes: specifying whether to create a new network namespace for the container runtime module, determining the network interface between the virtual machine and the virtual machine container, determining whether to manage the virtual machine runtime module only in the sandbox control group individual custom processes;
  • the role of the configuration parameters of the container process management module includes: specifying the size of the standard transmission pipeline created for the virtual machine container, determining the list of kernel modules loaded into the kernel of the virtual machine and the parameters in the list of kernel modules;
  • the role of virtual machine configuration parameters includes: determining the driver for the block device, determining the function list of the central processing unit passed to the virtual machine, determining the operating system when the virtual machine runs the virtual machine container, determining the system kernel module of the operating system, Specify the purpose of the communication protocol file in agent communication, determine whether to enable the memory swap of the virtual machine, and specify the address of each virtual machine management module, where the block device is used to store information in fixed-size data blocks, each data block have corresponding address information.
  • the container runtime management module receives the customized parameter delivered by the annotation tool annotation(, it converts it into OCI standard annotation information according to the OCI standard.
  • kubernetes annotations in four aspects are formulated:
  • the configuration parameters of the container process management module are shown in Table 4:
  • WCS-RUNTIME provides this information to wcs-agent via RPC.
  • the wcs-agent container process management module 404 completes the final action, that is, controls the virtual machine and the container running in the virtual machine, that is, the start-up internal action of the virtual machine container.
  • the start-up content includes the customization of each virtual machine container Create and activate state settings.
  • steps S306-S309 while creating the virtual machine container, or in other words, when the virtual machine is created, for each running task, customized parameters can be passed through the annotation (annotation tool) of kubernetes, and kubernetes will annotate Pass it to the container runtime management module and convert it into OCI comments, and WCS-RUNTIME provides this information to wcs-agent through RPC, and wcs-agent completes the final action.
  • annotation annotation
  • WCS-RUNTIME provides this information to wcs-agent through RPC, and wcs-agent completes the final action.
  • the parameters in Table 2-5 can be configured through the annotationss attribute of the kubectl yaml file, such as:
  • a one-time batch task is directly defined through yaml, and customized io.wcs.config.agent.kernel_modules and io.wcs.config.hypervisor.enable_swap are specified through annotations.
  • the Kubectl command submits the above files to kubernetes
  • select kubelet to call the CRI interface create a container command through CRI
  • containerd calls wcs-runtime to create a virtual machine container through the cri plug-in.
  • the task processing method provided in this embodiment is carried in the batch system, and the batch system itself does not pay attention to the developer's batch program, but only checks whether the image is a standard OCI image.
  • the batch system uses mirror warehouses to store batch program images uploaded by developers.
  • the batch system classifies these images by label and image directory, which is convenient for users to retrieve and use.
  • Operation and maintenance personnel can create batch tasks based on existing mirroring and time rules. These batch tasks are stored in the database and can be resumed at any time.
  • the batch system queries the progress of batch tasks through the kubernetes API at any time, and defines the status of batch tasks as: not started, running, failed, and completed.
  • the operation and maintenance personnel can check the batch task progress through the web page, and retry the task if the operation fails.
  • the batch system visualizes the Job and CronJob APIs of kubernetes, and enters through the web page to select the task type: one-time task, periodic task, periodic task can be expressed by cron expression, and supports running multiple copies at the same time. and specify the cpu, memory, and disk size required for each copy,
  • event triggers can be created for tasks, and events can be triggered based on task status to reclaim resources or notify operation and maintenance personnel. These greatly facilitate operation and maintenance personnel to use the system, thus saving a lot of manpower to install and uninstall batch programs.
  • the number of running instances can be set for each pending task.
  • the batch task that is, all pending tasks, can start to execute . And distribute the batch task instances in different nodes, and finally complete the startup of these batch tasks by WCS-RUNTIME.
  • the importance levels of batch tasks are also different. For tasks with high importance levels, the batch system uses the kubernetes qos mechanism to prioritize tasks with high importance levels. By setting the minimum resource and maximum resource of the task to Consistent, the batch system considers the batch task to have a high priority and will fully guarantee the resources required for its operation.
  • the batch allows it to use the resources within its resource setting range, but there is no guarantee that these resources will be used.
  • the batch system will try its best to meet the resource requirements of the batch task when it is running, but the batch task has the lowest priority, so when resources are insufficient, this type of task will be recycled first.
  • the batch system can label the nodes according to the actual node characteristics, such as: network bandwidth size, disk performance, GPU, physical address identification (computer room, rack), etc., by specifying labels in the batch task, so that the batch task Run on nodes with these labels to complete customized requirements.
  • the actual node characteristics such as: network bandwidth size, disk performance, GPU, physical address identification (computer room, rack), etc.
  • the cluster size of the batch system can also be scaled up or down.
  • the processing scale of the distributed cluster is very important. In order to make full use of cheap servers to do calculations for batch tasks, the expansion and reduction functions of the cluster are very necessary. Operation and maintenance personnel can view the workload of the entire system through the batch system, and automatically add nodes into the cluster or kick them out of the cluster according to the load. The operation and maintenance personnel also only need to make scaling decisions based on the cluster load, without checking the load of a single machine, and let the resource scheduling capability be handed over to the batch system, while the operation and maintenance personnel only need to control the cluster size, which fully reduces the operation cost. The mental burden of maintenance personnel.
  • the embodiment of the present application provides a task processing method, by acquiring a new task instruction; and then using the container management module to determine at least one task to be processed and a task execution instruction according to the newly created task instruction, and the task execution instruction corresponds to the task to be processed; Then use the preset virtual machine runtime module to determine one or more virtual machines and virtual machine containers according to the task execution instructions.
  • the virtual machine container is the container running in the virtual machine; finally use the virtual machine container to call the image resource processing Handle tasks. It solves the technical problems of low security and high operation and maintenance costs caused by insufficient isolation when the existing distributed batch task processing technology is applied in the financial technology field. It has achieved the technical effect of improving the complete isolation effect of batch task processing in the financial technology field, improving the security of batch task processing, and reducing operation and maintenance costs.
  • FIG. 5 is a schematic structural diagram of a task processing device provided by an embodiment of the present application.
  • the task processing device 500 may be implemented by software, hardware or a combination of both.
  • the task processing device 500 includes:
  • An acquisition module 501 configured to acquire a new task instruction
  • Processing module 502 for:
  • the task execution instruction corresponds to the task to be processed
  • the virtual machine container is a container running in the virtual machine
  • the processing module 502 is configured to:
  • the container management module includes: a node agent component on each node, a first container runtime interface and a container runtime management module, and the virtual machine runtime module includes: a second container runtime interface;
  • processing module 502 is configured to:
  • node proxy component Using the node proxy component to send a task execution instruction to the container runtime management module through the first container runtime interface
  • the container runtime management module is used to forward the task execution instruction to the second container runtime interface.
  • the virtual machine runtime module includes: a second container runtime interface, a container process management module, a virtual machine kernel, and a file system image
  • the second container runtime interface is the container runtime management module and the virtual machine
  • the intermediate link medium the virtual machine kernel is the kernel module used by the virtual machine when it is running
  • the file system image is the mini file system used by the virtual machine when running the virtual machine container;
  • processing module 502 is configured to:
  • the container process management module is used to send task execution instructions to the smallest container deployment unit of the virtual machine through the remote procedure call protocol to create one or more virtual machine containers and manage the working status of all virtual machine containers.
  • the virtual machine kernel includes a personalized customization tool, and the personalized customization tool is used to personalize all submodules and various parameters in the virtual machine kernel;
  • the file system image is completely isolated from the host hosting the virtual machine and can be used independently;
  • the container process management module starts at the same time as the virtual machine, and runs in the virtual machine as an initialization process.
  • the container process management module is also used to expose the communication protocol file to the host machine that hosts the virtual machine, so that the container process management module passes the communication protocol file. Communicate with the second container runtime interface.
  • the container management module includes an annotation tool
  • the function of the annotation tool includes carrying user-defined customized parameters.
  • the processing module 502 is also used for:
  • the startup content includes the custom creation and startup status setting of each virtual machine container.
  • the customized parameters include: global configuration parameters, container runtime configuration parameters, container process management module configuration parameters, and virtual machine configuration parameters;
  • the role of global configuration parameters includes: redefining various global default parameters and the type of container running in the virtual machine;
  • the role of container runtime configuration parameters includes: specifying whether to create a new network namespace for the container runtime module, determining the network interface between the virtual machine and the virtual machine container, determining whether to manage the virtual machine runtime module only in the sandbox control group individual custom processes;
  • the role of the configuration parameters of the container process management module includes: specifying the size of the standard transmission pipeline created for the virtual machine container, determining the list of kernel modules loaded into the kernel of the virtual machine and the parameters in the list of kernel modules;
  • the role of virtual machine configuration parameters includes: determining the driver for the block device, determining the function list of the central processing unit passed to the virtual machine, determining the operating system when the virtual machine runs the virtual machine container, determining the system kernel module of the operating system, Specify the purpose of the communication protocol file in agent communication, determine whether to enable the memory swap of the virtual machine, and specify the address of each virtual machine management module, where the block device is used to store information in fixed-size data blocks, each data block have corresponding address information.
  • the container management module includes a task management interface.
  • the processing module 502 is configured to use the task management interface to determine at least one task to be processed according to the task information in the new task instruction.
  • the task to be processed includes : one-time tasks and periodic tasks.
  • FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 6 , the electronic device 600 may include: at least one processor 601 and a memory 602 . FIG. 6 shows an electronic device with a processor as an example.
  • the memory 602 is used to store programs.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 602 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the processor 601 is configured to execute the computer-executed instructions stored in the memory 602 to implement the methods described in the above method embodiments.
  • the processor 601 may be a central processing unit (central processing unit, referred to as CPU), or a specific integrated circuit (application specific integrated circuit, referred to as ASIC), or is configured to implement one or more of the embodiments of the present application. multiple integrated circuits.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the memory 602 can be independent or integrated with the processor 601 .
  • the electronic device 600 may further include:
  • the bus 603 is used to connect the processor 601 and the memory 602 .
  • the bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc.
  • ISA industry standard architecture
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc., but it does not mean that there is only one bus or one type of bus.
  • the memory 602 and the processor 601 may communicate through an internal interface.
  • the embodiment of the present application also provides a computer-readable storage medium
  • the computer-readable storage medium may include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory) , RAM), a magnetic disk or an optical disk, and other media that can store program codes.
  • the computer-readable storage medium stores program instructions, and the program instructions are used in the methods in the above-mentioned method embodiments.
  • An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the methods in the foregoing method embodiments are implemented.
  • the embodiment of the present application also provides a computer program, which, when the computer program is run on the computer, causes the computer to execute the methods in the foregoing method embodiments.

Abstract

一种任务处理方法、设备、存储介质及程序产品。该方法通过获取新建任务指令(S201);然后利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令(S202),任务执行指令与待处理任务相对应;再利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器(S203),虚拟机容器为在虚拟机中运行的容器;最后利用虚拟机容器调用镜像资源处理待处理任务(S204)。该方法解决了现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。该方法达到了提高金融科技领域批量任务处理的完全隔离效果,提高批量任务处理的安全性,同时降低运维成本的技术效果。

Description

任务处理方法、设备、存储介质及程序产品
本申请要求于2021年11月12日提交中国专利局、申请号为202111341915.5、发明名称为“任务处理方法、设备、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及金融科技(Fintech)领域,尤其涉及一种任务处理方法、设备、存储介质及程序产品。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,分布式批量任务处理技术也不例外,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。
现有的分布式批量任务处理技术为保证批量程序运行时的计算资源,需要向上预留大量的计算资源,但是由于在金融科技领域应用时,各个任务的安全隔离性要求,使得计算资源间难以实现共享或复用,使得计算资源的利用率低,给金融企业的运营和维护增加了巨量的服务器成本和人力成本。
虽然容器技术的出现在一定程度上缓解了分布式批量任务处理中资源利用率低的问题,但是现有的容器技术仍然无法解决在金融科技领域的高隔离性、高安全性以及成本管理之间的矛盾,即现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。
发明内容
本申请提供一种任务处理方法、设备、存储介质及程序产品,以解决现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。
第一个方面,本申请提供一种任务处理方法,包括:
获取新建任务指令;
利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;
利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;
利用虚拟机容器调用镜像资源处理待处理任务。
本申请通过虚拟机容器来替代传统的容器,在继承传统容器技术的优点的同时,引入虚拟机,克服了各个容器间共享宿主机内核,容易产生内核逃逸的问题,从而导致的隔离不充分,或者只能采用节点级别的隔离,引发的在金融科技领域批量任务的隔离安全性不足的缺陷。虚拟机容器将资源利用率进一步提高,并且通过虚拟机的高隔离性,在原有容 器级别的隔离上再增加一层虚拟机隔离,这样就不会产生容器间共享内核而引发的隔离不充分的问题,从而达到提高金融科技领域批量任务处理的完全隔离效果,提高批量任务处理的安全性,同时降低运维成本的技术效果。
第二方面,本申请提供一种任务处理装置,包括:
获取模块,用于获取新建任务指令;
处理模块,用于:
利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;
利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;
利用虚拟机容器调用镜像资源处理待处理任务。
第三个方面,本申请提供一种电子设备,包括:
存储器,用于存储程序指令;
处理器,用于调用并执行所述存储器中的程序指令,执行第一方面所提供的任意一种可能的物品存储信息确定方法。
第四方面,本申请提供一种存储介质,所述可读存储介质中存储有计算机程序,所述计算机程序用于执行第一方面所提供的任意一种可能的任务处理方法。
第五方面,本申请还提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面所提供的任意一种可能的任务处理方法。
第六方面,本申请还提供了一种计算机程序,当计算机程序在计算机上运行时,使得计算机执行如上第一方面所提供的任意一种可能的任务处理方法。
本申请提供了一种任务处理方法、设备、存储介质及程序产品,通过获取新建任务指令;然后利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;再利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;最后利用虚拟机容器调用镜像资源处理待处理任务。解决了现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。达到了提高金融科技领域批量任务处理的完全隔离效果,提高批量任务处理的安全性,同时降低运维成本的技术效果。
附图说明
图1为本申请提供的一种任务处理方法的应用场景示意图;
图2为本申请提供的一种任务处理方法的流程示意图;
图3为本申请实施提供的另一种任务处理方法的流程示意图;
图4为本申请实施例提供的虚拟机容器交互流程示意图
图5为本申请实施例提供的一种任务处理装置的结构示意图;
图6为本申请提供的一种电子设备的结构示意图。
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本 领域技术人员说明本申请的概念。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,包括但不限于对多个实施例的组合,都属于本申请保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面对本申请所涉及到的专业名词作出解释:
虚拟机管理程序VMM(Virtual Machine Manager):用于建立和维护一个管理虚拟机的框架。
Kubernetes:一种分布式容器编排调度系统。
CRI(Kubernetes Runtime Interface):kubernetes的容器运行接口,实现该接口便可接入kubernetes。
开放容器标准OCI(Open Container Initiative):用于确立容器的镜像建立、认证、部署以及命名的方式。
节点:分布式计算节点,提供算力的最小物理单位。
Kubelet:kubernetes在每个节点上的代理组件。
镜像:是一种文件存储形式,包含在任何环境中运行预设任务时所需要的所有元素的软件包。
容器:通过镜像创建的实例。
安全容器:使用轻量级虚拟机来运行容器并且自身实现了OCI的要求。
Corn:一种定时器。
CornJob:按照cron时间规则运行的计算任务,如每天运行一次。
Job:只运行一次的计算任务。
服务质量qos:用于保证高优先级任务可以拥有足够的资源运行。当集群资源不足时,qos机制则会根据配置的任务等级,强制性地让低优先级任务让出其计算资源,来保障高优先级任务的执行。
下面先介绍本申请发明人在长期的工作实践中发现的,对于传统的批量任务处理技术所存在的问题:
传统的批量任务处理技术也称为传统机器方案,在此方案中,运行批量程序需要提前计算所需的计算资源。然而,这种计算往往只能向上预留计算资源,对于不同的批处理任 务(即批量任务处理)需要分配不同的机器,但批量系统所需要的资源非常巨大,传统的批处理任务在工作时,所有机器的工作负载几近满载;但是在非任务时间段内,机器往往又处于空闲状态,难以被重复利用。对于其他需要计算资源的任务,由于隔离性或安全性规范的要求,又无法运行在这些空闲的机器上。从而导致无法充分利用现有的计算资源,在金融技术领域上应用时,造成了巨大的算力浪费或资源浪费,即计算资源的利用率低,给金融企业的运营和维护增加了巨量的服务器成本和人力成本。
同时,当有新的批量任务需要上线或者下线时,都需要人工安装部署机器或者拆除机器,这也造成了大量人力资源的浪费。虽然,容器技术的诞生使得部分资源浪费得到了一定程度的缓解,但是现有的容器技术在金融科技领域,仍然未能满足各类批量任务定制化的需求,如加载不同内核模块,以及运行在不同的时间内等。并且对需要特殊配置的任务,只能使用节点级别的隔离来完成,这就造成资源无法被充分利用,即容器技术未能从根本上解决计算资源利用率低的问题。也未能解决金融类企业各类批量任务需要高度隔离的问题,一旦出现安全问题,则会引来致命打击。
总的来说,现有的批量任务处理技术在金融科技领域应用时,存在如下问题:
1、安全性较低:现有的容器技术,需要共享宿主机内核,这就导致容易发生内核逃逸,引发安全问题。所谓内核逃逸就是攻击者通过宿主机内核中的漏洞实现了容器逃逸,具体的,攻击者首先通过劫持容器化业务逻辑,或直接控制(例如CaaS(Communications as a Service,通信即服务)这一类的合法获得容器控制权的场景)等方式,已经获得了容器内某种权限下的命令执行能力;然后攻击者利用这种命令执行能力,借助一些手段进一步获得该容器所在直接宿主机上某种权限下的命令执行能力,从而引发了安全问题。
2、运行环境无法隔离:不同的批量任务在处理时需要的变量(即计算资源的一种具体表现形式,如环境变量和内核参数等)可能存在竞争关系,从而导致批量任务运行失败。
3、资源浪费:因运行环境变量存在竞争,从而导致需要更多机器来运行任务。此外,在任务休眠期无法利用其空闲算力为其他任务提供计算。
4、无法通过批量任务的个性化需求(如环境变量、操作系统版本、内核模块、CPU中央处理器、内存、IO输入输出端口等的个性化定制需求)来完成任务调度。
综上,现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。
为解决上述技术问题,本申请的发明构思是:
在处理金融科技领域的批量任务时,不是直接运行容器来调用镜像完成任务处理,而是先为容器创建一个安全的虚拟隔离环境,使得容器在该虚拟隔离环境中运行。本申请采用虚拟机来实现该虚拟隔离环境,通过虚拟机来整合计算资源,提高计算资源的复用率。同时,各批量任务运行在不同的虚拟隔离环境中,从根本上解决了现有容器技术由于共享宿主机内核而产生的容器逃逸漏洞,即提高了批量系统的隔离性和安全性。
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。
图1为本申请提供的一种任务处理方法的应用场景示意图。如图1所示,运维人员101通过用户终端102创建批量任务,批量系统103为各项任务分配任务类型,包括Job和 CornJob。然后,将任务的执行指令传递给kubernetes即容器管理模块104,kubernetes将该执行指令转发给VMM即虚拟机管理模块105申请创建虚拟隔离环境,由虚拟机管理模块构建各个虚拟机106,并在虚拟机106中运行与批量任务对应的各个处理具体任务的虚拟机容器107。由虚拟容器107调用批量系统103中的各类镜像包来完成具体的计算任务。
需要说明的是,在批量系统开发和维护时,开发人员可以将各类镜像包提前存入到批量系统103的数据库中,以备后续虚拟机容器进行调用。
图2为本申请实施例提供的一种任务处理方法的流程示意图。如图2所示,该任务处理方法的具体步骤,包括:
S201、获取新建任务指令。
在本步骤中,新建任务指令包括至少一个待处理任务的构建信息。
具体的,运维人员通过用户端创建了批量任务,在该批量任务中包括。至少一个待处理任务。运维人员通过用户端输入各个待处理任务的构建信息,上传到了批量系统当中。
需要说明的是,开发人员事先将预先制作好的用于处理各类型任务的镜像包文件上传到批量系统的数据库中进行存储,以供后续虚拟机容器进行调用。
还需要说明的是,运维人员可以通过用户端的任务界面进行批量任务的管理,包括:新建任务、查看任务进度、查看任务结果等等。
S202、利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令。
在本步骤中,任务执行指令与待处理任务相对应,待处理任务包括:一次性任务以及周期性任务。
在本实施例中,容器管理模块包括任务管理接口,利用任务管理接口,根据新建任务指令中的任务信息,确定至少一个待处理任务。
具体的,批量系统在接收到运维人员通过用户端发送的新建任务指令后,通过kunernetes(即容器管理模块)的Job(即一次性任务)和CronJob(即周期性任务)对应的接口API(Application Programming Interface)创建了批量任务,即至少一个待处理任务,并生成各个待处理任务对应的执行指令。
S203、利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器。
在本步骤中,虚拟机容器为在虚拟机中运行的容器。
在本实施例中,批量系统通过容器管理模块的第一容器运行时接口将任务执行指令发送给虚拟机运行时模块;通过虚拟机运行时模块,根据任务执行指令,连接虚拟机管理模块;利用虚拟机管理模块以及虚拟机运行时模块,根据任务执行指令,创建一个或多个虚拟机以及虚拟机容器。
需要说明的是,本实施例的批量系统通过虚拟机运行时模块来支持容器管理模块像运行容器一样运行虚拟机,使得虚拟机拥有容器的行为特性。
具体的,批量系统通过kubernetes的CRI将任务执行指令中创建容器的指令转发给WCS-RUNTIME(即虚拟机运行时模块)。通过WCS-RUNTIME选择多种VMM(即虚拟机管理模块)来创建虚拟机容器。WCS-RUNTIME实现了OCI开发容器标准,通过该模块可使得批量系统有效接入kubernetes,可以像容器一样运行虚拟机并且接受kubernetes 的管理和调度。
需要具体说明的是,OCI开发容器标准是Linux基金会于2015年6月成立OCI(Open Container Initiative)组织,旨在围绕容器格式和运行时制定一个开放的工业化标准,目前主要有两个标准文档:容器运行时标准(runtime spec)和容器镜像标准(image spec)。
制定容器格式标准的宗旨概括来说就是不受上层结构的绑定,如特定的客户端、编排栈等,同时也不受特定的供应商或项目的绑定,即不限于某种特定操作系统、硬件、CPU架构、公有云等。
这两个协议通过OCI runtime filesytem bundle的标准格式连接在一起,OCI镜像可以通过工具转换成bundle,然后OCI容器引擎能够识别这个bundle来运行容器。
需要说明的是,WCS-RUNTIME是实施例中基于kubernetes自行研发的容器管理服务平台。因为kubernetes是专门针对容器的编排调度的分布式系统,其只能够调用容器,而无法直接调用虚拟机。为了实现本申请的发明构思,将容器运行在具有高隔离性和高资源复用率的虚拟机上,需要一个中间媒介来让kubernetes能够调用VMM来创建并管理各个虚拟机。而WCS-RUNTIME就是此中间媒介。即虚拟机运行时模块用于连接容器管理模块以及虚拟机容器。
还需要说明的是,本实施例的虚拟机管理模块用于实现开放容器标准OCI,并且可以使用轻量级的虚拟机来运行容器,使得容器运行时,无需共享宿主机内核(因为共享的是虚拟机的内核,而不是实际的宿主机内核),达到将容器完全隔离的目的,使得各个批量任务处理时达到金融级别的隔离要求,提高批量系统的安全性。
S204、利用虚拟机容器调用镜像资源处理待处理任务。
在本步骤中,虚拟机容器调用预先存储在数据库中的,与待处理任务所对应的镜像包,来完成待处理任务的处理过程,得到处理结果。
本实施例通过与kubernetes对接,完成了分布式的批处理调度过程。通过使用虚拟机替换传统容器,从而达到金融级的安全级别,因此同时拥有容器批量系统的优点,充分地利用闲置计算资源。在批量任务休眠或者退出后可以将计算资源让给有需要的其他任务。因而达到计算资源复用,减少机器资源浪费和减少人力成本。并且,使用自研的批量系统和自研的WCS-RUNTIME接入kubernetes中,充分发挥kubernetes在分布式系统调度中的优势,同时避免其中的安全漏洞。
需要说明的是,本实施例所提供的任务处理方法承载与自主研发的批量系统中,在一种可能的设计中,批量系统使用镜像仓库存储开发人员上传的批量程序镜像。批量系统通过标签和镜像目录的方式将这些镜像进行分类,从而方便用户检索和使用。批量系统本身不关注开发人员的批量程序,只检查镜像是否为标准的OCI镜像。
运维人员能够根据现有的镜像和时间规则创建批量任务,这些批量任务均存储在数据库中,能够随时恢复运行。
批量系统随时通过kubernetes的API查询批量任务的进度,将批量任务的状态定义为:未开始、运行中、已失败、已完成。运维人员可以通过web页面查看批量任务进度,并且操作失败任务重试等。
在一种可能的设计中,批量系统通过将kubernetes的Job和CronJob的api可视化,通过web页面输入,即可以选择任务类型:一次性任务、周期性任务,周期性任务可以通过 cron表达式进行表示,支持同时运行多个副本,以及指定每个副本需要的cpu、内存和磁盘大小,且可以为任务创建事件触发,基于任务状态触发事件,用以回收资源或者通知运维人员。这些都极大地方便运维人员使用该系统,从而节省了大量人力去安装和卸载批量程序。
本申请实施例提供了一种任务处理方法,通过获取新建任务指令;然后利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;再利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;最后利用虚拟机容器调用镜像资源处理待处理任务。解决了现有分布式批量任务处理技术在金融科技领域应用时,存在隔离性不足而导致的安全性低以及运维成本高的技术问题。达到了提高金融科技领域批量任务处理的完全隔离效果,提高批量任务处理的安全性,同时降低运维成本的技术效果。
图3为本申请实施提供的另一种任务处理方法的流程示意图。如图3所示,该任务处理方法的具体步骤包括:
S301、获取新建任务指令。
S302、利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令。
在本步骤中,任务执行指令与待处理任务相对应,待处理任务包括:一次性任务以及周期性任务。
在本实施例中,容器管理模块包括任务管理接口,利用任务管理接口,根据新建任务指令中的任务信息,确定至少一个待处理任务。
具体的,批量系统在接收到运维人员通过用户端发送的新建任务指令后,通过kunernetes(即容器管理模块)的Job(即一次性任务)和CronJob(即周期性任务)对应的接口API(Application Programming Interface)创建了批量任务,即至少一个待处理任务,并生成各个待处理任务对应的执行指令。
S303、通过容器管理模块的第一容器运行时接口将任务执行指令发送给虚拟机运行时模块。
在本步骤中,容器管理模块包括:在各个节点上的节点代理组件,第一容器运行时接口以及容器运行时管理模块,虚拟机运行时模块包括:第二容器运行时接口。
本步骤具体包括:利用所述节点代理组件,通过所述第一容器运行时接口,向所述容器运行时管理模块发送所述任务执行指令;
利用所述容器运行时管理模块向所述第二容器运行时接口转发所述任务执行指令,从而实现将任务执行指令发送给虚拟机运行时模块。
在本实施例中,虚拟机运行时模块包括:第二容器运行时接口,第二容器运行时接口为容器运行时管理模块与虚拟机的中间链接媒介。
具体的,Kubelet(即节点代理组件)通过CRI接口(即第一容器运行时接口)向容器运行时管理程序contianerd(即容器运行时管理模块)发送指令,containerd在接收到指令后将转发给wcs-shim(即第二容器运行时接口)。
S304、通过虚拟机运行时模块,根据任务执行指令,连接虚拟机管理模块。
在本步骤中,虚拟机运行时模块的第二容器运行时接口在接收到任务执行指令后,解析任务执行指令中的容器创建信息,并通过第二容器运行时接口建立与虚拟机管理模块的连接,将容器创建信息传递给虚拟机管理模块,由虚拟机管理模块创建对应的一个或多个虚拟机,以为容器创建对应的虚拟隔离运行环境。
S305、利用虚拟机管理模块以及虚拟机运行时模块,根据任务执行指令,创建一个或多个虚拟机以及虚拟机容器。
在本实施例中,虚拟机运行时模块还包括:容器进程管理模块、虚拟机内核以及文件系统映像,虚拟机内核为虚拟机在运行的时候所使用的内核模块,文件系统映像为虚拟机在运行虚拟机容器的时候所使用的迷你型文件系统。
在本步骤中,利用虚拟机管理模块,根据任务执行指令、虚拟机内核以及文件系统映像,创建一个或多个虚拟机;
利用容器进程管理模块,通过远程过程调用协议(即RPC(Remote Procedure Call)远程过程调用协议),将任务执行指令发送到虚拟机的最小容器部署单元(即pod)中,以创建一个或多个虚拟机容器,并管理所有虚拟机容器的工作状态。
在一种可能的设计中,虚拟机内核包括个性化定制工具,个性化定制工具用于对虚拟机内核中的所有子模块以及各项参数进行个性化定制;
文件系统映像与承载虚拟机的宿主机完全隔离,并能被独立使用;
容器进程管理模块与虚拟机同时启动,并作为初始化进程运行在虚拟机中,容器进程管理模块还用于将通讯协议文件暴露到承载虚拟机的宿主机当中,使得容器进程管理模块通过通讯协议文件与第二容器运行时接口进行通讯。
具体的,虚拟机运行时模块在本实施例中为自主研发的WCS-RUNTIME,其所包含的组件如表1所示:
Figure PCTCN2021136020-appb-000001
表1
图4为本申请实施例提供的虚拟机容器交互流程示意图。如图4所示:
Kubelet节点代理组件401:通过CRI接口向contianerd容器运行时管理模块402发送指令,containerd容器运行时管理模块402在接收到指令后将转发给wcs-shim第二容器运行时接口403,wcs-shim第二容器运行时接口403根据虚拟机情况,通过私有RPC流程将命令发送到Pod中,wcs-agent容器进程管理模块404接收到指令后根据指令内容来管理容器的状态。
wcs-shim第二容器运行时接口403:当接收到创建容器的指令时,WCS-RUNTIME会将wcs-shim第二容器运行时接口403也会被一起创建出来,作为容器运行时和虚拟机通信 的中间模块,wcs-shim第二容器运行时接口403链接虚拟机和容器运行时管理模块的桥梁。
wcs-agent容器进程管理模块404:虚拟机启动时候,就会启动wcs-agent容器进程管理模块404,作为init初始化进程运行在虚拟机中,该组件会将vsocks文件(即通讯协议文件)暴露到主机中,从而通过vsocks与wcs-shim第二容器运行时接口403完成通信。wcs-agent容器进程管理模块404拥有OCI标准下的所有行为,包括:创建、启动和关闭容器407,I/O流通信以及传统容器的所有行为。
Guest Kernel虚拟机内核405:虚拟机真正运行时所使用的内核,而非传统容器共享主机内核,且该内核所有模块和参数均可定制,并且提供了完整工具来定制个性化内核。
Guest Image文件系统映像406:也称之为Guest OS是真正运行容器的操作系统,完全与主机隔离,可以使用独立的文件系统。
通过以上自主研发的WCS-RUNTIME中的各个组件,完全打通了容器和虚拟机的隔阂,使得虚拟机拥有容器的优点:快速、支持一次打包随处运行,又拥有虚拟机的传统优点:安全、隔离性强,定制化强。
S306、通过第一容器运行时接口,将注解工具传递给容器运行时管理模块。
在本步实施例中,容器管理模块中还包括注解工具,注解工具的作用包括承载用户自定义的定制化参数。
为了提供完全自由的定制化配置能力。在一种可能的设计中,全局配置参数的作用包括:重新定义各项全局默认参数以及在虚拟机中运行的容器的类型;
容器运行时配置参数的作用包括:指定是否为容器运行时模块创建新的网络命名空间、确定虚拟机与虚拟机容器的网络接口、确定是否仅在沙箱控制组中管理虚拟机运行时模块中各个自定义进程;
容器进程管理模块配置参数的作用包括:指定为虚拟机容器创建的标准传输管道的大小、确定加载到虚拟机内核的内核模块列表及内核模块列表中的各项参数;
虚拟机配置参数的作用包括:确定用于块设备的驱动程序、确定传递给虚拟机的中央处理器的功能列表、确定虚拟机运行虚拟机容器时的操作系统、确定操作系统的系统内核模块、指定通讯协议文件在代理通信时的用途、确定是否启用虚拟机的内存交换以及指定各个虚拟机管理模块的地址,其中,块设备用于将信息存储在固定大小的数据块中,每个数据块都有对应的地址信息。
S307、利用所述容器运行时管理模块,根据开放容器标准,将所述注解工具中的定制化参数转换为标准注释信息。
在本步骤中,容器运行时管理模块在接收到注解工具annotation(传递的定制化参数后,根据OCI标准,将其转换为OCI标准注释信息。
具体的,本实施例中,制定了四个方面的kubernetes的annotation:
全局配置参数如表2所示:
关键字 值类型 注释
io.wcs.config_path string 覆盖默认的wcs配置
io.wcs.pkg.oci.type string OCI容器类型
表2
容器运行时配置参数如表3所示:
Figure PCTCN2021136020-appb-000002
表3
容器进程管理模块配置参数如表4所示:
Figure PCTCN2021136020-appb-000003
表4
虚拟机配置参数如表5所示:
Figure PCTCN2021136020-appb-000004
Figure PCTCN2021136020-appb-000005
表5
S308、通过所述第一容器运行时接口以及所述远程过程调用协议,将所述标准注释信息发送给所述容器进程管理模块。
在本步骤中,WCS-RUNTIME通过RPC将该信息提供给wcs-agent。
S309、利用容器进程管理模块,根据标准注释信息,控制虚拟机的启动内容。
在本步骤中,wcs-agent容器进程管理模块404完成最终动作即对虚拟机以及虚拟机中运行的容器即虚拟机容器的启动内动进行控制,启动内容包括各个所述虚拟机容器的自定义创建以及启动状态设定。
具体的,对于步骤S306-S309,在创建虚拟机容器的同时,或者说在虚拟机创建时,对于每一个运行的任务都可以通过kubernetes的annotation(即注解工具)传递定制化参数,kubernetes将annotation传递到容器运行时管理模块中,并将之转换为OCI注释,而WCS-RUNTIME通过RPC将该信息提供给wcs-agent,而由wcs-agent完成最终动作。
例如表2-5中的各项参数可以通过kubectl的yaml文件的annotationss属性配置,如:
Figure PCTCN2021136020-appb-000006
以上代码示例中,通过yaml直接定义了一个一次性的批处理任务,通过annotations来指定定制化的io.wcs.config.agent.kernel_modules和io.wcs.config.hypervisor.enable_swap。Kubectl命令将上述文件提交至kubernetes之后,经过kubernetes调度匹配,选择kubelet调用CRI接口,通过CRI创建容器命令,将annotations传递至cri实现containerd,而containerd通过cri插件,调用wcs-runtime创建虚拟机容器,并解析annotations参数将之传递至wcs-runtime中,而wcs-runtime根据参数调用VMM生成对应的虚拟机容器。
S310、利用虚拟机容器调用镜像资源处理待处理任务。
本实施例所提供的任务处理方法承载在批量系统中,批量系统本身不关注开发人员的批量程序,只检查镜像是否为标准的OCI镜像。
批量系统使用镜像仓库存储开发人员上传的批量程序镜像。批量系统通过标签和镜像目录的方式将这些镜像进行分类,从而方便用户检索和使用。
运维人员能够根据现有的镜像和时间规则创建批量任务,这些批量任务均存储在数据库中,能够随时恢复运行。
批量系统随时通过kubernetes的API查询批量任务的进度,将批量任务的状态定义为:未开始、运行中、已失败、已完成。运维人员可以通过web页面查看批量任务进度,并且操作失败任务重试等。
批量系统通过将kubernetes的Job和CronJob的api可视化,通过web页面输入,即可以选择任务类型:一次性任务、周期性任务,周期性任务可以通过cron表达式进行表示,支持同时运行多个副本,以及指定每个副本需要的cpu、内存和磁盘大小,
且可以为任务创建事件触发,基于任务状态触发事件,用以回收资源或者通知运维人员。这些都极大地方便运维人员使用该系统,从而节省了大量人力去安装和卸载批量程序。
具体的,每个待处理任务都可以设置运行的实例数量,当整个集群资源(即批量系统中的所有镜像资源或计算资源)满足实例数量需求时,批量任务即所有待处理任务就可以开始执行。并且将批量任务实例分配在不同的节点中,最终由WCS-RUNTIME完成这些批量任务的启动。但是在实际生产环境中,批量任务的重要等级也是不一样的,对于重要等级高的任务,批量系统通过kubernetes的qos机制来优先保障重要等级高的任务,通过将任务最小资源和最大资源设为一致,批量系统就认为该批量任务优先级高,会充分保障其运行时所需的资源。当设置了批量任务的最小资源小于最大资源时,批量允许其使用其资源设置范围内的资源,但不能保证一定能用上这些资源。当任务没有设置资源要求时,批量系统将尽可能满足该批量任务运行时的资源需求,但该批量任务优先级最低,所以当资源不足时,该类任务则会被优先回收。
批量系统可以根据现实的节点特性,对节点进行标签化,比如:网络带宽大小、磁盘性能、GPU、物理的地址标识(机房、机架)等,通过在批量任务中指定标签,从而让批量任务运行在拥有这些标签的节点上,完成定制化的需求。
在一种可能的设计中,还可以对批量系统的集群规模进行扩充或缩减。
分布式集群的处理规模非常重要,为了能够充分利用廉价的服务器为批量任务做计算,集群的扩充和缩减功能就显得十分必要。运维人员可以通过批量系统查看整个系统的工作负载情况,可根据负载情况自动将节点纳入集群或者踢出集群。运维人员也只需要根据集群负载情况来做扩缩决策,而无需查看单个机器的负载情况,让资源调度能力交给批量系统,而运维人员只要控制集群规模即可,这样充分减少了运维人员的心智负担。
本申请实施例提供了一种任务处理方法,通过获取新建任务指令;然后利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;再利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;最后利用虚拟机容器调用镜像资源处理待处理任务。解决了现有分布式批量任务处理技术在金融科技领域应用时, 存在隔离性不足而导致的安全性低以及运维成本高的技术问题。达到了提高金融科技领域批量任务处理的完全隔离效果,提高批量任务处理的安全性,同时降低运维成本的技术效果。
图5为本申请实施例提供的一种任务处理装置的结构示意图。该任务处理装置500可以通过软件、硬件或者两者的结合实现。
如图5所示,该任务处理装置500包括:
获取模块501,用于获取新建任务指令;
处理模块502,用于:
利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;
利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;
利用虚拟机容器调用镜像资源处理待处理任务。
在一种可能的设计中,处理模块502,用于:
通过容器管理模块的第一容器运行时接口将任务执行指令发送给虚拟机运行时模块;
通过虚拟机运行时模块,根据任务执行指令,连接虚拟机管理模块;
利用虚拟机管理模块以及虚拟机运行时模块,根据任务执行指令,创建一个或多个虚拟机以及虚拟机容器。
在一种可能的设计中,容器管理模块包括:在各个节点上的节点代理组件,第一容器运行时接口以及容器运行时管理模块,虚拟机运行时模块包括:第二容器运行时接口;
对应的,处理模块502,用于:
利用节点代理组件,通过第一容器运行时接口,向容器运行时管理模块发送任务执行指令;
利用容器运行时管理模块向第二容器运行时接口转发任务执行指令。
在一种可能的设计中,虚拟机运行时模块包括:第二容器运行时接口、容器进程管理模块、虚拟机内核以及文件系统映像,第二容器运行时接口为容器运行时管理模块与虚拟机的中间链接媒介,虚拟机内核为虚拟机在运行的时候所使用的内核模块,文件系统映像为虚拟机在运行虚拟机容器的时候所使用的迷你型文件系统;
对应的,处理模块502,用于:
利用虚拟机管理模块,根据任务执行指令、虚拟机内核以及文件系统映像,创建一个或多个虚拟机;
利用容器进程管理模块,通过远程过程调用协议,将任务执行指令发送到虚拟机的最小容器部署单元中,以创建一个或多个虚拟机容器,并管理所有虚拟机容器的工作状态。
在一种可能的设计中,虚拟机内核包括个性化定制工具,个性化定制工具用于对虚拟机内核中的所有子模块以及各项参数进行个性化定制;
文件系统映像与承载虚拟机的宿主机完全隔离,并能被独立使用;
容器进程管理模块与虚拟机同时启动,并作为初始化进程运行在虚拟机中,容器进程管理模块还用于将通讯协议文件暴露到承载虚拟机的宿主机当中,使得容器进程管理模块通过通讯协议文件与第二容器运行时接口进行通讯。
在一种可能的设计中,容器管理模块中包括注解工具,注解工具的作用包括承载用户自定义的定制化参数,对应的,处理模块502,还用于:
通过第一容器运行时接口,将注解工具传递给容器运行时管理模块;
利用容器运行时管理模块,根据开放容器标准,将注解工具中的定制化参数转换为标准注释信息,并通过第一容器运行时接口以及远程过程调用协议,将标准注释信息发送给容器进程管理模块;
利用容器进程管理模块,根据标准注释信息,控制虚拟机的启动内容,启动内容包括各个虚拟机容器的自定义创建以及启动状态设定。
在一种可能的设计中,定制化参数包括:全局配置参数、容器运行时配置参数、容器进程管理模块配置参数、虚拟机配置参数;
其中,全局配置参数的作用包括:重新定义各项全局默认参数以及在虚拟机中运行的容器的类型;
容器运行时配置参数的作用包括:指定是否为容器运行时模块创建新的网络命名空间、确定虚拟机与虚拟机容器的网络接口、确定是否仅在沙箱控制组中管理虚拟机运行时模块中各个自定义进程;
容器进程管理模块配置参数的作用包括:指定为虚拟机容器创建的标准传输管道的大小、确定加载到虚拟机内核的内核模块列表及内核模块列表中的各项参数;
虚拟机配置参数的作用包括:确定用于块设备的驱动程序、确定传递给虚拟机的中央处理器的功能列表、确定虚拟机运行虚拟机容器时的操作系统、确定操作系统的系统内核模块、指定通讯协议文件在代理通信时的用途、确定是否启用虚拟机的内存交换以及指定各个虚拟机管理模块的地址,其中,块设备用于将信息存储在固定大小的数据块中,每个数据块都有对应的地址信息。
在一种可能的设计中,容器管理模块包括任务管理接口,对应的,处理模块502,用于利用任务管理接口,根据新建任务指令中的任务信息,确定至少一个待处理任务,待处理任务包括:一次性任务以及周期性任务。
值得说明的是,图5所示实施例提供的装置,可以执行上述任一方法实施例中所提供的方法中共识节点侧的功能,其具体实现原理、技术特征、专业名词解释以及技术效果类似,在此不再赘述。
图6为本申请实施例提供的一种电子设备的结构示意图。如图6所示,该电子设备600,可以包括:至少一个处理器601和存储器602。图6示出的是以一个处理器为例的电子设备。
存储器602,用于存放程序。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。
存储器602可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
处理器601用于执行存储器602存储的计算机执行指令,以实现以上各方法实施例所述的方法。
其中,处理器601可能是一个中央处理器(central processing unit,简称为CPU),或者是特定集成电路(application specific integrated circuit,简称为ASIC),或者是被配置成 实施本申请实施例的一个或多个集成电路。
可选地,存储器602既可以是独立的,也可以跟处理器601集成在一起。当所述存储器602是独立于处理器601之外的器件时,所述电子设备600,还可以包括:
总线603,用于连接所述处理器601以及所述存储器602。总线可以是工业标准体系结构(industry standard architecture,简称为ISA)总线、外部设备互连(peripheral component,PCI)总线或扩展工业标准体系结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等,但并不表示仅有一根总线或一种类型的总线。
可选的,在具体实现上,如果存储器602和处理器601集成在一块芯片上实现,则存储器602和处理器601可以通过内部接口完成通信。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可以包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁盘或者光盘等各种可以存储程序代码的介质,具体的,该计算机可读存储介质中存储有程序指令,程序指令用于上述各方法实施例中的方法。
本申请实施例还提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的方法。
本申请实施例还提供一种计算机程序,当计算机程序在计算机上运行时,使得计算机执行上述各方法实施例中的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由本申请的权利要求书指出。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。

Claims (13)

  1. 一种任务处理方法,其特征在于,包括:
    获取新建任务指令;
    利用容器管理模块,根据所述新建任务指令,确定至少一个待处理任务以及任务执行指令,所述任务执行指令与所述待处理任务相对应;
    利用预设的虚拟机运行时模块,根据所述任务执行指令,确定一个或多个虚拟机以及虚拟机容器,所述虚拟机容器为在所述虚拟机中运行的容器;
    利用所述虚拟机容器调用镜像资源处理所述待处理任务。
  2. 根据权利要求1所述的任务处理方法,其特征在于,所述利用预设的虚拟机运行时模块,根据所述任务执行指令,确定一个或多个虚拟机以及虚拟机容器,包括:
    通过所述容器管理模块的第一容器运行时接口将所述任务执行指令发送给虚拟机运行时模块;
    通过所述虚拟机运行时模块,根据所述任务执行指令,连接虚拟机管理模块;
    利用所述虚拟机管理模块以及所述虚拟机运行时模块,根据所述任务执行指令,创建一个或多个虚拟机以及虚拟机容器。
  3. 根据权利要求2所述的任务处理方法,其特征在于,所述容器管理模块包括:在各个节点上的节点代理组件、所述第一容器运行时接口以及容器运行时管理模块,所述虚拟机运行时模块包括:第二容器运行时接口,所述通过所述容器管理模块的第一容器运行时接口将所述任务执行指令发送给虚拟机运行时模块,包括:
    利用所述节点代理组件,通过所述第一容器运行时接口,向所述容器运行时管理模块发送所述任务执行指令;
    利用所述容器运行时管理模块向所述第二容器运行时接口转发所述任务执行指令。
  4. 根据权利要求2或3所述的任务处理方法,其特征在于,所述虚拟机运行时模块包括:第二容器运行时接口、容器进程管理模块、虚拟机内核以及文件系统映像,所述第二容器运行时接口为容器运行时管理模块与所述虚拟机的中间链接媒介,所述虚拟机内核为所述虚拟机在运行的时候所使用的内核模块,所述文件系统映像为所述虚拟机在运行所述虚拟机容器的时候所使用的迷你型文件系统;
    对应的,所述利用所述虚拟机管理模块以及所述虚拟机运行时模块,根据所述任务执行指令,创建一个或多个虚拟机以及虚拟机容器,包括:
    利用所述虚拟机管理模块,根据所述任务执行指令、所述虚拟机内核以及所述文件系统映像,创建一个或多个所述虚拟机;
    利用所述容器进程管理模块,通过远程过程调用协议,将所述任务执行指令发送到所述虚拟机的最小容器部署单元中,以创建一个或多个所述虚拟机容器,并管理所有所述虚拟机容器的工作状态。
  5. 根据权利要求4所述的任务处理方法,其特征在于,所述虚拟机内核包括个性化定制工具,所述个性化定制工具用于对所述虚拟机内核中的所有子模块以及各项参数进行个性化定制;
    所述文件系统映像与承载所述虚拟机的宿主机完全隔离,并能被独立使用;
    所述容器进程管理模块与所述虚拟机同时启动,并作为初始化进程运行在所述虚拟机中,所述容器进程管理模块还用于将通讯协议文件暴露到承载所述虚拟机的宿主机当中,使得所述容器进程管理模块通过所述通讯协议文件与所述第二容器运行时接口进行通讯。
  6. 根据权利要求1所述的任务处理方法,其特征在于,所述容器管理模块中包括: 在各个节点上的节点代理组件、第一容器运行时接口、容器运行时管理模块以及注解工具,所述虚拟机运行时模块包括:容器进程管理模块,所述注解工具的作用包括承载用户自定义的定制化参数,在所述利用所述虚拟机容器调用镜像资源处理所述待处理任务之前,还包括:
    通过所述第一容器运行时接口,将所述注解工具传递给所述容器运行时管理模块;
    利用所述容器运行时管理模块,根据开放容器标准,将所述注解工具中的所述定制化参数转换为标准注释信息,并通过所述第一容器运行时接口以及远程过程调用协议,将所述标准注释信息发送给所述容器进程管理模块;
    利用所述容器进程管理模块,根据所述标准注释信息,控制所述虚拟机的启动内容,所述启动内容包括各个所述虚拟机容器的自定义创建以及启动状态设定。
  7. 根据权利要求6所述的任务处理方法,其特征在于,所述定制化参数包括:全局配置参数、容器运行时配置参数、容器进程管理模块配置参数、虚拟机配置参数;
    其中,所述全局配置参数的作用包括:重新定义各项全局默认参数以及在所述虚拟机中运行的容器的类型;
    所述容器运行时配置参数的作用包括:指定是否为容器运行时模块创建新的网络命名空间、确定所述虚拟机与所述虚拟机容器的网络接口、确定是否仅在沙箱控制组中管理所述虚拟机运行时模块中各个自定义进程;
    所述容器进程管理模块配置参数的作用包括:指定为所述虚拟机容器创建的标准传输管道的大小、确定加载到所述虚拟机内核的内核模块列表及所述内核模块列表中的各项参数;
    所述虚拟机配置参数的作用包括:确定用于块设备的驱动程序、确定传递给所述虚拟机的中央处理器的功能列表、确定所述虚拟机运行所述虚拟机容器时的操作系统、确定所述操作系统的系统内核模块、指定通讯协议文件在代理通信时的用途、确定是否启用所述虚拟机的内存交换以及指定各个虚拟机管理模块的地址,其中,所述块设备用于将信息存储在固定大小的数据块中,每个所述数据块都有对应的地址信息。
  8. 根据权利要求1所述的任务处理方法,其特征在于,所述容器管理模块包括任务管理接口,所述利用容器管理模块,根据所述新建任务指令,确定至少一个待处理任务,包括:
    利用所述任务管理接口,根据所述新建任务指令中的任务信息,确定至少一个所述待处理任务,所述待处理任务包括:一次性任务以及周期性任务。
  9. 一种任务处理装置,其特征在于,包括:
    获取模块,用于获取新建任务指令;
    处理模块,用于:
    利用容器管理模块,根据新建任务指令,确定至少一个待处理任务以及任务执行指令,任务执行指令与待处理任务相对应;
    利用预设的虚拟机运行时模块,根据任务执行指令,确定一个或多个虚拟机以及虚拟机容器,虚拟机容器为在虚拟机中运行的容器;
    利用虚拟机容器调用镜像资源处理待处理任务。
  10. 一种电子设备,其特征在于,包括:
    处理器;以及,
    存储器,用于存储所述处理器的计算机程序;
    其中,所述处理器配置为经由执行所述计算机程序来执行权利要求1至8任一项所述的任务处理方法。
  11. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机 程序被处理器执行时实现权利要求1至8任一项所述的任务处理方法。
  12. 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至8任一项所述的任务处理方法。
  13. 一种计算机程序,其特征在于,所述计算机程序被计算机执行时,使得所述计算机实现权利要求1至8任一项所述的任务处理方法。
PCT/CN2021/136020 2021-11-12 2021-12-07 任务处理方法、设备、存储介质及程序产品 WO2023082389A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111341915.5 2021-11-12
CN202111341915.5A CN114003346A (zh) 2021-11-12 2021-11-12 任务处理方法、设备、存储介质及程序产品

Publications (1)

Publication Number Publication Date
WO2023082389A1 true WO2023082389A1 (zh) 2023-05-19

Family

ID=79928774

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136020 WO2023082389A1 (zh) 2021-11-12 2021-12-07 任务处理方法、设备、存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN114003346A (zh)
WO (1) WO2023082389A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454681B (zh) * 2022-11-10 2023-01-20 维塔科技(北京)有限公司 批处理程序执行方法、装置及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160344798A1 (en) * 2015-05-19 2016-11-24 Amazon Technologies, Inc. Custom communication channels for application deployment
CN107947961A (zh) * 2017-10-17 2018-04-20 上海数讯信息技术有限公司 基于SDN的Kubernetes网络管理系统与方法
CN109471727A (zh) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 一种任务处理方法、装置及系统
CN110569111A (zh) * 2019-09-12 2019-12-13 天津华云软件有限公司 一种基于传统容器的虚拟机实现方法、装置及系统
CN112667362A (zh) * 2021-01-04 2021-04-16 烽火通信科技股份有限公司 Kubernetes上部署Kubernetes虚拟机集群的方法与系统
CN112965788A (zh) * 2021-03-22 2021-06-15 西安电子科技大学 一种混合虚拟化方式的任务执行方法、系统及设备
CN113296950A (zh) * 2021-05-28 2021-08-24 重庆紫光华山智安科技有限公司 处理方法、装置、电子设备及可读存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160344798A1 (en) * 2015-05-19 2016-11-24 Amazon Technologies, Inc. Custom communication channels for application deployment
CN107947961A (zh) * 2017-10-17 2018-04-20 上海数讯信息技术有限公司 基于SDN的Kubernetes网络管理系统与方法
CN109471727A (zh) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 一种任务处理方法、装置及系统
CN110569111A (zh) * 2019-09-12 2019-12-13 天津华云软件有限公司 一种基于传统容器的虚拟机实现方法、装置及系统
CN112667362A (zh) * 2021-01-04 2021-04-16 烽火通信科技股份有限公司 Kubernetes上部署Kubernetes虚拟机集群的方法与系统
CN112965788A (zh) * 2021-03-22 2021-06-15 西安电子科技大学 一种混合虚拟化方式的任务执行方法、系统及设备
CN113296950A (zh) * 2021-05-28 2021-08-24 重庆紫光华山智安科技有限公司 处理方法、装置、电子设备及可读存储介质

Also Published As

Publication number Publication date
CN114003346A (zh) 2022-02-01

Similar Documents

Publication Publication Date Title
EP3343364B1 (en) Accelerator virtualization method and apparatus, and centralized resource manager
US11429442B2 (en) Parallel and distributed computing using multiple virtual machines
US11138030B2 (en) Executing code referenced from a microservice registry
CN111052086B (zh) 一种云托管函数的暖启动技术
US8854663B2 (en) Dynamic print server generation in a distributed printing environment
US10708232B2 (en) Techniques for communication in hybrid cloud system
US20180359218A1 (en) Systems and methods for securing network traffic flow in a multi-service containerized application
US20080163171A1 (en) Virtual resource templates
CN1910554A (zh) 多处理器系统中处理器任务迁移的方法与装置
CN1659539A (zh) 一种具有虚拟服务模块的网络系统
US11057464B1 (en) Synchronization of data between local and remote computing environment buffers
WO2022037612A1 (zh) 提供应用构建服务的方法及应用构建平台、应用部署方法和系统
US9940148B1 (en) In-place hypervisor updates
US20130318528A1 (en) Information processing method
WO2022143714A1 (zh) 服务器系统、虚拟机创建方法及装置
JP7251648B2 (ja) サーバ内遅延制御システム、サーバ内遅延制御装置、サーバ内遅延制御方法およびプログラム
WO2020108443A1 (zh) 一种虚拟化管理方法及装置
WO2018076882A1 (zh) 存储设备的操作方法及物理服务器
US20240143378A1 (en) Methods and systems for instantiating and transparently migrating executing containerized processes
WO2023082389A1 (zh) 任务处理方法、设备、存储介质及程序产品
WO2017181829A1 (zh) 虚拟化平台的运行方法及虚拟化平台
KR20110124333A (ko) 가상 네트워크 환경에서 복사 회피
US20230105439A1 (en) Methods and systems for instantiating and transparently migrating executing containerized processes
CN116828035A (zh) 一种基于云计算的数据集成系统
US10530706B2 (en) Arbitrating control access to a shared resource across multiple consumers

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21963827

Country of ref document: EP

Kind code of ref document: A1