CN110704177A - Computing task processing method and device, computer equipment and storage medium - Google Patents

Computing task processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110704177A
CN110704177A CN201910832817.8A CN201910832817A CN110704177A CN 110704177 A CN110704177 A CN 110704177A CN 201910832817 A CN201910832817 A CN 201910832817A CN 110704177 A CN110704177 A CN 110704177A
Authority
CN
China
Prior art keywords
task
resource specification
environment
request
service
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.)
Granted
Application number
CN201910832817.8A
Other languages
Chinese (zh)
Other versions
CN110704177B (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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN201910832817.8A priority Critical patent/CN110704177B/en
Publication of CN110704177A publication Critical patent/CN110704177A/en
Application granted granted Critical
Publication of CN110704177B publication Critical patent/CN110704177B/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/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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

The application relates to a computing task processing method, a computing task processing device, computer equipment and a storage medium. The method comprises the following steps: receiving a task running request, wherein the task running request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request; acquiring a current operating environment type, and acquiring an environment resource specification corresponding to the current operating environment according to the current operating environment type; determining a target resource specification according to the user application resource specification and the environment resource specification, and creating a non-service container through an interface provided by a current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to the task operation request; and executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished. The method improves the calculation efficiency.

Description

Computing task processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a computing task, a computer device, and a storage medium.
Background
With the development of computer technology, an ERP (Enterprise Resource Planning) system appears, where the ERP is Enterprise management software integrating material Resource management, human Resource management, financial Resource management, and information Resource management. In the ERP system, a large amount of calculation resources are required for calculation tasks such as report calculation and end-of-term checkout.
In the conventional technology, a node where a computing task is located is called to calculate the computing task. However, the computing resources of the node are fixed and limited, and when the computing resources of the node are insufficient, the operation and maintenance personnel need to manually allocate more computing resources to the node, which is inefficient in computing.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for processing a computing task, which can improve the computing efficiency.
A method of computing task processing, the method comprising:
receiving a task running request, wherein the task running request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request;
acquiring a current operating environment type, and acquiring an environment resource specification corresponding to the current operating environment according to the current operating environment type;
determining a target resource specification according to the user application resource specification and the environment resource specification, and creating a non-service container through an interface provided by a current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to the task operation request;
and executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished.
In one embodiment, before receiving the task execution request, the method further includes:
receiving a storage request, wherein the storage request comprises a task identifier of the computing task, and the task identifier is a task identifier generated when a terminal creates a corresponding computing task according to an operation code of the computing task;
and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task in a public storage space in an associated manner according to the storage request.
In one embodiment, the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
In one embodiment, the determining a target resource specification according to the user application resource specification and the environment resource specification includes:
when the resource specification requested by the user is larger than the environmental resource specification, the target resource specification is the environmental resource specification;
and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
In one embodiment, the executing, by the service-less container, the computing task corresponding to the task execution request includes:
acquiring the task identifier from the non-service container, and acquiring running information corresponding to the computing task from the public storage space according to the task identifier;
downloading the running code in a public storage space according to the running information, and running the running code in the non-service container according to the running information;
and acquiring an operation result and storing the operation result in the public storage space.
In one embodiment, the method further comprises:
when the number of the task operation requests is more than one and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence;
and when detecting that the target resource specification is smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queuing queue according to the receiving time sequence, and creating corresponding non-service containers aiming at the task operating requests.
A computing task processing device, the device comprising:
the system comprises a receiving request module, a task execution module and a task execution module, wherein the receiving request module is used for receiving a task execution request, and the task execution request comprises a user application resource specification and a task identifier of a calculation task corresponding to the task execution request;
the acquisition environment resource specification module is used for acquiring the current operation environment type and acquiring the environment resource specification corresponding to the current operation environment according to the current operation environment type;
a service-free container creating module, configured to determine a target resource specification according to the user application resource specification and the environment resource specification, and create a service-free container through an interface provided by a current operating environment according to the target resource specification, where the service-free container carries a task identifier of a computing task corresponding to the task operating request;
and the computation task execution module is used for executing the computation task corresponding to the task operation request by using the service-free container, and quitting the service-free container after the computation task execution is finished.
In one embodiment, the apparatus further comprises:
the storage module is used for receiving a storage request, wherein the storage request comprises a task identifier of the computing task, and the task identifier is a task identifier generated when a terminal creates a corresponding computing task according to an operation code of the computing task; and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task in a public storage space in an associated manner according to the storage request.
In one embodiment, the create no service container module is further configured to determine that the target resource specification is the environment resource specification when the user application resource specification is greater than the environment resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
In one embodiment, the computing task executing module is further configured to obtain the task identifier from the non-service container, and obtain, from the public storage space, operation information corresponding to the computing task according to the task identifier; downloading the running code in a public storage space according to the running information, and running the running code in the non-service container according to the running information; and acquiring an operation result and storing the operation result in the public storage space.
In one embodiment, the apparatus further comprises:
the task running request queuing module is used for establishing a queuing queue and adding the task running requests into the queuing queue according to the receiving time sequence when the number of the task running requests is more than one and the target resource specification is larger than the idle environment resource specification of the current running environment;
and when detecting that the target resource specification is smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queuing queue according to the receiving time sequence, and creating corresponding non-service containers aiming at the task operating requests.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a task running request, wherein the task running request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request;
acquiring a current operating environment type, and acquiring an environment resource specification corresponding to the current operating environment according to the current operating environment type;
determining a target resource specification according to the user application resource specification and the environment resource specification, and creating a non-service container through an interface provided by the current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to the task operation request;
and executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a task running request, wherein the task running request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request;
acquiring a current operating environment type, and acquiring an environment resource specification corresponding to the current operating environment according to the current operating environment type;
determining a target resource specification according to the user application resource specification and the environment resource specification, and creating a non-service container through an interface provided by the current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to the task operation request;
and executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished.
According to the computing task processing method, the computing task processing device, the computer equipment and the storage medium, the task operation request is received, and comprises the resource specification applied by the user and the task identifier of the computing task corresponding to the task operation request; acquiring a current operation environment type, and acquiring an environment resource specification corresponding to the current operation environment according to the current operation environment type; determining a target resource specification according to a resource specification applied by a user and an environment resource specification, and creating a no-service container through an interface provided by a current operation environment according to the target resource specification, wherein the no-service container carries a task identifier of a calculation task corresponding to a task operation request; and executing the calculation task corresponding to the task operation request by using the no-service container, and exiting the no-service container after the execution of the calculation task is finished. Compared with the traditional technology, when the computing resources are in shortage, the computing resources need to be artificially expanded, the method can determine the target resource specification according to the resource specification applied by the user and the environment resource specification, the operation is simplified, and the computing efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for processing computing tasks in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for processing computing tasks, according to one embodiment;
FIG. 3 is a flowchart illustrating a method for processing a computing task according to another embodiment;
FIG. 4 is a flow diagram that illustrates the processing of computing tasks in one embodiment;
FIG. 5 is a block diagram showing the structure of a calculation task processing device according to one embodiment;
FIG. 6 is a block diagram showing a configuration of a calculation task processing apparatus according to another embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The calculation processing method provided by the application can be applied to the application environment shown in fig. 1. As shown in fig. 1, the application environment includes a terminal 110 and a server 120, and communication between the terminal 110 and the server 120 can be performed through a network, and the communication network can be a wireless or limited communication network, such as an IP network, a cellular data network, and the like, where the number of devices of the terminal and the server is not limited. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
The computing task processing method may be executed on the server 120, and a user may write an operating code on the terminal 110 to create a computing task, and send a task operating request corresponding to the computing task to the server 120, where the task operating request includes a resource specification applied by the user and a task identifier of the computing task corresponding to the task operating request. The server 120 obtains the current operating environment type, and obtains the environmental resource specification of the current operating environment according to the current operating environment type. The server 120 determines a target resource specification according to the resource specification applied by the user and the resource specification of the current operating environment, and creates a non-service container through an interface provided by the current operating environment according to the target resource specification, wherein the non-service container carries a task identifier of a computing task corresponding to the task operating request. And executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished.
In one embodiment, as shown in fig. 2, a method for processing a computing task is provided, which is described by taking the method as an example of being applied to the application environment in fig. 1, and includes the following steps:
step 202, receiving a task running request, where the task running request includes a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request.
And the task identifier is the unique identifier of the computing task corresponding to the task running request. The resource specification applied by the user refers to the resource specification which is selected by the user in the server resource pool and is suitable for the computing task. The resource pool refers to the combination of software and hardware involved in the execution of the computing task, including but not limited to the number of CPU cores, the dominant frequency range, the memory size, and whether the disk is a high-speed access disk. The computing task is created from run code submitted by a user. One running code may create one computing task or multiple computing tasks. One task execution request corresponds to one computing task.
Specifically, a user writes operating code at the terminal, and creates at least one computing task at the terminal according to the operating code. And determining a user application resource specification corresponding to the computing task in a resource pool of the server. And the terminal sends a task operation request carrying the resource specification and the task identifier applied by the user to the server. The terminal can simultaneously send a plurality of task running requests. One task execution request corresponds to one computing task. The task operation request is used for indicating the server to create a non-service container, and the non-service container is used for executing the calculation task corresponding to the task operation request.
And 204, acquiring the type of the current operating environment, and acquiring the environment resource specification corresponding to the current operating environment according to the type of the current operating environment.
Wherein the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment. The environment resource specification refers to the maximum resource specification that the current operating environment can provide.
Specifically, after receiving a task operation request sent by a user through a terminal, a server acquires an environment type of a current operation environment, and acquires an environment resource specification corresponding to the current operation environment according to the current operation environment type.
And step 206, determining a target resource specification according to the resource specification applied by the user and the environment resource specification, and creating a no-service container through an interface provided by the current operation environment according to the target resource specification, wherein the no-service container carries a task identifier of a calculation task corresponding to the task operation request.
Wherein the target resource specification is a resource specification used in executing the computing task.
A serverless container is not a fixedly operating container. The non-service container is an on-demand container which is started when needed and is destroyed after use. The developer can use the service-less container without considering the problem of the server too much. The non-service container has the following characteristics: 1. maintenance is not needed, and the problems of operation and maintenance are not worried about. 2. The cost is reduced. The no service container is created on demand, charged on demand. Whereas traditional containers are charged per resource and management. Containers increase overhead and idle resource costs over non-service containers. 3. And (4) elastic expansion.
The non-service container can be applied to the scenes of event requests, traffic bursts, large data processing and the like. The event request scenario includes, but is not limited to, a customized picture, a low frequency request in the internet of things, a customized event, and a fixed time trigger. Traffic burst scenarios include, but are not limited to, elastic expansion coping with burst traffic, transcoding, and traffic volume expansion.
The interface provided by the current operating environment is a software-like interface used to create a serverless container, such as amazon cloud creation serverless container interface, wayside cloud serverless cloud functions.
Specifically, when the resource specification requested by the user is greater than the environmental resource specification, the target resource specification is the environmental resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user. After the target resource specification is determined on the server, a serverless container is created through an interface provided by the current operating environment according to the target resource specification. And the created non-service container carries the unique identification of the calculation task corresponding to the task operation request.
And step 208, executing the calculation task corresponding to the task operation request by using the no-service container, and exiting the no-service container after the execution of the calculation task is finished.
Specifically, the non-service container created in step 206 carries a task identifier, obtains the operation information from the public storage space according to the task identifier, downloads the operation code, and executes the calculation task by operating the operation code in the non-service container according to the operation information. And after the calculation task is executed, obtaining an operation result, storing the operation result in the public storage space and exiting the no-service container. After the computation task is completed, the service container is destroyed.
In the computing task processing method, a task operation request is received, wherein the task operation request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task operation request; acquiring a current operation environment type, and acquiring an environment resource specification corresponding to the current operation environment according to the current operation environment type; determining a target resource specification according to a resource specification applied by a user and an environment resource specification, and creating a non-service container through an interface provided by a current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to a task operation request; the method has the advantages that the calculation task corresponding to the task operation request is executed by using the service-free container, the service-free container is withdrawn after the execution of the calculation task is finished, and compared with the prior art that the calculation resource needs to be artificially expanded when the calculation resource is in shortage, the method can determine the target resource specification according to the resource specification applied by the user and the environment resource specification, dynamically apply for the calculation resource, is more convenient to operate and improves the calculation efficiency.
In one embodiment, as shown in fig. 3, the computing task processing method may further include:
step 302, receiving a storage request, where the storage request includes a task identifier of a computation task, and the task identifier is a task identifier generated when a terminal creates a corresponding computation task according to an operation code of the computation task.
The server can receive a storage request sent by the terminal, wherein the storage request is used for instructing the server to store the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task in the public storage space in an associated manner. The running code is written by a user at a terminal, and can be written by using languages such as Java, Python and the like. One running code may create one computing task or multiple computing tasks.
Specifically, the user writes the running code in the terminal, and the running code can be written in languages such as Java and Python. And the terminal creates a corresponding calculation task according to the running code. When a computing task is created, a unique task identifier corresponding to the computing task is generated.
And 304, storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task in a public storage space in an associated manner according to the storage request.
The public storage space is a carrier space for storing and managing data through a storage medium, and provides data storage and service access functions for the outside.
Specifically, the server stores the running information, the running code and the task identifier corresponding to the computing task into the public storage space in an associated manner according to the storage request. And associating the running information, the running code and the task identifier corresponding to the computing task so that the no-service container can acquire the running information and the running code through the task identifier.
In one embodiment, the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
The public cloud environment generally refers to a cloud environment that can be used and provided by a third-party provider for a user. The public cloud environment can be generally used through the internet, and the core attribute of the public cloud environment is shared resource service. The public cloud environment provides almost infinite space for storing and managing data, provides infinite computing capability for users to finish various applications, and has no limitation on resource expansion capability. Public cloud environments include, but are not limited to, amazon cloud, hua yun, and ali cloud.
The private cloud environment is a cloud environment dedicated to a single user and is not open to the outside. A private cloud environment may be owned, managed, and operated by an enterprise or third party provider. The resource expansion capability of the private cloud environment is limited, but the security of the private cloud environment is better than that of the public cloud environment.
The hybrid cloud environment merges a public cloud environment and a private cloud environment. The hybrid cloud environment can utilize the security of the private cloud environment to store the internal important data in the local data center, and meanwhile, the computing resources of the public cloud environment can be used to complete work more efficiently and quickly.
In one embodiment, step 206 further comprises: when the resource specification requested by the user is larger than the environmental resource specification, the target resource specification is the environmental resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
Specifically, when the resource specification requested by the user is greater than the environment resource specification, that is, the resource specification requested by the user exceeds the maximum limit of the environment resource specification, the computing task can be executed only using the environment resource specification. For public cloud environment and mixed cloud environment, the environmental resource specification is not limited to the maximum, and the above situation cannot exist. When the resource specification requested by the user is less than or equal to the environment resource specification, that is, the resource specification requested by the user is less than or equal to the maximum limit of the environment resource specification, the computing task can be executed by using the resource specification requested by the user. If the resource specification applied by the user is smaller than the minimum limit of the environment resource specification, the resource isolation technology can be used for ensuring that the computing task is executed only by using the resource specification applied by the user, and resource waste is avoided.
In one embodiment, step 208 further comprises: acquiring a task identifier from a non-service container, and acquiring running information corresponding to a calculation task from a public storage space according to the task identifier; downloading the operation code in the public storage space according to the operation information, and operating the operation code in the non-service container according to the operation information; and acquiring the operation result and storing the operation result in the public storage space.
Specifically, the task identification is added to the environment variable of the non-service container when the non-service container is created. When the non-service container is operated, the task identifier is read first, and the operation information associated with the task identifier is obtained from the public storage space, namely the information such as the operation code storage position, the parameters and the operation entry required by the operation of the task is obtained from the public storage space. Then, the no-service container downloads the operation code from the common storage space and loads the operation code, and the calculation task is executed by using the acquired operation entry, parameters and other information. And finally, the no-service container stores the operation result obtained after the execution of the calculation task is finished in the public storage space.
In one embodiment, as shown in fig. 3, the computing task processing method may further include:
and step 306, when more than one task operation request is received and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence.
Wherein the idle environment resource specification is a resource specification remaining available in the current operating environment.
Specifically, when there are more than one task running requests, the remaining environment resource specifications are not enough for the computing tasks corresponding to other task running requests because the computing tasks corresponding to some task running requests already occupy part of the environment resource specifications. When the target resource specification of the computing task corresponding to the task operation request is larger than the idle resource specification of the current operation environment, namely the residual resource specification of the current operation environment is not enough to be used, the server establishes a queuing queue. And the server adds the corresponding task running requests into a queue according to the time sequence of the received task running requests.
And 308, when the target resource specification is detected to be smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queue according to the receiving time sequence, and creating corresponding non-service containers aiming at the task operating requests.
Specifically, after the execution of the computing task occupying part of the environmental resource specification is finished, the occupied environmental resource specification is released. When detecting that the target resource specification of the computing task corresponding to the task operation request is smaller than or equal to the idle resource specification of the current operation environment, namely the residual resource specification of the current operation environment is enough to use, the server sequentially takes out the corresponding task operation requests according to the receiving time sequence, and creates corresponding non-service containers according to the task operation requests.
In one embodiment, as shown in FIG. 4, a method of task processing is provided.
And writing task codes. Specifically, the user writes task code at the terminal.
And (5) packaging and storing the task codes. Specifically, the terminal sends a storage request to the server, and the server stores the task codes to the public storage space in a packaging mode according to the storage request.
A task is created, resulting in a unique task ID. Specifically, the terminal creates a calculation task according to the task code, and generates a unique task ID (Identity Document) corresponding to the calculation task. The task ID is associated with relevant information of task running.
Storing the code storage position, operating the entrance and the parameter. Specifically, the terminal sends a storage request to the server, and the server stores information related to task operation associated with the task ID, such as an operation task parameter, the code storage location, an entry code location for operating the task, and the like, into the common storage space according to the storage request.
And applying for the required resources and submitting a task operation request. Specifically, the user applies for the required resource, that is, the user selects a resource with a suitable specification for the task in a resource pool of the server, and submits a task operation request to the server.
A cloud environment is identified. Specifically, the server identifies a cloud environment, i.e., the server identifies a current operating environment, which includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
And acquiring the resource specification which can be provided by the current environment. Specifically, the server obtains the resource specification that can be provided by the current environment. And the server determines a target resource specification according to the resource specification applied by the user and the resource specification which can be provided by the current environment. The target resource specification is a resource specification used by the task runtime.
And creating a serverless container of the specified resource according to the interface of the current cloud environment. The specified resource is a target resource specification determined according to the resource specification which can be provided by the user application resource and the current environment.
The task ID runs a serverless container as an environment variable.
And reading the position of the task code, and operating an entrance and parameters. Specifically, the serverless container obtains a code position, a parameter and an operation entry required by the operation of the task in the common storage space by reading the task ID.
And downloading and loading the task codes. Specifically, the serverless container downloads the task code in the common memory space and loads and runs the task code.
And running the task. Specifically, the tasks are executed in the serverless container by using the obtained information such as the operation entries, the parameters and the like.
And saving the task operation result. Specifically, after the task operation is finished, the task operation result is saved, that is, the serverless container writes the operation result into the public storage space.
The serverless container is exited. Specifically, after the running task is completed, the created serverless container is exited.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided a computing task processing device including: a receive request module 502, a get environment resource specification module 504, a create no service container module 506, and a perform compute task module 508, wherein:
the receiving request module 502 is configured to receive a task running request, where the task running request includes a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request.
An obtaining environment resource specification module 504, configured to obtain a current operating environment type, and obtain an environment resource specification corresponding to the current operating environment according to the current operating environment type.
And a create no-service container module 506, configured to determine a target resource specification according to the resource specification applied by the user and the environment resource specification, and create a no-service container according to the target resource specification through an interface provided by the current operating environment, where the no-service container carries a task identifier of a computing task corresponding to the task operating request.
And the computation task execution module 508 is configured to execute the computation task corresponding to the task operation request by using the non-service container, and exit the non-service container after the computation task is executed.
In one embodiment, the create no service container module 506 is further configured to, when the user application resource specification is greater than the environmental resource specification, the target resource specification is the environmental resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
In one embodiment, the computation task execution module 508 is further configured to obtain a task identifier from the non-service container, and obtain operation information corresponding to the computation task from the public storage space according to the task identifier; downloading the operation code in the public storage space according to the operation information, and operating the operation code in the non-service container according to the operation information; and acquiring the operation result and storing the operation result in the public storage space.
In one embodiment, the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
As shown in fig. 6, in one embodiment, the apparatus further comprises:
a storage module 501, configured to receive a storage request, where the storage request includes a task identifier of a computing task, and the task identifier is a task identifier generated when a terminal creates a corresponding computing task according to an operation code of the computing task; and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task into a public storage space in a correlation manner according to the storage request.
In one embodiment, the apparatus further comprises:
a task running request queuing module 505, configured to establish a queuing queue and add task running requests to the queuing queue according to a receiving time sequence when there are more than one task running requests and a target resource specification is greater than an idle environment resource specification of a current running environment; and when the target resource specification is detected to be smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queue according to the receiving time sequence, and establishing corresponding non-service containers aiming at the task operating requests.
For specific limitations of the computing task processing device, reference may be made to the above limitations of the computing task processing method, which are not described herein again. The respective modules in the above-described calculation task processing device may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing data such as running code data, computing task running information, running results and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a computing task processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a task operation request, wherein the task operation request comprises a resource specification applied by a user and a task identifier of a calculation task corresponding to the task operation request;
acquiring a current operation environment type, and acquiring an environment resource specification corresponding to the current operation environment according to the current operation environment type;
determining a target resource specification according to a resource specification applied by a user and an environment resource specification, and creating a no-service container through an interface provided by a current operation environment according to the target resource specification, wherein the no-service container carries a task identifier of a calculation task corresponding to a task operation request;
and executing the calculation task corresponding to the task operation request by using the no-service container, and exiting the no-service container after the execution of the calculation task is finished.
In one embodiment, the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
In one embodiment, the determining the target resource specification according to the user application resource specification and the environmental resource specification includes:
when the resource specification requested by the user is larger than the environmental resource specification, the target resource specification is the environmental resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
In one embodiment, executing a computing task corresponding to a task execution request by using a serverless container comprises:
acquiring a task identifier from a non-service container, and acquiring running information corresponding to a calculation task from a public storage space according to the task identifier; downloading the running code in the public storage space according to the running information, and running the running code in the service-free container according to the running information; and acquiring the operation result and storing the operation result in the public storage space.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a storage request, wherein the storage request comprises a task identifier of a calculation task, and the task identifier is generated when a terminal creates a corresponding calculation task according to an operation code of the calculation task; and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task into a public storage space in an associated manner according to the storage request.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when more than one task operation request is received and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence; and when the target resource specification is detected to be smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queue according to the receiving time sequence, and establishing corresponding non-service containers aiming at the task operating requests.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a task operation request, wherein the task operation request comprises a resource specification applied by a user and a task identifier of a calculation task corresponding to the task operation request;
acquiring a current operation environment type, and acquiring an environment resource specification corresponding to the current operation environment according to the current operation environment type;
determining a target resource specification according to a resource specification applied by a user and an environment resource specification, and creating a no-service container through an interface provided by a current operation environment according to the target resource specification, wherein the no-service container carries a task identifier of a calculation task corresponding to a task operation request;
and executing the calculation task corresponding to the task operation request by using the no-service container, and exiting the no-service container after the execution of the calculation task is finished.
In one embodiment, the current operating environment type includes at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
In one embodiment, the determining the target resource specification according to the user application resource specification and the environmental resource specification includes:
when the resource specification requested by the user is larger than the environmental resource specification, the target resource specification is the environmental resource specification; and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
In one embodiment, executing a computing task corresponding to a task execution request by using a serverless container comprises:
acquiring a task identifier from a non-service container, and acquiring running information corresponding to a calculation task from a public storage space according to the task identifier; downloading the running code in the public storage space according to the running information, and running the running code in the service-free container according to the running information; and acquiring the operation result and storing the operation result in the public storage space.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a storage request, wherein the storage request comprises a task identifier of a calculation task, and the task identifier is generated when a terminal creates a corresponding calculation task according to an operation code of the calculation task; and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task into a public storage space in an associated manner according to the storage request.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when more than one task operation request is received and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence; and when the target resource specification is detected to be smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queue according to the receiving time sequence, and establishing corresponding non-service containers aiming at the task operating requests.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of computing task processing, the method comprising:
receiving a task running request, wherein the task running request comprises a resource specification applied by a user and a task identifier of a computing task corresponding to the task running request;
acquiring a current operating environment type, and acquiring an environment resource specification corresponding to the current operating environment according to the current operating environment type;
determining a target resource specification according to the user application resource specification and the environment resource specification, and creating a non-service container through an interface provided by a current operation environment according to the target resource specification, wherein the non-service container carries a task identifier of a calculation task corresponding to the task operation request;
and executing the calculation task corresponding to the task operation request by using the service-free container, and exiting the service-free container after the execution of the calculation task is finished.
2. The method of claim 1, wherein prior to receiving a task execution request, further comprising:
receiving a storage request, wherein the storage request comprises a task identifier of the computing task, and the task identifier is a task identifier generated when a terminal creates a corresponding computing task according to an operation code of the computing task;
and storing the task identifier of the computing task, the running code of the computing task and the running information corresponding to the computing task in a public storage space in an associated manner according to the storage request.
3. The method of claim 1, wherein the current operating environment type comprises at least one of a public cloud environment, a private cloud environment, and a hybrid cloud environment.
4. The method of claim 1, wherein determining a target resource specification from the user application resource specification and the environmental resource specification comprises:
when the resource specification requested by the user is larger than the environmental resource specification, the target resource specification is the environmental resource specification;
and when the resource specification applied by the user is smaller than or equal to the environment resource specification, the target resource specification is the resource specification applied by the user.
5. The method according to claim 1, wherein the executing the computing task corresponding to the task execution request by using the serverless container comprises:
acquiring the task identifier from the non-service container, and acquiring running information corresponding to the computing task from the public storage space according to the task identifier;
downloading the running code in a public storage space according to the running information, and running the running code in the non-service container according to the running information;
and acquiring an operation result and storing the operation result in the public storage space.
6. The method of claim 1, further comprising:
when the number of the task operation requests is more than one and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence;
and when detecting that the target resource specification is smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queuing queue according to the receiving time sequence, and creating corresponding non-service containers aiming at the task operating requests.
7. A computing task processing apparatus, characterized in that the apparatus comprises:
the system comprises a receiving request module, a task execution module and a task execution module, wherein the receiving request module is used for receiving a task execution request, and the task execution request comprises a user application resource specification and a task identifier of a calculation task corresponding to the task execution request;
the acquisition environment resource specification module is used for acquiring the current operation environment type and acquiring the environment resource specification corresponding to the current operation environment according to the current operation environment type;
a service-free container creating module, configured to determine a target resource specification according to the user application resource specification and the environment resource specification, and create a service-free container through an interface provided by a current operating environment according to the target resource specification, where the service-free container carries a task identifier of a computing task corresponding to the task operating request;
and the computation task execution module is used for executing the computation task corresponding to the task operation request by using the service-free container, and quitting the service-free container after the computation task execution is finished.
8. The apparatus of claim 7, further comprising:
a task execution request queuing module for
When the number of the task operation requests is more than one and the target resource specification is larger than the idle environment resource specification of the current operation environment, establishing a queuing queue, and adding the task operation requests into the queuing queue according to the receiving time sequence;
and when detecting that the target resource specification is smaller than or equal to the idle environment resource specification of the current operating environment, sequentially taking out the task operating requests from the queuing queue according to the receiving time sequence, and creating corresponding non-service containers aiming at the task operating requests.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN201910832817.8A 2019-09-04 2019-09-04 Computing task processing method and device, computer equipment and storage medium Active CN110704177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910832817.8A CN110704177B (en) 2019-09-04 2019-09-04 Computing task processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910832817.8A CN110704177B (en) 2019-09-04 2019-09-04 Computing task processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110704177A true CN110704177A (en) 2020-01-17
CN110704177B CN110704177B (en) 2022-06-10

Family

ID=69194317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910832817.8A Active CN110704177B (en) 2019-09-04 2019-09-04 Computing task processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110704177B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314735A (en) * 2020-03-06 2020-06-19 新华智云科技有限公司 Video processing method, system and storage medium
CN112905328A (en) * 2021-03-04 2021-06-04 杭州海康威视数字技术股份有限公司 Task processing method and device and computer readable storage medium
CN112966256A (en) * 2021-02-01 2021-06-15 万翼科技有限公司 Equipment management method based on building information model and related device
CN113778956A (en) * 2021-09-15 2021-12-10 京东科技信息技术有限公司 Resource processing method and device, electronic equipment and computer readable medium
CN113903219A (en) * 2021-11-22 2022-01-07 创盛视联数码科技(北京)有限公司 Display method and device for programming teaching, electronic equipment and storage medium
CN116107913A (en) * 2023-04-06 2023-05-12 阿里云计算有限公司 Test control method, device and system of single-node server

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014063449A (en) * 2012-09-24 2014-04-10 Hitachi Systems Ltd Resource management system, resource management method and resource management program
CN103780655A (en) * 2012-10-24 2014-05-07 阿里巴巴集团控股有限公司 Message transmission interface task and resource scheduling system and method
CN105607955A (en) * 2015-12-23 2016-05-25 浪潮集团有限公司 Calculation task distribution method and apparatus
CN106708622A (en) * 2016-07-18 2017-05-24 腾讯科技(深圳)有限公司 Cluster resource processing method and system, and resource processing cluster
CN107222531A (en) * 2017-05-23 2017-09-29 北京科技大学 A kind of container cloud resource dispatching method
CN107424074A (en) * 2017-07-27 2017-12-01 广州弘融信息科技有限公司 A kind of internet balance system and its method based on Serverless technologies
CN108089924A (en) * 2017-12-18 2018-05-29 郑州云海信息技术有限公司 A kind of task run method and device
CN108845878A (en) * 2018-05-08 2018-11-20 南京理工大学 The big data processing method and processing device calculated based on serverless backup
US20190179678A1 (en) * 2017-12-07 2019-06-13 International Business Machines Corporation Computer server application execution scheduling latency reduction
CN110166507A (en) * 2018-02-12 2019-08-23 北京京东尚科信息技术有限公司 More resource regulating methods and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014063449A (en) * 2012-09-24 2014-04-10 Hitachi Systems Ltd Resource management system, resource management method and resource management program
CN103780655A (en) * 2012-10-24 2014-05-07 阿里巴巴集团控股有限公司 Message transmission interface task and resource scheduling system and method
CN105607955A (en) * 2015-12-23 2016-05-25 浪潮集团有限公司 Calculation task distribution method and apparatus
CN106708622A (en) * 2016-07-18 2017-05-24 腾讯科技(深圳)有限公司 Cluster resource processing method and system, and resource processing cluster
CN107222531A (en) * 2017-05-23 2017-09-29 北京科技大学 A kind of container cloud resource dispatching method
CN107424074A (en) * 2017-07-27 2017-12-01 广州弘融信息科技有限公司 A kind of internet balance system and its method based on Serverless technologies
US20190179678A1 (en) * 2017-12-07 2019-06-13 International Business Machines Corporation Computer server application execution scheduling latency reduction
CN108089924A (en) * 2017-12-18 2018-05-29 郑州云海信息技术有限公司 A kind of task run method and device
CN110166507A (en) * 2018-02-12 2019-08-23 北京京东尚科信息技术有限公司 More resource regulating methods and device
CN108845878A (en) * 2018-05-08 2018-11-20 南京理工大学 The big data processing method and processing device calculated based on serverless backup

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HYUNGRO LEE 等: "Evaluation of Production Serverless Computing Environments", 《2018 IEEE 11TH INTERNATIONAL CONFERENCE ON CLOUD COMPUTING (CLOUD)》 *
郑继来: "网络环境下基于用户信息需求的信息资源配置研究综述", 《信息资源管理学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314735A (en) * 2020-03-06 2020-06-19 新华智云科技有限公司 Video processing method, system and storage medium
CN112966256A (en) * 2021-02-01 2021-06-15 万翼科技有限公司 Equipment management method based on building information model and related device
CN112905328A (en) * 2021-03-04 2021-06-04 杭州海康威视数字技术股份有限公司 Task processing method and device and computer readable storage medium
CN112905328B (en) * 2021-03-04 2023-09-19 杭州海康威视数字技术股份有限公司 Task processing method, device and computer readable storage medium
CN113778956A (en) * 2021-09-15 2021-12-10 京东科技信息技术有限公司 Resource processing method and device, electronic equipment and computer readable medium
CN113903219A (en) * 2021-11-22 2022-01-07 创盛视联数码科技(北京)有限公司 Display method and device for programming teaching, electronic equipment and storage medium
CN116107913A (en) * 2023-04-06 2023-05-12 阿里云计算有限公司 Test control method, device and system of single-node server
CN116107913B (en) * 2023-04-06 2023-11-14 阿里云计算有限公司 Test control method, device and system of single-node server

Also Published As

Publication number Publication date
CN110704177B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN110704177B (en) Computing task processing method and device, computer equipment and storage medium
WO2021142609A1 (en) Information reporting method, apparatus and device, and storage medium
CN108573371B (en) Data approval method, device, computer equipment and storage medium
US11442790B2 (en) Resource scheduling system, method and server for ensuring high availability of services
CN112000348A (en) Control method and device for service gray release and computer equipment
CN108492005B (en) Project data processing method and device, computer equipment and storage medium
CN110620812A (en) Interactive information pushing method and device, computer equipment and storage medium
CN112099979B (en) Access control method, device, computer equipment and storage medium
CN109800083B (en) Method, device, system and storage medium for micro-service collaborative call
CN111338779B (en) Resource allocation method, device, computer equipment and storage medium
CN114615340B (en) Request processing method and device, computer equipment and storage device
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
CN111694639A (en) Method and device for updating address of process container and electronic equipment
CN111209061A (en) Method and device for filling in user information, computer equipment and storage medium
US20200285527A1 (en) Determination method, information processing apparatus, and storage medium
CN112631994A (en) Data migration method and system
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN113065887A (en) Resource processing method, resource processing device, computer equipment and storage medium
CN110609707B (en) Online data processing system generation method, device and equipment
CN112688980B (en) Resource distribution method and device, and computer equipment
CN114924888A (en) Resource allocation method, data processing method, device, equipment and storage medium
CN114040378A (en) Application arranging method and device, computer equipment and storage medium
CN109548000B (en) System, method and computer equipment for sharing and purchasing communication service
CN110659288A (en) Case statement calculation method, system, device, computer equipment and storage medium
CN110969430A (en) Method and device for identifying suspicious user, computer equipment and storage medium

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