CN113778658A - Task allocation method and device, electronic equipment and storage medium - Google Patents

Task allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113778658A
CN113778658A CN202011057512.3A CN202011057512A CN113778658A CN 113778658 A CN113778658 A CN 113778658A CN 202011057512 A CN202011057512 A CN 202011057512A CN 113778658 A CN113778658 A CN 113778658A
Authority
CN
China
Prior art keywords
task
timing task
timing
execution end
configuration information
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.)
Pending
Application number
CN202011057512.3A
Other languages
Chinese (zh)
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011057512.3A priority Critical patent/CN113778658A/en
Publication of CN113778658A publication Critical patent/CN113778658A/en
Pending legal-status Critical Current

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/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/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
    • 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/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

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 And Data Communications (AREA)

Abstract

The disclosure provides a task allocation method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The task allocation method comprises the following steps: acquiring configuration information of a timing task in a task management platform; when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information; and executing the timing task based on the distributed target execution end, and returning an execution result to a task management platform. The technical scheme of the embodiment of the disclosure can realize the uniform configuration and the uniform distribution of the timing task, reduce the development cost and improve the execution efficiency of the timing task.

Description

Task allocation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a task allocation method, a task allocation apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of internet technology, the magnitude of timing tasks in a distributed system is larger and larger, and the management of the timing tasks is more and more difficult.
At present, in related technical solutions, when configuring and allocating a timing task, either the implementation is cumbersome and inconvenient for subsequent execution or maintenance, or an execution end of the timing task cannot be accurately allocated, which results in a large pressure on part of the execution ends and reduces the execution efficiency of the timing task.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a task allocation method, a task allocation apparatus, an electronic device, and a computer-readable storage medium, so as to overcome at least to some extent the problems that the maintenance cost of a timing task in a related scheme is high and the timing task cannot be accurately allocated.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the embodiments of the present disclosure, there is provided a task allocation method, including:
acquiring configuration information of a timing task in a task management platform;
when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information;
and executing the timing task based on the distributed target execution end, and returning an execution result to the task management platform.
In some example embodiments of the present disclosure, based on the foregoing solution, allocating a target execution end corresponding to the timing task based on a predefined remote invocation routing filtering rule and the configuration information includes:
based on the remote call routing filtering rule, extracting a limited service identifier configured in the configuration information corresponding to the timing task;
and distributing the target execution end corresponding to the timing task according to the limited service identifier.
In some example embodiments of the present disclosure, based on the foregoing solution, extracting, based on the remote invocation routing filtering rule, a defined service identifier configured in the configuration information corresponding to the timing task, includes:
acquiring the access parameter information when the timing task is called based on the remote call routing filtering rule; wherein the entry information comprises the configuration information of the timing task;
and extracting the limited service identification corresponding to the timing task from the access information.
In some example embodiments of the present disclosure, based on the foregoing scheme, allocating a target server corresponding to the timing task according to the defined service identifier includes:
acquiring a service provider set;
standardizing the limited service identification to generate a limited service identification set;
and performing intersection processing on the service provider set and the limited service identifier set to obtain a target set, and allocating a target execution end corresponding to the timing task according to the target set.
In some example embodiments of the present disclosure, based on the foregoing, the method further includes:
when detecting that the configuration information of the timing task does not contain a limited service identifier, determining resource demand data corresponding to the timing task;
and distributing a target execution end matched with the resource demand data of the timing task based on the remote call routing filtering rule and the resource demand data.
In some example embodiments of the present disclosure, based on the foregoing solution, allocating a target execution end matched with the resource demand data of the timing task based on the remote invocation routing filtering rule and the resource demand data includes:
carrying out fragmentation processing on the timing task to obtain a fragmentation task;
and distributing a target execution end matched with the resource demand data of the fragmentation task based on the remote call routing filtering rule and the resource demand data.
In some example embodiments of the present disclosure, based on the foregoing solution, allocating a target execution end matched with the resource demand data of the timing task based on the remote invocation routing filtering rule and the resource demand data includes:
acquiring a pre-registered execution end configuration table;
and distributing a target execution end matched with the resource demand data of the timing task by combining the resource demand data and the execution end configuration table based on the remote call routing filtering rule.
According to a second aspect of the embodiments of the present disclosure, there is provided a task assigning apparatus including:
the configuration information acquisition module is used for acquiring the configuration information of the timing task in the task management platform;
the task allocation module is used for allocating a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information when the timing task is triggered;
and the task execution module executes the timing task based on the distributed target execution end and returns an execution result to the task management platform.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the task allocation module further includes:
a limited service identifier extracting unit, configured to extract a limited service identifier configured in the configuration information corresponding to the timing task based on the remote invocation routing filtering rule;
and the timing task allocation unit is used for allocating the target execution end corresponding to the timing task according to the limited service identifier.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the defined service identification extracting unit is further configured to:
acquiring the access parameter information when the timing task is called based on the remote call routing filtering rule; wherein the entry information comprises the configuration information of the timing task;
and extracting the limited service identification corresponding to the timing task from the access information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the timing task allocating unit is further configured to:
acquiring a service provider set;
standardizing the limited service identification to generate a limited service identification set;
and performing intersection processing on the service provider set and the limited service identifier set to obtain a target set, and allocating a target execution end corresponding to the timing task according to the target set.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the task assigning apparatus further includes:
a resource demand data determining unit, configured to determine resource demand data corresponding to the timing task when it is detected that the configuration information of the timing task does not include a limited service identifier;
and the resource allocation unit is used for allocating a target execution end matched with the resource demand data of the timing task based on the remote call routing filtering rule and the resource demand data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the resource allocation unit is further configured to:
carrying out fragmentation processing on the timing task to obtain a fragmentation task;
and distributing a target execution end matched with the resource demand data of the fragmentation task based on the remote call routing filtering rule and the resource demand data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the resource allocation unit is further configured to:
acquiring a pre-registered execution end configuration table;
and distributing a target execution end matched with the resource demand data of the timing task by combining the resource demand data and the execution end configuration table based on the remote call routing filtering rule.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement the task allocation method of any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a task allocation method according to any one of the above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the task allocation method in the example embodiment of the disclosure, configuration information of a timing task in a task management platform is acquired; when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and configuration information; and executing the timing task based on the distributed target execution end, and returning an execution result to the task management platform. On one hand, the unified management and distribution of the timing tasks configured by the task management platform are realized by remotely calling the routing filtering rules, so that the distribution efficiency of the timing tasks can be effectively improved; on the other hand, based on the remote call routing filtering rule and in combination with the configuration information corresponding to the timing task, the target execution end for executing the timing task is accurately distributed, and meanwhile, the consumed resources of the timing task (pressure of each execution end is balanced) can be balanced according to the configuration information corresponding to the timing task, so that the distribution efficiency of the timing task is further improved, and the execution efficiency of the timing task is ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 schematically illustrates a flow diagram of a task allocation method, according to some embodiments of the present disclosure;
FIG. 2 schematically illustrates a flow diagram for assigning timed tasks according to restricted service identification, in accordance with some embodiments of the present disclosure;
FIG. 3 schematically illustrates a flow diagram for allocating timed tasks according to resource demand data, in accordance with some embodiments of the present disclosure;
FIG. 4 schematically illustrates a flow diagram for task distribution via route filtering rules, in accordance with some embodiments of the present disclosure;
FIG. 5 schematically illustrates a flow diagram of timed task invocation logic, in accordance with some embodiments of the present disclosure;
FIG. 6 schematically illustrates a system diagram of timed task allocation, according to some embodiments of the present disclosure;
FIG. 7 schematically illustrates a schematic diagram of a task allocation apparatus, according to some embodiments of the present disclosure;
FIG. 8 schematically illustrates a structural schematic of a computer system of an electronic device, in accordance with some embodiments of the present disclosure;
fig. 9 schematically illustrates a schematic diagram of a computer-readable storage medium, according to some embodiments of the present disclosure.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
Furthermore, the drawings are merely schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The inventor finds that, in the related technical scheme, the method for realizing the timing task allocation comprises the following steps: firstly, using a Quartz framework and a task scheduling table to perform task execution allocation; secondly, uniformly deploying timing tasks by using an elastic-jobframe; and thirdly, uniformly deploying timing tasks by using a TBSchedule framework.
However, in the first use mode, the implementation process is complicated, and the operation and maintenance are inconvenient; in the second use mode, the Zookeeper environment needs to be deployed, an execution machine (execution end) of a timing task cannot be specified, and multiple times of calling are needed when multiple fragments are divided; in the case of the third usage, the execution machine (execution end) on which the timing task is executed cannot be specified.
In view of one or more of the above problems, in the present exemplary embodiment, a task allocation method is first provided, which can be applied to a server. Fig. 1 schematically illustrates a flow diagram of a task allocation method according to some embodiments of the present disclosure. Referring to fig. 1, the task assigning method may include the steps of:
step S110, acquiring configuration information of a timing task in a task management platform;
step S120, when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information;
step S130, executing the timing task based on the allocated target execution end, and returning an execution result to the task management platform.
According to the task allocation method in the embodiment of the present invention, on one hand, unified management and allocation of the timing tasks configured by the task management platform are realized by remotely calling the routing filtering rule, and the allocation efficiency of the timing tasks can be effectively improved; on the other hand, based on the remote call routing filtering rule and in combination with the configuration information corresponding to the timing task, the target execution end for executing the timing task is accurately distributed, and meanwhile, the consumed resources of the timing task (pressure of each execution end is balanced) can be balanced according to the configuration information corresponding to the timing task, so that the distribution efficiency of the timing task is further improved, and the execution efficiency of the timing task is ensured.
Next, a task allocation method in the present exemplary embodiment will be further explained.
In step S110, configuration information of the timed task in the task management platform is acquired.
In an example embodiment of the present disclosure, the timed task refers to a task executed when a set time arrives, for example, the timed task may be a task of sending a mail at a fixed time, may also be a task of an order due and unpaid reminder, and of course, may also be another task executed when the set time arrives, which is not particularly limited in this example embodiment.
The task management platform refers to a platform for configuring a timing task, and for example, the timing task can be added, deleted, configured information of the timing task is modified, and the timing task is queried through the task management platform. Certainly, the task management platform may also be used to schedule a timing task, define a unified service, and filter a routing rule, which is not particularly limited in this example embodiment.
The configuration information may be data configured when a timing task is newly added in the task management platform, for example, the configuration information may be in the form of a task name, a task class name, or a method name, or may be a task content description, a task state (0: open or 1: closed), and an execution end representation list that restricts the task, or may also be associated information corresponding to other timing tasks, which is not particularly limited in this example embodiment.
In step S120, when the timing task is triggered, a target execution end corresponding to the timing task is allocated based on a predefined remote invocation routing filtering rule and the configuration information.
In an example embodiment of the present disclosure, the Remote invocation Routing filtering rule may be a Remote Procedure Call (Remote invocation) based Routing filtering rule defined in advance by the task management platform, and may implement accurate allocation of the timing task through the Remote invocation Routing filtering rule. The target execution end can be a plurality of machine ends used for executing the timing task, is provided by a service end accessed to the task management platform, deploys the application program and is responsible for executing specific implementation logic of the timing task (executing the timing task logic when being called).
In step S130, the timing task is executed based on the allocated target execution end, and an execution result is returned to the task management platform.
In an example embodiment of the present disclosure, each execution end corresponds to different machine configuration information, for example, the machine configuration information may include CPU resources or memory resources, and the execution end with high configuration generally has a larger amount of tasks than the execution end with low configuration. The routing filtering rules are called remotely, and the configuration information corresponding to the timing tasks is used for allocating the timing tasks to the appropriate target execution ends according to the demand resources (the required CPU resources or the required memory resources), so that the workload of the execution ends can be reduced, the processing efficiency of the timing tasks is effectively improved, and the timing task capacity which can be accommodated by the whole system is improved.
In an example embodiment of the present disclosure, the execution end executing the timing task may be allocated by the steps in fig. 2:
referring to fig. 2, in step S210, based on the remote invocation routing filtering rule, a limited service identifier configured in the configuration information corresponding to the timing task is extracted;
and step S220, distributing the target execution end corresponding to the timing task according to the limited service identifier.
The limited service identifier may refer to identifier data of an execution end used for executing the timing task, which is included in the configuration information for configuring the timing task, for example, the service identifier information may be an ip (internet protocol) address corresponding to the execution end, may also be a terminal serial number corresponding to the execution end, and of course, may also be other identifier data capable of identifying the execution end, which is not particularly limited by the exemplary temple.
For example, when a timing task is newly added through the task management platform, configuration information of the timing task needs to be newly added on the task management platform, and the configuration information may be represented as:
JobModel
-jobName:String
-serviceName:String
-cronExpression:String
-jobDesc:String
-limitIps:String
-status:Integer
where "jobName" may represent a task alias, such as worker1, worker 2; method name form, e.g., void serviceclient. dealmethod (); "cronExpression" may represent a cron (planning task) execution expression; "jobDesc" may represent a timed task content description; "status" may indicate a task status, for example, a value of 0 indicates that the timed task is turned on, and a value of 1 indicates that the timed task is turned off; "limit ips" may represent a list of executors that limit timed tasks, which attribute is needed to filter the executors when the timed tasks are assigned, and the data format may be represented as: "ip 1, ip2, ip 3".
Assuming that in the configuration of the timing task, the timing task 1 can configure the limit ips as ip1 and ip 2; the timing task 2 may be configured with limit ips as ip1, ip3, and ip4, and in this case, it is described that the execution end corresponding to ip1 is the execution end of the timing task 1 and is also the execution end of the timing task 2, and the two tasks may be simultaneously assumed. Meanwhile, when the limit ips is configured as ip1 and ip2, the timed task 1 may indicate that only the services whose ips are ip1 and ip2 in the service list may execute the timed task, and the other services do not execute the timed task.
Specifically, the structure for implementing the Dubbo (a Java-based high-performance RPC distributed service framework SOA) routing can be expressed as:
LimitIpRouter
route(Invocation varl,List<Provider>var2):List<Provider>
wherein, the "Invocation" may represent the reference information when the RPC call is made, and all the reference information may be obtained through the object; "List < Provider >" may represent a List of providers of RPC services.
Specifically, the entry parameter information can be acquired when the timing task is called based on the remote call routing filtering rule; the entry information may include configuration information of the timing task; and extracting a limited service identifier corresponding to the timing task from the access information.
Further, the timing task may be assigned by:
acquiring a service provider set;
standardizing the limited service identification to generate a limited service identification set;
and performing intersection processing on the service provider set and the limited service identifier set to obtain a target set, and allocating a target execution end corresponding to the timing task according to the target set.
The service Provider set may be "List < Provider >" as described above, and the normalization process may refer to arranging the limited service identifier extracted from the configuration information into data having the same data structure as that of the service Provider set "List < Provider >" so as to facilitate subsequent calculation, for example, the limited service identifiers ip1, ip3, and ip4 may be normalized into the limited service identifier set < ip1, ip3, and ip4 >. After the limited service identifier is standardized to generate a limited service identifier set, a target set can be obtained by performing intersection calculation on the service provider set and the limited service identifier set, and then a target execution end corresponding to the timing task is distributed through the target set.
Optionally, the allocation of the timing task may also be implemented by the steps in fig. 3:
referring to fig. 3, in step S310, when it is detected that the configuration information of the timing task does not include a limited service identifier, resource requirement data corresponding to the timing task is determined;
step S320, allocating a target execution end matched with the resource demand data of the timing task based on the remote invocation routing filtering rule and the resource demand data.
The resource requirement data may refer to resources that are determined according to the content of the timing task and are required to be consumed when the timing task is executed, for example, the resource requirement data may be memory data that is required to be consumed by the timing task, may also be computing power data (computing power of a central processing unit CPU) that is required to be consumed by the timing task, and of course, may also be resource data that is required to be consumed when other timing tasks are executed, which is not particularly limited in this example.
In an example embodiment of the present disclosure, when the timing task is complex, for example, the timing task may be a timing replenishment statistical task of an intelligent replenishment system, the calculation amount is large, an individual execution end may not be able to bear the timing task, and the allocation processing of the timing task may be implemented by the following steps:
carrying out fragmentation processing on the timing task to obtain a fragmentation task;
and distributing a target execution end matched with the resource demand data of the fragmentation task based on the remote call routing filtering rule and the resource demand data.
The fragmentation task may refer to a plurality of tasks with a small calculation amount obtained by fragmenting a more complex timing task, for example, the fragmentation task may be a timing replenishment statistics task of an intelligent replenishment system, and different tasks for counting various types of articles are obtained by performing fragmentation processing according to classifications of different articles, which is only illustrated schematically here, and this is not limited in this example embodiment.
Specifically, when the routing filtering rule is remotely called to allocate the timing task, the execution end corresponding to the timing task can be allocated through the following steps:
acquiring a pre-registered execution end configuration table;
and distributing a target execution end matched with the resource demand data of the timing task by combining the resource demand data and the execution end configuration table based on the remote call routing filtering rule.
The execution-side configuration table may be a table of configuration information corresponding to a plurality of execution sides registered in advance on the task management platform at the server, for example, the execution-side configuration table may include identification data corresponding to the execution sides, resource data corresponding to the execution sides, current resource consumption conditions corresponding to the execution sides, and the like, which is not limited in this example embodiment. Based on the remote calling of the routing filtering rules, the timing tasks can be more accurately distributed by combining the resource demand data and the execution end configuration table, and the execution efficiency of the timing tasks is effectively ensured.
Fig. 4 schematically illustrates a flow diagram for task allocation via route filtering rules, according to some embodiments of the present disclosure.
Referring to FIG. 4, step S410, obtaining the import parameter information param from the Invocation object Invocation;
step S420, extracting the limited service identification limit IPs from the parameter information param;
step S430, carrying out standardization processing on the limited service identifier limit IPs to obtain a limited service identifier set with the same data structure as the service Provider set List < Provider >;
step S440, carrying out intersection processing on the service Provider set List < Provider > and the limited service identification set to obtain a target set;
step S450, returning a target set meeting the requirements;
and step S460, distributing target execution ends corresponding to the timing tasks according to the target set based on the remote call routing filtering rule.
FIG. 5 schematically illustrates a flow diagram of timed task invocation logic, according to some embodiments of the present disclosure.
Referring to fig. 5, in step S501, a timed task is called by the task management platform 510, and a timed task 1 is triggered and executed;
step S502, executing the self-defined function (task or joba) logic corresponding to the timing task 1 through the self-defined function interface 520;
step S503, RPC calling is carried out on the timing task 1 through the custom route 530;
step S504, route filtering is carried out on the timing task 1 based on the remote call route filtering rule, and the timing task 1 is distributed to the server 540;
step S505, RPC calling is carried out on the timing task 1 after route filtering through the server 540;
step S506, the correct target execution end is called to execute the target method corresponding to the timing task 1 through the server 540;
step S507, returning the execution result to the task management platform 510 through the server 540;
step S508, the timing task is called through the task management platform 510, and the timing task 2 is triggered and executed;
step S509, execute a custom function (task or joba) logic corresponding to the timing task 2 through the custom function interface 520;
step S510, RPC calling is carried out on the timing task 2 through the custom route 530;
step S511, route filtering is carried out on the timing task 2 based on the remote call route filtering rule, and the timing task 2 is distributed to the server 550;
step S512, RPC calling is carried out on the timing task 2 after route filtering through the server 550;
step S513, the correct target execution end is called to execute the target method corresponding to the timing task 2 through the server 550;
in step S514, the execution result is returned to the task management platform 510 through the server 550.
Generally speaking, when a timed task is triggered, the timed task is called in an RPC mode, and when the timed task is called, the timed task is delegated according to a pre-configured remote call routing filter rule, that is, not all service providers can bear the timed task, and after filtering a server through the configured remote call routing filter rule, the service provider can be found, and then the task call can be performed.
FIG. 6 schematically illustrates a system diagram of timed task allocation, according to some embodiments of the present disclosure.
Referring to fig. 6, the task allocation system may include a task management platform 610, a route filtering module 620, a server 630, a server 640, a registry 650, and an executive 660 corresponding to the server 630 and the server 640.
The task management platform 610 is mainly responsible for task scheduling, defining unified RPC service, task configuration (functions of task addition, task deletion, task modification, task query, and the like), routing rule filtering, and the like; the route filtering module 620 is a module integrated into the task management platform 610 to implement a route rule filtering function; the server 630 and the server 640 may be accessed to a system corresponding to the task management platform 610, and are mainly responsible for providing a unified RPC service defined by the task management platform 610 and for adding a timing task in the task management platform 610; the execution end 660 may be provided by the server 630 or the server 640, and is mainly used for deploying an application program and is responsible for executing specific implementation logic corresponding to the timing task (executing task logic when being called).
The task execution delegation scheme is realized based on an RPC routing rule filtering mode, multi-machine deployment is realized, and the problem of a single point is avoided. When a plurality of machines are deployed, the execution machine (execution end) of the timing task can be determined according to the actual situation, and the delegation of the timing task is realized in a configuration mode; the tasks can be flexibly split, so that the overload work of the execution machine caused by more tasks born by the execution machine is avoided; the assignment of the timing task may be performed according to the configuration of the execution device (configuration data such as CPU or memory), the execution device with a high configuration may perform a plurality of tasks, and the execution device with a low configuration may perform some tasks, so that the timing task may be assigned according to the configuration information of the execution device.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, in the present exemplary embodiment, a task assigning apparatus is also provided. Referring to fig. 7, the task assigning apparatus 700 includes: a configuration information acquisition module unit 710, a task assignment module unit 720, and a task execution module 730. Wherein:
the configuration information obtaining module 710 is configured to obtain configuration information of a timing task in the task management platform;
the task allocation module 720 is configured to, when the timing task is triggered, allocate a target execution end corresponding to the timing task based on a predefined remote invocation routing filtering rule and the configuration information;
the task execution module 730 executes the timing task based on the allocated target execution end, and returns an execution result to the task management platform.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the task allocation module 720 further includes:
a limited service identifier extracting unit, configured to extract a limited service identifier configured in the configuration information corresponding to the timing task based on the remote invocation routing filtering rule;
and the timing task allocation unit is used for allocating the target execution end corresponding to the timing task according to the limited service identifier.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the defined service identification extracting unit is further configured to:
acquiring the access parameter information when the timing task is called based on the remote call routing filtering rule; wherein the entry information comprises the configuration information of the timing task;
and extracting the limited service identification corresponding to the timing task from the access information.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the timing task allocating unit is further configured to:
acquiring a service provider set;
standardizing the limited service identification to generate a limited service identification set;
and performing intersection processing on the service provider set and the limited service identifier set to obtain a target set, and allocating a target execution end corresponding to the timing task according to the target set.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the task assigning apparatus 700 further includes:
a resource demand data determining unit, configured to determine resource demand data corresponding to the timing task when it is detected that the configuration information of the timing task does not include a limited service identifier;
and the resource allocation unit is used for allocating a target execution end matched with the resource demand data of the timing task based on the remote call routing filtering rule and the resource demand data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the resource allocation unit is further configured to:
carrying out fragmentation processing on the timing task to obtain a fragmentation task;
and distributing a target execution end matched with the resource demand data of the fragmentation task based on the remote call routing filtering rule and the resource demand data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the resource allocation unit is further configured to:
acquiring a pre-registered execution end configuration table;
and distributing a target execution end matched with the resource demand data of the timing task by combining the resource demand data and the execution end configuration table based on the remote call routing filtering rule.
The specific details of each module of the task allocation apparatus have been described in detail in the corresponding task allocation method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the task assigning means are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the task allocation method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to such an embodiment of the disclosure is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, a bus 830 connecting different system components (including the memory unit 820 and the processing unit 810), and a display unit 840.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present disclosure as described in the "exemplary methods" section above in this specification. For example, the processing unit 810 may execute step S110 shown in fig. 1, and obtain configuration information of a timed task in the task management platform; step S120, when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information; step S130, executing the timing task based on the allocated target execution end, and returning an execution result to the task management platform.
The storage unit 820 may include readable media in the form of volatile storage units, such as a random access storage unit (RAM)821 and/or a cache storage unit 822, and may further include a read only storage unit (ROM) 823.
Storage unit 820 may also include a program/utility 824 having a set (at least one) of program modules 825, such program modules 825 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 870 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the present disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
Referring to fig. 9, a program product 900 for implementing the task allocation method described above according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a 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.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a 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 readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like 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 computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A task allocation method, comprising:
acquiring configuration information of a timing task in a task management platform;
when the timing task is triggered, distributing a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information;
and executing the timing task based on the distributed target execution end, and returning an execution result to the task management platform.
2. The task allocation method according to claim 1, wherein allocating the target execution end corresponding to the timing task based on a predefined remote invocation routing filtering rule and the configuration information comprises:
based on the remote call routing filtering rule, extracting a limited service identifier configured in the configuration information corresponding to the timing task;
and distributing the target execution end corresponding to the timing task according to the limited service identifier.
3. The task allocation method according to claim 2, wherein extracting, based on the remote invocation routing filtering rule, a defined service identifier configured in the configuration information corresponding to the timing task includes:
acquiring the access parameter information when the timing task is called based on the remote call routing filtering rule; wherein the entry information comprises the configuration information of the timing task;
and extracting the limited service identification corresponding to the timing task from the access information.
4. The task allocation method according to claim 2, wherein allocating the target server corresponding to the timing task according to the limited service identifier comprises:
acquiring a service provider set;
standardizing the limited service identification to generate a limited service identification set;
and performing intersection processing on the service provider set and the limited service identifier set to obtain a target set, and allocating a target execution end corresponding to the timing task according to the target set.
5. The task allocation method according to claim 1, further comprising:
when detecting that the configuration information of the timing task does not contain a limited service identifier, determining resource demand data corresponding to the timing task;
and distributing a target execution end matched with the resource demand data of the timing task based on the remote call routing filtering rule and the resource demand data.
6. The task allocation method according to claim 5, wherein allocating a target execution end matching the resource requirement data of the timed task based on the remote invocation routing filtering rule and the resource requirement data comprises:
carrying out fragmentation processing on the timing task to obtain a fragmentation task;
and distributing a target execution end matched with the resource demand data of the fragmentation task based on the remote call routing filtering rule and the resource demand data.
7. The task allocation method according to claim 5, wherein allocating a target execution end matching the resource requirement data of the timed task based on the remote invocation routing filtering rule and the resource requirement data comprises:
acquiring a pre-registered execution end configuration table;
and distributing a target execution end matched with the resource demand data of the timing task by combining the resource demand data and the execution end configuration table based on the remote call routing filtering rule.
8. A task assigning apparatus, comprising:
the configuration information acquisition module is used for acquiring the configuration information of the timing task in the task management platform;
the task allocation module is used for allocating a target execution end corresponding to the timing task based on a predefined remote call routing filtering rule and the configuration information when the timing task is triggered;
and the task execution module executes the timing task based on the distributed target execution end and returns an execution result to the task management platform.
9. An electronic device, comprising:
a processor; and
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the task allocation method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a task allocation method according to any one of claims 1 to 7.
CN202011057512.3A 2020-09-29 2020-09-29 Task allocation method and device, electronic equipment and storage medium Pending CN113778658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011057512.3A CN113778658A (en) 2020-09-29 2020-09-29 Task allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011057512.3A CN113778658A (en) 2020-09-29 2020-09-29 Task allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113778658A true CN113778658A (en) 2021-12-10

Family

ID=78835111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011057512.3A Pending CN113778658A (en) 2020-09-29 2020-09-29 Task allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113778658A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745382A (en) * 2022-04-07 2022-07-12 中国邮政储蓄银行股份有限公司 Task fragmentation method, task fragmentation device and service system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844018A (en) * 2015-12-07 2017-06-13 阿里巴巴集团控股有限公司 A kind of task processing method, apparatus and system
CN106970843A (en) * 2016-01-14 2017-07-21 阿里巴巴集团控股有限公司 remote invocation method and device
CN110659131A (en) * 2019-08-15 2020-01-07 中国平安人寿保险股份有限公司 Task processing method, electronic device, computer device, and storage medium
CN110874272A (en) * 2020-01-16 2020-03-10 北京懿医云科技有限公司 Resource allocation method and device, computer readable storage medium and electronic device
WO2020048391A1 (en) * 2018-09-04 2020-03-12 京东数字科技控股有限公司 Methods and apparatuses for deploying and invoking web services based on multi-tenancy technology
CN110928721A (en) * 2020-01-22 2020-03-27 北京懿医云科技有限公司 Task execution method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844018A (en) * 2015-12-07 2017-06-13 阿里巴巴集团控股有限公司 A kind of task processing method, apparatus and system
CN106970843A (en) * 2016-01-14 2017-07-21 阿里巴巴集团控股有限公司 remote invocation method and device
WO2020048391A1 (en) * 2018-09-04 2020-03-12 京东数字科技控股有限公司 Methods and apparatuses for deploying and invoking web services based on multi-tenancy technology
CN110659131A (en) * 2019-08-15 2020-01-07 中国平安人寿保险股份有限公司 Task processing method, electronic device, computer device, and storage medium
CN110874272A (en) * 2020-01-16 2020-03-10 北京懿医云科技有限公司 Resource allocation method and device, computer readable storage medium and electronic device
CN110928721A (en) * 2020-01-22 2020-03-27 北京懿医云科技有限公司 Task execution method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
茹清兰;李敏;: "探究云计算模式下主动服务构架", 煤炭技术, no. 07, 31 July 2013 (2013-07-31) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745382A (en) * 2022-04-07 2022-07-12 中国邮政储蓄银行股份有限公司 Task fragmentation method, task fragmentation device and service system
CN114745382B (en) * 2022-04-07 2024-05-24 中国邮政储蓄银行股份有限公司 Task slicing method, task slicing device and service system

Similar Documents

Publication Publication Date Title
CN109670297B (en) Method and device for opening service permission, storage medium and electronic equipment
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN107729139B (en) Method and device for concurrently acquiring resources
US20180157543A1 (en) System and method for a generic actor system container application
JP2018026114A (en) Application profiling job management system, program, and method
CN108595316B (en) Lifecycle management method, manager, device, and medium for distributed application
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN108429768A (en) Cloud data analysis service manages system, method and cloud server
US20190278590A1 (en) Automated generation of service definitions for message queue application clients
CN110740057B (en) Service deployment method and block chain platform
US20120246157A1 (en) Method and system for dynamically tagging metrics data
CN110874272A (en) Resource allocation method and device, computer readable storage medium and electronic device
CN110532044A (en) A kind of big data batch processing method, device, electronic equipment and storage medium
CN108009010B (en) Management device, system, method, electronic device and storage medium for thin client
CN109672722B (en) Data deployment method and device, computer storage medium and electronic equipment
US20170345016A1 (en) Enforcing compliance with administrative requirements relating to using computing resources
CN110166507A (en) More resource regulating methods and device
CN114205230A (en) Method, system, medium and electronic device for configuring cloud native network element
US20180288169A1 (en) Intelligent information adapter generation for service management
CN111767089A (en) Method, device and equipment for loading file and storage medium
CN111984505A (en) Operation and maintenance data acquisition engine and acquisition method
CN114489954A (en) Tenant creation method based on virtualization platform, tenant access method and equipment
CN113778658A (en) Task allocation method and device, electronic equipment and storage medium
CN112333672B (en) Method and device for opening UPF network element of 5G core network
US20150212834A1 (en) Interoperation method of newtork device performed by computing device including cloud operating system in could environment

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