WO2019019400A1 - 任务分布式处理方法、装置、存储介质和服务器 - Google Patents
任务分布式处理方法、装置、存储介质和服务器 Download PDFInfo
- Publication number
- WO2019019400A1 WO2019019400A1 PCT/CN2017/104970 CN2017104970W WO2019019400A1 WO 2019019400 A1 WO2019019400 A1 WO 2019019400A1 CN 2017104970 W CN2017104970 W CN 2017104970W WO 2019019400 A1 WO2019019400 A1 WO 2019019400A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- task
- terminal
- processing
- server
- distributed
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
Definitions
- the present application relates to the field of data processing technologies, and in particular, to a task distributed processing method, apparatus, storage medium, and server.
- the distributed computing system is basically set up on the server cluster, and the tasks to be processed are allocated to the respective nodes on the server for processing according to Zookeeper, so that the processing of the task and the upper allocation are optimized, and the server is improved.
- Resource utilization efficiency the resources of the server are limited. When the amount of data to be processed is large, the task is more, and even exceeds the processing load of the server, the task efficiency of the traditional method is not high.
- a task distributed processing method, apparatus, storage medium, and server are provided.
- a task distributed processing method is applied to a distributed task scheduling system, where the distributed task scheduling system includes a server and a plurality of terminals, wherein the server is a master node in the distributed task scheduling system, and each The terminal is an execution node in the distributed task scheduling system;
- the method includes: the server receiving a task processing request sent by the terminal; selecting at least one task to be assigned, assigning the selected task to the terminal for processing; and receiving a task processing result fed back by the terminal; Modifying the task status of the corresponding task according to the task processing result.
- a task distributed processing device for use in a distributed task scheduling system, comprising: a request receiving module, configured to receive a task processing request sent by a terminal, where the terminal is an execution node in the distributed task scheduling system; a distribution module, configured to select at least one task to be assigned, to assign the selected task to the terminal for processing; and a task state modification module, configured to receive a task processing result fed back by the terminal; Modify the task status of the corresponding task.
- One or more computer readable non-volatile storage media storing computer readable instructions, when executed by one or more processors, causing the one or more processors to perform a task a distributed processing method, the method being applied to a distributed task scheduling system, the distributed task scheduling system comprising a server and a plurality of terminals, wherein the server is a master node in the distributed task scheduling system, each The terminal is an execution node in the distributed task scheduling system; when the computer readable instructions are executed by one or more processors, causing the one or more processors to perform the steps of: receiving the terminal to send The task processing request; selecting at least one task to be assigned, assigning the selected task to the terminal for processing; receiving the task processing result fed back by the terminal; and modifying the task status of the corresponding task according to the task processing result.
- a server for use in a distributed task scheduling system includes a memory and a processor, wherein the memory stores computer readable instructions, the distributed task scheduling system includes the server and a plurality of terminals, and the server is a master node in the distributed task scheduling system, each of the terminals being an execution node in the distributed task scheduling system; when the instructions are executed by the processor, causing the processor to perform the following steps Receiving a task processing request sent by the terminal; selecting at least one task to be assigned, and assigning the selected task to the terminal for processing;
- 1 is an application environment diagram of a task distributed processing method in an embodiment
- FIG. 2 is a flow chart of a task distributed processing method in an embodiment
- FIG. 3 is an application environment diagram of a distributed processing method for Crash parsing tasks in an embodiment.
- FIG. 5 is a structural block diagram of a task distributed processing apparatus in an embodiment
- FIG. 6 is a structural block diagram of a task distributed processing apparatus in another embodiment.
- Figure 7 is a diagram showing the internal structure of a server in one embodiment.
- the task distributed processing method provided by the embodiment of the present application can be applied to the application environment shown in FIG. 1 .
- the server 110 is connected to a plurality of terminals 120.
- the terminal can be any one of a notebook computer, a desktop computer, a tablet, and the like.
- Each terminal 120 can send a task processing request to the server.
- the server 110 may select at least one task to be assigned according to the received task processing request, and allocate the selected task to the terminal 120 that sends the task processing request for processing.
- the terminal 120 may perform an analysis process on the received task, and send the task processing result to the server 110.
- the server 110 modifies the task status of the corresponding task according to the received task processing result. Thereby, distributed processing of tasks through the terminal is realized.
- a task distributed processing method is provided, which can be applied to the application environment shown in FIG. 1, and specifically includes the following steps:
- Step S202 Receive a task processing request sent by the terminal.
- the terminal is an employee terminal or other belonging terminal in a company or a group corresponding to the task to be processed.
- Each terminal may be a task execution node in a DTS system (Distributed Task Scheduler).
- the DTS system is a general-purpose, plug-in, distributed extended execution framework that supports distributed processing and parsing of tasks. This task refers to a large number of tasks that each task can be distributed, including application compilation tasks, log report statistics tasks, Crash resolution tasks, and so on.
- Crash parsing task Take the Crash parsing task as an example to illustrate that the Crash can report the Crash stack information reported by an app (application), and can analyze one or more adaptive Crash stack information to be parsed as a Crash. task. The more Crash stack information is collected, the more Crash parsing tasks are pending.
- the terminal may send a task processing request to the server in the DTS system, where the task processing request carries the terminal identifier.
- the server is the master node in the DTS system and is responsible for managing tasks and all execution nodes.
- the management of the task includes receiving, storing, distributing, recording, and monitoring tasks; the management of the node includes receiving the heartbeat packet of the executing node, monitoring the working state of the executing node, and the like.
- the server can receive the task processing request sent by each terminal in real time, and obtain the terminal identifier in the terminal, so that the corresponding terminal is determined according to the terminal identifier.
- Step S204 Select at least one task to be assigned, and assign the selected task to the terminal for processing.
- the server may select a preset number of tasks from the tasks to be allocated in the database, and send the task information of the selected task to the terminal, so that the terminal processes the task.
- the status of the task includes the status to be assigned, in process, successful in processing, and failed in processing.
- the preset number may be a preset number or a plurality of suitable numbers, so that the terminal can process multiple tasks at the same time, thereby improving the processing efficiency.
- the manner of selecting the task to be assigned may include a random selection method and a manner of selecting according to the time sequence generated by the task.
- the terminal may receive the allocated task, parse the task according to the corresponding task resolution manner, and send the processing result to the server.
- the method further comprises: modifying the state of the selected task to be processed.
- Step S206 Receive a task processing result fed back by the terminal, and modify a task state of the corresponding task according to the task processing result.
- the server may receive the task processing result that is fed back after the terminal processes the task.
- the task processing results include task processing success and task processing failure.
- the server may modify the task status of the corresponding assigned task according to the task processing result. For example, when the task is successfully processed, its task status is modified to be processed successfully. If the processing fails, its task status is changed to processing failure.
- each terminal may be a terminal that is independent of each other in task processing. That is, in the process of task processing, the terminals are processed independently of each other, and there is no connection relationship. In the DTS system, since each terminal is only connected to the server, the independence of the task processing can be maintained to improve the efficiency of the terminal for task processing.
- the task processing request sent by the terminal is received; at least one task to be assigned is selected, and the selected task is allocated to the terminal for processing; then the task processing result fed back by the terminal is received; and the corresponding task is modified according to the task processing result.
- Task status the terminal is implemented as a task execution node in the DTS system, and the task is processed.
- the greater the number of terminals the more distributed processing tasks that can be allocated on the server in a timely manner. Therefore, the server is not required to be added, or the server is expanded, and a plurality of tasks are allocated to each existing terminal for processing by using the existing terminal, thereby improving the efficiency of task processing.
- the selecting the at least one task to be assigned includes: selecting at least one task identifier to be assigned; reading the task corresponding to each task identifier from the primary database, when reading from the primary database fails When the task corresponding to each task ID is read from the standby database.
- the task identifier is used to uniquely identify the corresponding task, and the task corresponding to the task
- the information is associated with a number of characters, letters, and the like of the preset number of digits.
- the task ID can be the task number.
- two databases are set in advance, which are a primary database and a standby database, respectively.
- the task information of each unprocessed task is stored in both the primary database and the standby database, and can be queried from the primary database or the standby database according to the task number.
- the primary database is the default priority database and the standby database is the standby database.
- the server may first query the corresponding task from the primary database according to the task identifier, and read the task information. When the reading from the primary database fails, the task information of the corresponding task is read from the standby database, so that the success rate of the extraction of the task can be further improved.
- the task to be allocated can be read from the standby database when the primary database fails. It can prevent the database from malfunctioning, resulting in a backlog of pending tasks and further impact.
- the task processing request carries the Internet Protocol address of the terminal; and the selected task is allocated to the terminal for processing, including: assigning the selected task to the terminal for processing according to the Internet Protocol address.
- the Internet Protocol Address is the local IP address of the terminal. Because the terminal is an employee terminal and needs to handle other work items, there may be operations such as shutting down, restarting, disconnecting the network, and switching the network at any time, so that the IP address or other parameter characteristics of the terminal change. Compared to the traditional zookeeper, you need to configure the IP and port of all the execution nodes before starting.
- the IP address of the terminal is carried in the task processing request, so that the server can send the assigned task to the IP address, and the IP address of the instant terminal is dynamically changed, and the changed IP address can also be used according to the changed IP address.
- the task information is successfully sent to the terminal, and the terminal performs task processing.
- the method includes: receiving a heartbeat packet sent by the terminal, to determine, according to the heartbeat packet, that the terminal is processing the selected task.
- the terminal may serve the service according to a preset frequency after receiving the assigned task.
- the heartbeat packet is sent, and the heartbeat packet includes the IP address of the terminal, so that the server can identify the corresponding IP address according to each heartbeat packet received, so that the corresponding terminal can be determined.
- the server can know that the corresponding terminal is processing the assigned task, thereby implementing monitoring of task processing for each terminal.
- the method includes: detecting whether the task processing result is received within a preset duration, and if not, reassigning the selected task to another sending task processing request.
- the terminal is processed.
- the server further sets a duration threshold, that is, the preset duration described above.
- the duration threshold is a duration for judging whether the processing of the task is abnormal.
- the duration threshold can be set according to the historical average time required to complete the processing of the task. It may be a length of time that exceeds the average length. For example, if the average duration of processing a task is 5 minutes, the duration threshold can be set to 8 minutes or 10 minutes.
- the server can start the processing time of the real-time statistical task, and compare the processing duration and the preset duration. When the processing duration reaches the preset duration, the server does not receive the task processing result sent by the terminal. Then, it is determined that the processing of the task by the terminal fails. And re-set the task status of the assigned task to the status to be assigned, and re-allocate the task according to the received task processing request of other terminals.
- the success rate of the task processing completion may be further mentioned.
- the task distributed processing method further includes: calculating a number of allocations of the selected tasks; and when the number of allocations reaches a preset number of times, if the task processing result is not received within the preset duration, or is received If the task processing fails the task processing result, the task status of the selected task is modified to handle the abnormal state.
- the server may further count the number of allocations of the reassigned tasks, and compare the number of allocations with the preset number of times.
- the preset number of times may be a suitable number of times, for example, may be 3 times or 5 times.
- the task When a task that has been assigned a preset number of times occurs, the task has not been successfully processed.
- the result of the task processing may be caused by problems in the task itself and difficult to be successfully processed. Therefore, if it can be determined that the task has failed to be processed multiple times, the reallocation of the task can be terminated, and the state of the task is set to a state in which the abnormality is handled.
- the server may summarize task information that is set to handle the abnormal state, send the task information to the corresponding administrator terminal, and cause the corresponding administrator to further detect the task.
- the aggregation may be performed according to a preset summary frequency, for example, by frequency once every hour.
- the task can be prevented from being redistributed indefinitely, thereby wasting resources of the terminal and the server.
- the foregoing method further includes: counting the number of tasks completed by each terminal, and sorting the terminals according to the number of completed tasks.
- the server can count the number of tasks completed by each terminal within a preset time period. Specifically, the number of task processing results successfully processed by the terminal with the same terminal identifier may be counted according to the terminal identifier carried in the received task processing request.
- the terminal identifier may be information such as a user name that can uniquely identify the identity of the terminal.
- the number of tasks completed by each terminal can be counted on a per-weekly or daily basis, and sorted according to the number of completed tasks.
- the sorting information includes information such as a terminal identifier, a number of completed tasks, and a ranking.
- the ranking information may be sent to the corresponding terminal, so that the terminal can know the number of tasks and rankings that are completed in the preset time period.
- the server may further select, from the sorting, the number of tasks that are more than the preset number, or the number of completed tasks exceeds the preset number, and broadcast the reward information to the selected terminal to each terminal to further improve each The enthusiasm of end users to participate in task processing.
- an application environment diagram of a distributed processing method for a Crash parsing task in an embodiment includes a server 110, a terminal 120, a database 130, and a Crash parsing platform.
- the server 110 includes a primary server 112 and a backup server 112.
- the database also includes a primary database 132 and a standby database 134.
- the Crash parsing platform is a Crash data provider.
- the Crash parsing task needs to obtain and upload a Crash file.
- the Crash parsing platform is responsible for providing the Crash source data and receiving the parsed result upload.
- Each terminal 120 can send a task processing request to the server 110, and the server 110 selects at least one task to be assigned from the database 130 according to the received task processing request, and allocates to the interface defined by the terminal 110 to the task.
- the terminal 110 can be an interface implemented by http.
- the terminal 110 receives the task information sent by the server 110 and interacts with the Crash platform to implement parsing processing of the Crash.
- the terminal 110 sends the task processing result to the server 110, and the server 110 modifies the task status of the corresponding task according to the task processing result, thereby implementing the processing of the Crash parsing task.
- another task distributed processing method which is a Crash parsing task.
- the method includes:
- Step S401 The terminal sends a task processing request to the server, where the task processing request carries the Internet Protocol address of the terminal.
- the task processing request is a task processing request of the Crash parsing task.
- the task can be processed for the IOS Crash resolution task
- the terminal is a terminal that deploys a Mac OSX system, such as a Mac notebook or a Mac desktop computer.
- the server can generate multiple Crash resolution tasks in advance or in real time and write this into the primary database as well as the standby database.
- the task identifier is set for the generated Crash parsing task and the task status is set to be assigned.
- the Crash parsing task contains the Crash file to be parsed.
- an interface and a web page creation task may be provided, so that the Crash resolution task created by the terminal through the interface and the web page may be received.
- the server may encapsulate multiple Crash files into one compressed package and encapsulate multiple compressed packages into one Crash parsing task, thereby causing a Crash to be assigned to the terminal.
- the parsing task contains multiple Crash files to be parsed, which can improve the allocation processing efficiency of Crash files.
- the terminal can detect if it is in an idle state, and if so, send a task processing request to the server.
- the idle state includes a state in which the CPU utilization is lower than the preset utilization rate and the memory usage is lower than the preset occupancy rate.
- the preset utilization rate and the preset occupancy rate may be set to any suitable value, for example, may be 50%.
- Step S402 the server receives the task processing request, selects at least one task to be assigned, and assigns the selected task to the terminal for processing according to the Internet Protocol address.
- the server may select a preset number of task identifiers of the tasks to be assigned, and query the tasks corresponding to the task identifiers from the primary database in priority.
- the queried task is read, and the IP address of the terminal carried in the request processing request is sent to the corresponding terminal, so that the terminal performs task processing.
- the server may preset a first task table for storing tasks to be assigned, where the task information of the tasks to be assigned may be stored in the order in which the tasks are generated.
- the task identifier of the task can be stored.
- the task identifier of the task that has not been assigned is selected from the table in the order of generation.
- the corresponding task information is read from the primary database according to the task identifier. Wherein, when the read from the primary database fails, the task can be read from the standby database.
- the server can be a server cluster containing a primary server and a secondary server.
- the main server can be called by default for task allocation and monitoring.
- the standby server can be called to perform task allocation and monitoring.
- the method further includes: modifying the state of the assigned task to be processed. Further, the database logic of the assignable task sets transaction isolation, thereby avoiding the case where the same task is assigned to multiple terminals and repeated execution occurs.
- the task may be moved from the first task table to the second task table for storing the process, or the task status of the task may be marked as being processed directly in the first task table. Task status.
- Step S403 the terminal receives the task assigned by the server, processes the task through the Crash analysis platform, and sends the task processing result to the server.
- the terminal after receiving the task assigned by the server, the terminal can interact with the Crash to implement parsing processing of each Crash file in the task, generate a task processing result, and send the result to the server.
- the task processing result may include the processing result of each Crash file.
- Processing results include processing success and processing failure.
- the terminal may also send a heartbeat packet to the server according to a preset frequency to inform the terminal that the parsing process of the task is in progress.
- step S404 the server detects whether the task processing result is received within the preset duration. If yes, step S405 is performed; otherwise, step S406 is performed.
- the server After the server assigns the selected task to the terminal for processing, the server starts to process the processing time of the task, and if the task processing result is received within the preset duration.
- the task processing result includes a corresponding task identifier, so that the server can identify the task to which the task processing result belongs according to the task.
- the server may extract a task that has all the states as being processed, and the allocated time is longer than the preset time, and then resets the state of the task to be allocated.
- the preset duration can be set according to the experience value. Assuming that the normal execution time of a task is 2 minutes and the maximum execution time is 5 minutes, the preset duration can be set to 6 minutes or 8 minutes.
- Step S405 modifying the task status of the corresponding task according to the task processing result.
- step S406 the selected task is reassigned to other terminals that send the task processing request for processing.
- the task is further modified into a state to be allocated, and is again stored in the first task table for reallocation. If the task status is successful, the task is placed in a third task table for storing the processing success. If the task status is a processing exception, the task is stored in a fourth task table for storing processing exceptions.
- Each task table includes a task identifier of the corresponding task, so that the server can periodically record according to the fourth task table. The service identifier reads the corresponding task information from the primary database or the standby database and sends it to the administrator terminal for the administrator to detect.
- the terminal may set up multiple threads for task assignment requests and processing. For example, two threads can be set, and each thread is cyclically "task request -> execution -> processing result report -> rest preset duration", thereby improving terminal utilization and task processing efficiency.
- the above-mentioned task distributed processing method can allocate the task to multiple terminals for processing by using the terminal as an execution node in the DTS system, which can alleviate the pressure of the server on the task processing and improve the efficiency of the task processing.
- a task distributed processing apparatus which is applied to a distributed task scheduling system, and includes:
- the request receiving module 502 is configured to receive a task processing request sent by the terminal, where the terminal is an execution node in the distributed task scheduling system.
- the task assignment module 504 is configured to select at least one task to be assigned, and assign the selected task to the terminal for processing.
- the task status modification module 506 is configured to receive a task processing result fed back by the terminal, and modify a task status of the corresponding task according to the task processing result.
- the task assignment module 504 is further configured to select at least one task identifier to be assigned status; read a task corresponding to each task identifier from the primary database, and when the read from the primary database fails, from the standby database. Read the task corresponding to each task ID.
- the task processing request carries the Internet Protocol address of the terminal; the task assignment module 504 is further configured to allocate the selected task to the terminal for processing according to the Internet Protocol address.
- the task status modification module 506 is further configured to receive a heartbeat packet sent by the terminal to determine, according to the heartbeat packet, that the terminal is processing the selected task.
- the task assignment module 504 is further configured to detect whether the task processing result is received within a preset duration, and if not, re-allocate the selected task to another terminal that sends the task processing request for processing.
- the apparatus further includes:
- the sorting module 508 is configured to count the number of tasks completed by each terminal, and sort the terminals according to the number of completed tasks.
- the various modules in the above-described task distributed processing device may be implemented in whole or in part by software, hardware, and combinations thereof.
- the network interface may be an Ethernet card or a wireless network card.
- the above modules may be embedded in the hardware in the processor or in the memory in the server, or may be stored in the memory in the server, so that the processor calls the corresponding operations of the above modules.
- the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
- the task distributed processing apparatus may be implemented in the form of a computer program, which may be run on a server as shown in FIG. 7, and the non-volatile storage medium of the server may be
- the various program modules that make up the task distributed processing device are stored.
- the request receiving module 502, the task assigning module 504, and the task state modifying module 506 as shown in FIG. 5 may be included.
- Each of the program modules includes computer readable instructions for causing the server to perform the steps in the task distributed processing method of various embodiments of the present application described in the present specification, for example, the server may be as shown in FIG.
- the behavior request receiving module 502 in the illustrated task distributed processing device receives the task processing request sent by the terminal, the terminal is an execution node in the distributed task scheduling system; and at least one task to be assigned is selected by the task assignment module
- the task is allocated to the terminal for processing; and the task state modification module 506 receives the task processing result fed back by the terminal; and the task state of the corresponding task is modified according to the task processing result.
- one or more non-transitory computer readable storage media containing computer readable instructions are provided that, when executed by one or more processors, cause the processor to implement a A task distributed processing method, the method is applied to a distributed task scheduling system, the distributed task scheduling system comprising a server and a plurality of terminals, wherein the server is a master node in the distributed task scheduling system, and each terminal For the execution node in the distributed task scheduling system, the processor executes the steps of the task distributed processing method provided by the various embodiments described above when the instruction is executed.
- the processor when the computer readable instructions are executed by one or more processors, the processor is caused to perform the steps of: receiving a task processing request sent by the terminal; selecting at least one task to be assigned, selecting the selected The task is allocated to the terminal for processing; the task processing result fed back by the terminal is received; and the task state of the corresponding task is modified according to the task processing result.
- the processor when the computer readable instructions are executed by one or more processors, causing the processor to perform at least one task to be assigned a state, comprising: selecting at least one task identifier to be assigned a status; The task corresponding to each task identifier is read in the primary database. When the read from the primary database fails, the task corresponding to each task identifier is read from the standby database.
- the task processing request carries an internet protocol address of the terminal; when the computer readable instruction is executed by the one or more processors, causing the processor to perform the task of assigning the selected task to the terminal for processing, including : Assign the selected task to the terminal for processing according to the Internet Protocol address.
- the computer readable instructions when executed by one or more processors, causing the processor to perform the process of assigning the selected task to the terminal for processing, further comprising the step of: receiving a heartbeat sent by the terminal Packet to determine that the terminal is processing the selected task based on the heartbeat packet.
- the processor when the computer readable instructions are executed by one or more processors, causing the processor to perform the process of assigning the selected task to the terminal for processing, further comprising the step of: detecting whether the preset is The task processing result is received within the duration, and if not, the selected task is reassigned to other terminals that send the task processing request for processing.
- the processor when the computer readable instructions are executed by one or more processors, the processor is further caused to perform the steps of counting the number of tasks completed by each terminal and sorting the terminals according to the number of completed tasks.
- a server for use in a distributed task scheduling system, including a memory and a processor, the memory storing computer readable instructions, the distributed task scheduling system including the server and a plurality of terminals
- the server is a master node in the distributed task scheduling system, and each terminal is an execution node in the distributed task scheduling system, and the instruction is When the processor executes, the processor is caused to perform the steps of the task distributed processing method provided by the various embodiments described above.
- the processor when the instruction is executed by the processor, the processor is configured to: receive a task processing request sent by the terminal; select at least one task to be assigned, assign the selected task to the terminal for processing; and receive the terminal Feedback task processing result; modify the task status of the corresponding task according to the task processing result.
- FIG. 7 is an internal structure diagram of a server in one embodiment.
- the server includes a processor, memory, and network interface connected through a system bus including connections through a system bus.
- the processor of the server is used to provide computing and control capabilities to support the operation of the entire terminal.
- the memory is used to store data, instruction codes, etc., and the network interface is used for network communication with the terminal. For example, the selected task or the like can be sent to the terminal.
- At least one computer readable instruction is stored on the memory, and the computer readable instructions are executable by the processor to implement the task-distributed processing method for the server provided in the embodiments of the present application.
- the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or the like.
- the memory includes a non-volatile storage medium and an internal memory.
- the server's non-volatile storage medium stores operating system and computer readable instructions.
- the computer readable instructions are executable by a processor for implementing the task distributed processing methods provided by the various embodiments above.
- the internal memory in the terminal provides a cached operating environment for operating systems, databases, and computer readable instructions in a non-volatile storage medium.
- the network interface may be an Ethernet card or a wireless network card or the like for communicating with an external terminal or server.
- the server can be implemented with a stand-alone server or a server cluster consisting of multiple servers. It will be understood by those skilled in the art that the structure shown in FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied.
- the specific server may include a ratio. More or fewer components are shown in the figures, or some components are combined, or have different component arrangements.
- the processor when the instruction is executed by the processor, causing the processor to perform the task of selecting at least one state to be allocated, including: selecting at least one task identifier to be assigned; reading each task identifier from the primary database Corresponding task, when reading from the primary database fails, from standby The task corresponding to each task ID is read in the database.
- the task processing request carries the Internet Protocol address of the terminal; when the instruction is executed by the processor, the processor performs the process of assigning the selected task to the terminal for processing, including: selecting the selected according to the Internet Protocol address. Tasks are assigned to the terminal for processing.
- the method when the instruction is executed by the processor, after the processor performs the process of assigning the selected task to the terminal for processing, the method further includes the step of: receiving a heartbeat packet sent by the terminal, to determine, according to the heartbeat packet, that the terminal is Process selected tasks.
- the method when the instruction is executed by the processor, after the processor performs the process of assigning the selected task to the terminal for processing, the method further includes the step of: detecting whether the task processing result is received within the preset duration, If not, the selected task is reassigned to other terminals that send the task processing request for processing.
- the processor when the instructions are executed by the processor, the processor further performs the steps of: counting the number of tasks completed by each terminal, and ordering the terminals according to the number of completed tasks.
- the readable storage medium which when executed, may include the flow of an embodiment of the methods as described above.
- the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or the like.
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 Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Hardware Redundancy (AREA)
Abstract
Description
Claims (20)
- 一种任务分布式处理方法,应用于分布式任务调度系统中,其特征在于,所述分布式任务调度系统包括服务器和多个终端,所述服务器为所述分布式任务调度系统中的主控节点,每个所述终端为所述分布式任务调度系统中的执行节点;所述方法包括:所述服务器接收所述终端发送的任务处理请求;选取至少一个待分配状态的任务,将选取的任务分配给所述终端进行处理;接收所述终端反馈的任务处理结果;及根据所述任务处理结果修改对应任务的任务状态。
- 根据权利要求1所述的方法,其特征在于,所述选取至少一个待分配状态的任务,包括:选取至少一个待分配状态的任务标识;及从主数据库中读取每个任务标识对应的任务,当从所述主数据库读取失败时,从备用数据库中读取每个任务标识对应的任务。
- 根据权利要求1所述的方法,其特征在于,所述任务处理请求中携带所述终端的互联网协议地址;所述将选取的任务分配给所述终端进行处理,包括:根据所述互联网协议地址,将选取的任务分配给所述终端进行处理。
- 根据权利要求1所述的方法,其特征在于,在所述将选取的任务分配给所述终端进行处理之后,包括:接收所述终端发送的心跳包,以根据所述心跳包确定所述终端正在处理所述选取的任务。
- 根据权利要求1所述的方法,其特征在于,在所述将选取的任务分配给所述终端进行处理之后,包括:检测是否在预设时长之内接收到所述任务处理结果,若否,则将所述选取的任务重新分配给其它发送任务处理请求的终端进行处理。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:统计每个终端完成的任务数量,根据完成的任务数量对终端进行排序。
- 一种应用于分布式任务调度系统中的任务分布式处理装置,包括:请求接收模块,用于接收终端发送的任务处理请求,所述终端为所述分布式任务调度系统中的执行节点;任务分配模块,用于选取至少一个待分配状态的任务,将选取的任务分配给所述终端进行处理;及任务状态修改模块,用于接收所述终端反馈的任务处理结果;根据所述任务处理结果修改对应任务的任务状态。
- 根据权利要求7所述的装置,其特征在于,所述任务分配模块还用于选取至少一个待分配状态的任务标识;从主数据库中读取每个任务标识对应的任务,当从所述主数据库读取失败时,从备用数据库中读取每个任务标识对应的任务。
- 一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行一种任务分布式处理方法,所述方法应用于分布式任务调度系统中,所述分布式任务调度系统包括服务器和多个终端,所述服务器为所述分布式任务调度系统中的主控节点,每个所述终端为所述分布式任务调度系统中的执行节点;所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:接收所述终端发送的任务处理请求;选取至少一个待分配状态的任务,将选取的任务分配给所述终端进行处理;接收所述终端反馈的任务处理结果;及根据所述任务处理结果修改对应任务的任务状态。
- 根据权利要求9所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行以下步骤:选取至少一个待分配状态的任务标识;从主数据库中读取每个任务标识对应的任务,当从所述主数据库读取失败时,从备用数据库中读取每个任务标识对应的任务。
- 根据权利要求9所述的存储介质,其特征在于,所述任务处理请求中携带所述终端的互联网协议地址;所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行以下步骤:根据所述互联网协议地址,将选取的任务分配给所述终端进行处理。
- 根据权利要求9所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行以下步骤:接收所述终端发送的心跳包,以根据所述心跳包确定所述终端正在处理所述选取的任务。
- 根据权利要求9所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行以下步骤:检测是否在预设时长之内接收到所述任务处理结果,若否,则将所述选取的任务重新分配给其它发送任务处理请求的终端进行处理。
- 根据权利要求9所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,还使得所述一个或多个处理器执行以下步骤:统计每个终端完成的任务数量,根据完成的任务数量对终端进行排序。
- 一种应用于分布式任务调度系统中的服务器,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述分布式任务调度系统包括所述服务器和多个终端,所述服务器为所述分布式任务调度系统中的主控节点,每个所述终端为所述分布式任务调度系统中的执行节点;所述指令被所述处理器执行时,使得所述处理器执行以下步骤:接收所述终端发送的任务处理请求;选取至少一个待分配状态的任务,将选取的任务分配给所述终端进行处 理;接收所述终端反馈的任务处理结果;及根据所述任务处理结果修改对应任务的任务状态。
- 根据权利要求15所述的处理器,其特征在于,所述指令被所述处理器执行时,还使得所述处理器执行以下步骤:选取至少一个待分配状态的任务标识;及从主数据库中读取每个任务标识对应的任务,当从所述主数据库读取失败时,从备用数据库中读取每个任务标识对应的任务。
- 根据权利要求15所述的处理器,其特征在于,所述任务处理请求中携带所述终端的互联网协议地址;所述指令被所述处理器执行时,还使得所述处理器执行以下步骤:根据所述互联网协议地址,将选取的任务分配给所述终端进行处理。
- 根据权利要求15所述的处理器,其特征在于,所述指令被所述处理器执行时,还使得所述处理器执行以下步骤:接收所述终端发送的心跳包,以根据所述心跳包确定所述终端正在处理所述选取的任务。
- 根据权利要求15所述的处理器,其特征在于,所述指令被所述处理器执行时,还使得所述处理器执行以下步骤:检测是否在预设时长之内接收到所述任务处理结果,若否,则将所述选取的任务重新分配给其它发送任务处理请求的终端进行处理。
- 根据权利要求15所述的处理器,其特征在于,所述指令被所述处理器执行时,还使得所述处理器执行以下步骤:统计每个终端完成的任务数量,根据完成的任务数量对终端进行排序。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710608537.XA CN107688496B (zh) | 2017-07-24 | 2017-07-24 | 任务分布式处理方法、装置、存储介质和服务器 |
| CN201710608537.X | 2017-07-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019019400A1 true WO2019019400A1 (zh) | 2019-01-31 |
Family
ID=61152957
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/104970 Ceased WO2019019400A1 (zh) | 2017-07-24 | 2017-09-30 | 任务分布式处理方法、装置、存储介质和服务器 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107688496B (zh) |
| WO (1) | WO2019019400A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110661844A (zh) * | 2019-08-16 | 2020-01-07 | 北京旷视科技有限公司 | 自动发布调度系统、方法和存储介质 |
| CN115629854A (zh) * | 2022-10-12 | 2023-01-20 | 神策网络科技(北京)有限公司 | 分布式任务调度方法、系统、电子设备和存储介质 |
Families Citing this family (27)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110309391A (zh) * | 2018-03-21 | 2019-10-08 | 腾讯科技(深圳)有限公司 | 内容抓取任务的调度、处理方法、装置、存储介质和设备 |
| CN109120679B (zh) * | 2018-07-27 | 2021-09-28 | 平安科技(深圳)有限公司 | 任务分配方法及装置 |
| CN110825532B (zh) * | 2018-08-08 | 2022-08-05 | 深圳市优必选科技有限公司 | 分布式任务处理方法、装置、系统、机器人和存储介质 |
| CN111126733A (zh) * | 2018-10-31 | 2020-05-08 | 北京国双科技有限公司 | 爬取任务的分配方法及装置 |
| CN109669773B (zh) * | 2018-11-12 | 2024-03-08 | 平安科技(深圳)有限公司 | 金融数据处理方法、装置、设备和存储介质 |
| CN109582451A (zh) * | 2018-11-21 | 2019-04-05 | 金色熊猫有限公司 | 任务调度方法、系统、设备以及可读介质 |
| CN109634730B (zh) * | 2018-11-26 | 2024-05-31 | 平安科技(深圳)有限公司 | 任务调度方法、装置、计算机设备和存储介质 |
| CN109669775B (zh) * | 2018-12-10 | 2024-06-25 | 平安科技(深圳)有限公司 | 分布式任务调度方法、系统及存储介质 |
| CN109684095B (zh) * | 2018-12-26 | 2021-03-23 | 北京奇艺世纪科技有限公司 | 一种任务处理方法及任务分配设备 |
| CN110209488B (zh) * | 2019-06-10 | 2021-12-07 | 北京达佳互联信息技术有限公司 | 任务执行方法、装置、设备、系统及存储介质 |
| CN110377407A (zh) * | 2019-06-19 | 2019-10-25 | 北京威努特技术有限公司 | 一种扫描任务调度方法、装置、存储介质及设备 |
| CN110458407A (zh) * | 2019-07-12 | 2019-11-15 | 平安普惠企业管理有限公司 | 一种任务分配方法、装置及计算机可读存储介质 |
| CN110398985B (zh) * | 2019-08-14 | 2022-11-11 | 北京信成未来科技有限公司 | 一种分布式自适应无人机测控系统及方法 |
| CN110489222B (zh) * | 2019-08-22 | 2025-01-28 | 深圳前海微众银行股份有限公司 | 任务调度方法、系统、集群服务器及可读存储介质 |
| CN110543354B (zh) * | 2019-09-05 | 2023-06-13 | 腾讯科技(上海)有限公司 | 任务调度方法、装置、设备及存储介质 |
| CN110691120A (zh) * | 2019-09-10 | 2020-01-14 | 威富通科技有限公司 | 一种定时任务状态检测方法、服务器及检测系统 |
| CN110602545A (zh) * | 2019-09-26 | 2019-12-20 | 杭州米络星科技(集团)有限公司 | 一种网络直播的分布式录制执行方法 |
| CN110888730A (zh) * | 2019-12-06 | 2020-03-17 | 深圳前海环融联易信息科技服务有限公司 | 分布式任务调度方法、装置、计算机设备及存储介质 |
| CN111078379B (zh) * | 2019-12-06 | 2024-01-09 | 中至数据集团股份有限公司 | 任务调度方法、系统、移动终端及存储介质 |
| CN111182061B (zh) * | 2019-12-30 | 2023-04-14 | 苏宁云计算有限公司 | 任务分发处理方法、系统、计算机设备和存储介质 |
| CN111522641B (zh) * | 2020-04-21 | 2023-11-14 | 北京嘀嘀无限科技发展有限公司 | 任务调度方法、装置、计算机设备和存储介质 |
| CN112231108A (zh) * | 2020-11-02 | 2021-01-15 | 网易(杭州)网络有限公司 | 任务处理方法、装置、计算机可读存储介质及服务器 |
| CN112561264A (zh) * | 2020-12-04 | 2021-03-26 | 中广核工程有限公司 | 企业内容的服务方法、服务系统和存储介质 |
| CN112804334A (zh) * | 2021-01-15 | 2021-05-14 | 京东方科技集团股份有限公司 | 分发及获取任务的方法、装置、存储介质、电子设备 |
| CN114245288B (zh) * | 2021-10-29 | 2025-05-30 | 重庆惠科金渝光电科技有限公司 | 一种服务设备的任务调度方法、服务设备及存储介质 |
| CN114139999A (zh) * | 2021-12-07 | 2022-03-04 | 海南电网有限责任公司澄迈供电局 | 智能派工分值辅助计算系统 |
| CN116737345A (zh) * | 2023-08-11 | 2023-09-12 | 之江实验室 | 分布式任务处理系统及方法、装置、存储介质以及设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030065709A1 (en) * | 2001-10-01 | 2003-04-03 | International Business Machines Corporation | Dynamically determining whether to process requests synchronously or asynchronously |
| CN102279730A (zh) * | 2010-06-10 | 2011-12-14 | 阿里巴巴集团控股有限公司 | 一种并行的数据处理方法、装置和并行的数据处理系统 |
| CN102710554A (zh) * | 2012-06-25 | 2012-10-03 | 深圳中兴网信科技有限公司 | 分布式消息系统和分布式消息系统的服务状态检测方法 |
| CN103713942A (zh) * | 2012-09-28 | 2014-04-09 | 腾讯科技(深圳)有限公司 | 在集群中调度运行分布式计算框架的方法和系统 |
| CN104683171A (zh) * | 2013-12-02 | 2015-06-03 | 中国移动通信集团广东有限公司 | 应用软件的实时监控方法及装置 |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20020039921A (ko) * | 2000-11-22 | 2002-05-30 | 김봉태 | 인터넷 분산 슈퍼컴퓨팅의 모델 및 구현방법 |
| CN101340331B (zh) * | 2007-07-06 | 2010-12-08 | 中国电信股份有限公司 | P2p网络中利用空闲终端执行系统任务的方法 |
| CN101770402B (zh) * | 2008-12-29 | 2012-12-05 | 中国移动通信集团公司 | MapReduce系统中的Map任务调度方法、设备及系统 |
| CN102096602A (zh) * | 2009-12-15 | 2011-06-15 | 中国移动通信集团公司 | 一种任务调度方法及其系统和设备 |
| CN102255926B (zh) * | 2010-05-17 | 2015-11-25 | 中国移动通信集团公司 | MapReduce系统中的任务分配方法、系统及装置 |
| US8732720B2 (en) * | 2011-12-22 | 2014-05-20 | Hewlett-Packard Development Company, L.P. | Job scheduling based on map stage and reduce stage duration |
| CN103246550A (zh) * | 2012-02-09 | 2013-08-14 | 深圳市腾讯计算机系统有限公司 | 一种基于容量的多任务调度方法及系统 |
| CN103279351B (zh) * | 2013-05-31 | 2016-06-29 | 北京高森明晨信息科技有限公司 | 一种任务调度的方法及装置 |
| CN106161643B (zh) * | 2016-07-25 | 2019-09-06 | 镇江惠通电子有限公司 | 任务分布式处理方法、装置及云服务器 |
-
2017
- 2017-07-24 CN CN201710608537.XA patent/CN107688496B/zh not_active Expired - Fee Related
- 2017-09-30 WO PCT/CN2017/104970 patent/WO2019019400A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030065709A1 (en) * | 2001-10-01 | 2003-04-03 | International Business Machines Corporation | Dynamically determining whether to process requests synchronously or asynchronously |
| CN102279730A (zh) * | 2010-06-10 | 2011-12-14 | 阿里巴巴集团控股有限公司 | 一种并行的数据处理方法、装置和并行的数据处理系统 |
| CN102710554A (zh) * | 2012-06-25 | 2012-10-03 | 深圳中兴网信科技有限公司 | 分布式消息系统和分布式消息系统的服务状态检测方法 |
| CN103713942A (zh) * | 2012-09-28 | 2014-04-09 | 腾讯科技(深圳)有限公司 | 在集群中调度运行分布式计算框架的方法和系统 |
| CN104683171A (zh) * | 2013-12-02 | 2015-06-03 | 中国移动通信集团广东有限公司 | 应用软件的实时监控方法及装置 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110661844A (zh) * | 2019-08-16 | 2020-01-07 | 北京旷视科技有限公司 | 自动发布调度系统、方法和存储介质 |
| CN115629854A (zh) * | 2022-10-12 | 2023-01-20 | 神策网络科技(北京)有限公司 | 分布式任务调度方法、系统、电子设备和存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107688496B (zh) | 2020-12-04 |
| CN107688496A (zh) | 2018-02-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107688496B (zh) | 任务分布式处理方法、装置、存储介质和服务器 | |
| CN103677752B (zh) | 基于分布式数据的并发处理方法和系统 | |
| CN106254144B (zh) | 故障定位平台、故障定位方法及装置 | |
| CN103412786B (zh) | 一种高性能服务器架构系统及数据处理方法 | |
| CN106850830B (zh) | 一种业务请求处理方法、装置、系统和相关服务器 | |
| CN106557497A (zh) | 一种数据同步方法和装置 | |
| CN108268372A (zh) | Mock测试处理方法、装置、存储介质和计算机设备 | |
| CN105701099B (zh) | 用于在分布式环境中执行任务的方法、装置及系统 | |
| US20150074264A1 (en) | Traffic statistic generation for datacenters | |
| CN106033373A (zh) | 一种云计算平台中虚拟机资源调度方法和调度系统 | |
| CN111459641B (zh) | 一种跨机房的任务调度和任务处理的方法及装置 | |
| CN104866378A (zh) | 一种协调执行任务的系统及方法 | |
| EP3422186A1 (en) | Method, device and system for preventing memory data loss | |
| CN105956481A (zh) | 一种数据处理方法及其装置 | |
| CN103164262B (zh) | 一种任务管理方法及装置 | |
| CN111913784A (zh) | 任务调度方法及装置、网元、存储介质 | |
| CN107566214B (zh) | 一种性能测试方法和装置 | |
| CN110928679A (zh) | 一种资源分配方法及装置 | |
| US10237148B2 (en) | Providing a data set for tracking and diagnosing datacenter issues | |
| WO2014173366A2 (zh) | 一种实现电信能力群发的方法、装置及系统 | |
| CN108255820B (zh) | 分布式系统中数据入库的方法、装置以及电子设备 | |
| US20250097162A1 (en) | Reducing placement conflicts between concurrent virtual machine allocations | |
| CN103514036B (zh) | 一种用于事件触发和批量处理的调度系统和方法 | |
| CN113934525A (zh) | 一种基于正负反馈负载调度算法的Hadoop集群任务调度方法 | |
| CN118689638A (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: 17919020 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17919020 Country of ref document: EP Kind code of ref document: A1 |
|
| 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 28.05.2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17919020 Country of ref document: EP Kind code of ref document: A1 |