CN113590331A - Task processing method, control device and storage medium - Google Patents
Task processing method, control device and storage medium Download PDFInfo
- Publication number
- CN113590331A CN113590331A CN202110896216.0A CN202110896216A CN113590331A CN 113590331 A CN113590331 A CN 113590331A CN 202110896216 A CN202110896216 A CN 202110896216A CN 113590331 A CN113590331 A CN 113590331A
- Authority
- CN
- China
- Prior art keywords
- client
- task
- clients
- task instruction
- target client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000012545 processing Methods 0.000 claims description 24
- 238000000034 method Methods 0.000 claims description 22
- 230000003993 interaction Effects 0.000 claims description 15
- 238000004891 communication Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 6
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005401 electroluminescence Methods 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 210000001525 retina Anatomy 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06F9/5088—Techniques for rebalancing the load in a distributed system involving task migration
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the application provides a task processing method, a control device and a storage medium, wherein a server sends a task instruction needing to be executed by a client to the control device, the control device sends the task instruction to the client, and a task execution result of the client is maintained and managed. Because the control device bears part of the tasks originally borne by the server, the working pressure of the server is reduced, the resource consumption of the server is saved, and the working performance of the server is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of internet, in particular to a task processing method, a control device and a storage medium.
Background
At present, the server often communicates with the client directly in an instant mode. In practical application, the number of the clients is large, the server needs to monitor which clients can execute the task instructions in real time, issue the task instructions to the clients and monitor the task execution results of the clients, and the resource consumption of the server is high, so that the working performance of the server is affected.
Disclosure of Invention
The embodiment of the application provides a task processing method, a control device and a storage medium, which are used for reducing resource consumption of a server and improving working performance of the server.
In a first aspect, an embodiment of the present application provides a task processing method, where the method includes:
receiving a task instruction sent by a server, and storing the task instruction into a storage space;
acquiring an unexecuted task instruction to be distributed from the storage space, and analyzing a service logic code of the unexecuted task instruction to acquire a target client name for executing the unexecuted task instruction and a required client resource state index;
acquiring the current busy states of a plurality of clients and acquiring the client resource states periodically reported by the clients;
according to the current busy state and the client resource state of the plurality of clients, selecting a target client which is idle at present and has a client resource state meeting the client resource state index and corresponding to the target client name from the plurality of clients;
distributing the unexecuted task instruction to the target client so as to enable the target client to execute the unexecuted task instruction.
In a second aspect, an embodiment of the present application provides a control apparatus, including a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions to be invoked for execution by the processing component;
the processing component is to:
receiving a task instruction sent by a server, and storing the task instruction into a storage space;
acquiring an unexecuted task instruction to be distributed from the storage space, and analyzing a service logic code of the unexecuted task instruction to acquire a target client name for executing the unexecuted task instruction and a required client resource state index;
acquiring the current busy states of a plurality of clients and acquiring the client resource states periodically reported by the clients;
according to the current busy state and the client resource state of the plurality of clients, selecting a target client which is idle at present and has a client resource state meeting the client resource state index and corresponding to the target client name from the plurality of clients;
distributing the unexecuted task instruction to the target client so as to enable the target client to execute the unexecuted task instruction.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the computer program implements the steps in the method.
In the embodiment of the application, the server sends a task instruction to be executed by the client to the control device, and the control device sends the task instruction to the client and maintains and manages the task execution result of the client. Because the control device bears part of the tasks originally borne by the server, the working pressure of the server is reduced, the resource consumption of the server is saved, and the working performance of the server is improved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic structural diagram of an application scenario applicable to the embodiment of the present application;
fig. 2 is a flowchart of a task processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a control device according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of another control device provided in the embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In some of the flows described in the specification and claims of this application and in the above-described figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, the number of operations, e.g., 101, 102, etc., merely being used to distinguish between various operations, and the number itself does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic structural diagram of an application scenario applicable to the embodiment of the present application. As shown in fig. 1, includes one or more clients 11, a server 12, and a control device 13. The control device 13 is in communication connection with the server 12 and the plurality of clients 11 through a wireless network or a wired network. The wireless network may be a 2G, 3G, 4G, or 5G communication network, or may be a wireless local area network, which is not limited herein.
Wherein the client can run on the terminal device. For example, the terminal device may be a computer device, a tablet computer, a mobile phone (or referred to as "cellular" phone), etc., and the terminal device may also be a portable, pocket, hand-held, computer-embedded mobile device or apparatus, which is not limited herein. It should be noted that fig. 1 exemplarily shows 3 clients, and in practical applications, the number of the clients is not particularly limited in the present application.
The server 12 is a server capable of providing a plurality of services, and the server 12 may be hardware or software. When the server 12 is hardware, the server 12 is a single server or a distributed server cluster composed of a plurality of servers. When the server 12 is software, it may be a plurality of software modules or a single software module, and the embodiments of the present application are not limited.
The control device 13 may be an electronic device having a processing capability such as a server or a terminal device. It should be understood that the control device in fig. 1 is exemplified by a server.
Optionally, when the server 12 communicates with the control device 13 or the client 11 communicates with the control device 13, an HTTP short connection mode may be adopted to save resource consumption of the server 13.
Optionally, the server 12 and the control device 13 or the client 11 and the control device 13 may communicate in an API (Application Programming Interface) or RPC (Remote Procedure Call) mode or HTTP (hypertext Transfer Protocol) short connection mode, so as to reduce resource consumption of the server. The HTTP short connection is essentially TCP (Transmission Control Protocol) short connection, and the operation steps of the short connection are establishing connection-data Transmission-closing connection.
In the application scenario, the server 12 sends a task instruction to the control device 13, which requires the client to execute, and the control device 13 sends the task instruction to the client 11, and maintains the task execution result of the management client 11. Because the control device 13 undertakes part of the tasks originally undertaken by the server 12, the working pressure of the server 12 is reduced, the resource consumption of the server 12 is saved, and the working performance of the server 12 is improved.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the description of the same or similar contents in different embodiments is not repeated.
Fig. 2 is a flowchart of a task processing method according to an embodiment of the present application. The method may be performed by the control apparatus in fig. 1, and the task processing method may include the steps of:
201. and the server side sends the task instruction and stores the task instruction into a storage space.
Optionally, the server may provide an interactive interface for the administrator, generate a task instruction in response to a task input operation of the administrator on the interactive interface, and send the task instruction to the control device.
Optionally, before the server needs to send the task instruction to the control device, the server establishes a communication connection with the control device, and after the server sends the task instruction to the control device, the server may disconnect the communication connection with the control device, so as to save resource consumption of the server.
In practical application, the server sends the task instruction to the control device irregularly or periodically, and the control device stores the task instruction to the storage space and maintains the execution state of the task instruction when receiving the task instruction sent by the server each time. If the task instruction is executed, the execution state of the task instruction is not executed, and if the task instruction is executed, the execution state of the task instruction is executed.
202. And acquiring the unexecuted task instruction to be distributed from the storage space, and analyzing the service logic code of the unexecuted task instruction to acquire the name of the target client for executing the unexecuted task instruction and the required client resource state index.
In practical applications, when some task instructions are issued by a server, the execution time of the task instructions is specified, and the task instructions can be understood as timed tasks. And when the current time reaches the execution time of the unexecuted task instruction belonging to the timing task in the storage space, the control device analyzes the service logic code of the unexecuted task instruction. Certainly, the server may also issue some task instructions with unspecified execution time, and these task instructions may be sequentially allocated to the client by the control device according to the transmission time sequence in which the task instructions are transmitted to the control device, that is, the control device analyzes and processes the unexecuted task instructions in the storage space in sequence. In addition, the control device can analyze and process the unexecuted task instruction in the storage space after receiving the reported client resource state and the last task execution result reported by the client according to the polling mechanism.
The control device analyzes the unexecuted task instruction and determines the name of a target client end for executing the unexecuted task instruction and the required client end resource state index. The client resource status index may be set according to an actual application requirement, and the client resource status index includes, for example, a hardware index and a software index, that is, the hardware performance of the client executing the task instruction needs to satisfy the hardware index, and the software performance needs to satisfy the software index. Hardware indicators such as a CPU (central processing unit) having a main frequency larger than a set main frequency, a memory having a capacity larger than a set capacity, and a video memory having a bandwidth larger than a set bandwidth. The software index is, for example, that the response time is less than the preset response time, the throughput is greater than the preset throughput, the resource utilization rate is greater than the preset utilization rate, and the like.
It should be noted that different task instructions have different task contents, which results in different client resource status indicators required by different task instructions. By analyzing the service logic code of the task instruction, the required client resource state index corresponding to the task instruction can be determined.
203. The method comprises the steps of obtaining the current busy states of a plurality of clients and obtaining the resource states of the clients periodically reported by the clients.
In practical application, the control device maintains the current busy state of each client, and if the client is in a stage of executing a task instruction, the current busy state of the client is busy; and if the client does not execute the task instruction currently, the currently busy state of the client is idle. Optionally, after the client executes the task instruction each time, the client sends the last task execution result to the control device, so that the control device can update the busy state of the client in time.
In addition, the multiple clients can report their own client resource states, that is, the hardware states and software states corresponding to the clients, to the control device periodically. The hardware state includes, but is not limited to, a main frequency of the CPU, a capacity of the memory, a bandwidth of the memory, and the like. Software states include, for example, but are not limited to, response time, throughput, resource utilization, and the like.
Optionally, the client may report its resource status and the last task execution result by using a polling mechanism, so that the control device queries whether there is a latest task instruction that the client needs to execute.
204. And selecting a target client which is idle at present and has a client resource state meeting the client resource state index and corresponding to the target client name from the plurality of clients according to the current busy state and the client resource state of the plurality of clients.
It should be understood that the target client for executing the unexecuted task instruction is selected based on the current busy state and the client resource state of the plurality of clients, so that the execution success rate of the unexecuted task instruction can be increased, and the resource consumption is reduced.
Optionally, an implementation process of selecting, according to the current busy state and the client resource state of the multiple clients, a target client that is currently idle and whose client resource state satisfies the client resource state index and corresponds to the target client name from the multiple clients may be: selecting a client which is idle at present and corresponds to the name of the target client from the plurality of clients as a candidate client according to the name of the target client and the current busy states of the plurality of clients; and selecting a target client with the client resource state meeting the client resource state index from the candidate clients.
It should be appreciated that first selecting candidate clients based on the currently busy state and client resource state of the plurality of clients may reduce the probability that an unexecuted task instruction is assigned to the wrong client; and then, a target client matched with the unexecuted task instruction can be selected from the candidate clients based on the client resource state, so that the execution success rate of the unexecuted task instruction is further improved, and the resource consumption is reduced.
Optionally, considering that the historical task execution result of the client may reflect the historical execution success condition of the task execution instruction of the client, then, one implementation process of selecting a target client whose client resource state satisfies the client resource state index from the candidate clients may be:
and selecting a target client of which the client resource state meets the client resource state index and the historical task execution result meets the preset condition from the candidate clients.
Optionally, the preset condition includes at least one of the following: the historical task execution success frequency is larger than a preset frequency threshold, and the ratio of the historical task execution success frequency to the historical task execution frequency is larger than a preset ratio threshold.
Wherein, the first time threshold value is set according to the actual application requirement. The number of successful execution times of the historical task is larger than a preset first time threshold value, which shows that the probability of successful execution of the task instruction by the client is higher. Otherwise, the number of successful execution times of the historical task is smaller than or equal to the preset first time threshold, which indicates that the probability of successful execution of the task instruction by the client is low. The historical task execution success times are increased once when the client successfully executes the task instruction once every time.
Wherein, the ratio threshold value is set according to the actual application requirement. Considering that the client may execute successfully or fail for the issued task instruction. When the client executes the task instruction once, the execution times of the historical task are increased once, namely the execution times of the historical task reflects the times of the client executing the task instruction. And if the historical task execution success frequency is recorded as A, and the historical task execution frequency is recorded as B, the ratio of the historical task execution success frequency to the historical task execution frequency is recorded as A/B.
It should be understood that the ratio of the number of successful execution times of the historical task to the number of execution times of the historical task is greater than a preset ratio threshold, which indicates that the probability that the client successfully executes the task instruction is high. Otherwise, the ratio of the number of successful execution times of the historical task to the number of execution times of the historical task is smaller than or equal to a preset ratio threshold, which indicates that the probability of successful execution of the task instruction by the client is low.
205. And distributing the unexecuted task instruction to the target client so that the target client executes the unexecuted task instruction.
Optionally, before distributing the non-executed task instruction to the target client, the control device identifies a communication protocol between the control device and the target client, and converts the non-executed task instruction into a non-executed task instruction that can be identified by the target client according to the communication protocol, so that the target client can accurately identify the non-executed task instruction.
After the target client is screened out from the plurality of clients, the control device distributes the unexecuted task instruction to the target client so that the target client executes the unexecuted task instruction.
In practical application, the target client may fail to execute the unexecuted task instruction, and optionally, in order to improve the probability that the client successfully executes the task instruction, the control device may further receive a task execution result for the unexecuted task instruction, which is sent by the target client; and if the task execution result indicates that the task execution fails, distributing the unexecuted task instruction to the target client again until the task execution succeeds or the preset maximum retry number is reached. The maximum retry number is set according to the actual application requirement, and is, for example, 3 times.
Alternatively, referring to fig. 3, the control device may include a client interaction layer 301, a server interaction layer 302, a service logic layer 303, and a storage layer 304. The service logic layer 303 is in communication connection with the client interaction layer 301, the server interaction layer 302, and the storage layer 304, respectively.
The client interaction layer 301 may provide a server for providing a service interacting with the client, for example, receive information sent by the client or send information to the server. The client interaction layer 301, which serves as an interaction interface for controlling the device to communicate with the client, may send a task instruction to the client, and receive information uploaded by the client, such as information about the resource status of the client and the task execution result.
The server interaction layer 302 may provide a server interacting with the server, for example, receive information sent by the server or send information to the server. The server interaction layer 302, which serves as an interaction interface for the control device to communicate with the server, may receive a task instruction sent by the server and feed back related information to the server.
The service logic layer 303 may provide a server with data processing services, for example, store a task instruction issued by the server into a storage layer, and when the task instruction issued by the server needs to be distributed to a client, the service logic layer 303 may further read an unexecuted task instruction from the storage layer to perform analysis. The service logic layer 303 may further analyze information uploaded by the client, and execute the task processing method provided in the embodiment of the present application.
The storage layer 304 may provide storage services, such as for storing task instructions issued by a server. Of course, the storage layer 304 may also store other information according to the actual application requirements, for example, the relevant information of the client.
By adopting the task processing method of the embodiment of the application, the remote client can execute the task instruction issued by the management and control server. When the number of the clients is increased, only the network bandwidth of the control device, the number of the client interaction layers and the storage resources of the storage layer need to be expanded, and the system architecture of the control device is simple and convenient to maintain.
According to the task processing method provided by the embodiment of the application, the server sends the task instruction needing to be executed by the client to the control device, the control device sends the task instruction to the client, and the task execution result of the client is maintained and managed. Because the control device bears part of the tasks originally borne by the server, the working pressure of the server is reduced, the resource consumption of the server is saved, and the working performance of the server is improved.
The embodiment of the application also provides a control device. Fig. 4 is a schematic structural diagram of a control device according to an embodiment of the present application. Referring to fig. 4, the control apparatus includes: comprises a storage component 401 and a processing component 402; wherein storage component 401 stores one or more computer instructions; one or more computer instructions to be invoked for execution by the processing component 402;
wherein the storage component 401 is configured to store various types of data to support operations at the terminal. The memory components may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The processing component 402 may include one or more processors to execute computer instructions to perform all or part of the steps of the information pushing method provided by the embodiments of the present application. Of course, the processing elements may also be implemented as one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components configured to perform the above-described methods.
Specifically, the processing component 402 is configured to:
receiving a task instruction sent by a server, and storing the task instruction into a storage space;
acquiring an unexecuted task instruction to be distributed from a storage space, and analyzing a service logic code of the unexecuted task instruction to acquire a target client name for executing the unexecuted task instruction and a required client resource state index;
acquiring the current busy states of a plurality of clients and acquiring the client resource states periodically reported by the clients;
according to the current busy state and the client resource state of the plurality of clients, selecting a target client which is idle at present and has a client resource state meeting a client resource state index and corresponding to a target client name from the plurality of clients;
and distributing the unexecuted task instruction to the target client so that the target client executes the unexecuted task instruction.
Optionally, when the processing component 402 selects the target client, it is specifically configured to:
selecting a client which is idle at present and corresponds to the name of the target client from the plurality of clients as a candidate client according to the name of the target client and the current busy states of the plurality of clients;
and selecting a target client with the client resource state meeting the client resource state index from the candidate clients.
Optionally, when the processing component 402 selects a target client whose client resource state meets the client resource state index from the candidate clients, the processing component is specifically configured to:
and selecting a target client of which the client resource state meets the client resource state index and the historical task execution result meets the preset condition from the candidate clients.
Optionally, the preset condition includes at least one of the following: the historical task execution success frequency is larger than a preset first time threshold, the ratio of the historical task execution success frequency to the historical task execution frequency is smaller than a preset first ratio, and the historical task retry frequency is smaller than a preset second time threshold.
Optionally, after the processing component 402 allocates the non-executed task instruction to the target client, the processing component is further configured to:
receiving a task execution result aiming at an unexecuted task instruction sent by a target client;
and if the task execution result indicates that the task execution fails, distributing the unexecuted task instruction to the target client again until the task execution succeeds or the preset maximum retry number is reached.
Optionally, the client resource state includes a hardware state and a software state; the hardware state comprises at least one of a main frequency of the CPU, the capacity of the memory and the bandwidth of the memory, and the software state comprises at least one of response time, throughput and resource utilization rate.
In addition, the control device may further include a display element 403, which may be an Electroluminescence (EL) element, a liquid crystal display, or a micro display having a similar structure, or a laser scanning type display in which the retina can directly display or the like. Wherein the display component 403 can display the recommendation information.
Of course, the control device may of course also comprise other components, such as input/output interfaces, communication components, etc.
The input/output interface provides an interface between the processing components and peripheral interface modules, which may be output devices, input devices, etc.
The communication component is configured to facilitate wired or wireless communication between the control device and other devices, and the like.
As used herein, a "control device" may be a remote web server, a computer networking device, a chipset, a desktop computer, a notebook computer, a workstation, or any other processing device or equipment.
The control device may be a physical device or an elastic computing host provided by a cloud computing platform, and the control device may be a cloud server, and the processing component, the storage component, and the like may be basic server resources rented or purchased from the cloud computing platform.
An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a computer, the task processing method in the embodiment shown in fig. 2 may be implemented.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (10)
1. A task processing method, comprising:
receiving a task instruction sent by a server, and storing the task instruction into a storage space;
acquiring an unexecuted task instruction to be distributed from the storage space, and analyzing a service logic code of the unexecuted task instruction to acquire a target client name for executing the unexecuted task instruction and a required client resource state index;
acquiring the current busy states of a plurality of clients and acquiring the client resource states periodically reported by the clients;
according to the current busy state and the client resource state of the plurality of clients, selecting a target client which is idle at present and has a client resource state meeting the client resource state index and corresponding to the target client name from the plurality of clients;
distributing the unexecuted task instruction to the target client so as to enable the target client to execute the unexecuted task instruction.
2. The method of claim 1, wherein selecting a target client from the plurality of clients that is currently idle and has a client resource status satisfying the client resource status indicator and corresponding to the target client name according to the currently busy status and the client resource status of the plurality of clients comprises:
selecting a client which is idle at present and corresponds to the name of the target client from the plurality of clients as a candidate client according to the name of the target client and the current busy states of the plurality of clients;
and selecting a target client with a client resource state meeting the client resource state index from the candidate clients.
3. The method of claim 2, wherein selecting a target client from the candidate clients whose client resource status satisfies the client resource status indicator comprises:
and selecting a target client of which the client resource state meets the client resource state index and the historical task execution result meets a preset condition from the candidate clients.
4. The method of claim 3, wherein the preset condition comprises at least one of: the historical task execution success frequency is larger than a preset first time threshold, the ratio of the historical task execution success frequency to the historical task execution frequency is smaller than a preset first ratio, and the historical task retry frequency is smaller than a preset second time threshold.
5. The method of claim 1, wherein after assigning the unexecuted task instruction to the target client, further comprising:
receiving a task execution result aiming at the unexecuted task instruction sent by the target client;
and if the task execution result indicates that the task execution fails, distributing the unexecuted task instruction to the target client again until the task execution succeeds or the preset maximum retry number is reached.
6. The method of any of claims 1 to 5, wherein the client resource states comprise a hardware state and a software state; the hardware state comprises at least one of a main frequency of a CPU, the capacity of a memory and the bandwidth of the memory, and the software state comprises at least one of response time, throughput and resource utilization rate.
7. The method according to any one of claims 1 to 5, applied to a control device, wherein the control device comprises a client interaction layer, a service logic layer, a server interaction layer and a storage layer, wherein the service logic layer is in communication connection with the client interaction layer, the server interaction layer and the storage layer respectively.
8. A control device is characterized by comprising a processing component and a storage component;
the storage component stores one or more computer instructions; the one or more computer instructions to be invoked for execution by the processing component;
the processing component is to:
receiving a task instruction sent by a server, and storing the task instruction into a storage space;
acquiring an unexecuted task instruction to be distributed from the storage space, and analyzing a service logic code of the unexecuted task instruction to acquire a target client name for executing the unexecuted task instruction and a required client resource state index;
acquiring the current busy states of a plurality of clients and acquiring the client resource states periodically reported by the clients;
according to the current busy state and the client resource state of the plurality of clients, selecting a target client which is idle at present and has a client resource state meeting the client resource state index and corresponding to the target client name from the plurality of clients;
distributing the unexecuted task instruction to the target client so as to enable the target client to execute the unexecuted task instruction.
9. The control device of claim 8, wherein the processing component is further configured to: receiving a task execution result aiming at the unexecuted task instruction sent by the target client;
and if the task execution result indicates that the task execution fails, distributing the unexecuted task instruction to the target client again until the task execution succeeds or the preset maximum retry number is reached.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a computer, carries out the steps of the method of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110896216.0A CN113590331A (en) | 2021-08-05 | 2021-08-05 | Task processing method, control device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110896216.0A CN113590331A (en) | 2021-08-05 | 2021-08-05 | Task processing method, control device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113590331A true CN113590331A (en) | 2021-11-02 |
Family
ID=78255459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110896216.0A Pending CN113590331A (en) | 2021-08-05 | 2021-08-05 | Task processing method, control device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113590331A (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101202761A (en) * | 2007-12-04 | 2008-06-18 | 赵晓宇 | System of distributed resource scheduling and method thereof |
CN102799467A (en) * | 2011-05-27 | 2012-11-28 | 金蝶软件(中国)有限公司 | Method and system for allocating tasks |
CN103870338A (en) * | 2014-03-05 | 2014-06-18 | 国家电网公司 | Distributive parallel computing platform and method based on CPU (central processing unit) core management |
CN103929441A (en) * | 2014-05-09 | 2014-07-16 | 中国银行股份有限公司 | Task allocation method and device |
US20150141150A1 (en) * | 2013-11-21 | 2015-05-21 | Tencent Technology (Shenzhen) Company Limited | Task execution method, apparatus and system |
CN107580023A (en) * | 2017-08-04 | 2018-01-12 | 山东大学 | A kind of the stream process job scheduling method and system of dynamic adjustment task distribution |
CN107729126A (en) * | 2016-08-12 | 2018-02-23 | 中国移动通信集团浙江有限公司 | A kind of method for scheduling task and device of container cloud |
WO2019153488A1 (en) * | 2018-02-07 | 2019-08-15 | 平安科技(深圳)有限公司 | Service configuration management method, apparatus, storage medium and server |
CN111106946A (en) * | 2018-10-29 | 2020-05-05 | 深圳市云帆加速科技有限公司 | Method and system for reconstructing edge computing node of networking equipment |
CN111556126A (en) * | 2020-04-24 | 2020-08-18 | 杭州浮云网络科技有限公司 | Model management method, system, computer device and storage medium |
CN112162865A (en) * | 2020-11-03 | 2021-01-01 | 中国工商银行股份有限公司 | Server scheduling method and device and server |
CN112769928A (en) * | 2020-12-31 | 2021-05-07 | 上海渠杰信息科技有限公司 | Information interaction method and device based on service scene |
-
2021
- 2021-08-05 CN CN202110896216.0A patent/CN113590331A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101202761A (en) * | 2007-12-04 | 2008-06-18 | 赵晓宇 | System of distributed resource scheduling and method thereof |
CN102799467A (en) * | 2011-05-27 | 2012-11-28 | 金蝶软件(中国)有限公司 | Method and system for allocating tasks |
US20150141150A1 (en) * | 2013-11-21 | 2015-05-21 | Tencent Technology (Shenzhen) Company Limited | Task execution method, apparatus and system |
CN103870338A (en) * | 2014-03-05 | 2014-06-18 | 国家电网公司 | Distributive parallel computing platform and method based on CPU (central processing unit) core management |
CN103929441A (en) * | 2014-05-09 | 2014-07-16 | 中国银行股份有限公司 | Task allocation method and device |
CN107729126A (en) * | 2016-08-12 | 2018-02-23 | 中国移动通信集团浙江有限公司 | A kind of method for scheduling task and device of container cloud |
CN107580023A (en) * | 2017-08-04 | 2018-01-12 | 山东大学 | A kind of the stream process job scheduling method and system of dynamic adjustment task distribution |
WO2019153488A1 (en) * | 2018-02-07 | 2019-08-15 | 平安科技(深圳)有限公司 | Service configuration management method, apparatus, storage medium and server |
CN111106946A (en) * | 2018-10-29 | 2020-05-05 | 深圳市云帆加速科技有限公司 | Method and system for reconstructing edge computing node of networking equipment |
CN111556126A (en) * | 2020-04-24 | 2020-08-18 | 杭州浮云网络科技有限公司 | Model management method, system, computer device and storage medium |
CN112162865A (en) * | 2020-11-03 | 2021-01-01 | 中国工商银行股份有限公司 | Server scheduling method and device and server |
CN112769928A (en) * | 2020-12-31 | 2021-05-07 | 上海渠杰信息科技有限公司 | Information interaction method and device based on service scene |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109246229B (en) | Method and device for distributing resource acquisition request | |
US10904112B2 (en) | Automatic capture of detailed analysis information based on remote server analysis | |
CN110069337B (en) | Disaster recovery degradation method and device | |
US10642585B1 (en) | Enhancing API service schemes | |
CN108900627B (en) | Network request method, terminal device and storage medium | |
CN109428926B (en) | Method and device for scheduling task nodes | |
CN111193789A (en) | Subscription information pushing method and device, computer equipment and readable storage medium | |
CN111831503B (en) | Monitoring method based on monitoring agent and monitoring agent device | |
CN110008187B (en) | File transmission scheduling method, device, equipment and computer readable storage medium | |
CN112685157B (en) | Task processing method, device, computer equipment and storage medium | |
CN112783629A (en) | Service calling method and device, electronic equipment and storage medium | |
CN107045452B (en) | Virtual machine scheduling method and device | |
CN112653736A (en) | Parallel source returning method and device and electronic equipment | |
CN110188258B (en) | Method and device for acquiring external data by using crawler | |
CN105917694B (en) | Service in telecommunication network provides and activation | |
CN111190731A (en) | Cluster task scheduling system based on weight | |
CN110113176B (en) | Information synchronization method and device for configuration server | |
CN113590331A (en) | Task processing method, control device and storage medium | |
CN112688982B (en) | User request processing method and device | |
CN112688980B (en) | Resource distribution method and device, and computer equipment | |
CN114564249A (en) | Recommendation scheduling engine, recommendation scheduling method, and computer-readable storage medium | |
CN115250276A (en) | Distributed system and data processing method and device | |
CN113542424A (en) | Data processing method, device, equipment and computer program product | |
CN111611123B (en) | Data processing method, data processing system and equipment | |
CN112433891A (en) | Data processing method and device and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20211102 |