[go: up one dir, main page]

CN111625326B - Task pipeline execution method and device and electronic equipment - Google Patents

Task pipeline execution method and device and electronic equipment Download PDF

Info

Publication number
CN111625326B
CN111625326B CN202010401618.4A CN202010401618A CN111625326B CN 111625326 B CN111625326 B CN 111625326B CN 202010401618 A CN202010401618 A CN 202010401618A CN 111625326 B CN111625326 B CN 111625326B
Authority
CN
China
Prior art keywords
task
sub
container
executed
processes
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010401618.4A
Other languages
Chinese (zh)
Other versions
CN111625326A (en
Inventor
白戈
王长虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010401618.4A priority Critical patent/CN111625326B/en
Publication of CN111625326A publication Critical patent/CN111625326A/en
Application granted granted Critical
Publication of CN111625326B publication Critical patent/CN111625326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • 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/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release 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/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/45583Memory management, e.g. access or allocation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure provides a task pipeline execution method, a device and electronic equipment, belonging to data scheduling, wherein the method comprises the following steps: setting a plurality of subprocesses which are isolated from the main process in a task container, wherein each subprocess is used for executing one pipeline task; after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes, wherein the target sub-process is used for running the task to be executed; after the task to be executed in the target subprocess is executed, executing the task in the associated subprocess related to the target subprocess according to a preset strategy; and after the tasks in all the sub-processes in the container are executed, releasing the system resources occupied by all the sub-processes in the task executing process. By the processing scheme, the execution efficiency of the task pipeline can be improved.

Description

Task pipeline execution method and device and electronic equipment
Technical Field
The disclosure relates to data scheduling, and in particular, to a task pipeline execution method, a task pipeline execution device and electronic equipment.
Background
There are two different ways of implementing the task pipeline, one is loosely coupled and the other is tightly coupled. Loose coupling means that each task runs in a separate container, and when one task of the task pipeline is completed, the container is killed, and then the other container is started to run the next task. Tightly coupled means that all tasks are scheduled by the same master process. The close coupling mode has the advantages that the task pipeline is high in execution efficiency, all tasks are operated in the same container, and the cost of frequently starting the container is avoided. The problem with the tight coupling approach is that the python script has a memory leak problem and the python module cannot be uninstalled cleanly. If two tasks have duplicate names but modules that are not identical in function (e.g., are different versions of the same tool), the tasks will not perform properly.
Disclosure of Invention
Accordingly, embodiments of the present disclosure provide a task pipeline execution method, apparatus and electronic device, so as to at least partially solve the problems in the prior art.
In a first aspect, an embodiment of the present disclosure provides a task pipeline execution method, including:
setting a plurality of subprocesses which are isolated from the main process in a task container, wherein each subprocess is used for executing one pipeline task;
after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes, wherein the target sub-process is used for running the task to be executed;
after the task to be executed in the target subprocess is executed, executing the task in the associated subprocess related to the target subprocess according to a preset strategy;
and after the tasks in all the sub-processes in the container are executed, releasing the system resources occupied by all the sub-processes in the task executing process.
According to a specific implementation manner of the embodiment of the present disclosure, before the plurality of sub-processes that are set separately from the main process are set in the task container, the method includes:
after the wake-up main process wakes up, judging whether a container configuration file exists or not;
if so, further judging whether the task container exists or not based on the container system configuration file;
if not, the main process creates a container setup sub-process, and the task container is created by using the container setup sub-process;
if the task container is in the starting state, the main process sends the packaged starting message to the task promoter process, and the task promoter process unpacks the sent message to obtain a starting container message entity, and starts to start the task container.
According to a specific implementation manner of the embodiment of the present disclosure, the setting, in a task container, a plurality of sub-processes that are set separately from a main process includes:
setting kernel resource isolation parameters of the task container, and updating a configuration file;
starting a resource isolation mechanism according to the updated configuration file, and setting a parent-child process isolation attribute;
creating a task container sub-process, wherein the sub-process is used for loading a task process entity into the sub-process.
According to a specific implementation manner of the embodiment of the present disclosure, after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes includes:
acquiring a task list to be executed by the main process;
determining the execution sequence of each task in the task list;
determining an execution order of the plurality of sub-processes based on the execution order;
and determining a target sub-process matched with the current task based on the execution sequence of the sub-processes.
According to a specific implementation manner of the embodiment of the present disclosure, after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes includes:
acquiring a task ID of a current task to be executed;
and selecting a sub-process matched with the task ID from the plurality of sub-processes as the target sub-process.
According to a specific implementation manner of the embodiment of the present disclosure, before the task in the associated sub-process related to the target sub-process is executed according to a preset policy, the method further includes:
pre-loading a program module corresponding to the associated subprocess in the target subprocess;
and binding the loaded program module with the associated subprocess.
According to a specific implementation manner of the embodiment of the present disclosure, the executing, according to a preset policy, a task in an associated sub-process related to the target sub-process includes:
monitoring the execution state of the target sub-process;
judging whether a task completion mark of the target sub-process exists or not;
if so, the preloaded program modules in the associated sub-process are further started and executed.
According to a specific implementation manner of the embodiment of the present disclosure, the releasing the system resources occupied by all the sub-processes in the process of executing the task includes:
acquiring memory address space occupied by all sub-processes in the task execution process;
and executing release operation on the data in the memory address space.
In a second aspect, embodiments of the present disclosure provide a task pipeline execution device, including:
the setting module is used for setting a plurality of subprocesses which are isolated from the main process in the task container, wherein each subprocess is used for executing one pipeline task;
the selecting module is used for selecting a target subprocess from the plurality of subprocesses after acquiring a task to be executed related to the main process, wherein the target subprocess is used for running the task to be executed;
the execution module is used for executing the tasks in the associated subprocesses related to the target subprocess according to a preset strategy after the execution of the tasks to be executed in the target subprocess is completed;
and the releasing module is used for releasing the system resources occupied by all the sub-processes in the task executing process after the task executing process of all the sub-processes in the container is completed.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task pipeline execution method of the first aspect or any implementation of the first aspect.
In a fourth aspect, the presently disclosed embodiments also provide a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the task pipeline execution method of the foregoing first aspect or any implementation of the first aspect.
In a fifth aspect, embodiments of the present disclosure also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the task pipeline execution method of the first aspect or any implementation of the first aspect.
The task pipeline execution scheme in the embodiment of the disclosure comprises the steps of setting a plurality of subprocesses which are isolated from a main process in a task container, wherein each subprocess is used for executing one pipeline task; after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes, wherein the target sub-process is used for running the task to be executed; after the task to be executed in the target subprocess is executed, executing the task in the associated subprocess related to the target subprocess according to a preset strategy; and after the tasks in all the sub-processes in the container are executed, releasing the system resources occupied by all the sub-processes in the task executing process. By the processing scheme, the execution efficiency of the task pipeline can be improved, and system resources are saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a flow chart of a method of task pipeline execution provided by an embodiment of the present disclosure;
FIG. 2 is a schematic configuration diagram of a task pipeline execution method according to an embodiment of the disclosure;
FIG. 3 is a flow chart of another task pipeline execution method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of another task pipeline execution method provided by an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a task pipeline execution device according to an embodiment of the disclosure;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
Other advantages and effects of the present disclosure will become readily apparent to those skilled in the art from the following disclosure, which describes embodiments of the present disclosure by way of specific examples. It will be apparent that the described embodiments are merely some, but not all embodiments of the present disclosure. The disclosure may be embodied or practiced in other different specific embodiments, and details within the subject specification may be modified or changed from various points of view and applications without departing from the spirit of the disclosure. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should also be noted that the illustrations provided in the following embodiments merely illustrate the basic concepts of the disclosure by way of illustration, and only the components related to the disclosure are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided in order to provide a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the disclosure provides a task pipeline execution method. The task pipeline execution method provided in the present embodiment may be executed by a computing device, which may be implemented as software, or as a combination of software and hardware, and the computing device may be integrally provided in a server, a client, or the like.
Referring to fig. 1, a task pipeline execution method in an embodiment of the present disclosure may include the steps of:
s101, setting a plurality of subprocesses which are isolated from a main process in a task container, wherein each subprocess is used for executing one pipeline task.
The task container (or container) provides an environment for components to run, and the container itself may provide a set of services for the components associated with performing tasks to be utilized in a standard manner.
There are two different ways of implementing the task pipeline, one is loosely coupled and the other is tightly coupled. Loose coupling means that each task runs in a separate container, and when one task of the task pipeline is completed, the task container is killed, and then the other container is started to run the next task. Tightly coupled means that all tasks are scheduled by the same master process. The close coupling mode has the advantages that the task pipeline is high in execution efficiency, all tasks are operated in the same container, and the cost of frequently starting the container is avoided. The problem with the tight coupling approach is that the program script (e.g., python) has a memory leak problem and the program module cannot be uninstalled cleanly. If two tasks have duplicate names but modules that are not identical in function (e.g., are different versions of the same tool), the tasks will not perform properly.
To this end, referring to fig. 2, the scheme of the present disclosure sets a plurality of sub-processes in a task container, the task container corresponding to a main process, the sub-processes being set apart from the main process, and one pipeline task being executed by each sub-process by means of an importer module. The number of the sub-processes may be set according to actual needs, and the number of the sub-processes is not limited herein.
In the process of setting the sub-process, the sub-process and the main process are required to be isolated, specifically, the kernel resource isolation parameters of the task container can be set, the kernel resource isolation parameters are updated into the configuration file of the container, and the sub-process and the main process are isolated rapidly and effectively in a mode of updating the configuration file. In the process of executing the isolation operation, a resource isolation mechanism is started according to the updated configuration file, isolation attributes of parent-child processes (namely, a main process and a child process) are set, and finally, a task container child process is created, wherein the child process is used for loading task process entities (e.g., program modules) into the child process.
S102, after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes, wherein the target sub-process is used for running the task to be executed.
The main process in the task container can correspond to a plurality of tasks to be executed which need to be executed, and therefore, the tasks to be executed which need to be executed currently can be acquired, a target sub-process is determined by matching the tasks to be executed currently with one of the sub-processes, and the tasks to be executed are executed through the target sub-process.
As a way, a task list to be executed by a main process can be obtained by a query way, the execution sequence of each task in the task list is determined by the task list, the execution sequences of the plurality of sub-processes are determined by the execution sequence, and finally, a target sub-process matched with the current task is determined based on the execution sequence of the sub-process.
Further, a task ID of a task to be executed currently may be obtained, and a sub-process matched with the task ID is selected from the plurality of sub-processes as the target sub-process.
S103, executing tasks in the associated subprocesses related to the target subprocess according to a preset strategy after the execution of the tasks to be executed in the target subprocess is completed.
In the process of pipeline task execution in the target sub-process, the task execution condition can be monitored, and whether the task execution in the target sub-process is completed or not can be judged by monitoring the task execution condition, so that the next execution strategy can be further determined.
Specifically, the execution state of the target sub-process may be monitored, whether a task completion flag of the target sub-process exists or not may be determined, and when the task completion flag in the sub-process exists, a preloaded program module in the associated sub-process is further started and executed. The associated sub-process can be used for executing the sub-process which needs to be executed next after the task in the target sub-process is executed according to a preset strategy.
S104, after the task execution in all the sub-processes in the container is completed, releasing the system resources occupied by all the sub-processes in the task execution process.
In order to save system resources, the execution condition of all the sub-processes in the container can be further monitored, and after the tasks in all the sub-processes are completed, the system resources occupied by all the sub-processes in executing the tasks are released. For example, the memory resources occupied by all the sub-processes in the process of executing the task can be monitored, and the memory resources are released after the tasks of all the sub-processes are completed. Of course, other types of system resources besides processing memory resources are also possible, and the type and content of the system resources are not limited herein.
By the scheme in steps S101-S104, a main process and a plurality of sub-processes isolated from the main process can be arranged in the container, in this way, all tasks can be ensured to run in a closed and safe running environment, the sub-processes are isolated from the main process, all memories in the sub-processes are all recovered by the operating system along with the process exit, and no memory leakage and no environmental pollution exist. Tasks are run in a completely clean software environment and are not contaminated by previously run tasks.
Referring to fig. 3, according to a specific implementation of an embodiment of the present disclosure, before setting a plurality of sub-processes set separately from a main process in a task container, the method includes:
s301, after the wake-up main process wakes up, whether a container configuration file exists is judged.
By means of the configuration file, a specific type of task container can be generated, and for this purpose, after the main process is awakened, whether the configuration file corresponding to the main process exists or not can be judged. The configuration file may have a preset storage address, and whether the container configuration file exists may be determined by querying whether the configuration file exists at the storage address.
S302, if so, judging whether the task container exists or not further based on the container system configuration file.
By reading the content in the configuration file, whether the related task container is generated or not can be further judged, so that a foundation is laid for further executing the related operation of the task container.
S303, if not, the main process creates a container setup sub-process, and the task container is created by using the container setup sub-process.
In the case where it is found through the configuration file that the task container has not been created yet, the task container may be created by setting up a sub-process through the set container in such a manner that the sub-process is set up by the main process.
S304, if the task container is in existence, the main process sends the packaged starting message to the task promoter process, and the task promoter process unpacks the sent message to obtain a starting container message entity, and starts to start the task container.
When a task container has been created through the configuration file discovery, an existing task container can be started by a task start sub-process set by the main process.
By the embodiment, the task container can be started and set quickly.
According to a specific implementation manner of the embodiment of the present disclosure, the setting, in a task container, a plurality of sub-processes that are set separately from a main process includes: setting kernel resource isolation parameters of the task container, and updating a configuration file; starting a resource isolation mechanism according to the updated configuration file, and setting a parent-child process isolation attribute; creating a task container sub-process, wherein the sub-process is used for loading a task process entity into the sub-process.
Referring to fig. 4, according to a specific implementation manner of the embodiment of the present disclosure, after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes includes:
s401, acquiring a task list which needs to be executed by the main process.
The task list required to be executed by the main process can be acquired in a query mode, and the task list can be stored in a specific storage position in a preset mode.
S402, determining the execution sequence of each task in the task list.
By parsing the tasks in the task list, the order of execution of each task in the task list may be determined.
S403, determining the execution sequence of the plurality of sub-processes based on the execution sequence.
After determining the execution sequence of the tasks, the task types of the sub-processes and the execution sequence of the tasks can be matched according to the task types distributed by each sub-process, so that the execution sequence of the plurality of sub-processes is finally determined.
S404, determining a target sub-process matched with the current task based on the execution sequence of the sub-processes.
After determining the execution order of the sub-programs to be completed, by analyzing the current task, a sub-process required for executing the current task may be determined, and set as a target sub-process through which the current task is executed.
By means of the method in the embodiment, a target sub-process for executing the current task can be quickly selected from a plurality of sub-processes.
According to a specific implementation manner of the embodiment of the present disclosure, after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes includes: acquiring a task ID of a current task to be executed; and selecting a sub-process matched with the task ID from the plurality of sub-processes as the target sub-process.
According to a specific implementation manner of the embodiment of the present disclosure, before the task in the associated sub-process related to the target sub-process is executed according to a preset policy, the method further includes: pre-loading a program module corresponding to the associated subprocess in the target subprocess; and binding the loaded program module with the associated subprocess.
According to a specific implementation manner of the embodiment of the present disclosure, the executing, according to a preset policy, a task in an associated sub-process related to the target sub-process includes: monitoring the execution state of the target sub-process; judging whether a task completion mark of the target sub-process exists or not; if so, the preloaded program modules in the associated sub-process are further started and executed.
According to a specific implementation manner of the embodiment of the present disclosure, the releasing the system resources occupied by all the sub-processes in the process of executing the task includes:
acquiring memory address space occupied by all sub-processes in the task execution process; and executing release operation on the data in the memory address space.
Corresponding to the above method embodiment, referring to fig. 5, the present disclosure further provides a task pipeline execution device 50, including:
a setting module 501, configured to set a plurality of sub-processes in the task container, where the plurality of sub-processes are set separately from the main process, and each sub-process is configured to execute a pipeline task;
a selecting module 502, configured to select a target sub-process from the plurality of sub-processes after obtaining a task to be executed related to a main process, where the target sub-process is used to run the task to be executed;
an executing module 503, configured to execute, according to a preset policy, a task in an associated sub-process related to the target sub-process after execution of a task to be executed in the target sub-process is completed;
and the releasing module 504 is configured to release system resources occupied by all the sub-processes in the process of executing the tasks after the tasks in all the sub-processes in the container are executed.
The parts of this embodiment, which are not described in detail, are referred to the content described in the above method embodiment, and are not described in detail herein.
Referring to fig. 6, an embodiment of the present disclosure also provides an electronic device 60, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task pipeline execution method of the method embodiments described above.
The disclosed embodiments also provide a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the task pipeline execution method of the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the task pipeline execution method of the foregoing method embodiments.
Referring now to fig. 6, a schematic diagram of an electronic device 60 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device 60 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic device 60 are also stored. The processing device 601, the ROM602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. While an electronic device 60 having various means is shown, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects an internet protocol address from the at least two internet protocol addresses and returns the internet protocol address; receiving an Internet protocol address returned by the node evaluation equipment; wherein the acquired internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the disclosure are intended to be covered by the protection scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method of task pipeline execution, comprising:
setting a plurality of subprocesses which are isolated from the main process in a task container, wherein each subprocess is used for executing one pipeline task;
after acquiring a task to be executed related to a main process, selecting a target sub-process from the plurality of sub-processes, wherein the target sub-process is used for running the task to be executed;
after the task to be executed in the target subprocess is executed, executing the task in the associated subprocess related to the target subprocess according to a preset strategy;
after the task in all the sub-processes in the container is executed, releasing system resources occupied by all the sub-processes in the process of executing the task;
wherein before executing the task in the associated sub-process related to the target sub-process according to the preset policy, the method further comprises:
pre-loading a program module corresponding to the associated subprocess in the target subprocess;
and binding the loaded program module with the associated subprocess.
2. The method of claim 1, wherein prior to setting the plurality of sub-processes in the task container that are set apart from the main process, the method comprises:
after the wake-up main process wakes up, judging whether a container configuration file exists or not;
if so, further judging whether the task container exists or not based on the container system configuration file;
if not, the main process creates a container setup sub-process, and the task container is created by using the container setup sub-process;
if the task container is in the starting state, the main process sends the packaged starting message to the task promoter process, and the task promoter process unpacks the sent message to obtain a starting container message entity, and starts to start the task container.
3. The method of claim 1, wherein the setting a plurality of sub-processes in the task container that are set apart from the main process comprises:
setting kernel resource isolation parameters of the task container, and updating a configuration file;
starting a resource isolation mechanism according to the updated configuration file, and setting a parent-child process isolation attribute;
creating a task container sub-process, wherein the sub-process is used for loading a task process entity into the sub-process.
4. The method of claim 1, wherein selecting a target sub-process from the plurality of sub-processes after acquiring the task to be performed associated with the main process comprises:
acquiring a task list to be executed by the main process;
determining the execution sequence of each task in the task list;
determining an execution order of the plurality of sub-processes based on the execution order;
and determining a target sub-process matched with the current task based on the execution sequence of the sub-processes.
5. The method of claim 1, wherein selecting a target sub-process from the plurality of sub-processes after acquiring the task to be performed associated with the main process comprises:
acquiring a task ID of a current task to be executed;
and selecting a sub-process matched with the task ID from the plurality of sub-processes as the target sub-process.
6. The method of claim 1, wherein executing tasks in an associated sub-process related to the target sub-process according to a preset policy comprises:
monitoring the execution state of the target sub-process;
judging whether a task completion mark of the target sub-process exists or not;
if so, the preloaded program modules in the associated sub-process are further started and executed.
7. The method of claim 1, wherein said releasing system resources occupied by all sub-processes in performing tasks comprises:
acquiring memory address space occupied by all sub-processes in the task execution process;
and executing release operation on the data in the memory address space.
8. A task pipeline execution device, comprising:
the setting module is used for setting a plurality of subprocesses which are isolated from the main process in the task container, wherein each subprocess is used for executing one pipeline task;
the selecting module is used for selecting a target subprocess from the plurality of subprocesses after acquiring a task to be executed related to the main process, wherein the target subprocess is used for running the task to be executed;
the execution module is used for executing the tasks in the associated subprocesses related to the target subprocess according to a preset strategy after the execution of the tasks to be executed in the target subprocess is completed;
the releasing module is used for releasing system resources occupied by all the subprocesses in the task executing process after the task executing process of all the subprocesses in the container is completed;
before executing the task in the associated sub-process related to the target sub-process according to the preset strategy, the method further comprises the following steps:
pre-loading a program module corresponding to the associated subprocess in the target subprocess;
and binding the loaded program module with the associated subprocess.
9. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the task pipeline execution method of any one of the preceding claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the task pipeline execution method of any one of the preceding claims 1-7.
CN202010401618.4A 2020-05-13 2020-05-13 Task pipeline execution method and device and electronic equipment Active CN111625326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010401618.4A CN111625326B (en) 2020-05-13 2020-05-13 Task pipeline execution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010401618.4A CN111625326B (en) 2020-05-13 2020-05-13 Task pipeline execution method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111625326A CN111625326A (en) 2020-09-04
CN111625326B true CN111625326B (en) 2023-06-27

Family

ID=72258075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010401618.4A Active CN111625326B (en) 2020-05-13 2020-05-13 Task pipeline execution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111625326B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356446B (en) * 2021-12-27 2023-08-22 湖北天融信网络安全技术有限公司 Processing method, device, equipment and storage medium for inter-process event

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9792163B1 (en) * 2016-06-28 2017-10-17 Vmware, Inc. Decentralized control plane for a computing system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7735080B2 (en) * 2001-08-30 2010-06-08 International Business Machines Corporation Integrated system and method for the management of a complete end-to-end software delivery process
US20080320490A1 (en) * 2007-06-20 2008-12-25 Nokia Corporation Method, apparatus and computer program product for providing sub-process resource management
CA2779993C (en) * 2012-06-15 2019-05-07 Ibm Canada Limited - Ibm Canada Limitee Configurable resource policies
CN107133086B (en) * 2016-02-29 2020-09-04 阿里巴巴集团控股有限公司 Task processing method, device and system based on distributed system
CN106095530B (en) * 2016-06-08 2019-10-22 电子科技大学 A container automatic creation and startup method for multiple Android systems
CN110413386B (en) * 2019-06-27 2023-06-30 深圳市富途网络科技有限公司 Multi-process processing method, device, terminal equipment and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9792163B1 (en) * 2016-06-28 2017-10-17 Vmware, Inc. Decentralized control plane for a computing system

Also Published As

Publication number Publication date
CN111625326A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112214408B (en) Dependency conflict detection method, dependency conflict detection device, electronic equipment and computer readable medium
CN110275723A (en) Obtain method, apparatus, electronic equipment and the readable medium of resource
CN111367516B (en) Application interface generation method and device and electronic equipment
CN110389796A (en) Edit operation processing method, device and electronic equipment
CN111309406A (en) Event processing method and device of application program and electronic equipment
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN110221857A (en) The problem of application program restorative procedure, device, electronic equipment and storage medium
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN112905220B (en) Thermal restoration method, device, equipment and storage medium
CN111625291B (en) Automatic iteration method and device for data processing model and electronic equipment
CN111414152B (en) Method, system, readable medium and electronic device for realizing business logic
CN116069227A (en) Interface interaction method, device, equipment and storage medium
CN113448585B (en) Compiling method and device of thread pool, electronic equipment and storage medium
CN117992204A (en) Memory detection method, device, equipment and storage medium
CN113032046A (en) Method, device and equipment for repairing so file and storage medium
CN113986743B (en) Location information modification method, device, storage medium and electronic device
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN113448550B (en) Method and device for realizing collection management of classes, electronic equipment and computer medium
CN111782713B (en) Method and device for converting data
CN111625243B (en) Cross-language task processing method and device and electronic equipment
CN111026571B (en) Processor down-conversion processing method and device and electronic equipment
CN111857879B (en) Data processing method, device, electronic equipment and computer readable medium
CN116594630A (en) File generation method, device, medium and electronic equipment
CN117768443A (en) Method, system, equipment and storage medium for replacing client center address

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant