CN113051045B - Method and device for dynamically balancing equipment end load under IOT platform - Google Patents
Method and device for dynamically balancing equipment end load under IOT platform Download PDFInfo
- Publication number
- CN113051045B CN113051045B CN201911377620.6A CN201911377620A CN113051045B CN 113051045 B CN113051045 B CN 113051045B CN 201911377620 A CN201911377620 A CN 201911377620A CN 113051045 B CN113051045 B CN 113051045B
- Authority
- CN
- China
- Prior art keywords
- equipment
- threads
- available
- iot platform
- queue
- 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.)
- Active
Links
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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- 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/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multi Processors (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a method and a device for dynamically balancing equipment end load under an IOT platform, wherein, the equipment under the IOT platform dynamically distributes resources according to the performance of the equipment and creates available threads; and responding to the device receiving data requests from other devices under the IOT platform, and dynamically calling the task queue according to the available threads. According to the number of threads which are running by the equipment and the number of CPU cores of the equipment, the data interaction between the equipment is dynamically started to execute the threads, the data interaction task queue between the equipment is maintained, and the task switching between the equipment is dynamically scheduled.
Description
Technical Field
The invention relates to the technical field of data interaction under an IOT (Internet of things) platform, in particular to a method for dynamically balancing equipment end load under the IOT platform.
Background
When receiving data requests of other devices, the device under the IOT platform adopts a current mode of blindly opening up a thread to perform data processing to cause performance degradation of the device, that is, when receiving data requests of other devices, the device end does not perform reasonable data interaction aiming at the performance of the device itself, so that the device is in a high-load operation state or an overload operation state for a long time, and the original function is affected; or the idle performance of the equipment is not started, so that the data interaction is overtime, and the utilization rate of the equipment cannot reach the optimal use state due to the redundant performance of the idle equipment, so that the performance is wasted.
Meanwhile, on the premise of decentralization of the platform, when all or most of the devices under the platform request data from one device singly, the devices are in a full-load operation state for a long time.
Disclosure of Invention
The invention provides a method for dynamically balancing equipment end load under an IOT platform. And processing the data transmission task in the task queue, after the task is completed, scheduling the end equipment of the waiting queue to acquire data from the equipment which acquires the data, and dynamically allocating resources among the equipment.
To achieve the above object, the present invention provides a method for dynamically balancing device side loads under an IOT platform, including:
dynamically allocating resources by equipment under the IOT platform according to the performance of the equipment, and creating available threads;
and responding to the device receiving data requests from other devices under the IOT platform, and dynamically calling the task queue according to the available threads.
Further, the device creates an available thread based on its own CPU performance and blocking factor.
Further, the device calculates the blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient (W/C) is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of threads which can be opened by the equipment, wherein: the number of open threads = number of cores available to the CPU/(1-blocking coefficient) -number of open threads;
the device creates a thread pool and starts available threads.
Further, after receiving data requests from other devices under the IOT platform, the device creates a task waiting queue and an execution queue, and stores the SN number and the scheduling time of the device.
Further, based on the created task waiting queue and the created task execution queue, the device firstly adds the data request into the waiting queue and arranges the data request according to the scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing tasks of the data requests by the available threads.
Further, after the task is completed, removing the data request from the execution queue, and putting the first task of the waiting queue into the execution queue for processing; and then informing the equipment corresponding to the task at the tail end of the waiting queue to carry out data request to the equipment which completes data transmission, and removing the task at the tail end of the waiting queue.
Further, the thread pool releases the thread after all task processing of the wait queue is completed.
According to the embodiment disclosed in the present invention, there is also provided an apparatus for dynamically balancing device side loads under an IOT platform, including a first module and a second module in a device that is disposed under the IOT platform and keeps connected to the IOT platform, wherein:
the first module is used for dynamically allocating resources according to the performance of equipment under the IOT platform and creating available threads;
and the second module is used for responding to the data request received by the equipment from other equipment under the IOT platform and carrying out dynamic calling of the task queue according to the available thread.
Further, the first module creates an available thread based on the CPU performance of the device itself and the blocking factor.
Further, the first module is further configured to: calculating a blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient (W/C) is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of threads which can be opened by the equipment, wherein: the number of open threads = number of cores available to the CPU/(1-blocking coefficient) -number of open threads;
the device creates a thread pool and starts available threads.
Further, the second module is configured to:
after receiving data requests from other devices under the IOT platform, creating a task waiting queue and an execution queue, and storing the SN number and scheduling time of the device;
based on the created task waiting queue and the created execution queue, the equipment firstly adds the data request into the waiting queue and arranges the data request according to the scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing the tasks of the data requests by the available threads.
It should be understood that all combinations of the foregoing concepts and additional concepts described in greater detail below can be considered as part of the inventive subject matter of this disclosure unless such concepts are mutually inconsistent. In addition, all combinations of claimed subject matter are considered a part of the presently disclosed subject matter.
The foregoing and other aspects, embodiments and features of the present teachings will be more fully understood from the following description taken in conjunction with the accompanying drawings. Additional aspects of the present invention, such as features and/or advantages of exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of specific embodiments in accordance with the teachings of the present invention.
Drawings
The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component that is illustrated in various figures may be represented by a like numeral. For purposes of clarity, not every component may be labeled in every drawing. Embodiments of various aspects of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which:
FIG. 1 is an example of a process for dynamically allocating resources by a device according to performance in the present invention;
FIG. 2 is a flowchart of a device performing dynamic invocation of a task queue according to the present invention.
Detailed Description
In order to better understand the technical content of the present invention, specific embodiments are described below with reference to the accompanying drawings.
In this disclosure, aspects of the present invention are described with reference to the accompanying drawings, in which a number of illustrative embodiments are shown. Embodiments of the present disclosure are not necessarily intended to include all aspects of the invention. It should be appreciated that the various concepts and embodiments described above, as well as those described in greater detail below, may be implemented in any of numerous ways, as the disclosed concepts and embodiments are not limited to any one implementation. Additionally, some aspects of the present disclosure may be used alone, or in any suitable combination with other aspects of the present disclosure.
With reference to fig. 1-2, according to the method for dynamically balancing device end load under an IOT platform according to an exemplary embodiment of the present invention, according to the number of threads in which a device is running and the number of CPU cores of the device, a thread is dynamically started to perform data interaction between devices, and a data interaction task queue between devices is maintained, and task switching between devices is dynamically scheduled.
With reference to the drawings, a method for dynamically balancing device side loads according to an exemplary embodiment includes: dynamically allocating resources by equipment under the IOT platform according to the performance of the equipment, and creating available threads; and responding to the device receiving data requests from other devices under the IOT platform, and dynamically calling the task queue according to the available threads.
Further, the device creates the available threads based on its own CPU performance and blocking coefficients. The aforementioned CPU performance particularly refers to the number of cores available for the CPU.
Further, the device calculates the blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient (W/C) is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of threads which can be opened by the equipment, wherein: the number of open threads = number of cores available to the CPU/(1-blocking coefficient) -number of open threads;
the device creates a thread pool and starts available threads.
As an optional way, the device calculates the number of cores available to the device CPU using the google Api interface int N _ CPU.
int N_CPU = Runtime.getRuntime().availableProcessors()
The number of threads that have been turned on is calculated using the google Api interface.
int active_threads = Thread.activeCount()
Referring to fig. 2, after receiving data requests from other devices under the IOT platform, a device creates a task waiting queue and an execution queue, stores a device SN number and a scheduling time.
Further, based on the created task waiting queue and the created task execution queue, the device firstly adds the data request into the waiting queue and arranges the data request according to the scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing the tasks of the data requests by the available threads.
Further, after the task is completed, removing the data request from the execution queue, and putting the first task of the waiting queue into the execution queue for processing; and then informing the equipment corresponding to the task at the tail end of the waiting queue to carry out data request to the equipment which completes data transmission, and removing the task at the tail end of the waiting queue.
Further, the thread pool releases the thread after all task processing of the wait queue is completed.
According to the embodiments of the present disclosure, embodiments of the present disclosure may also be configured as follows.
An apparatus for dynamically balancing device side loads under an IOT platform includes a first module and a second module in a device disposed under the IOT platform and connected to the IOT platform, wherein:
the system comprises a first module, a second module and a third module, wherein the first module is used for dynamically allocating resources according to the performance of equipment under an IOT platform and creating available threads;
and the second module is used for responding to the data request received by the equipment from other equipment under the IOT platform and carrying out dynamic calling of the task queue according to the available thread.
Further, the first module creates an available thread based on the CPU performance of the device itself and the blocking factor.
Further, the first module is further configured to: calculating a blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient (W/C) is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of threads which can be opened by the equipment, wherein: the number of open threads = number of cores available to the CPU/(1-blocking coefficient) -number of open threads;
the device creates a thread pool and starts available threads.
Further, the second module is configured to:
after receiving data requests from other devices under the IOT platform, creating a task waiting queue and an execution queue, and storing the SN number and scheduling time of the device;
based on the created task waiting queue and the created execution queue, the equipment firstly adds the data request into the waiting queue and arranges the data request according to the scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing the tasks of the data requests by the available threads.
Further, the second module is configured to:
after the task is completed, removing the data request from the execution queue, and putting the first task of the waiting queue into the execution queue for processing; then informing the equipment corresponding to the task at the tail end of the waiting queue to carry out data request to the equipment which completes data transmission, and removing the task at the tail end of the waiting queue; and
after all task processing of the wait queue is completed, the thread pool releases the thread.
Therefore, the dynamic balance of the equipment end load under the IOT platform is realized through the implementation scheme, the service function of the equipment end is not influenced by the data transmission of the equipment end, the equipment can start a reasonable thread according to the calculation of the equipment, an idle process is fully utilized, and the data interaction efficiency is improved by dynamically scheduling request tasks among the equipment.
Although the invention has been described with reference to preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention should be determined by the appended claims.
Claims (10)
1. A method for dynamically balancing equipment end load under an IOT platform is characterized by comprising the following steps:
dynamically allocating resources by equipment under the IOT platform according to the performance of the equipment, and creating available threads;
responding to a data request received by equipment from other equipment under the IOT platform, and dynamically calling a task queue according to available threads;
the device calculates the blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of openable threads of the equipment, wherein the number of openable threads = the number of cores available to the CPU/(1-blocking coefficient) -the number of opened threads;
the device creates a thread pool and starts available threads.
2. The method of dynamically balancing device side loads under an IOT platform of claim 1, wherein a device creates an available thread based on its own CPU performance and blocking coefficients.
3. The method of claim 1, wherein the device creates a task waiting queue and an execution queue, stores a device SN number and a scheduling time after receiving data requests from other devices under the IOT platform.
4. The method of dynamically balancing device side loads under an IOT platform according to claim 1, wherein based on the created task waiting queue and execution queue, the device first adds data requests to the waiting queue, and arranges them according to scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing the tasks of the data requests by the available threads.
5. The method for dynamically balancing device side loads under the IOT platform according to claim 4, wherein after a task is completed, removing a data request from an execution queue, and placing a first task of a waiting queue into the execution queue for processing; and then informing the equipment corresponding to the task at the tail end of the waiting queue to carry out data request to the equipment which completes data transmission, and removing the task at the tail end of the waiting queue.
6. The method of dynamically balancing device side loads under an IOT platform of claim 4, wherein the thread pool releases threads after all tasks of the wait queue are processed.
7. The utility model provides an apparatus of dynamic balance equipment end load under IOT platform which characterized in that, including set up under the IOT platform and with the first module and the second module in the equipment of IOT platform keep being connected, wherein:
the system comprises a first module, a second module and a third module, wherein the first module is used for dynamically allocating resources according to the performance of equipment under an IOT platform and creating available threads;
the second module is used for responding to the data request received by the equipment from other equipment under the IOT platform and dynamically calling the task queue according to the available thread;
the first module is configured to create an available thread according to:
the device calculates the blocking coefficient according to the time of the existing thread processing data, namely: the blocking coefficient is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of openable threads of the equipment, wherein the number of openable threads = the number of cores available for the CPU/(1-blocking coefficient) -the number of opened threads;
the device creates a thread pool and starts available threads.
8. The apparatus for dynamically balancing device side loads under an IOT platform according to claim 7, wherein the first module creates the available threads based on the device's own CPU performance and blocking coefficients.
9. The apparatus for dynamically balancing device side loads under an IOT platform according to claim 7 or claim 8, wherein the first module is further configured to: calculating a blocking coefficient according to the time of the existing thread processing data, namely: the blocking factor is the ratio of the latency to the computation time, and:
utilizing a Google Api interface to settle the available core number and the opened thread number of the CPU of the computing equipment;
then, acquiring the number of threads which can be opened by the equipment, wherein: the number of open threads = number of cores available to the CPU/(1-blocking coefficient) -number of open threads;
the equipment creates a thread pool and starts available threads.
10. The apparatus for dynamically balancing device side loads under an IOT platform according to claim 7 or 8, wherein the second module is configured to:
after receiving data requests from other devices under the IOT platform, creating a task waiting queue and an execution queue, and storing the SN number and scheduling time of the device;
based on the created task waiting queue and the created execution queue, the equipment firstly adds the data request into the waiting queue and arranges the data request according to the scheduling time; and then putting a corresponding number of data requests into an execution queue according to the number of the available threads, and processing the tasks of the data requests by the available threads.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911377620.6A CN113051045B (en) | 2019-12-27 | 2019-12-27 | Method and device for dynamically balancing equipment end load under IOT platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911377620.6A CN113051045B (en) | 2019-12-27 | 2019-12-27 | Method and device for dynamically balancing equipment end load under IOT platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113051045A CN113051045A (en) | 2021-06-29 |
CN113051045B true CN113051045B (en) | 2022-08-16 |
Family
ID=76506561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911377620.6A Active CN113051045B (en) | 2019-12-27 | 2019-12-27 | Method and device for dynamically balancing equipment end load under IOT platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113051045B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106656863A (en) * | 2016-12-31 | 2017-05-10 | 广东欧珀移动通信有限公司 | Business monitoring method and apparatus, and computer device |
CN109241111A (en) * | 2018-08-27 | 2019-01-18 | 武汉虹信技术服务有限责任公司 | A kind of distributed face identification system and method for database based on memory |
CN109324909A (en) * | 2018-08-01 | 2019-02-12 | 武汉普利商用机器有限公司 | A kind of face alignment service system and method based on cloud service |
CN110019873A (en) * | 2017-12-25 | 2019-07-16 | 深圳市优必选科技有限公司 | Human face data processing method, device and equipment |
-
2019
- 2019-12-27 CN CN201911377620.6A patent/CN113051045B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106656863A (en) * | 2016-12-31 | 2017-05-10 | 广东欧珀移动通信有限公司 | Business monitoring method and apparatus, and computer device |
CN110019873A (en) * | 2017-12-25 | 2019-07-16 | 深圳市优必选科技有限公司 | Human face data processing method, device and equipment |
CN109324909A (en) * | 2018-08-01 | 2019-02-12 | 武汉普利商用机器有限公司 | A kind of face alignment service system and method based on cloud service |
CN109241111A (en) * | 2018-08-27 | 2019-01-18 | 武汉虹信技术服务有限责任公司 | A kind of distributed face identification system and method for database based on memory |
Also Published As
Publication number | Publication date |
---|---|
CN113051045A (en) | 2021-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107391243B (en) | Thread task processing equipment, device and method | |
CN105007337A (en) | Cluster system load balancing method and system thereof | |
US9858115B2 (en) | Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core processor system and related non-transitory computer readable medium | |
US20150121387A1 (en) | Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core system and related non-transitory computer readable medium | |
EP0961204A3 (en) | Thread based governor for time scheduled process execution | |
US11144366B2 (en) | Computing node processor resource optimization method, computing node and server cluster | |
CN103150213A (en) | Method and device for balancing load | |
CN109144691B (en) | Task scheduling and distributing method for multi-core processor | |
CN116991585A (en) | Automatic AI calculation power scheduling method, device and medium | |
CN111858040A (en) | Resource scheduling method and device | |
CN113051045B (en) | Method and device for dynamically balancing equipment end load under IOT platform | |
CN106570011B (en) | Distributed crawler URL seed distribution method, scheduling node and capturing node | |
CN112799811B (en) | High concurrency thread pool task scheduling method for edge gateway | |
CN111290842A (en) | Task execution method and device | |
CN112181689A (en) | Runtime system for efficiently scheduling GPU kernel under cloud | |
CN110825342B (en) | Memory scheduling device and system, method and apparatus for processing information | |
CN112214299A (en) | Multi-core processor and task scheduling method and device thereof | |
CN107391248B (en) | Multilevel feedback queue dispatching method for STM32 system | |
CN105955816A (en) | Event scheduling method and device | |
CN113590324B (en) | Heuristic task scheduling method and system for cloud side-end collaborative computing | |
CN116467053A (en) | Resource scheduling method and device, equipment and storage medium | |
CN115114022A (en) | Method, system, device and medium for using GPU resources | |
CN112399470B (en) | LoRa communication method, loRa gateway, loRa system and computer readable storage medium | |
CN114579309A (en) | Data processing method and device | |
CN112148496A (en) | Energy efficiency management method and device for computing storage resources of super-fusion virtual machine and electronic equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: No.568 longmian Avenue, gaoxinyuan, Jiangning District, Nanjing City, Jiangsu Province, 211000 Patentee after: Xiaoshi Technology (Jiangsu) Co.,Ltd. Address before: No.568 longmian Avenue, gaoxinyuan, Jiangning District, Nanjing City, Jiangsu Province, 211000 Patentee before: NANJING ZHENSHI INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |