Task scheduling method and device

By establishing a mapping relationship between edge devices and server identifiers in a preset storage area, the target server processing task is automatically determined, solving the problem of high storage requirements in the scheduling of large-scale data processing tasks, and achieving cost reduction and stability improvement.

CN112148458BActive Publication Date: 2026-03-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, high storage requirements in large-scale data processing task scheduling lead to increased hardware costs.

Method used

By establishing a mapping relationship between edge device identifiers and server identifiers in a preset storage area, the target server is automatically determined to process the task, realizing automatic task scheduling and fixed server addressing, and reducing storage requirements.

Benefits of technology

It reduces the scheduling cost of tasks, especially data processing tasks, improves the stability and availability of task processing, and reduces hardware and manual maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112148458B_ABST
    Figure CN112148458B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a task scheduling method and device, which are executed on a task scheduling end. The method comprises: obtaining a target task from a target edge device, the target task comprising a target edge device identifier of the target edge device; determining a mapping relationship between an edge device identifier and a server identifier established in advance in a preset storage area; determining a target server identifier associated with the target edge device identifier based on the mapping relationship; and routing the target task to a target server corresponding to the target server identifier, so as to process the target task through the target server. The technical solution of the embodiments of the present application can reduce the scheduling cost of a task, in particular a data processing task.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud technology and computer technology, in particular to a task scheduling method and device. BACKGROUND

[0002] In a task scheduling scenario, such as a scenario of scheduling data processing tasks requested by the same device to the same backend server, it is usually completed through data read-write separation, that is, a storage is first introduced, data tasks uploaded by each device are collected in the storage, and then the server pulls the data of the same device in the storage and performs continuous analysis. However, when the amount of data to be analyzed is large, the requirement for the storage is high, which increases the hardware cost. Therefore, how to reduce the scheduling cost of tasks, especially data processing tasks, is a technical problem to be solved. SUMMARY

[0003] Embodiments of the present application provide a task scheduling method, device, computer readable medium and electronic device, thereby at least reducing the scheduling cost of tasks, especially data processing tasks.

[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0005] According to an aspect of an embodiment of the present application, a task scheduling method is provided, the method is executed at a task scheduling end, and the method comprises: obtaining a target task from a target edge device, the target task comprising a target edge device identifier of the target edge device; determining a mapping relationship between an edge device identifier and a server identifier established in advance in a preset storage area; determining a target server identifier associated with the target edge device identifier based on the mapping relationship; and routing the target task to a target server corresponding to the target server identifier, so as to process the target task through the target server.

[0006] According to an aspect of an embodiment of the present application, a task scheduling method is provided, the method is executed at a task scheduling end, and the method comprises: obtaining a target task from a target edge device, the target task comprising a target edge device identifier of the target edge device; determining a mapping relationship between an edge device identifier and a server identifier established in advance in a preset storage area; determining a target server identifier associated with the target edge device identifier based on the mapping relationship; and routing the target task to a target server corresponding to the target server identifier, so as to process the target task through the target server.

[0007] According to an aspect of some embodiments of the present application, a task scheduling apparatus is provided. The apparatus is configured to be located at a task scheduling end. The apparatus comprises: a first obtaining unit configured to obtain a target task from a target edge device, the target task comprising a target edge device identifier of the target edge device; a first determining unit configured to determine a mapping relationship between an edge device identifier and a server identifier that is established in advance in a preset storage area; a second determining unit configured to determine a target server identifier associated with the target edge device identifier based on the mapping relationship; and a routing unit configured to route the target task to a target server corresponding to the target server identifier, so as to process the target task by the target server.

[0008] In some embodiments of the present application, based on the foregoing scheme, the apparatus further comprises: a third determining unit configured to, before determining the target server identifier associated with the target edge device identifier based on the mapping relationship, determine a candidate server from the servers when the target server identifier associated with the target edge device identifier does not exist in the preset storage area, the candidate server being configured to process the target task; an establishing unit configured to establish a mapping relationship between the target edge device identifier and a server identifier of the candidate server; and a storage unit configured to store the mapping relationship between the target edge device identifier and the server identifier of the candidate server in the preset storage area.

[0009] In some embodiments of the present application, based on the foregoing scheme, the third determining unit is configured to: obtain an available load value of each server respectively, the available load value being configured to represent the ability of the server to process tasks; and determine the server with the highest available load value as the candidate server.

[0010] In some embodiments of the present application, based on the foregoing scheme, the third determining unit is configured to: obtain an available load value of each server respectively, the available load value being configured to represent the ability of the server to process tasks; determine a selection probability value of each server being determined as the candidate server according to the available load value of each server respectively; and determine a candidate server from the servers based on the selection probability value of each server.

[0011] In some embodiments of the present application, the method for obtaining the available load value of the server comprises any one of the following: determining the reciprocal of the average number of threads in the running queue in the server per unit time as the available load value; determining the reciprocal of the number of edge devices associated in the server as the available load value; determining the reciprocal of the CPU utilization in the server as the available load value; determining the disk remaining space in the server as the available load value; and determining the memory remaining space in the server as the available load value.

[0012] In some embodiments of the present application, based on the foregoing scheme, the device further comprises: a second obtaining unit configured to obtain at least one task in the target server when the target server fails; and a scheduling unit configured to balance schedule the at least one task to other servers except the target server according to available load values of the other servers.

[0013] In some embodiments of the present application, based on the foregoing scheme, the device further comprises: a configuration unit configured to configure an initial server when available load values of each server are lower than a predetermined threshold; and a fourth determining unit configured to determine an initial available load value for the initial server.

[0014] According to an aspect of an embodiment of the present application, there is provided a task scheduling device, which is arranged at a task receiving end, and the device comprises: a receiving unit configured to receive tasks sent by at least one edge device to obtain at least one task; and a distribution unit configured to distribute the at least one task to each task scheduling end according to scheduling load borne by each task scheduling end, so that each task scheduling end executes the method provided in the first aspect or various optional implementation manners of the first aspect.

[0015] According to an aspect of an embodiment of the present application, there is provided a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method provided in the first aspect or the second aspect or various optional implementation manners of the first aspect or the second aspect.

[0016] According to an aspect of an embodiment of the present application, there is provided a computer readable medium having stored thereon a computer program, which is executed by a processor to implement the task scheduling method as described in the above embodiments.

[0017] According to an aspect of an embodiment of the present application, there is provided an electronic device, which comprises: one or more processors; and a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the task scheduling method as described in the above embodiments.

[0018] In some embodiments provided by the present application, the mapping relationship between the edge device identifier and the server identifier established in advance in the preset storage area can be used to determine the target server identifier corresponding to the target edge device identifier in the target task, and then the target task can be routed to the target server corresponding to the target server identifier, so as to implement processing of the target task by the target server. On the one hand, the mapping relationship between the edge device identifier and the server identifier in the preset storage area can implement the automatic scheduling strategy of fixed server addressing, thereby realizing automatic access and maintenance between the task sent by the edge device and the server. On the other hand, the data size of the mapping relationship between the edge device identifier and the server identifier is much smaller than the data size of the data task uploaded by each device, so that the storage has a relatively low requirement, thereby reducing the scheduling cost of the task, especially the data processing task, that is, reducing the hardware cost.

[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. In the drawings:

[0021] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied is shown;

[0022] Figure 2 A flowchart of a task scheduling method according to an embodiment of the present application is shown;

[0023] Figure 3 A flowchart of a method for determining a target server identifier associated with the target edge device identifier according to an embodiment of the present application is shown;

[0024] Figure 4 A detailed flowchart of determining a candidate server in each server according to an embodiment of the present application is shown;

[0025] Figure 5 A detailed flowchart of determining a candidate server in each server according to an embodiment of the present application is shown;

[0026] Figure 6A method flowchart is shown according to an embodiment of the present application when the target server fails;

[0027] Figure 7 A method flowchart is shown according to an embodiment of the present application when the available load value of each server is below a predetermined threshold;

[0028] Figure 8 A flowchart of a task scheduling method is shown according to an embodiment of the present application;

[0029] Figure 9 A system framework diagram implementing the task scheduling method is shown according to an embodiment of the present application;

[0030] Figure 10 A block diagram of a task scheduling device is shown according to an embodiment of the present application;

[0031] Figure 11 A block diagram of a task scheduling device is shown according to an embodiment of the present application;

[0032] Figure 12 A structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown. DETAILED DESCRIPTION

[0033] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations can be implemented in any

[0034] Moreover, described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0035] The block diagrams in the drawings show only the functional entities and not necessarily the physical separate entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0036] The flowchart shown in the drawing is only an exemplary illustration, and is not necessarily to include all the contents and operations / steps, nor is it necessarily to be executed in the order as described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so that the actual execution order can be changed according to the actual situation.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the objects thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described.

[0038] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied is shown.

[0039] As shown in Figure 1 , the system architecture can include one or more of terminal devices (such as a smart phone 101, a tablet computer 102 and a portable computer 103 as shown in Figure 1 , of course, other terminal devices with positioning functions, such as water meters, electricity meters, etc.), a network 104 and a server 105. The network 104 is a medium for providing a communication link between the terminal device and the server 105. The network 104 can include various connection types, such as wired communication links, wireless communication links, etc.

[0040] In an embodiment of the present application, the server 105 can obtain a target task from the terminal device, the target task including a terminal device identifier of the terminal device, the server 105 determining a mapping relationship between an edge device identifier and a server identifier established in advance in a preset storage area, and determining a target server identifier associated with the terminal device identifier based on the mapping relationship, the server 105 routing the target task to a target server corresponding to the target server identifier (it should be noted that the role and function of the target server here are different from those of the server 105) to process the target task through the target server.

[0041] It should be noted that the task scheduling method provided by the embodiments of the present application can be executed by the server 105, and correspondingly, the task scheduling device is generally provided in the server 105. However, in other embodiments of the present application, the terminal device can also have similar functions as the server, so as to execute the task scheduling scheme provided by the embodiments of the present application.

[0042] It should also be noted that Figure 1The number of terminal devices, networks and servers in the above is only illustrative. According to the implementation needs, the server can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smartphone, tablet computer, notebook computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto, and the present application does not limit the same.

[0043] It should be explained that the cloud computing as described above is a computing mode that distributes computing tasks on a resource pool composed of a large number of computing devices, so that various application systems can obtain computing power, storage space and information services as needed. The network providing resources is called "cloud". The resources in the "cloud" are infinitely expandable to users and can be obtained at any time, used on demand, and expanded at any time. By establishing a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform), a plurality of types of virtual resources are deployed in the resource pool for external customers to select and use. The cloud computing resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, network devices.

[0044] The implementation details of the technical solutions of the embodiments of the present application will be described in detail from the perspective of different execution subjects as follows:

[0045] From the perspective of the task scheduling end:

[0046] The embodiment provides a task scheduling method.

[0047] Referring to Figure 2 , a flowchart of a task scheduling method according to an embodiment of the present application is shown, which can be executed by a device with computing processing function, such as the server 105 shown in Figure 1 . Referring to Figure 2 , the task scheduling method at least includes steps 210 to 270, which are described in detail as follows:

[0048] In step 210, a target task from a target edge device is obtained, and the target task includes a target edge device identifier of the target edge device.

[0049] In the present application, the target edge device can be a data acquisition device, for example, can be a camera or a snapshot machine, and can also be a geological data acquisition device in a geological disaster monitoring system, etc.

[0050] In the present application, the target edge device sends the collected data to the server at the back end, and the server at the back end continuously analyzes and processes the data sent by the target edge device, so that the task (data) collected by the target edge device is generally processed by the fixed server, and therefore, in each scheduling of the task of the target edge device, the target edge device generally needs to be fixedly routed to the same server at the back end.

[0051] In the present application, the target edge device identifier can be used to identify the identity of the target edge device, specifically, the target edge device identifier can be the number of the target edge device, can also be the location of the target edge device, and can also be the registration ID of the target edge device, etc.

[0052] Continuing to refer to Figure 2 In steps 230 to 250, a mapping relationship between the edge device identifier established in advance and the server identifier is determined in a preset storage area; based on the mapping relationship, a target server identifier associated with the target edge device identifier is determined.

[0053] In the present application, the preset storage area can be a storage database such as mysql, or various caches such as redis.

[0054] In the present application, the preset storage area can store a mapping relationship between a plurality of edge device identifiers including the target edge device identifier and a plurality of server identifiers including the target server identifier, wherein one server identifier corresponds to at least one edge device identifier.

[0055] For those skilled in the art, the present application can include a plurality of edge devices including the target edge device and a plurality of servers including the target server.

[0056] In the present application, the target server identifier can be used to identify the identity of the target server, specifically, the target server identifier can be the number of the target server, can also be the location of the target server, and can also be the registration ID of the target server, etc.

[0057] In an embodiment of the present application, before determining the target server identifier associated with the target edge device identifier based on the mapping relationship, the method shown in Figure 3 may also be performed.

[0058] Referring to Figure 3 , a method flowchart before determining the target server identifier associated with the target edge device identifier according to an embodiment of the present application is shown. Specifically, it includes steps 241 to 243:

[0059] Step 241, when the target server identifier associated with the target edge device identifier does not exist in the preset storage area, determining a candidate server in each server, the candidate server being used for processing the target task.

[0060] Step 242, establishing a mapping relationship between the target edge device identifier and the server identifier of the candidate server.

[0061] Step 243, storing the mapping relationship between the target edge device identifier and the server identifier of the candidate server into the preset storage area.

[0062] In the present application, when the target server identifier associated with the target edge device identifier does not exist in the preset storage area, it can be considered that the target edge device uploading the target task is a newly accessed edge device, and the mapping relationship between the target edge device identifier and the server identifier does not exist in the preset storage area.

[0063] Therefore, it is needed to allocate a candidate server for the target edge device, establish a mapping relationship between the target edge device identifier and the server identifier of the candidate server, and store the mapping relationship into the preset storage area.

[0064] In one specific implementation of the present embodiment, the determination of the candidate server in each server can be performed according to the steps as shown in Figure 4

[0065] Referring to Figure 4 , a detailed flowchart of determining a candidate server in each server according to one embodiment of the present application is shown. Specifically, it includes steps 2411 to 2412:

[0066] Step 2411, respectively acquiring available load values of each server, the available load value being used for representing the ability of the server to process tasks.

[0067] Step 2412, determining the server with the highest available load value as the candidate server.

[0068] Specifically, for example, the most initial available load value of each server is “100”, in one example, including server A, server B, server C, server D and server E, wherein the available load values corresponding to the five servers are “server A: 36, server B: 56, server C: 42, server D: 81, server E: 77”. Then, the server D can be determined as the candidate server.

[0069] In one specific implementation of the present embodiment, the determination of the candidate server in each server can also be performed according to the steps as shown in​Figure 5 The steps shown are performed.

[0070] Referring to Figure 5 , a detailed flowchart of determining a candidate server in each server according to an embodiment of the present application is shown. Specifically, it includes steps 2413 to 2415:

[0071] Step 2413, respectively acquiring available load values of each server, the available load values being used to represent the ability of the server to process tasks.

[0072] Step 2414, respectively determining selection probability values of each server being determined as a candidate server according to the available load values of each server.

[0073] Step 2415, determining a candidate server in each server based on the selection probability values of each server.

[0074] Specifically, for example, the most initial available load value of each server is "100", and in an example, there are server A, server B, server C, server D and server E, wherein the available load values corresponding to the five servers are "server A: 36, server B: 56, server C: 42, server D: 81, server E: 77", and the selection probability values of each server being determined as a candidate server can be determined as "server A: 12%, server B: 19%, server C: 15%, server D: 28%, server E: 26%".

[0075] server A: 36 / (36+56+42+81+77) = 12%,

[0076] server B: 56 / (36+56+42+81+77) = 19%,

[0077] server C: 42 / (36+56+42+81+77) = 15%,

[0078] server D: 81 / (36+56+42+81+77) = 28%,

[0079] server E: 77 / (36+56+42+81+77) = 26%".

[0080] Therefore, server A is determined as a candidate server with a probability of 12%, server B is determined as a candidate server with a probability of 19%, server C is determined as a candidate server with a probability of 15%, server D is determined as a candidate server with a probability of 28%, and server E is determined as a candidate server with a probability of 26%.

[0081] It should be noted that in the present embodiment, the method of acquiring the available load value of the server can include any one of the following:

[0082] The first, the inverse of the average number of threads in the running queue per unit time in the server is determined as the available load value.

[0083] The second, the inverse of the number of associated edge devices in the server is determined as the available load value.

[0084] The third, the inverse of the CPU utilization in the server is determined as the available load value.

[0085] The fourth, the disk remaining space in the server is determined as the available load value.

[0086] The fifth, the memory remaining space in the server is determined as the available load value.

[0087] It should be noted that in the present application, the greater the available load value, the stronger the server's ability to handle tasks.

[0088] In the embodiment, through the above two specific implementation manners, a standby server for accessing a new edge device is determined in each server, and the advantage is that based on the available load value of each server, the load balancing of each server can be fully guaranteed, and the runtime stability of each server is improved.

[0089] In an embodiment of the present application, when the target server fails, the steps shown in Figure 6 may be performed.

[0090] Referring to Figure 6 , a method flowchart when the target server fails according to an embodiment of the present application is shown. Specifically, it includes steps 261 to 262:

[0091] Step 261, at least one task in the target server is obtained.

[0092] Step 262, according to the available load value of the other servers except the target server, the at least one task is balanced and scheduled to the other servers except the target server.

[0093] In the present application, the target server corresponds to at least one edge device, so the target server should need to handle at least one task, and when the target server fails, at least one task in the target server needs to be transferred to other servers. The advantage of this is that it can better cope with sudden situations such as target server failure, so as to ensure the normal processing of tasks.

[0094] In the embodiment, before the at least one task in the target server is acquired in step 261, an alarm prompt can also be performed for the target server to remind an operation and maintenance personnel to monitor processing of the sudden situation, so as to further ensure normal processing of the task.

[0095] In an embodiment of the present application, when the available load value of each server is lower than the predetermined threshold, the steps shown in FIG. 8 can be performed. Figure 7

[0096] Referring to FIG. 8, a flowchart of a method when the available load value of each server is lower than the predetermined threshold according to an embodiment of the present application is shown. Specifically, the method includes steps 263 to 264. Figure 7

[0097] Step 263, configuring an initial server.

[0098] Step 264, determining an initial available load value for the initial server.

[0099] In the present application, determining an initial available load value for the initial server can be automatically assigning an available load value of 100 to each initial server, can be adjusting the available load value of the initial server according to the performance of the initial server, or can be adjusting the available load value of the initial server according to actual use.

[0100] Continuing to refer to FIG. 8, in step 270, the target task is routed to a target server corresponding to the target server identification, so that the target task is processed by the target server. Figure 2

[0101] Specifically, for example, after the target server receives the task of the target edge device, the target server can continuously analyze the same data, such as trajectory analysis of a target object in video data.

[0102] From the perspective of the task receiving end:

[0103] The embodiment provides a task scheduling method.

[0104] Referring to FIG. 8, a flowchart of a task scheduling method according to an embodiment of the present application is shown, which can be performed by a device having a computing processing function, such as the server 105 shown in FIG. 1. Referring to FIG. 8, the task scheduling method at least includes steps 810 to 830, which are described in detail as follows. Figure 8 Figure 1 Figure 8

[0105] In step 810, a task sent by at least one edge device is received, and at least one task is obtained.​​​​​​

[0106] In step 830, the at least one task is distributed to each task scheduling end according to the scheduling load carried by each task scheduling end, so that each task scheduling end performs the task scheduling method of the steps shown in Figure 2 and the method provided in various optional implementations.

[0107] In this application, for accessing a large number of edge devices, the task receiving end is mainly used to be responsible for a unified access portal to receive tasks sent by each edge device, and automatically schedule the tasks to the task scheduling end.

[0108] It should be noted that in the process of distributing the at least one task to each task scheduling end by the task receiving end, the task receiving end can consider the task scheduling load carried by each task scheduling end, and distribute the at least one task to each task scheduling end.

[0109] In order for those skilled in the art to more intuitively understand the task scheduling method proposed in this application, the task scheduling method in this application will be described as a whole below: Figure 9 in combination with the application scenario of cloud technology:

[0110] Figure 9 A system framework diagram for implementing the task scheduling method according to an embodiment of the present application is shown.

[0111] In this application, as shown in Figure 9 , the system framework for implementing the task scheduling method in this embodiment includes an edge device group 901, a cloud task scheduling layer 902, a cloud server group 903, wherein the edge device group 901 includes a plurality of edge devices, the cloud task scheduling layer 902 includes a task receiving end, a task scheduling end, and a preset storage area, and the cloud server group 903 includes a plurality of servers.

[0112] It should be noted that in this application, one or more edge devices are bound to a fixed server, so that the server processes and analyzes the tasks of the one or more edge devices.

[0113] Specifically, in the edge device group 901, after each edge device collects data (video data monitored by a camera), the edge device sends the task (data) to the unique portal of the cloud task scheduling layer 902.

[0114] In the cloud task scheduling layer 902, the task receiving end receives the tasks sent by each edge device, obtains at least one task, and then the task receiving end distributes the at least one task to each task scheduling end according to the scheduling load carried by each task scheduling end.

[0115] It should be noted that each task contains a device identifier of an edge device.

[0116] For each task scheduling end, after obtaining the task from the target edge device, the mapping relationship between the pre-established edge device identifier and the server identifier in the preset storage area is determined, and based on the mapping relationship, the target server identifier associated with the edge device identifier in the task is determined, and the target task is routed to the target server corresponding to the target server identifier, so as to process the target task through the target server.

[0117] It should be noted that, for example, if the edge device F in the edge device group 901 is a newly accessed edge device, there will be no server identifier associated with the identifier of the edge device F in the preset storage area, and therefore a server needs to be bound for the edge device F.

[0118] In the above binding process, the task scheduling end obtains the available load value of each server, and based on the available load value of each server, determines a selected server in each server according to the load balancing principle, and the selected server is used to process the target task. In addition, the task scheduling end also establishes the mapping relationship between the target edge device identifier and the server identifier of the selected server, and stores the mapping relationship between the target edge device identifier and the server identifier of the selected server in the preset storage area.

[0119] In this application, for large-scale access devices, the technical solution proposed in this application can not only automatically realize the fixed mapping of edge devices to servers, but also realize the automatic access and operation and maintenance of edge devices, while only a small amount of data storage or buffer area is required, and the consideration of improving availability and reducing cost (including manual operation and maintenance cost and hardware cost) is taken into account. In particular, in the scene where a large number of devices are accessed and a large amount of data needs to be analyzed but such data does not need to be persistent, the superiority of this solution is more prominent.

[0120] The technical solution proposed in this application can also take into account the load capacity of the back-end server, and balance the scheduling of tasks to related servers, so as to improve the stability and availability of services.

[0121] In some embodiments provided by the present application, on the one hand, the automatic scheduling strategy of fixed server addressing can be implemented due to the mapping relationship between the edge device identifier and the server identifier in the preset storage area, so that the automatic access and maintenance between the task sent by the edge device and the server can be implemented. On the other hand, the data size of the mapping relationship between the edge device identifier and the server identifier is much smaller than the data size of the data task uploaded by each device, so the storage has no high requirement, thereby reducing the scheduling cost of the task, especially the data processing task, that is, reducing the hardware cost. The device embodiments of the present application are introduced below, which can be used to execute the task scheduling method in the above embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the above embodiments of the task scheduling method of the present application.

[0122] Figure 10 A block diagram of a task scheduling device according to an embodiment of the present application is shown.

[0123] Referring to Figure 10 According to the task scheduling device 1000 of an embodiment of the present application, the device is arranged at a task scheduling end, and the device includes a first acquisition unit 1001, a first determination unit 1002, a second determination unit 1003, and a routing unit 1004.

[0124] The first acquisition unit 1001 is configured to acquire a target task from a target edge device, and the target task includes a target edge device identifier of the target edge device. The first determination unit 1002 is configured to determine a mapping relationship between an edge device identifier and a server identifier in a preset storage area. The second determination unit 1003 is configured to determine a target server identifier associated with the target edge device identifier based on the mapping relationship. The routing unit 1004 is configured to route the target task to a target server corresponding to the target server identifier, so as to process the target task through the target server.

[0125] In some embodiments of the present application, based on the foregoing scheme, the device further includes a third determination unit configured to determine a standby server in each server when the target server identifier associated with the target edge device identifier does not exist in the preset storage area before determining the target server identifier associated with the target edge device identifier based on the mapping relationship, and the standby server is used to process the target task. An establishment unit is configured to establish a mapping relationship between the target edge device identifier and the server identifier of the standby server. A storage unit is configured to store the mapping relationship between the target edge device identifier and the server identifier of the standby server to the preset storage area.

[0126] In some embodiments of the present application, based on the foregoing scheme, the third determining unit is configured to: obtain an available load value of each server, the available load value being used to represent the ability of the server to process tasks; and determine the server with the highest available load value as the candidate server.

[0127] In some embodiments of the present application, based on the foregoing scheme, the third determining unit is configured to: obtain an available load value of each server, the available load value being used to represent the ability of the server to process tasks; determine a selection probability value of each server being determined as a candidate server according to the available load value of each server; and determine a candidate server from the servers based on the selection probability value of each server.

[0128] In some embodiments of the present application, the method for obtaining the available load value of the server includes any one of the following: determining the reciprocal of the average number of threads in the running queue per unit time in the server as the available load value; determining the reciprocal of the number of edge devices associated in the server as the available load value; determining the reciprocal of the CPU utilization in the server as the available load value; determining the remaining disk space in the server as the available load value; and determining the remaining memory space in the server as the available load value.

[0129] In some embodiments of the present application, based on the foregoing scheme, the device further includes: a second obtaining unit configured to obtain at least one task in the target server when the target server fails; and a scheduling unit configured to balance schedule the at least one task to the servers other than the target server according to the available load values of the servers other than the target server.

[0130] In some embodiments of the present application, based on the foregoing scheme, the device further includes: a configuration unit configured to configure an initial server when the available load value of each server is lower than a predetermined threshold; and a fourth determining unit configured to determine an initial available load value for the initial server.

[0131] Figure 11 A block diagram of a task scheduling device according to an embodiment of the present application is shown.

[0132] Referring to Figure 11 As shown, a task scheduling device 1100 according to an embodiment of the present application is arranged at a task receiving end, and includes a receiving unit 1101 and a distribution unit 1102.

[0133] The receiving unit 1101 is configured to receive tasks sent by at least one edge device, and obtain at least one task; the distribution unit 1102 is configured to distribute the at least one task to each task scheduling end according to a scheduling load borne by each task scheduling end, so that each task scheduling end executes the task scheduling method as shown in the steps and the method provided in various optional implementation manners. Figure 2

[0134] Figure 12 A structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.

[0135] It should be noted that, Figure 12 The computer system 1200 of the electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0136] As shown in the figure, Figure 12 The computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1202 or programs loaded from a storage portion 1208 into a random access memory (RAM) 1203, such as performing the methods described in the above embodiments. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0137] The following components are connected to the I / O interface 1205: an input portion 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 1208 including a hard disk, and the like; and a communication portion 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication portion 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 1210 as needed, so that a computer program read therefrom is installed in the storage portion 1208 as needed. ​

[0138] In particular, the processes described above with reference to the flow charts can be implemented as computer software programs in accordance with the embodiments of the present application. For example, the embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 1209, and / or installed from the detachable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.

[0139] It should be noted that the computer readable medium shown in the embodiments of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.

[0140] The flow and block diagrams in the drawings represent possible architectural, functional, and operational architectures of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flow and block diagrams can represent a module, a segment, or a portion of code that comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0141] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described may

[0142] As another aspect, the present application also provides a computer program product or computer program, which comprises computer instructions. The computer instructions are stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above embodiments.

[0143] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the method described in the above embodiments.

[0144] It should be noted that although several modules or units for performing actions are mentioned in the above detailed description, the division into such modules or units is not mandatory. In fact, according to the embodiments of the present application, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into a plurality of modules or units.

[0145] Those skilled in the art can easily understand, through the above description of the embodiments, that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.

[0146] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. It is intended that the present application cover any and all variations of the present application that come within the scope of the claims and that the terms describe and of the specification be interpreted to cover such variations.

[0147] It should be understood that the present application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present application. The scope of the present application is limited only by the appended claims.

Claims

1. A task scheduling method, wherein the method is executed at a task scheduling terminal, characterized in that, The task scheduling terminal is located in the cloud task scheduling layer, which includes a task receiving terminal, multiple task scheduling terminals, and a preset storage area. The method includes: A target task is obtained from a target edge device. The target task includes a target edge device identifier, which is used to identify the target edge device. The target task is distributed from the task receiving end to the task scheduling end. The task receiving end is used to provide a unified access point to receive tasks sent by various edge devices, including the target edge device. Each edge device is a data acquisition device. The task receiving end distributes the tasks sent by each edge device evenly to each task scheduling end according to the scheduling load carried by each task scheduling end. Determine the pre-established mapping relationship between edge device identifiers and server identifiers in the preset storage area; When no target server identifier associated with the target edge device identifier exists in the preset storage area, the available load value of each server is obtained. The available load value is used to characterize the server's ability to process tasks. The method for obtaining the available load value of the server includes any of the following: determining the available load value as the reciprocal of the average number of threads in the run queue of the server per unit time; determining the available load value as the reciprocal of the number of edge devices associated with the server; determining the available load value as the reciprocal of the CPU utilization of the server; determining the available load value as the remaining disk space of the server; determining the available load value as the remaining memory space of the server. Based on the available load value of each server, determine the selection probability value of each server as a candidate server; Based on the selection probability value of each server, a candidate server is determined from among the servers, and the candidate server is used to process the target task; Establish a mapping relationship between the target edge device identifier and the server identifier of the candidate server; The mapping relationship between the target edge device identifier and the server identifier of the candidate server is stored in the preset storage area; Based on the mapping relationship, the target server identifier associated with the target edge device identifier is determined; The target task is routed to the target server corresponding to the target server identifier, so that the target task from the target edge device is processed through the fixed target server; When the target server malfunctions, an alarm is triggered for the target server. Obtain at least one task from the target server; Based on the available load values ​​of servers other than the target server, the at least one task is evenly distributed to servers other than the target server.

2. The method according to claim 1, characterized in that, When the available load value of each server is lower than a predetermined threshold, the method further includes: Configure an initial server; An initial available load value is determined for the initial server.

3. A task scheduling method, wherein the method is executed at a task receiving end, characterized in that, The method includes: Receive a task sent by at least one edge device and obtain at least one task; Based on the scheduling load carried by each task scheduling terminal, the at least one task is distributed to each task scheduling terminal, so that each task scheduling terminal executes the task scheduling method as described in claims 1 to 2.

4. A task scheduling device, wherein the device is disposed at a task scheduling terminal, characterized in that, The task scheduling terminal is located in the cloud task scheduling layer, which includes a task receiving terminal, multiple task scheduling terminals, and a preset storage area. The device includes: The first acquisition unit is used to acquire a target task from a target edge device. The target task includes a target edge device identifier, which is used to identify the target edge device. The target task is distributed from the task receiving end to the task scheduling end. The task receiving end is used to provide a unified access point to receive tasks sent by various edge devices, including the target edge device. Each edge device is a data acquisition device. The task receiving end distributes the tasks sent by each edge device evenly to each task scheduling end according to the scheduling load carried by each task scheduling end. The first determining unit is used to determine the pre-established mapping relationship between edge device identifiers and server identifiers in the preset storage area; The third determining unit is configured to, before determining the target server identifier associated with the target edge device identifier based on the mapping relationship, determine a candidate server among the servers when there is no target server identifier associated with the target edge device identifier in the preset storage area, the candidate server being used to process the target task; the third determining unit is configured to: obtain the available load value of each server, the available load value being used to characterize the server's task processing capability; determine the selection probability value of each server being determined as a candidate server based on the available load value of each server; and determine a candidate server among the servers based on the selection probability value of each server; the method for obtaining the available load value of the server includes any of the following: determining the available load value as the reciprocal of the average number of threads in the run queue in the server per unit time; determining the available load value as the reciprocal of the number of edge devices associated in the server; determining the available load value as the reciprocal of the CPU utilization in the server; determining the available load value as the remaining disk space in the server; or determining the available load value as the remaining memory space in the server. The establishment unit is used to establish a mapping relationship between the target edge device identifier and the server identifier of the candidate server; A storage unit is used to store the mapping relationship between the target edge device identifier and the server identifier of the candidate server in the preset storage area; The second determining unit is used to determine the target server identifier associated with the target edge device identifier based on the mapping relationship; A routing unit is used to route the target task to a target server corresponding to the target server identifier, so as to process the target task from the target edge device through the fixed target server; The device further includes: The second acquisition unit is used to acquire at least one task from the target server when the target server fails. The scheduling unit is used to evenly schedule the at least one task to other servers besides the target server based on the available load values ​​of other servers besides the target server. The device is also used to: issue an alarm notification to the target server when the target server malfunctions.

5. A task scheduling device, wherein the device is disposed at a task receiving end, characterized in that, The device includes: The receiving unit is used to receive tasks sent by at least one edge device and obtain at least one task. The distribution unit is used to distribute the at least one task to each task scheduling terminal according to the scheduling load carried by each task scheduling terminal, so that each task scheduling terminal executes the task scheduling method as described in claims 1 to 2.

6. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the task scheduling method as described in any one of claims 1 to 3.

7. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the task scheduling method as described in any one of claims 1 to 3.

8. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the task scheduling method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Service data processing method and device, storage medium and electronic device

    CN110365748A