WO2019148728A1 - 电子装置、分布式系统执行任务分配方法及存储介质 - Google Patents

电子装置、分布式系统执行任务分配方法及存储介质 Download PDF

Info

Publication number
WO2019148728A1
WO2019148728A1 PCT/CN2018/089873 CN2018089873W WO2019148728A1 WO 2019148728 A1 WO2019148728 A1 WO 2019148728A1 CN 2018089873 W CN2018089873 W CN 2018089873W WO 2019148728 A1 WO2019148728 A1 WO 2019148728A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
execution
service node
executed
instruction
Prior art date
Application number
PCT/CN2018/089873
Other languages
English (en)
French (fr)
Inventor
王丽
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019148728A1 publication Critical patent/WO2019148728A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/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
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Definitions

  • the present application relates to the field of distributed systems, and in particular, to an electronic device, a distributed system task assignment method, and a storage medium.
  • a distributed system is a server cluster composed of multiple servers.
  • Each server in a server cluster can perform tasks as a service node, realize multi-task synchronous execution, and improve the efficiency of executing tasks, but distributed systems usually Multiple service node failure events occur, and the node failure events overlap each other, causing problems that may be performed by different service nodes may be missed or repeatedly executed, which significantly affects the accuracy of task execution.
  • the present application provides an electronic device, a distributed system task assignment method, and a storage medium, which can identify task codes and task identification codes of tasks to be executed according to tasks performed by each service node in the distributed system, and prevent different service nodes.
  • the problem of missed execution or repeated execution increases the accuracy of distributed system task execution.
  • the present application provides an electronic device including a memory and a processor connected to the memory, the processor for executing a distributed system task allocation program stored on the memory
  • the processor for executing a distributed system task allocation program stored on the memory
  • A1 Monitor a task performed by each service node of the distributed system and an execution state of the task, generate a task execution code of each service node of the distributed system according to the monitored task and an execution state of the task, and perform coding of the task.
  • A3. Analyze the task execution code and the task identification code stored in the predetermined database according to a predetermined task assignment rule, determine a service node that executes the to-be-executed task, or determine to issue a rejection execution to each service node. An instruction to perform a task.
  • the present application further provides a distributed system task allocation method, the method comprising the following steps:
  • the present application further provides a computer readable storage medium storing a distributed system task allocation program, the distributed system task allocation program being executable by at least one processor So that the at least one processor performs the following steps:
  • the electronic device, the distributed system task assignment method and the storage medium proposed by the present application monitor the tasks performed by the service nodes of the distributed system and the execution status of the tasks, according to the monitored tasks and The execution state of the task generates a task execution code of each service node of the distributed system, and stores the task execution code in a predetermined database; after receiving the task execution instruction, generates a code generation rule according to a predetermined task identification code a task identification code of the task to be executed in the received task execution instruction; analyzing the task execution code and the task identification code stored in the predetermined database according to a predetermined task assignment rule, and determining to execute the task to be executed The service node, or determining to issue an instruction to each service node to refuse execution of the to-be-executed task.
  • the task identification code of the task and the task to be executed can be identified according to the task of each service node in the distributed system, and the problem of leakage execution or repeated execution of different service nodes is prevented, and the accuracy of the task execution of the
  • FIG. 1 is a schematic diagram of an optional hardware architecture of an electronic device proposed by the present application.
  • FIG. 2 is a schematic diagram of a program module of a distributed system task allocation program in an embodiment of an electronic device of the present application
  • FIG. 3 is a flow chart of an implementation of a preferred embodiment of a distributed system task assignment method of the present application.
  • the electronic device 10 may include, but is not limited to, the memory 11, the processor 12, and the network interface 13 being communicably connected to each other through the communication bus 14. It should be noted that FIG. 1 only shows the electronic device 10 having the components 11-14, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 11 includes at least one type of computer readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, SD or DX memory, etc.), a random access memory (RAM), and a static memory.
  • the memory 11 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10.
  • the memory 11 may also be an outsourced storage device of the electronic device 10, such as a plug-in hard disk equipped on the electronic device 10, a smart memory card (SMC), and a secure digital (Secure Digital, SD) ) cards, flash cards, etc.
  • the memory 11 can also include both the internal storage unit of the electronic device 10 and its outsourced storage device.
  • the memory 11 is generally used to store an operating system installed on the electronic device 10 and various types of application software, such as a distributed system task allocation program. Further, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.
  • Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 12 is typically used to control the overall operation of the electronic device 10.
  • the processor 12 is configured to run program code or process data stored in the memory 11, such as a distributed distributed system task assignment program or the like.
  • the network interface 13 may include a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the electronic device 10 and other electronic devices.
  • Communication bus 14 is used to implement a communication connection between components 11-13.
  • Figure 1 shows only the electronic device 10 with components 11-14 and a distributed system task assignment program, but it should be understood that not all illustrated components may be implemented and that more or fewer components may be implemented instead. .
  • the electronic device 10 may further include a user interface (not shown in FIG. 1), and the user interface may include a display, an input unit such as a keyboard, wherein the user interface may further include a standard wired interface, a wireless interface, and the like.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED touch device, or the like. Further, the display may also be referred to as a display screen or display unit for displaying information processed in the electronic device 10 and a user interface for displaying visualizations.
  • the task execution coding includes a first name corresponding to the monitored task, and a first time when the task is monitored is monitored;
  • the predetermined task identification code generation rule includes acquiring a second name of the task to be executed in the task execution instruction, and a second time of receiving the task execution instruction, and generating the a second name and a task identification code of the second time;
  • the step of generating the task identification code of the task to be executed in the received task execution instruction according to the predetermined task identification code generation rule includes:
  • the task execution coding includes a first name corresponding to the monitored task, a first time when the task is monitored, and the predetermined database is analyzed according to the predetermined task allocation rule.
  • the step of performing the task execution coding and the task identification code, determining the service node that performs the task to be executed, or determining the instruction to each of the service nodes to refuse to execute the task to be executed specifically includes:
  • the request to execute the second task is simultaneously sent to each service node according to a preset time frequency (for example, every 10 minutes), and the service node is monitored. After responding to the request and starting to execute the second task, sending an instruction to the other service nodes except the service node that the second task is no longer executed;
  • the task execution coding further includes a monitored task execution state, where the task execution state includes execution, to be executed, and execution completion.
  • the distributed system includes four servers, namely server a, server b, server c, and server d, and all four servers start thread work (here, it is necessary to explain The time for starting the thread for the four servers is the same, but there is a slight difference in the time that each server starts the thread because the clock set by each server may not be synchronized, or the time used by the server to start the thread itself is different.
  • the task execution coding table stored in the predetermined database is expressed as follows:
  • the instruction to execute the second task is received.
  • the second name is minute statistics
  • the generated task identification code is: minute statistics 2017101115:40; after knowing, in the predetermined database
  • the first task whose stored task execution code is W1 and W2 does not have the second name (minute statistics) is then simultaneously directed to server a, server b, server c, according to a preset time frequency (for example, every 10 minutes).
  • the server d sends the task request of the minute statistics. If the server a responds to the minute statistical task request and the task execution state is waiting for execution, the server b also responds to the minute statistical task request and the task status is in execution, then the server b is determined to execute.
  • the task performs encoding and stores the generated task execution code into the predetermined database. Then the server b executes the minute statistics task, and the server a, the server c, and the server d no longer execute the minute statistics task.
  • the first time and the second time have the same time unit, for example, the first time and the second time may be all in minutes, or the first time And the second time may also be in seconds.
  • the above table is used to represent the following:
  • the electronic device proposed by the present application monitors the tasks performed by each service node of the distributed system and the execution state of the tasks by real-time or timing, and generates the distributed according to the monitored tasks and the execution state of the tasks.
  • the task execution coding of each service node of the system stores the task execution code in a predetermined database; after receiving the task execution instruction, generates a task execution instruction to be executed according to the predetermined task identification code generation rule. a task identification code of the task; analyzing the task execution code stored in the predetermined database and the task identification code according to a predetermined task assignment rule, determining a service node executing the task to be executed, or determining to each service node An instruction to refuse execution of the task to be executed is issued. It can prevent the problem of leakage execution or repeated execution of different service nodes, and improve the efficiency of distributed system task execution.
  • the distributed system task allocation program of the present application may be described by using a program module having the same function according to different functions implemented by the various parts thereof.
  • FIG. 2 is a schematic diagram of a program module of a distributed system task allocation program in an embodiment of the electronic device of the present application.
  • the distributed system task allocation program may be divided into a monitoring module 201, a generating module 202, and a determining module 203 according to different functions implemented by the various parts thereof.
  • the program module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, which is more suitable than the program to describe the execution process of the distributed system task assignment program in the electronic device 10.
  • the functions or operational steps implemented by the modules 201-203 are similar to the above, and are not described in detail herein, by way of example, for example:
  • the monitoring module 201 is configured to monitor a task performed by each service node of the distributed system and an execution state of the task, and generate a task execution code of each service node of the distributed system according to the monitored task and an execution state of the task, where The task execution code is stored in a predetermined database;
  • the generating module 202 is configured to: after receiving the new task execution instruction, generate a task identification code of the task to be executed in the received task execution instruction according to the predetermined task identification code generation rule;
  • the determining module 203 is configured to analyze the task execution code and the task identification code stored in the predetermined database according to a predetermined task allocation rule, determine a service node that executes the task to be executed, or determine to send to each service node The instruction to execute the task to be executed is rejected.
  • the present application also provides a distributed system task allocation method.
  • FIG. 3 it is a flowchart of an implementation of a preferred embodiment of the distributed system task allocation method of the present application. As can be seen from FIG. 3, when the distributed system task allocation method is executed by the processor 12, the following steps are implemented:
  • Step S301 Monitor a task performed by each service node of the distributed system and an execution state of the task, and generate a task execution code of each service node of the distributed system according to the monitored task and an execution state of the task, and execute the task.
  • the code is stored in a predetermined database;
  • the task execution coding includes a first name corresponding to the monitored task, and a first time when the task is monitored is monitored;
  • Step S302 after receiving a new task execution instruction, generating a task identification code of the task to be executed in the received task execution instruction according to the predetermined task identification code generation rule;
  • the predetermined task identification code generation rule includes acquiring a second name of the task to be executed in the task execution instruction, and a second time of receiving the task execution instruction, and generating the a second name and a task identification code of the second time;
  • Step S303 analyzing the task execution code and the task identification code stored in the predetermined database according to a predetermined task assignment rule, determining a service node that executes the task to be executed, or determining to refuse execution to each service node.
  • the step of generating the task identification code of the task to be executed in the received task execution instruction according to the predetermined task identification code generation rule includes:
  • the task execution coding includes a first name corresponding to the monitored task, a first time when the task is monitored, and the predetermined database is analyzed according to the predetermined task allocation rule.
  • the step of performing the task execution coding and the task identification code, determining the service node that performs the task to be executed, or determining the instruction to each of the service nodes to refuse to execute the task to be executed specifically includes:
  • the request to execute the second task is simultaneously sent to each service node according to a preset time frequency (for example, every 10 minutes), and the service node is monitored. After responding to the request and starting to execute the second task, sending an instruction to the other service nodes except the service node that the second task is no longer executed;
  • the task execution coding further includes a monitored task execution state, where the task execution state includes execution, to be executed, and execution completion.
  • the distributed system includes four servers, namely server a, server b, server c, and server d, and all four servers start thread work (here, it is necessary to explain The time for starting the thread for the four servers is the same, but there is a slight difference in the time that each server starts the thread because the clock set by each server may not be synchronized, or the time used by the server to start the thread itself is different.
  • the task execution coding table stored in the predetermined database is expressed as follows:
  • the second name is minute statistics
  • the generated task identification code is: minute statistics 2017101115:40; after knowing, in the predetermined database
  • the task of the stored task execution code whose first name is W1, W2 does not have the second name (minute statistics) is simultaneously directed to the server a, the server b, the server c, according to a preset time frequency (for example, every 10 minutes).
  • the server d sends the task request of the minute statistics. If the server a responds to the minute statistical task request and the task execution state is waiting for execution, the server b also responds to the minute statistical task request and the task status is in execution, then the server b is determined to execute.
  • the task performs encoding and stores the generated task execution code into the predetermined database. Then the server b executes the minute statistics task, and the server a, the server c, and the server d no longer execute the minute statistics task.
  • the first time and the second time have the same time unit; for example, the first time and the second time are all in minutes, or the first time and The second time may also be in seconds.
  • the above table is used to represent the following:
  • the distributed system task allocation method proposed by the present application generates the distribution according to the monitored task and the execution state of the task by monitoring the tasks performed by the service nodes of the distributed system and the execution state of the tasks.
  • the task execution coding of each service node of the system storing the task execution code in a predetermined database; and after receiving the task execution instruction, generating the received task execution instruction according to the predetermined task identification code generation rule Performing a task identification code of the task; analyzing the task execution code stored in the predetermined database and the task identification code according to a predetermined task assignment rule, determining a service node executing the task to be executed, or determining to each service
  • the node issues an instruction to refuse execution of the task to be executed. It can prevent the problem of leakage execution or repeated execution of different service nodes, and improve the efficiency of distributed system task execution.
  • the present application also provides a computer readable storage medium having a distributed system task allocation program stored thereon, the distributed system task allocation program being executed by the processor to:
  • the specific embodiment of the computer readable storage medium of the present application is substantially the same as the foregoing embodiments of the electronic device and the method for distributing an upgrade version based on load weight scheduling, and is not described herein.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Abstract

本申请提出一种电子装置、分布式系统任务分配方法及存储介质,通过监测分布式系统各个服务节点执行的任务以及所述任务的执行状态生成各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;在接收到任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码与所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。能够防止不同服务节点出现漏执行或者重复执行的问题,提高分布式系统任务执行的准确性。

Description

电子装置、分布式系统执行任务分配方法及存储介质
本申请要求于2018年02月01日提交中国专利局、申请号为201810102250.4、发明名称为“电子装置、分布式系统执行任务分配方法及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及分布式系统领域,尤其涉及一种电子装置、分布式系统任务分配方法及存储介质。
背景技术
目前,随着互联网技术的发展以及应用的普及,分布式系统的应用也越来越广泛,例如,企业的后台服务系统以及数据管理系统等。通常分布式系统为由多个服务器组成的服务器集群,服务器集群中的每台服务器可以作为一个服务节点来单独执行任务,实现了多任务同步执行,提高了执行任务的效率,但是分布式系统通常会出现多个服务节点故障事件,并且节点故障事件会相互重叠,导致不同服务节点执行的任务可能被漏执行或者重复执行的问题出现,显著影响任务执行的准确性。
发明内容
有鉴于此,本申请提出一种电子装置、分布式系统任务分配方法及存储介质,能够根据分布式系统中各个服务节点执行任务的任务识别编码及待执行任务的任务识别编码,防止不同服务节点出现漏执行或者重复执行的问题,提高分布式系统任务执行的准确性。
首先,为实现上述目的,本申请提出一种电子装置,所述电子装置包括存储器、及与所述存储器连接的处理器,所述处理器用于执行所述存储器上 存储的分布式系统任务分配程序,所述分布式系统任务分配程序被所述处理器执行时实现如下步骤:
A1、监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
A2、在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
A3、根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
此外,为实现上述目的,本申请还提供一种分布式系统任务分配方法,该方法包括如下步骤:
S1、监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
S2、在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
S3、根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有分布式系统任务分配程序,所述分布式系统任务分配程序可被至少一个处理器执行,以使所述至少一个处理器执行如下步骤:
监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
相较于现有技术,本申请所提出的电子装置、分布式系统任务分配方法及存储介质,通过监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;在接收到任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。能够根据分布式系统中各个服务节点执行任务的任务识别编码及待执行任务的任务识别编码,防止不同服务节点出现漏执行或者重复执行的问题,提高分布式系统任务执行的准确性。
附图说明
图1是本申请提出的电子装置一可选的硬件架构的示意图;
图2是本申请电子装置一实施例中分布式系统任务分配程序的程序模块示意图;
图3是本申请分布式系统任务分配方法较佳实施例的实施流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
参阅图1所示,是本申请提出的电子装置一可选的硬件架构示意图。本实施例中,电子装置10可包括,但不仅限于,可通过通信总线14相互通信连接存储器11、处理器12、网络接口13。需要指出的是,图1仅示出了具有组件11-14的电子装置10,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
其中,存储器11至少包括一种类型的计算机可读存储介质,计算机可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器11可以是电子装置10的内部存储单元,例如电子装置10的硬盘或内存。在另一些实施例中,存储器11也可以是电子装置10的外包存储设备,例如电子装置10上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器11还可以既包括电 子装置10的内部存储单元也包括其外包存储设备。本实施例中,存储器11通常用于存储安装于电子装置10的操作系统和各类应用软件,例如分布式系统任务分配程序等。此外,存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。处理器12通常用于控制电子装置10的总体操作。本实施例中,处理器12用于运行存储器11中存储的程序代码或者处理数据,例如运行的分布式系统任务分配程序等。
网络接口13可包括无线网络接口或有线网络接口,网络接口13通常用于在电子装置10与其他电子设备之间建立通信连接。
通信总线14用于实现组件11-13之间的通信连接。
图1仅示出了具有组件11-14以及分布式系统任务分配程序的电子装置10,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,电子装置10还可以包括用户接口(图1中未示出),用户接口可以包括显示器、输入单元比如键盘,其中,用户接口还可以包括标准的有线接口、无线接口等。
可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED触摸器等。进一步地,显示器也可称为显示屏或显示单元,用于显示在电子装置10中处理信息以及用于显示可视化的用户界面。
在一实施例中,存储器11中存储的分布式系统任务分配程序被处理器12执行时,实现如下操作:
A、监测分布式系统各个服务节点执行的任务以及所述任务的执行状态, 根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
在本实施例中,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;
B、在接收到任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
在本实施例中,所述预先确定的任务识别编码生成规则包括获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间,生成包括所述第二名称及所述第二时间的任务识别编码;
C、根据预先确定的任务分配分析规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
在本实施例中,所述根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码的步骤,具体包括:
获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间;
根据所述第二名称及所述第二时间生成包括所述第二名称及所述第二时间的任务识别编码。
进一步地,在本实施例中,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
将所述第二名称分别与所述第一名称进行匹配,若有所述第一名称与所述第二名称相匹配,则获取相匹配的第一名称对应的任务执行编码中的第一时间;计算该第一时间与所述第二时间的时间差值,若所述时间差值小于预 设的时间差阈值(例如3分钟),则向各个服务节点发出拒绝执行所述待执行任务的指令;
若没有第一名称与所述第二名称相匹配,则根据预设的时间频率(例如每隔10分钟)同时向各个服务节点发送执行所述第二任务的请求,并在监测到有服务节点响应该请求并开始执行所述第二任务后,向除该服务节点之外的其他各个服务节点发送不再执行所述第二任务的指令;
根据所述预先确定的任务执行编码生成规则生成所述第二任务对应的任务执行编码,将生成的任务执行编码存入所述预先确定的数据库中。
在本实施例中,所述任务执行编码还包括监测到的任务执行状态,所述任务执行状态包括执行中、待执行、以及执行完成。
在本申请的另一实施例中,例如,假设分布式系统包括4台服务器,分别为服务器a、服务器b、服务器c、以及服务器d,且4台服务器都启动线程工作(这里需要说明的是,4台服务器启动线程的时间是相同的,但是由于各个服务器本身设置的时钟有可能不同步,或者服务器启动线程所用的时间本身存在差异等原因,导致各台服务器启动线程的时间存在微小差异),实时监测到的该4台服务器执行的任务以及任务的执行状态,并存入预先确定的数据库中的任务执行编码为:W12017101115:20正在执行中,W22017101115:40已响应请求,等待执行中,在本实施例中,为了理解方便,将存入预先确定的数据库中的任务执行编码用表格表示如下:
任务名称 任务时间 任务状态
W1 2017101115:20 执行中
W2 2017101115:40 待执行
假设在2017年10月11日15点40分钟接收到执行第二任务的指令,第二名称为分钟统计,则生成的任务识别编码为:分钟统计2017101115:40;经过可知,预先确定的数据库中存储的任务执行编码的第一名称为W1、W2不存在第二名称(分钟统计)的任务,则按照预设的时间频率(例如每隔10 分钟)同时向服务器a、服务器b、服务器c、以及服务器d发送该分钟统计的任务请求,若监测到服务器a响应分钟统计任务请求且任务执行状态为等待执行,服务器b也响应分钟统计的任务请求且任务状态为执行中,则确定服务器b执行所述分钟统计的任务,并向所述服务器a、所述服务器c、以及所述服务器d发出不再执行所述分钟统计任务的指令,根据预先确定的任务执行编码生成规则生成第二任务对应的任务执行编码,并将生成的任务执行编码存入所述预先确定的数据库。则服务器b执行所述分钟统计任务,且服务器a、服务器c、和服务器d不再执行所述分钟统计任务。
在本实施例中,所述第一时间与所述第二时间具有相同的时间单位,例如所述第一时间以及所述第二时间可以是均以分钟为单位,或者,所述第一时间以及所述第二时间还可以均以秒为单位。
在本实施例中,在所述预先确定的数据库中存入生成的任务执行编码后,用上述表格形象表示如下:
任务名称 任务时间 任务状态
分钟统计任务 20171011 15:20 执行中
W1 2017101115:20 执行中
W2 2017101115:40 待执行
由上述事实施例可知,本申请提出的电子装置通过实时或定时监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;在接收到任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码与所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。能够防止不同服务节点出现漏执行或者重复执行的问题,提高分布式系统任 务执行的效率。
进一步需要说明的是,本申请的分布式系统任务分配程序依据其各部分所实现的功能不同,可用具有相同功能的程序模块进行描述。
请参阅图2所示,是本申请电子装置一实施例中分布式系统任务分配程序的程序模块示意图。本实施例中,分布式系统任务分配程序依据其各部分所实现的功能的不同,可以被分割成监测模块201、生成模块202、确定模块203。由上面的描述可知,本申请所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序更适合于描述分布式系统任务分配程序在电子装置10中的执行过程。所述模块201-203所实现的功能或操作步骤均与上文类似,此处不再详述,示例性地,例如其中:
监测模块201用于监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
生成模块202用于在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
确定模块203用于根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
此外,本申请还提出一种分布式系统任务分配方法,请参阅图3所示,为本申请分布式系统任务分配方法较佳实施例的实施流程图。由图3可知,所述分布式系统任务分配方法被所述处理器12执行时实现包括如下步骤:
步骤S301,监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
在本实施例中,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;
步骤S302,在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
在本实施例中,所述预先确定的任务识别编码生成规则包括获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间,生成包括所述第二名称及所述第二时间的任务识别编码;
步骤S303,根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
在本实施例中,所述根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码的步骤,具体包括:
获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间;
根据所述第二名称及所述第二时间生成包括所述第二名称及所述第二时间的任务识别编码。
进一步地,在本实施例中,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
将所述第二名称分别与所述第一名称进行匹配,若有所述第一名称与所述第二名称相匹配,则获取相匹配的第一名称对应的任务执行编码中的第一时间;计算该第一时间与所述第二时间的时间差值,若所述时间差值小于预设的时间差阈值(例如3分钟),则向各个服务节点发出拒绝执行所述待执行任务的指令;
若没有第一名称与所述第二名称相匹配,则根据预设的时间频率(例如每隔10分钟)同时向各个服务节点发送执行所述第二任务的请求,并在监测到有服务节点响应该请求并开始执行所述第二任务后,向除该服务节点之外的其他各个服务节点发送不再执行所述第二任务的指令;
根据所述预先确定的任务执行编码生成规则生成所述第二任务对应的任务执行编码,将生成的任务执行编码存入所述预先确定的数据库中。
在本实施例中,所述任务执行编码还包括监测到的任务执行状态,所述任务执行状态包括执行中、待执行、以及执行完成。
在本申请的另一实施例中,例如,假设分布式系统包括4台服务器,分别为服务器a、服务器b、服务器c、以及服务器d,且4台服务器都启动线程工作(这里需要说明的是,4台服务器启动线程的时间是相同的,但是由于各个服务器本身设置的时钟有可能不同步,或者服务器启动线程所用的时间本身存在差异等原因,导致各台服务器启动线程的时间存在微小差异),实时监测到的该4台服务器执行的任务以及任务的执行状态,并存入预先确定的数据库中的任务执行编码为:W12017101115:20正在执行中,W22017101115:40已响应请求,等待执行中,在本实施例中,为了理解方便,将存入预先确定的数据库中的任务执行编码用表格表示如下:
任务名称 任务时间 任务状态
W1 2017101115:20 执行中
W2 2017101115:40 待执行
假设在2017年10月11日15点40分钟接收到执行第二任务的指令,第二名称为分钟统计,则生成的任务识别编码为:分钟统计2017101115:40;经过可知,预先确定的数据库中存储的任务执行编码的第一名称为W1、W2不存在第二名称(分钟统计)的任务,则按照预设的时间频率(例如每隔10分钟)同时向服务器a、服务器b、服务器c、以及服务器d发送该分钟统计的任务请求,若监测到服务器a响应分钟统计任务请求且任务执行状态为等 待执行,服务器b也响应分钟统计的任务请求且任务状态为执行中,则确定服务器b执行所述分钟统计的任务,并向所述服务器a、所述服务器c、以及所述服务器d发出不再执行所述分钟统计任务的指令,根据预先确定的任务执行编码生成规则生成第二任务对应的任务执行编码,并将生成的任务执行编码存入所述预先确定的数据库。则服务器b执行所述分钟统计任务,且服务器a、服务器c、和服务器d不再执行所述分钟统计任务。
在本实施例中,所述第一时间与所述第二时间具有相同的时间单位;例如,所述第一时间以及所述第二时间均以分钟为单位,或者,所述第一时间以及所述第二时间还可以是均以秒为单位。
在本实施例中,在所述预先确定的数据库中存入生成的任务执行编码后,用上述表格形象表示如下:
任务名称 任务时间 任务状态
分钟统计任务 20171011 15:20 执行中
W1 2017101115:20 执行中
W2 2017101115:40 待执行
由上述事实施例可知,本申请提出的分布式系统任务分配方法通过监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;在接收到任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码与所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。能够防止不同服务节点出现漏执行或者重复执行的问题,提高分布式系统任务执行的效率。
此外,本申请还提出一种计算机可读存储介质,所述计算机可读存储介 质上存储有分布式系统任务分配程序,所述分布式系统任务分配程序被处理器执行时实现如下操作:
监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
本申请计算机可读存储介质具体实施方式与上述电子装置以及基于负载权重调度发布升级版本应用的方法各实施例基本相同,在此不作累述。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储器、及与所述存储器连接的处理器,所述处理器用于执行所述存储器上存储的分布式系统任务分配程序,所述分布式系统任务分配程序被所述处理器执行时实现如下步骤:
    A1、监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
    A2、在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
    A3、根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
  2. 如权利要求1所述的电子装置,其特征在于,所述根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码的步骤,具体包括:
    获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间;
    根据所述第二名称及所述第二时间生成包括所述第二名称及所述第二时间的任务识别编码。
  3. 如权利要求2所述的电子装置,其特征在于,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    将所述第二名称分别与所述第一名称进行匹配,若有第一名称与所述第 二名称相匹配,则获取相匹配的第一名称对应的任务执行编码中的第一时间;
    计算该第一时间与所述第二时间的时间差值,若所述时间差值小于预设的时间差阈值,则向各个服务节点发出拒绝执行所述待执行任务的指令;
    若没有第一名称与所述第二名称相匹配,则根据预设的时间频率同时向各个服务节点发送执行所述第二任务的请求,并在监测到有服务节点响应该请求并开始执行所述第二任务后,向除该服务节点之外的其他各个服务节点发送不再执行所述第二任务的指令;
    根据所述预先确定的任务执行编码生成规则生成所述第二任务对应的任务执行编码,将生成的任务执行编码存入所述预先确定的数据库中。
  4. 如权利要求2所述的电子装置,其特征在于,所述任务执行编码还包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行,则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定向该服务节点发送执行所述待执行任务的指令。
  5. 如权利要求3所述的电子装置,其特征在于,所述任务执行编码还包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行, 则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定向该服务节点发送执行所述待执行任务的指令。
  6. 如权利要求5所述的电子装置,其特征在于,所述第一时间与所述第二时间具有相同的时间单位。
  7. 如权利要求3所述的电子装置,其特征在于,所述第一时间与所述第二时间具有相同的时间单位。
  8. 一种分布式系统任务分配方法,其特征在于,所述方法包括如下步骤:
    S1、监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
    S2、在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
    S3、根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
  9. 如权利要求8所述的分布式系统任务分配方法,其特征在于,所述根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码的步骤,具体包括
    获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间;
    根据所述第二名称及所述第二时间生成包括所述第二名称及所述第二时间的任务识别编码。
  10. 如权利要求9所述的分布式系统任务分配方法,其特征在于,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务 执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    将所述第二名称分别与所述第一名称进行匹配,若有第一名称与所述第二名称相匹配,则获取相匹配的第一名称对应的任务执行编码中的第一时间;
    计算该第一时间与所述第二时间的时间差值,若所述时间差值小于预设的时间差阈值,则向各个服务节点发出拒绝执行所述待执行任务的指令;
    若没有第一名称与所述第二名称相匹配,则根据预设的时间频率同时向各个服务节点发送执行所述第二任务的请求,并在监测到有服务节点响应该请求并开始执行所述第二任务后,向除该服务节点之外的其他各个服务节点发送不再执行所述第二任务的指令;
    根据所述预先确定的任务执行编码生成规则生成所述第二任务对应的任务执行编码,将生成的任务执行编码存入所述预先确定的数据库中。
  11. 如权利要求9所述的分布式任务系统分配方法,其特征在于,所述任务执行编码包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行,则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定向该服务节点发送执行所述待执行任务的指令。
  12. 如权利要求10所述的分布式任务系统分配方法,其特征在于,所述任务执行编码包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行 所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行,则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定向该服务节点发送执行所述待执行任务的指令。
  13. 如权利要求12所述的分布式任务系统分配方法,其特征在于,所述第一时间与所述第二时间具有相同的时间单位。
  14. 如权利要求10所述的分布式任务系统分配方法,其特征在于,所述第一时间与所述第二时间具有相同的时间单位。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有分布式系统任务分配程序,所述分布式任务系统分配程序可被至少一个处理器执行,以使所述至少一个处理器执行如下步骤:
    监测分布式系统各个服务节点执行的任务以及所述任务的执行状态,根据监测到的任务以及任务的执行状态生成所述分布式系统各个服务节点的任务执行编码,将所述任务执行编码存储在预先确定的数据库中;
    在接收到新的任务执行指令后,根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码;
    根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述根据预先确定的任务识别编码生成规则生成接收到的任务执行指令中待执行任务的任务识别编码的步骤,具体包括
    获取所述任务执行指令中待执行任务的第二名称、及接收到所述任务执行指令的第二时间;
    根据所述第二名称及所述第二时间生成包括所述第二名称及所述第二时间的任务识别编码。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述任务执行编码包括监测到的任务对应的第一名称、监测到执行任务的第一时间;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    将所述第二名称分别与所述第一名称进行匹配,若有第一名称与所述第二名称相匹配,则获取相匹配的第一名称对应的任务执行编码中的第一时间;
    计算该第一时间与所述第二时间的时间差值,若所述时间差值小于预设的时间差阈值,则向各个服务节点发出拒绝执行所述待执行任务的指令;
    若没有第一名称与所述第二名称相匹配,则根据预设的时间频率同时向各个服务节点发送执行所述第二任务的请求,并在监测到有服务节点响应该请求并开始执行所述第二任务后,向除该服务节点之外的其他各个服务节点发送不再执行所述第二任务的指令;
    根据所述预先确定的任务执行编码生成规则生成所述第二任务对应的任务执行编码,将生成的任务执行编码存入所述预先确定的数据库中。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述任务执行编码包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行,则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定 向该服务节点发送执行所述待执行任务的指令。
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,所述任务执行编码包括执行任务的状态,所述执行任务的状态包括任务执行中、任务待执行、以及任务执行完成;所述根据预先确定的任务分配规则分析所述预先确定的数据库中存储的任务执行编码及所述任务识别编码,确定执行所述待执行任务的服务节点,或者确定向各个服务节点发出拒绝执行所述待执行任务的指令的步骤,具体包括:
    若检测到有服务节点的执行任务的状态为任务执行中或者任务待执行,则确定向该服务节点发出拒绝执行所述待执行任务的指令;
    或者,若检测到有服务节点的执行任务的状态为任务执行完成,则确定向该服务节点发送执行所述待执行任务的指令。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述第一时间与所述第二时间具有相同的时间单位。
PCT/CN2018/089873 2018-02-01 2018-06-05 电子装置、分布式系统执行任务分配方法及存储介质 WO2019148728A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810102250.4A CN108446171B (zh) 2018-02-01 2018-02-01 电子装置、分布式系统执行任务分配方法及存储介质
CN201810102250.4 2018-02-01

Publications (1)

Publication Number Publication Date
WO2019148728A1 true WO2019148728A1 (zh) 2019-08-08

Family

ID=63191699

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089873 WO2019148728A1 (zh) 2018-02-01 2018-06-05 电子装置、分布式系统执行任务分配方法及存储介质

Country Status (2)

Country Link
CN (1) CN108446171B (zh)
WO (1) WO2019148728A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032188A (zh) * 2019-12-24 2021-06-25 腾讯科技(深圳)有限公司 确定主服务器的方法、装置、服务器及存储介质
CN114327819A (zh) * 2021-12-24 2022-04-12 北京百度网讯科技有限公司 一种任务管理方法、装置、设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245009B (zh) * 2019-05-14 2024-03-08 平安科技(深圳)有限公司 周期任务分配方法、装置、计算机设备和存储介质
CN112085346A (zh) * 2020-08-18 2020-12-15 远光软件股份有限公司 基于日历的安全检查工作展示方法、装置及电子设备
CN112099958B (zh) * 2020-11-17 2021-03-02 深圳壹账通智能科技有限公司 分布式多任务管理方法、装置、计算机设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360310A (zh) * 2011-09-28 2012-02-22 中国电子科技集团公司第二十八研究所 一种分布式系统环境下的多任务进程监视方法和监视系统
US20140143787A1 (en) * 2010-08-30 2014-05-22 Adobe Systems Incorporated Methods and apparatus for resource management in cluster computing
CN104503845A (zh) * 2015-01-14 2015-04-08 北京邮电大学 一种任务分发方法和系统
CN106850747A (zh) * 2016-12-23 2017-06-13 上海网达软件股份有限公司 一种分布式实时转码系统的转码节点管理系统及方法

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2007203220A1 (en) * 2006-07-31 2008-02-14 Accenture Global Services Limited Work allocation model
WO2014062637A2 (en) * 2012-10-15 2014-04-24 Hadapt, Inc. Systems and methods for fault tolerant, adaptive execution of arbitrary queries at low latency
GB2507338A (en) * 2012-10-26 2014-04-30 Ibm Determining system topology graph changes in a distributed computing system
CN104468174B (zh) * 2013-09-25 2017-10-13 北京新媒传信科技有限公司 一种集群服务器执行任务的方法和装置
CN104123186B (zh) * 2013-10-15 2015-09-16 腾讯科技(深圳)有限公司 业务分配方法及装置
CN107329820B (zh) * 2016-04-28 2019-12-20 杭州海康威视数字技术股份有限公司 一种用于集群系统的任务处理方法及装置
CN106227596A (zh) * 2016-07-13 2016-12-14 百度在线网络技术(北京)有限公司 用于任务调度服务器的任务监控方法和装置
KR101795696B1 (ko) * 2016-07-14 2017-11-09 주식회사 코인플러그 메신저 서비스를 통하여 송수신되는 데이터에 대한 기록 및 검증 서비스를 제공하는 방법, 및 이를 이용한 서버

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143787A1 (en) * 2010-08-30 2014-05-22 Adobe Systems Incorporated Methods and apparatus for resource management in cluster computing
CN102360310A (zh) * 2011-09-28 2012-02-22 中国电子科技集团公司第二十八研究所 一种分布式系统环境下的多任务进程监视方法和监视系统
CN104503845A (zh) * 2015-01-14 2015-04-08 北京邮电大学 一种任务分发方法和系统
CN106850747A (zh) * 2016-12-23 2017-06-13 上海网达软件股份有限公司 一种分布式实时转码系统的转码节点管理系统及方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032188A (zh) * 2019-12-24 2021-06-25 腾讯科技(深圳)有限公司 确定主服务器的方法、装置、服务器及存储介质
CN113032188B (zh) * 2019-12-24 2023-11-03 腾讯科技(深圳)有限公司 确定主服务器的方法、装置、服务器及存储介质
CN114327819A (zh) * 2021-12-24 2022-04-12 北京百度网讯科技有限公司 一种任务管理方法、装置、设备及存储介质
CN114327819B (zh) * 2021-12-24 2023-02-03 北京百度网讯科技有限公司 一种任务管理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN108446171B (zh) 2022-07-08
CN108446171A (zh) 2018-08-24

Similar Documents

Publication Publication Date Title
WO2019148728A1 (zh) 电子装置、分布式系统执行任务分配方法及存储介质
WO2019140828A1 (zh) 电子装置、分布式系统日志查询方法及存储介质
CN108462760B (zh) 电子装置、集群访问域名自动生成方法及存储介质
WO2019148727A1 (zh) 电子装置、基于redis的异常预警方法及存储介质
WO2019205371A1 (zh) 服务器、消息分配的方法及存储介质
CN108874558B (zh) 分布式事务的消息订阅方法、电子装置及可读存储介质
US20220058104A1 (en) System and method for database replication benchmark testing using a pipeline-based microservices model
US7624309B2 (en) Automated client recovery and service ticketing
US20190158626A1 (en) Method, apparatus and computer readable storage medium for processing service
US10055436B2 (en) Alert management
WO2019136812A1 (zh) 电子装置、数据调用日志生成及查询方法及存储介质
EP4113299A2 (en) Task processing method and device, and electronic device
CN110222119B (zh) 一种异构数据库的数据转换同步方法、设备及存储介质
CN110555150B (zh) 一种数据监控方法、装置、设备和存储介质
WO2020224100A1 (zh) 区块链配置文件的处理装置、系统、方法及存储介质
US11537476B2 (en) Database management system backup and recovery management
WO2019169763A1 (zh) 电子装置、业务系统风险控制方法及存储介质
CN114090113B (zh) 数据源处理插件动态加载的方法、装置、设备及存储介质
CN111459629A (zh) 基于Azkaban的项目运行方法、装置及终端设备
WO2019169771A1 (zh) 电子装置、访问指令信息获取方法及存储介质
CN113238815B (zh) 一种接口访问控制方法、装置、设备及存储介质
CN113220342A (zh) 中心化配置方法、装置、电子设备及存储介质
CN110033242B (zh) 工作时间确定方法、装置、设备和介质
CN113419949B (zh) 数据处理的异常检测方法、装置、设备及存储介质
CN115499493A (zh) 异步事务处理方法、装置、存储介质及计算机设备

Legal Events

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

Ref document number: 18904419

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.11.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18904419

Country of ref document: EP

Kind code of ref document: A1